From d76999f3896d095334b75f132ecab8cd893d7612 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Thu, 9 Jan 2025 14:21:16 -0500 Subject: [PATCH] feat: [cloudquotas] new module for cloudquotas v1beta (#11388) * feat: [cloudquotas] new module for cloudquotas v1beta * chore: generate libraries at Thu Jan 9 16:55:35 UTC 2025 --------- Co-authored-by: cloud-java-bot --- generation_config.yaml | 1 + .../google-cloud-cloudquotas-bom/pom.xml | 10 + .../google-cloud-cloudquotas/pom.xml | 9 + .../cloudquotas/v1beta/CloudQuotasClient.java | 1408 ++++++ .../v1beta/CloudQuotasSettings.java | 286 ++ .../QuotaAdjusterSettingsManagerClient.java | 471 ++ .../QuotaAdjusterSettingsManagerSettings.java | 235 + .../cloudquotas/v1beta/gapic_metadata.json | 51 + .../api/cloudquotas/v1beta/package-info.java | 75 + .../v1beta/stub/CloudQuotasStub.java | 86 + .../v1beta/stub/CloudQuotasStubSettings.java | 625 +++ .../stub/GrpcCloudQuotasCallableFactory.java | 115 + .../v1beta/stub/GrpcCloudQuotasStub.java | 365 ++ ...djusterSettingsManagerCallableFactory.java | 115 + .../GrpcQuotaAdjusterSettingsManagerStub.java | 213 + .../HttpJsonCloudQuotasCallableFactory.java | 103 + .../v1beta/stub/HttpJsonCloudQuotasStub.java | 578 +++ ...djusterSettingsManagerCallableFactory.java | 103 + ...pJsonQuotaAdjusterSettingsManagerStub.java | 288 ++ .../QuotaAdjusterSettingsManagerStub.java | 50 + ...taAdjusterSettingsManagerStubSettings.java | 382 ++ .../reflect-config.json | 1730 ++++++++ .../v1beta/CloudQuotasClientHttpJsonTest.java | 865 ++++ .../v1beta/CloudQuotasClientTest.java | 768 ++++ .../cloudquotas/v1beta/MockCloudQuotas.java | 59 + .../v1beta/MockCloudQuotasImpl.java | 187 + .../MockQuotaAdjusterSettingsManager.java | 59 + .../MockQuotaAdjusterSettingsManagerImpl.java | 104 + ...sterSettingsManagerClientHttpJsonTest.java | 226 + ...uotaAdjusterSettingsManagerClientTest.java | 207 + .../pom.xml | 45 + .../cloudquotas/v1beta/CloudQuotasGrpc.java | 1022 +++++ .../QuotaAdjusterSettingsManagerGrpc.java | 543 +++ java-cloudquotas/pom.xml | 12 + .../clirr-ignored-differences.xml | 5 + .../pom.xml | 37 + .../cloudquotas/v1beta/CloudquotasProto.java | 285 ++ .../v1beta/CreateQuotaPreferenceRequest.java | 1569 +++++++ ...CreateQuotaPreferenceRequestOrBuilder.java | 192 + .../cloudquotas/v1beta/DimensionsInfo.java | 1456 ++++++ .../v1beta/DimensionsInfoOrBuilder.java | 217 + .../GetQuotaAdjusterSettingsRequest.java | 657 +++ ...QuotaAdjusterSettingsRequestOrBuilder.java | 57 + .../v1beta/GetQuotaInfoRequest.java | 661 +++ .../v1beta/GetQuotaInfoRequestOrBuilder.java | 61 + .../v1beta/GetQuotaPreferenceRequest.java | 661 +++ .../GetQuotaPreferenceRequestOrBuilder.java | 61 + .../v1beta/ListQuotaInfosRequest.java | 968 ++++ .../ListQuotaInfosRequestOrBuilder.java | 108 + .../v1beta/ListQuotaInfosResponse.java | 1128 +++++ .../ListQuotaInfosResponseOrBuilder.java | 105 + .../v1beta/ListQuotaPreferencesRequest.java | 1420 ++++++ .../ListQuotaPreferencesRequestOrBuilder.java | 182 + .../v1beta/ListQuotaPreferencesResponse.java | 1425 ++++++ ...ListQuotaPreferencesResponseOrBuilder.java | 157 + .../api/cloudquotas/v1beta/LocationName.java | 359 ++ .../v1beta/QuotaAdjusterSettings.java | 1471 +++++++ .../v1beta/QuotaAdjusterSettingsName.java | 194 + .../QuotaAdjusterSettingsOrBuilder.java | 153 + .../v1beta/QuotaAdjusterSettingsProto.java | 157 + .../api/cloudquotas/v1beta/QuotaConfig.java | 1932 ++++++++ .../v1beta/QuotaConfigOrBuilder.java | 241 + .../api/cloudquotas/v1beta/QuotaDetails.java | 839 ++++ .../v1beta/QuotaDetailsOrBuilder.java | 80 + .../v1beta/QuotaIncreaseEligibility.java | 938 ++++ .../QuotaIncreaseEligibilityOrBuilder.java | 73 + .../api/cloudquotas/v1beta/QuotaInfo.java | 3911 +++++++++++++++++ .../api/cloudquotas/v1beta/QuotaInfoName.java | 519 +++ .../v1beta/QuotaInfoOrBuilder.java | 488 ++ .../cloudquotas/v1beta/QuotaPreference.java | 3115 +++++++++++++ .../v1beta/QuotaPreferenceName.java | 450 ++ .../v1beta/QuotaPreferenceOrBuilder.java | 467 ++ .../cloudquotas/v1beta/QuotaSafetyCheck.java | 181 + .../cloudquotas/v1beta/ResourcesProto.java | 305 ++ .../api/cloudquotas/v1beta/RolloutInfo.java | 534 +++ .../v1beta/RolloutInfoOrBuilder.java | 39 + .../api/cloudquotas/v1beta/ServiceName.java | 438 ++ .../UpdateQuotaAdjusterSettingsRequest.java | 1147 +++++ ...QuotaAdjusterSettingsRequestOrBuilder.java | 121 + .../v1beta/UpdateQuotaPreferenceRequest.java | 1685 +++++++ ...UpdateQuotaPreferenceRequestOrBuilder.java | 209 + .../api/cloudquotas/v1beta/cloudquotas.proto | 322 ++ .../v1beta/quota_adjuster_settings.proto | 134 + .../api/cloudquotas/v1beta/resources.proto | 321 ++ .../SyncCreateSetCredentialsProvider.java | 44 + .../create/SyncCreateSetEndpoint.java | 41 + .../SyncCreateUseHttpJsonTransport.java | 39 + .../AsyncCreateQuotaPreference.java | 55 + .../SyncCreateQuotaPreference.java | 51 + ...PreferenceLocationnameQuotapreference.java | 43 + ...enceLocationnameQuotapreferenceString.java | 45 + ...eQuotaPreferenceStringQuotapreference.java | 43 + ...PreferenceStringQuotapreferenceString.java | 45 + .../getquotainfo/AsyncGetQuotaInfo.java | 52 + .../getquotainfo/SyncGetQuotaInfo.java | 49 + .../SyncGetQuotaInfoQuotainfoname.java | 44 + .../getquotainfo/SyncGetQuotaInfoString.java | 45 + .../AsyncGetQuotaPreference.java | 53 + .../SyncGetQuotaPreference.java | 49 + ...GetQuotaPreferenceQuotapreferencename.java | 44 + .../SyncGetQuotaPreferenceString.java | 45 + .../listquotainfos/AsyncListQuotaInfos.java | 56 + .../AsyncListQuotaInfosPaged.java | 63 + .../listquotainfos/SyncListQuotaInfos.java | 52 + .../SyncListQuotaInfosServicename.java | 45 + .../SyncListQuotaInfosString.java | 46 + .../AsyncListQuotaPreferences.java | 56 + .../AsyncListQuotaPreferencesPaged.java | 64 + .../SyncListQuotaPreferences.java | 52 + .../SyncListQuotaPreferencesLocationname.java | 44 + .../SyncListQuotaPreferencesString.java | 44 + .../AsyncUpdateQuotaPreference.java | 56 + .../SyncUpdateQuotaPreference.java | 52 + ...otaPreferenceQuotapreferenceFieldmask.java | 44 + .../getquotainfo/SyncGetQuotaInfo.java | 55 + .../SyncCreateSetCredentialsProvider.java | 45 + .../create/SyncCreateSetEndpoint.java | 42 + .../SyncCreateUseHttpJsonTransport.java | 41 + .../AsyncGetQuotaAdjusterSettings.java | 51 + .../SyncGetQuotaAdjusterSettings.java | 48 + ...sterSettingsQuotaadjustersettingsname.java | 44 + .../SyncGetQuotaAdjusterSettingsString.java | 44 + .../AsyncUpdateQuotaAdjusterSettings.java | 55 + .../SyncUpdateQuotaAdjusterSettings.java | 50 + ...ettingsQuotaadjustersettingsFieldmask.java | 47 + .../SyncUpdateQuotaAdjusterSettings.java | 57 + .../getquotainfo/SyncGetQuotaInfo.java | 56 + .../SyncUpdateQuotaAdjusterSettings.java | 57 + versions.txt | 2 + 129 files changed, 45786 insertions(+) create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasClient.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasSettings.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClient.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerSettings.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/gapic_metadata.json create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/package-info.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStubSettings.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasCallableFactory.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerCallableFactory.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasCallableFactory.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerCallableFactory.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStub.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStubSettings.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1beta/reflect-config.json create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientHttpJsonTest.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientTest.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotas.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotasImpl.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManager.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManagerImpl.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientHttpJsonTest.java create mode 100644 java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientTest.java create mode 100644 java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/pom.xml create mode 100644 java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasGrpc.java create mode 100644 java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerGrpc.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/clirr-ignored-differences.xml create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/pom.xml create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudquotasProto.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CreateQuotaPreferenceRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CreateQuotaPreferenceRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfo.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfoOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponse.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponseOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponse.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponseOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/LocationName.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettings.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsName.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsProto.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfig.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfigOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetails.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetailsOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibility.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibilityOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfo.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoName.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreference.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceName.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaSafetyCheck.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ResourcesProto.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfo.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfoOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ServiceName.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequest.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequestOrBuilder.java create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/cloudquotas.proto create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto create mode 100644 java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/resources.proto create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetEndpoint.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateUseHttpJsonTransport.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfo.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfos.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfos.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetEndpoint.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateUseHttpJsonTransport.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/AsyncGetQuotaAdjusterSettings.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettings.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsQuotaadjustersettingsname.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsString.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/AsyncUpdateQuotaAdjusterSettings.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanagersettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java create mode 100644 java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/quotaadjustersettingsmanagerstubsettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java diff --git a/generation_config.yaml b/generation_config.yaml index 717510411387..117425e1f589 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -541,6 +541,7 @@ libraries: release_level: stable GAPICs: - proto_path: google/api/cloudquotas/v1 + - proto_path: google/api/cloudquotas/v1beta - api_shortname: cloudsupport name_pretty: Google Cloud Support API diff --git a/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml b/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml index 31033de6a92b..59bbce5cd74b 100644 --- a/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml +++ b/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml @@ -34,11 +34,21 @@ grpc-google-cloud-cloudquotas-v1 0.24.0-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + com.google.api.grpc proto-google-cloud-cloudquotas-v1 0.24.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + diff --git a/java-cloudquotas/google-cloud-cloudquotas/pom.xml b/java-cloudquotas/google-cloud-cloudquotas/pom.xml index 1d3944b22900..a15b248a11f8 100644 --- a/java-cloudquotas/google-cloud-cloudquotas/pom.xml +++ b/java-cloudquotas/google-cloud-cloudquotas/pom.xml @@ -43,6 +43,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-cloudquotas-v1beta + com.google.api.grpc proto-google-cloud-cloudquotas-v1 @@ -68,6 +72,11 @@ grpc-google-common-protos test + + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1beta + test + com.google.api.grpc proto-google-iam-v1 diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasClient.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasClient.java new file mode 100644 index 000000000000..d4b00a8384f1 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasClient.java @@ -0,0 +1,1408 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.stub.CloudQuotasStub; +import com.google.api.cloudquotas.v1beta.stub.CloudQuotasStubSettings; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +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: The Cloud Quotas API is an infrastructure service for Google Cloud that lets + * service consumers list and manage their resource usage limits. + * + *

- List/Get the metadata and current status of the quotas for a service. - Create/Update quota + * preferencess that declare the preferred quota values. - Check the status of a quota preference + * request. - List/Get pending and historical quota preference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+ *   QuotaInfoName name =
+ *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+ *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+ *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+ * }
+ * }
+ * + *

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

ListQuotaInfos

Lists QuotaInfos of all quotas for a given project, folder or organization.

+ *

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

+ *
    + *
  • listQuotaInfos(ListQuotaInfosRequest request) + *

+ *

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

+ *
    + *
  • listQuotaInfos(ServiceName parent) + *

  • listQuotaInfos(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.

+ *
    + *
  • listQuotaInfosPagedCallable() + *

  • listQuotaInfosCallable() + *

+ *

GetQuotaInfo

Retrieve the QuotaInfo of a quota for a project, folder or organization.

+ *

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

+ *
    + *
  • getQuotaInfo(GetQuotaInfoRequest request) + *

+ *

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

+ *
    + *
  • getQuotaInfo(QuotaInfoName name) + *

  • getQuotaInfo(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.

+ *
    + *
  • getQuotaInfoCallable() + *

+ *

ListQuotaPreferences

Lists QuotaPreferences in a given project, folder or organization.

+ *

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

+ *
    + *
  • listQuotaPreferences(ListQuotaPreferencesRequest request) + *

+ *

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

+ *
    + *
  • listQuotaPreferences(LocationName parent) + *

  • listQuotaPreferences(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.

+ *
    + *
  • listQuotaPreferencesPagedCallable() + *

  • listQuotaPreferencesCallable() + *

+ *

GetQuotaPreference

Gets details of a single QuotaPreference.

+ *

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

+ *
    + *
  • getQuotaPreference(GetQuotaPreferenceRequest request) + *

+ *

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

+ *
    + *
  • getQuotaPreference(QuotaPreferenceName name) + *

  • getQuotaPreference(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.

+ *
    + *
  • getQuotaPreferenceCallable() + *

+ *

CreateQuotaPreference

Creates a new QuotaPreference that declares the desired value for a quota.

+ *

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

+ *
    + *
  • createQuotaPreference(CreateQuotaPreferenceRequest request) + *

+ *

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

+ *
    + *
  • createQuotaPreference(LocationName parent, QuotaPreference quotaPreference) + *

  • createQuotaPreference(String parent, QuotaPreference quotaPreference) + *

  • createQuotaPreference(LocationName parent, QuotaPreference quotaPreference, String quotaPreferenceId) + *

  • createQuotaPreference(String parent, QuotaPreference quotaPreference, String quotaPreferenceId) + *

+ *

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

+ *
    + *
  • createQuotaPreferenceCallable() + *

+ *

UpdateQuotaPreference

Updates the parameters of a single QuotaPreference. It can updates the config in any states, not just the ones pending approval.

+ *

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

+ *
    + *
  • updateQuotaPreference(UpdateQuotaPreferenceRequest request) + *

+ *

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

+ *
    + *
  • updateQuotaPreference(QuotaPreference quotaPreference, 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.

+ *
    + *
  • updateQuotaPreferenceCallable() + *

+ *
+ * + *

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 CloudQuotasSettings 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
+ * CloudQuotasSettings cloudQuotasSettings =
+ *     CloudQuotasSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

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
+ * CloudQuotasSettings cloudQuotasSettings =
+ *     CloudQuotasSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

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
+ * CloudQuotasSettings cloudQuotasSettings = CloudQuotasSettings.newHttpJsonBuilder().build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ServiceName parent =
+   *       ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]");
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaInfo resources. Listing across different resource + * containers (such as 'projects/-') is not allowed. + *

Example names: `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaInfosPagedResponse listQuotaInfos(ServiceName parent) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listQuotaInfos(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent =
+   *       ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *           .toString();
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaInfo resources. Listing across different resource + * containers (such as 'projects/-') is not allowed. + *

Example names: `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaInfosPagedResponse listQuotaInfos(String parent) { + ListQuotaInfosRequest request = ListQuotaInfosRequest.newBuilder().setParent(parent).build(); + return listQuotaInfos(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(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 ListQuotaInfosPagedResponse listQuotaInfos(ListQuotaInfosRequest request) { + return listQuotaInfosPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.listQuotaInfosPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (QuotaInfo element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaInfosPagedCallable() { + return stub.listQuotaInfosPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListQuotaInfosResponse response = cloudQuotasClient.listQuotaInfosCallable().call(request);
+   *     for (QuotaInfo element : response.getQuotaInfosList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaInfosCallable() { + return stub.listQuotaInfosCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaInfoName name =
+   *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the quota info. + *

An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaInfo getQuotaInfo(QuotaInfoName name) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getQuotaInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String name =
+   *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *               "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *           .toString();
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the quota info. + *

An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaInfo getQuotaInfo(String name) { + GetQuotaInfoRequest request = GetQuotaInfoRequest.newBuilder().setName(name).build(); + return getQuotaInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaInfoRequest request =
+   *       GetQuotaInfoRequest.newBuilder()
+   *           .setName(
+   *               QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *                       "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *                   .toString())
+   *           .build();
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(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 QuotaInfo getQuotaInfo(GetQuotaInfoRequest request) { + return getQuotaInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaInfoRequest request =
+   *       GetQuotaInfoRequest.newBuilder()
+   *           .setName(
+   *               QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *                       "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = cloudQuotasClient.getQuotaInfoCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaInfo response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getQuotaInfoCallable() { + return stub.getQuotaInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaPreference resources. Listing across different + * resource containers (such as 'projects/-') is not allowed. + *

When the value starts with 'folders' or 'organizations', it lists the QuotaPreferences + * for org quotas in the container. It does not list the QuotaPreferences in the descendant + * projects of the container. + *

Example parents: `projects/123/locations/global` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaPreferencesPagedResponse listQuotaPreferences(LocationName parent) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listQuotaPreferences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaPreference resources. Listing across different + * resource containers (such as 'projects/-') is not allowed. + *

When the value starts with 'folders' or 'organizations', it lists the QuotaPreferences + * for org quotas in the container. It does not list the QuotaPreferences in the descendant + * projects of the container. + *

Example parents: `projects/123/locations/global` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaPreferencesPagedResponse listQuotaPreferences(String parent) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder().setParent(parent).build(); + return listQuotaPreferences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaPreferenceName name =
+   *       QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *           "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]");
+   *   QuotaPreference response = cloudQuotasClient.getQuotaPreference(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + *

Example name: `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference getQuotaPreference(QuotaPreferenceName name) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String name =
+   *       QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *               "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]")
+   *           .toString();
+   *   QuotaPreference response = cloudQuotasClient.getQuotaPreference(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + *

Example name: `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference getQuotaPreference(String name) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder().setName(name).build(); + return getQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaPreferenceRequest request =
+   *       GetQuotaPreferenceRequest.newBuilder()
+   *           .setName(
+   *               QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *                       "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.getQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getQuotaPreferenceCallable() { + return stub.getQuotaPreferenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + LocationName parent, QuotaPreference quotaPreference) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuotaPreference(quotaPreference) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + String parent, QuotaPreference quotaPreference) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent) + .setQuotaPreference(quotaPreference) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   String quotaPreferenceId = "quotaPreferenceId-948332050";
+   *   QuotaPreference response =
+   *       cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @param quotaPreferenceId Optional. Id of the requesting object, must be unique under its + * parent. If client does not set this field, the service will generate one. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + LocationName parent, QuotaPreference quotaPreference, String quotaPreferenceId) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuotaPreference(quotaPreference) + .setQuotaPreferenceId(quotaPreferenceId) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   String quotaPreferenceId = "quotaPreferenceId-948332050";
+   *   QuotaPreference response =
+   *       cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @param quotaPreferenceId Optional. Id of the requesting object, must be unique under its + * parent. If client does not set this field, the service will generate one. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + String parent, QuotaPreference quotaPreference, String quotaPreferenceId) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent) + .setQuotaPreference(quotaPreference) + .setQuotaPreferenceId(quotaPreferenceId) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   CreateQuotaPreferenceRequest request =
+   *       CreateQuotaPreferenceRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuotaPreferenceId("quotaPreferenceId-948332050")
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(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 QuotaPreference createQuotaPreference(CreateQuotaPreferenceRequest request) { + return createQuotaPreferenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   CreateQuotaPreferenceRequest request =
+   *       CreateQuotaPreferenceRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuotaPreferenceId("quotaPreferenceId-948332050")
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.createQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createQuotaPreferenceCallable() { + return stub.createQuotaPreferenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   QuotaPreference response =
+   *       cloudQuotasClient.updateQuotaPreference(quotaPreference, updateMask);
+   * }
+   * }
+ * + * @param quotaPreference Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference updateQuotaPreference( + QuotaPreference quotaPreference, FieldMask updateMask) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setQuotaPreference(quotaPreference) + .setUpdateMask(updateMask) + .build(); + return updateQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   UpdateQuotaPreferenceRequest request =
+   *       UpdateQuotaPreferenceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setValidateOnly(true)
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   QuotaPreference response = cloudQuotasClient.updateQuotaPreference(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 QuotaPreference updateQuotaPreference(UpdateQuotaPreferenceRequest request) { + return updateQuotaPreferenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   UpdateQuotaPreferenceRequest request =
+   *       UpdateQuotaPreferenceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setValidateOnly(true)
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.updateQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateQuotaPreferenceCallable() { + return stub.updateQuotaPreferenceCallable(); + } + + @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 ListQuotaInfosPagedResponse + extends AbstractPagedListResponse< + ListQuotaInfosRequest, + ListQuotaInfosResponse, + QuotaInfo, + ListQuotaInfosPage, + ListQuotaInfosFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQuotaInfosPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQuotaInfosPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQuotaInfosPagedResponse(ListQuotaInfosPage page) { + super(page, ListQuotaInfosFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQuotaInfosPage + extends AbstractPage< + ListQuotaInfosRequest, ListQuotaInfosResponse, QuotaInfo, ListQuotaInfosPage> { + + private ListQuotaInfosPage( + PageContext context, + ListQuotaInfosResponse response) { + super(context, response); + } + + private static ListQuotaInfosPage createEmptyPage() { + return new ListQuotaInfosPage(null, null); + } + + @Override + protected ListQuotaInfosPage createPage( + PageContext context, + ListQuotaInfosResponse response) { + return new ListQuotaInfosPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQuotaInfosFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQuotaInfosRequest, + ListQuotaInfosResponse, + QuotaInfo, + ListQuotaInfosPage, + ListQuotaInfosFixedSizeCollection> { + + private ListQuotaInfosFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQuotaInfosFixedSizeCollection createEmptyCollection() { + return new ListQuotaInfosFixedSizeCollection(null, 0); + } + + @Override + protected ListQuotaInfosFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQuotaInfosFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListQuotaPreferencesPagedResponse + extends AbstractPagedListResponse< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage, + ListQuotaPreferencesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQuotaPreferencesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQuotaPreferencesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQuotaPreferencesPagedResponse(ListQuotaPreferencesPage page) { + super(page, ListQuotaPreferencesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQuotaPreferencesPage + extends AbstractPage< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage> { + + private ListQuotaPreferencesPage( + PageContext + context, + ListQuotaPreferencesResponse response) { + super(context, response); + } + + private static ListQuotaPreferencesPage createEmptyPage() { + return new ListQuotaPreferencesPage(null, null); + } + + @Override + protected ListQuotaPreferencesPage createPage( + PageContext + context, + ListQuotaPreferencesResponse response) { + return new ListQuotaPreferencesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQuotaPreferencesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage, + ListQuotaPreferencesFixedSizeCollection> { + + private ListQuotaPreferencesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQuotaPreferencesFixedSizeCollection createEmptyCollection() { + return new ListQuotaPreferencesFixedSizeCollection(null, 0); + } + + @Override + protected ListQuotaPreferencesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQuotaPreferencesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasSettings.java new file mode 100644 index 000000000000..b4e44a22dacb --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasSettings.java @@ -0,0 +1,286 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.stub.CloudQuotasStubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudQuotasClient}. + * + *

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

    + *
  • The default service address (cloudquotas.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getQuotaInfo: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudQuotasSettings.Builder cloudQuotasSettingsBuilder = CloudQuotasSettings.newBuilder();
+ * cloudQuotasSettingsBuilder
+ *     .getQuotaInfoSettings()
+ *     .setRetrySettings(
+ *         cloudQuotasSettingsBuilder
+ *             .getQuotaInfoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * CloudQuotasSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudQuotasSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listQuotaInfos. */ + public PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).listQuotaInfosSettings(); + } + + /** Returns the object with the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings getQuotaInfoSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).getQuotaInfoSettings(); + } + + /** Returns the object with the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).listQuotaPreferencesSettings(); + } + + /** Returns the object with the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings + getQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).getQuotaPreferenceSettings(); + } + + /** Returns the object with the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings + createQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).createQuotaPreferenceSettings(); + } + + /** Returns the object with the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings + updateQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).updateQuotaPreferenceSettings(); + } + + public static final CloudQuotasSettings create(CloudQuotasStubSettings stub) throws IOException { + return new CloudQuotasSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudQuotasStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudQuotasStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudQuotasStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudQuotasStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudQuotasStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudQuotasStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudQuotasStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudQuotasStubSettings.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 CloudQuotasSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudQuotasSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudQuotasStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudQuotasSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudQuotasStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudQuotasStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudQuotasStubSettings.newHttpJsonBuilder()); + } + + public CloudQuotasStubSettings.Builder getStubSettingsBuilder() { + return ((CloudQuotasStubSettings.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 listQuotaInfos. */ + public PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return getStubSettingsBuilder().listQuotaInfosSettings(); + } + + /** Returns the builder for the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings.Builder getQuotaInfoSettings() { + return getStubSettingsBuilder().getQuotaInfoSettings(); + } + + /** Returns the builder for the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return getStubSettingsBuilder().listQuotaPreferencesSettings(); + } + + /** Returns the builder for the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings.Builder + getQuotaPreferenceSettings() { + return getStubSettingsBuilder().getQuotaPreferenceSettings(); + } + + /** Returns the builder for the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings.Builder + createQuotaPreferenceSettings() { + return getStubSettingsBuilder().createQuotaPreferenceSettings(); + } + + /** Returns the builder for the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings.Builder + updateQuotaPreferenceSettings() { + return getStubSettingsBuilder().updateQuotaPreferenceSettings(); + } + + @Override + public CloudQuotasSettings build() throws IOException { + return new CloudQuotasSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClient.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClient.java new file mode 100644 index 000000000000..fb7140c3829a --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClient.java @@ -0,0 +1,471 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.stub.QuotaAdjusterSettingsManagerStub; +import com.google.api.cloudquotas.v1beta.stub.QuotaAdjusterSettingsManagerStubSettings; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The Quotas Adjuster Settings API is an infrastructure service for Google + * Cloud that lets service consumers view and update their quota adjuster settings. + * + *

- Update quota adjuster settings. - Get the name of the configurations. + * + *

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 (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+ *     QuotaAdjusterSettingsManagerClient.create()) {
+ *   QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   QuotaAdjusterSettings response =
+ *       quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(
+ *           quotaAdjusterSettings, updateMask);
+ * }
+ * }
+ * + *

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

UpdateQuotaAdjusterSettings

RPC Method for updating QuotaAdjusterSettings based on the request

+ *

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

+ *
    + *
  • updateQuotaAdjusterSettings(UpdateQuotaAdjusterSettingsRequest request) + *

+ *

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

+ *
    + *
  • updateQuotaAdjusterSettings(QuotaAdjusterSettings quotaAdjusterSettings, 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.

+ *
    + *
  • updateQuotaAdjusterSettingsCallable() + *

+ *

GetQuotaAdjusterSettings

RPC Method for getting QuotaAdjusterSettings based on the request

+ *

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

+ *
    + *
  • getQuotaAdjusterSettings(GetQuotaAdjusterSettingsRequest request) + *

+ *

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

+ *
    + *
  • getQuotaAdjusterSettings(QuotaAdjusterSettingsName name) + *

  • getQuotaAdjusterSettings(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.

+ *
    + *
  • getQuotaAdjusterSettingsCallable() + *

+ *
+ * + *

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 + * QuotaAdjusterSettingsManagerSettings 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
+ * QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
+ *     QuotaAdjusterSettingsManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+ *     QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
+ * }
+ * + *

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
+ * QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
+ *     QuotaAdjusterSettingsManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+ *     QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
+ * }
+ * + *

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
+ * QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
+ *     QuotaAdjusterSettingsManagerSettings.newHttpJsonBuilder().build();
+ * QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+ *     QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaAdjusterSettingsManagerClient implements BackgroundResource { + private final QuotaAdjusterSettingsManagerSettings settings; + private final QuotaAdjusterSettingsManagerStub stub; + + /** Constructs an instance of QuotaAdjusterSettingsManagerClient with default settings. */ + public static final QuotaAdjusterSettingsManagerClient create() throws IOException { + return create(QuotaAdjusterSettingsManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of QuotaAdjusterSettingsManagerClient, 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 QuotaAdjusterSettingsManagerClient create( + QuotaAdjusterSettingsManagerSettings settings) throws IOException { + return new QuotaAdjusterSettingsManagerClient(settings); + } + + /** + * Constructs an instance of QuotaAdjusterSettingsManagerClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(QuotaAdjusterSettingsManagerSettings). + */ + public static final QuotaAdjusterSettingsManagerClient create( + QuotaAdjusterSettingsManagerStub stub) { + return new QuotaAdjusterSettingsManagerClient(stub); + } + + /** + * Constructs an instance of QuotaAdjusterSettingsManagerClient, 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 QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((QuotaAdjusterSettingsManagerStubSettings) settings.getStubSettings()).createStub(); + } + + protected QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final QuotaAdjusterSettingsManagerSettings getSettings() { + return settings; + } + + public QuotaAdjusterSettingsManagerStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for updating QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   QuotaAdjusterSettings response =
+   *       quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(
+   *           quotaAdjusterSettings, updateMask);
+   * }
+   * }
+ * + * @param quotaAdjusterSettings Required. The QuotaAdjusterSettings 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 QuotaAdjusterSettings updateQuotaAdjusterSettings( + QuotaAdjusterSettings quotaAdjusterSettings, FieldMask updateMask) { + UpdateQuotaAdjusterSettingsRequest request = + UpdateQuotaAdjusterSettingsRequest.newBuilder() + .setQuotaAdjusterSettings(quotaAdjusterSettings) + .setUpdateMask(updateMask) + .build(); + return updateQuotaAdjusterSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for updating QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   UpdateQuotaAdjusterSettingsRequest request =
+   *       UpdateQuotaAdjusterSettingsRequest.newBuilder()
+   *           .setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   QuotaAdjusterSettings response =
+   *       quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(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 QuotaAdjusterSettings updateQuotaAdjusterSettings( + UpdateQuotaAdjusterSettingsRequest request) { + return updateQuotaAdjusterSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for updating QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   UpdateQuotaAdjusterSettingsRequest request =
+   *       UpdateQuotaAdjusterSettingsRequest.newBuilder()
+   *           .setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       quotaAdjusterSettingsManagerClient
+   *           .updateQuotaAdjusterSettingsCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   QuotaAdjusterSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateQuotaAdjusterSettingsCallable() { + return stub.updateQuotaAdjusterSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for getting QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]");
+   *   QuotaAdjusterSettings response =
+   *       quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name);
+   * }
+   * }
+ * + * @param name Required. Name of the config. Required to be “settings”, as only a single setting + * per container will be supported initially. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaAdjusterSettings getQuotaAdjusterSettings(QuotaAdjusterSettingsName name) { + GetQuotaAdjusterSettingsRequest request = + GetQuotaAdjusterSettingsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getQuotaAdjusterSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for getting QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   String name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString();
+   *   QuotaAdjusterSettings response =
+   *       quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name);
+   * }
+   * }
+ * + * @param name Required. Name of the config. Required to be “settings”, as only a single setting + * per container will be supported initially. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaAdjusterSettings getQuotaAdjusterSettings(String name) { + GetQuotaAdjusterSettingsRequest request = + GetQuotaAdjusterSettingsRequest.newBuilder().setName(name).build(); + return getQuotaAdjusterSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for getting QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   GetQuotaAdjusterSettingsRequest request =
+   *       GetQuotaAdjusterSettingsRequest.newBuilder()
+   *           .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   QuotaAdjusterSettings response =
+   *       quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(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 QuotaAdjusterSettings getQuotaAdjusterSettings( + GetQuotaAdjusterSettingsRequest request) { + return getQuotaAdjusterSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * RPC Method for getting QuotaAdjusterSettings based on the request + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+   *     QuotaAdjusterSettingsManagerClient.create()) {
+   *   GetQuotaAdjusterSettingsRequest request =
+   *       GetQuotaAdjusterSettingsRequest.newBuilder()
+   *           .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaAdjusterSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getQuotaAdjusterSettingsCallable() { + return stub.getQuotaAdjusterSettingsCallable(); + } + + @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); + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerSettings.java new file mode 100644 index 000000000000..af1f1360cdac --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerSettings.java @@ -0,0 +1,235 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.stub.QuotaAdjusterSettingsManagerStubSettings; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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 QuotaAdjusterSettingsManagerClient}. + * + *

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

    + *
  • The default service address (cloudquotas.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of updateQuotaAdjusterSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * QuotaAdjusterSettingsManagerSettings.Builder quotaAdjusterSettingsManagerSettingsBuilder =
+ *     QuotaAdjusterSettingsManagerSettings.newBuilder();
+ * quotaAdjusterSettingsManagerSettingsBuilder
+ *     .updateQuotaAdjusterSettingsSettings()
+ *     .setRetrySettings(
+ *         quotaAdjusterSettingsManagerSettingsBuilder
+ *             .updateQuotaAdjusterSettingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
+ *     quotaAdjusterSettingsManagerSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaAdjusterSettingsManagerSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to updateQuotaAdjusterSettings. */ + public UnaryCallSettings + updateQuotaAdjusterSettingsSettings() { + return ((QuotaAdjusterSettingsManagerStubSettings) getStubSettings()) + .updateQuotaAdjusterSettingsSettings(); + } + + /** Returns the object with the settings used for calls to getQuotaAdjusterSettings. */ + public UnaryCallSettings + getQuotaAdjusterSettingsSettings() { + return ((QuotaAdjusterSettingsManagerStubSettings) getStubSettings()) + .getQuotaAdjusterSettingsSettings(); + } + + public static final QuotaAdjusterSettingsManagerSettings create( + QuotaAdjusterSettingsManagerStubSettings stub) throws IOException { + return new QuotaAdjusterSettingsManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return QuotaAdjusterSettingsManagerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return QuotaAdjusterSettingsManagerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return QuotaAdjusterSettingsManagerStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.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 QuotaAdjusterSettingsManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for QuotaAdjusterSettingsManagerSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(QuotaAdjusterSettingsManagerStubSettings.newBuilder(clientContext)); + } + + protected Builder(QuotaAdjusterSettingsManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(QuotaAdjusterSettingsManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(QuotaAdjusterSettingsManagerStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(QuotaAdjusterSettingsManagerStubSettings.newHttpJsonBuilder()); + } + + public QuotaAdjusterSettingsManagerStubSettings.Builder getStubSettingsBuilder() { + return ((QuotaAdjusterSettingsManagerStubSettings.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 updateQuotaAdjusterSettings. */ + public UnaryCallSettings.Builder + updateQuotaAdjusterSettingsSettings() { + return getStubSettingsBuilder().updateQuotaAdjusterSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to getQuotaAdjusterSettings. */ + public UnaryCallSettings.Builder + getQuotaAdjusterSettingsSettings() { + return getStubSettingsBuilder().getQuotaAdjusterSettingsSettings(); + } + + @Override + public QuotaAdjusterSettingsManagerSettings build() throws IOException { + return new QuotaAdjusterSettingsManagerSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/gapic_metadata.json b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..0eff96ca9afe --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.api.cloudquotas.v1beta", + "libraryPackage": "com.google.api.cloudquotas.v1beta", + "services": { + "CloudQuotas": { + "clients": { + "grpc": { + "libraryClient": "CloudQuotasClient", + "rpcs": { + "CreateQuotaPreference": { + "methods": ["createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreferenceCallable"] + }, + "GetQuotaInfo": { + "methods": ["getQuotaInfo", "getQuotaInfo", "getQuotaInfo", "getQuotaInfoCallable"] + }, + "GetQuotaPreference": { + "methods": ["getQuotaPreference", "getQuotaPreference", "getQuotaPreference", "getQuotaPreferenceCallable"] + }, + "ListQuotaInfos": { + "methods": ["listQuotaInfos", "listQuotaInfos", "listQuotaInfos", "listQuotaInfosPagedCallable", "listQuotaInfosCallable"] + }, + "ListQuotaPreferences": { + "methods": ["listQuotaPreferences", "listQuotaPreferences", "listQuotaPreferences", "listQuotaPreferencesPagedCallable", "listQuotaPreferencesCallable"] + }, + "UpdateQuotaPreference": { + "methods": ["updateQuotaPreference", "updateQuotaPreference", "updateQuotaPreferenceCallable"] + } + } + } + } + }, + "QuotaAdjusterSettingsManager": { + "clients": { + "grpc": { + "libraryClient": "QuotaAdjusterSettingsManagerClient", + "rpcs": { + "GetQuotaAdjusterSettings": { + "methods": ["getQuotaAdjusterSettings", "getQuotaAdjusterSettings", "getQuotaAdjusterSettings", "getQuotaAdjusterSettingsCallable"] + }, + "UpdateQuotaAdjusterSettings": { + "methods": ["updateQuotaAdjusterSettings", "updateQuotaAdjusterSettings", "updateQuotaAdjusterSettingsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/package-info.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/package-info.java new file mode 100644 index 000000000000..aad3c079d77a --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/package-info.java @@ -0,0 +1,75 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Cloud Quotas API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= CloudQuotasClient ======================= + * + *

Service Description: The Cloud Quotas API is an infrastructure service for Google Cloud that + * lets service consumers list and manage their resource usage limits. + * + *

- List/Get the metadata and current status of the quotas for a service. - Create/Update quota + * preferencess that declare the preferred quota values. - Check the status of a quota preference + * request. - List/Get pending and historical quota preference. + * + *

Sample for CloudQuotasClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+ *   QuotaInfoName name =
+ *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+ *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+ *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+ * }
+ * }
+ * + *

======================= QuotaAdjusterSettingsManagerClient ======================= + * + *

Service Description: The Quotas Adjuster Settings API is an infrastructure service for Google + * Cloud that lets service consumers view and update their quota adjuster settings. + * + *

- Update quota adjuster settings. - Get the name of the configurations. + * + *

Sample for QuotaAdjusterSettingsManagerClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
+ *     QuotaAdjusterSettingsManagerClient.create()) {
+ *   QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build();
+ *   FieldMask updateMask = FieldMask.newBuilder().build();
+ *   QuotaAdjusterSettings response =
+ *       quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(
+ *           quotaAdjusterSettings, updateMask);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.api.cloudquotas.v1beta; + +import javax.annotation.Generated; diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStub.java new file mode 100644 index 000000000000..d20a1d0fc0a6 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStub.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CloudQuotasStub implements BackgroundResource { + + public UnaryCallable + listQuotaInfosPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaInfosPagedCallable()"); + } + + public UnaryCallable listQuotaInfosCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaInfosCallable()"); + } + + public UnaryCallable getQuotaInfoCallable() { + throw new UnsupportedOperationException("Not implemented: getQuotaInfoCallable()"); + } + + public UnaryCallable + listQuotaPreferencesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaPreferencesPagedCallable()"); + } + + public UnaryCallable + listQuotaPreferencesCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaPreferencesCallable()"); + } + + public UnaryCallable getQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: getQuotaPreferenceCallable()"); + } + + public UnaryCallable + createQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: createQuotaPreferenceCallable()"); + } + + public UnaryCallable + updateQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: updateQuotaPreferenceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStubSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStubSettings.java new file mode 100644 index 000000000000..9219cabda9c5 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/CloudQuotasStubSettings.java @@ -0,0 +1,625 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +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.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.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudQuotasStub}. + * + *

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

    + *
  • The default service address (cloudquotas.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getQuotaInfo: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudQuotasStubSettings.Builder cloudQuotasSettingsBuilder =
+ *     CloudQuotasStubSettings.newBuilder();
+ * cloudQuotasSettingsBuilder
+ *     .getQuotaInfoSettings()
+ *     .setRetrySettings(
+ *         cloudQuotasSettingsBuilder
+ *             .getQuotaInfoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * CloudQuotasStubSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudQuotasStubSettings 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 PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings; + private final UnaryCallSettings getQuotaInfoSettings; + private final PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings; + private final UnaryCallSettings + getQuotaPreferenceSettings; + private final UnaryCallSettings + createQuotaPreferenceSettings; + private final UnaryCallSettings + updateQuotaPreferenceSettings; + + private static final PagedListDescriptor + LIST_QUOTA_INFOS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQuotaInfosRequest injectToken(ListQuotaInfosRequest payload, String token) { + return ListQuotaInfosRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQuotaInfosRequest injectPageSize( + ListQuotaInfosRequest payload, int pageSize) { + return ListQuotaInfosRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQuotaInfosRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQuotaInfosResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListQuotaInfosResponse payload) { + return payload.getQuotaInfosList(); + } + }; + + private static final PagedListDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference> + LIST_QUOTA_PREFERENCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQuotaPreferencesRequest injectToken( + ListQuotaPreferencesRequest payload, String token) { + return ListQuotaPreferencesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQuotaPreferencesRequest injectPageSize( + ListQuotaPreferencesRequest payload, int pageSize) { + return ListQuotaPreferencesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQuotaPreferencesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQuotaPreferencesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListQuotaPreferencesResponse payload) { + return payload.getQuotaPreferencesList(); + } + }; + + private static final PagedListResponseFactory< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + LIST_QUOTA_INFOS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQuotaInfosRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_QUOTA_INFOS_PAGE_STR_DESC, request, context); + return ListQuotaInfosPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + LIST_QUOTA_PREFERENCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQuotaPreferencesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference> + pageContext = + PageContext.create( + callable, LIST_QUOTA_PREFERENCES_PAGE_STR_DESC, request, context); + return ListQuotaPreferencesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listQuotaInfos. */ + public PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return listQuotaInfosSettings; + } + + /** Returns the object with the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings getQuotaInfoSettings() { + return getQuotaInfoSettings; + } + + /** Returns the object with the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return listQuotaPreferencesSettings; + } + + /** Returns the object with the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings + getQuotaPreferenceSettings() { + return getQuotaPreferenceSettings; + } + + /** Returns the object with the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings + createQuotaPreferenceSettings() { + return createQuotaPreferenceSettings; + } + + /** Returns the object with the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings + updateQuotaPreferenceSettings() { + return updateQuotaPreferenceSettings; + } + + public CloudQuotasStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudQuotasStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudQuotasStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudquotas"; + } + + /** 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 "cloudquotas.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudquotas.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(CloudQuotasStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudQuotasStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudQuotasStubSettings.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 CloudQuotasStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listQuotaInfosSettings = settingsBuilder.listQuotaInfosSettings().build(); + getQuotaInfoSettings = settingsBuilder.getQuotaInfoSettings().build(); + listQuotaPreferencesSettings = settingsBuilder.listQuotaPreferencesSettings().build(); + getQuotaPreferenceSettings = settingsBuilder.getQuotaPreferenceSettings().build(); + createQuotaPreferenceSettings = settingsBuilder.createQuotaPreferenceSettings().build(); + updateQuotaPreferenceSettings = settingsBuilder.updateQuotaPreferenceSettings().build(); + } + + /** Builder for CloudQuotasStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings; + private final UnaryCallSettings.Builder getQuotaInfoSettings; + private final PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings; + private final UnaryCallSettings.Builder + getQuotaPreferenceSettings; + private final UnaryCallSettings.Builder + createQuotaPreferenceSettings; + private final UnaryCallSettings.Builder + updateQuotaPreferenceSettings; + 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))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listQuotaInfosSettings = PagedCallSettings.newBuilder(LIST_QUOTA_INFOS_PAGE_STR_FACT); + getQuotaInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listQuotaPreferencesSettings = + PagedCallSettings.newBuilder(LIST_QUOTA_PREFERENCES_PAGE_STR_FACT); + getQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listQuotaInfosSettings, + getQuotaInfoSettings, + listQuotaPreferencesSettings, + getQuotaPreferenceSettings, + createQuotaPreferenceSettings, + updateQuotaPreferenceSettings); + initDefaults(this); + } + + protected Builder(CloudQuotasStubSettings settings) { + super(settings); + + listQuotaInfosSettings = settings.listQuotaInfosSettings.toBuilder(); + getQuotaInfoSettings = settings.getQuotaInfoSettings.toBuilder(); + listQuotaPreferencesSettings = settings.listQuotaPreferencesSettings.toBuilder(); + getQuotaPreferenceSettings = settings.getQuotaPreferenceSettings.toBuilder(); + createQuotaPreferenceSettings = settings.createQuotaPreferenceSettings.toBuilder(); + updateQuotaPreferenceSettings = settings.updateQuotaPreferenceSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listQuotaInfosSettings, + getQuotaInfoSettings, + listQuotaPreferencesSettings, + getQuotaPreferenceSettings, + createQuotaPreferenceSettings, + updateQuotaPreferenceSettings); + } + + 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 + .listQuotaInfosSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getQuotaInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listQuotaPreferencesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getQuotaPreferenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createQuotaPreferenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateQuotaPreferenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_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 listQuotaInfos. */ + public PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return listQuotaInfosSettings; + } + + /** Returns the builder for the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings.Builder getQuotaInfoSettings() { + return getQuotaInfoSettings; + } + + /** Returns the builder for the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return listQuotaPreferencesSettings; + } + + /** Returns the builder for the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings.Builder + getQuotaPreferenceSettings() { + return getQuotaPreferenceSettings; + } + + /** Returns the builder for the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings.Builder + createQuotaPreferenceSettings() { + return createQuotaPreferenceSettings; + } + + /** Returns the builder for the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings.Builder + updateQuotaPreferenceSettings() { + return updateQuotaPreferenceSettings; + } + + @Override + public CloudQuotasStubSettings build() throws IOException { + return new CloudQuotasStubSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasCallableFactory.java new file mode 100644 index 000000000000..17745ebfb115 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.core.BetaApi; +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 CloudQuotas service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudQuotasCallableFactory 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasStub.java new file mode 100644 index 000000000000..7be5a4621ffa --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcCloudQuotasStub.java @@ -0,0 +1,365 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +import com.google.api.core.BetaApi; +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.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 CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudQuotasStub extends CloudQuotasStub { + private static final MethodDescriptor + listQuotaInfosMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/ListQuotaInfos") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQuotaInfosRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQuotaInfosResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQuotaInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/GetQuotaInfo") + .setRequestMarshaller(ProtoUtils.marshaller(GetQuotaInfoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaInfo.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listQuotaPreferencesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/ListQuotaPreferences") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQuotaPreferencesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQuotaPreferencesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/GetQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(GetQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/CreateQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/UpdateQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private final UnaryCallable listQuotaInfosCallable; + private final UnaryCallable + listQuotaInfosPagedCallable; + private final UnaryCallable getQuotaInfoCallable; + private final UnaryCallable + listQuotaPreferencesCallable; + private final UnaryCallable + listQuotaPreferencesPagedCallable; + private final UnaryCallable + getQuotaPreferenceCallable; + private final UnaryCallable + createQuotaPreferenceCallable; + private final UnaryCallable + updateQuotaPreferenceCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudQuotasStub create(CloudQuotasStubSettings settings) + throws IOException { + return new GrpcCloudQuotasStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudQuotasStub create(ClientContext clientContext) throws IOException { + return new GrpcCloudQuotasStub(CloudQuotasStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudQuotasStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudQuotasStub( + CloudQuotasStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudQuotasStub, 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 GrpcCloudQuotasStub(CloudQuotasStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudQuotasCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudQuotasStub, 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 GrpcCloudQuotasStub( + CloudQuotasStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listQuotaInfosTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQuotaInfosMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getQuotaInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQuotaInfoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listQuotaPreferencesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQuotaPreferencesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_preference.name", + String.valueOf(request.getQuotaPreference().getName())); + return builder.build(); + }) + .build(); + + this.listQuotaInfosCallable = + callableFactory.createUnaryCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.listQuotaInfosPagedCallable = + callableFactory.createPagedCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.getQuotaInfoCallable = + callableFactory.createUnaryCallable( + getQuotaInfoTransportSettings, settings.getQuotaInfoSettings(), clientContext); + this.listQuotaPreferencesCallable = + callableFactory.createUnaryCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.listQuotaPreferencesPagedCallable = + callableFactory.createPagedCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.getQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + getQuotaPreferenceTransportSettings, + settings.getQuotaPreferenceSettings(), + clientContext); + this.createQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + createQuotaPreferenceTransportSettings, + settings.createQuotaPreferenceSettings(), + clientContext); + this.updateQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + updateQuotaPreferenceTransportSettings, + settings.updateQuotaPreferenceSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listQuotaInfosCallable() { + return listQuotaInfosCallable; + } + + @Override + public UnaryCallable + listQuotaInfosPagedCallable() { + return listQuotaInfosPagedCallable; + } + + @Override + public UnaryCallable getQuotaInfoCallable() { + return getQuotaInfoCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesCallable() { + return listQuotaPreferencesCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesPagedCallable() { + return listQuotaPreferencesPagedCallable; + } + + @Override + public UnaryCallable getQuotaPreferenceCallable() { + return getQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + createQuotaPreferenceCallable() { + return createQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + updateQuotaPreferenceCallable() { + return updateQuotaPreferenceCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerCallableFactory.java new file mode 100644 index 000000000000..f898d6bda245 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.core.BetaApi; +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 QuotaAdjusterSettingsManager service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcQuotaAdjusterSettingsManagerCallableFactory 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerStub.java new file mode 100644 index 000000000000..71ee6d5f0a25 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/GrpcQuotaAdjusterSettingsManagerStub.java @@ -0,0 +1,213 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.api.core.BetaApi; +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.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 QuotaAdjusterSettingsManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcQuotaAdjusterSettingsManagerStub extends QuotaAdjusterSettingsManagerStub { + private static final MethodDescriptor + updateQuotaAdjusterSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager/UpdateQuotaAdjusterSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateQuotaAdjusterSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QuotaAdjusterSettings.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQuotaAdjusterSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager/GetQuotaAdjusterSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetQuotaAdjusterSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QuotaAdjusterSettings.getDefaultInstance())) + .build(); + + private final UnaryCallable + updateQuotaAdjusterSettingsCallable; + private final UnaryCallable + getQuotaAdjusterSettingsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcQuotaAdjusterSettingsManagerStub create( + QuotaAdjusterSettingsManagerStubSettings settings) throws IOException { + return new GrpcQuotaAdjusterSettingsManagerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcQuotaAdjusterSettingsManagerStub create(ClientContext clientContext) + throws IOException { + return new GrpcQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcQuotaAdjusterSettingsManagerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcQuotaAdjusterSettingsManagerStub, 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 GrpcQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcQuotaAdjusterSettingsManagerCallableFactory()); + } + + /** + * Constructs an instance of GrpcQuotaAdjusterSettingsManagerStub, 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 GrpcQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + updateQuotaAdjusterSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateQuotaAdjusterSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_adjuster_settings.name", + String.valueOf(request.getQuotaAdjusterSettings().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getQuotaAdjusterSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQuotaAdjusterSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.updateQuotaAdjusterSettingsCallable = + callableFactory.createUnaryCallable( + updateQuotaAdjusterSettingsTransportSettings, + settings.updateQuotaAdjusterSettingsSettings(), + clientContext); + this.getQuotaAdjusterSettingsCallable = + callableFactory.createUnaryCallable( + getQuotaAdjusterSettingsTransportSettings, + settings.getQuotaAdjusterSettingsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + updateQuotaAdjusterSettingsCallable() { + return updateQuotaAdjusterSettingsCallable; + } + + @Override + public UnaryCallable + getQuotaAdjusterSettingsCallable() { + return getQuotaAdjusterSettingsCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasCallableFactory.java new file mode 100644 index 000000000000..062028555aee --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.core.BetaApi; +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 CloudQuotas service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudQuotasCallableFactory + 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasStub.java new file mode 100644 index 000000000000..f76b2ee6a8f4 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonCloudQuotasStub.java @@ -0,0 +1,578 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +import com.google.api.core.BetaApi; +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.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 CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudQuotasStub extends CloudQuotasStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listQuotaInfosMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/ListQuotaInfos") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/services/*}/quotaInfos", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{parent=organizations/*/locations/*/services/*}/quotaInfos", + "/v1beta/{parent=folders/*/locations/*/services/*}/quotaInfos") + .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(ListQuotaInfosResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getQuotaInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/GetQuotaInfo") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/services/*/quotaInfos/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{name=organizations/*/locations/*/services/*/quotaInfos/*}", + "/v1beta/{name=folders/*/locations/*/services/*/quotaInfos/*}") + .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(QuotaInfo.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse> + listQuotaPreferencesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/ListQuotaPreferences") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{parent=folders/*/locations/*}/quotaPreferences", + "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences") + .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(ListQuotaPreferencesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/GetQuotaPreference") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/quotaPreferences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{name=organizations/*/locations/*/quotaPreferences/*}", + "/v1beta/{name=folders/*/locations/*/quotaPreferences/*}") + .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(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/CreateQuotaPreference") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{parent=folders/*/locations/*}/quotaPreferences", + "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "ignoreSafetyChecks", request.getIgnoreSafetyChecksList()); + serializer.putQueryParam( + fields, "quotaPreferenceId", request.getQuotaPreferenceId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("quotaPreference", request.getQuotaPreference(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1beta.CloudQuotas/UpdateQuotaPreference") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{quotaPreference.name=projects/*/locations/*/quotaPreferences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "quotaPreference.name", + request.getQuotaPreference().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1beta/{quotaPreference.name=folders/*/locations/*/quotaPreferences/*}", + "/v1beta/{quotaPreference.name=organizations/*/locations/*/quotaPreferences/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam( + fields, "ignoreSafetyChecks", request.getIgnoreSafetyChecksList()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("quotaPreference", request.getQuotaPreference(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listQuotaInfosCallable; + private final UnaryCallable + listQuotaInfosPagedCallable; + private final UnaryCallable getQuotaInfoCallable; + private final UnaryCallable + listQuotaPreferencesCallable; + private final UnaryCallable + listQuotaPreferencesPagedCallable; + private final UnaryCallable + getQuotaPreferenceCallable; + private final UnaryCallable + createQuotaPreferenceCallable; + private final UnaryCallable + updateQuotaPreferenceCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudQuotasStub create(CloudQuotasStubSettings settings) + throws IOException { + return new HttpJsonCloudQuotasStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudQuotasStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudQuotasStub( + CloudQuotasStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudQuotasStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudQuotasStub( + CloudQuotasStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudQuotasStub, 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 HttpJsonCloudQuotasStub(CloudQuotasStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudQuotasCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudQuotasStub, 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 HttpJsonCloudQuotasStub( + CloudQuotasStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listQuotaInfosTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listQuotaInfosMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getQuotaInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getQuotaInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listQuotaPreferencesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listQuotaPreferencesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_preference.name", + String.valueOf(request.getQuotaPreference().getName())); + return builder.build(); + }) + .build(); + + this.listQuotaInfosCallable = + callableFactory.createUnaryCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.listQuotaInfosPagedCallable = + callableFactory.createPagedCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.getQuotaInfoCallable = + callableFactory.createUnaryCallable( + getQuotaInfoTransportSettings, settings.getQuotaInfoSettings(), clientContext); + this.listQuotaPreferencesCallable = + callableFactory.createUnaryCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.listQuotaPreferencesPagedCallable = + callableFactory.createPagedCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.getQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + getQuotaPreferenceTransportSettings, + settings.getQuotaPreferenceSettings(), + clientContext); + this.createQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + createQuotaPreferenceTransportSettings, + settings.createQuotaPreferenceSettings(), + clientContext); + this.updateQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + updateQuotaPreferenceTransportSettings, + settings.updateQuotaPreferenceSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listQuotaInfosMethodDescriptor); + methodDescriptors.add(getQuotaInfoMethodDescriptor); + methodDescriptors.add(listQuotaPreferencesMethodDescriptor); + methodDescriptors.add(getQuotaPreferenceMethodDescriptor); + methodDescriptors.add(createQuotaPreferenceMethodDescriptor); + methodDescriptors.add(updateQuotaPreferenceMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listQuotaInfosCallable() { + return listQuotaInfosCallable; + } + + @Override + public UnaryCallable + listQuotaInfosPagedCallable() { + return listQuotaInfosPagedCallable; + } + + @Override + public UnaryCallable getQuotaInfoCallable() { + return getQuotaInfoCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesCallable() { + return listQuotaPreferencesCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesPagedCallable() { + return listQuotaPreferencesPagedCallable; + } + + @Override + public UnaryCallable getQuotaPreferenceCallable() { + return getQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + createQuotaPreferenceCallable() { + return createQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + updateQuotaPreferenceCallable() { + return updateQuotaPreferenceCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerCallableFactory.java new file mode 100644 index 000000000000..3d6037b33cf8 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.core.BetaApi; +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 QuotaAdjusterSettingsManager service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonQuotaAdjusterSettingsManagerCallableFactory + 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerStub.java new file mode 100644 index 000000000000..09e5f1fa9d7f --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/HttpJsonQuotaAdjusterSettingsManagerStub.java @@ -0,0 +1,288 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.api.core.BetaApi; +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.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 QuotaAdjusterSettingsManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonQuotaAdjusterSettingsManagerStub extends QuotaAdjusterSettingsManagerStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + UpdateQuotaAdjusterSettingsRequest, QuotaAdjusterSettings> + updateQuotaAdjusterSettingsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager/UpdateQuotaAdjusterSettings") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{quotaAdjusterSettings.name=projects/*/locations/*/quotaAdjusterSettings}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "quotaAdjusterSettings.name", + request.getQuotaAdjusterSettings().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "quotaAdjusterSettings", + request.getQuotaAdjusterSettings(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaAdjusterSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getQuotaAdjusterSettingsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager/GetQuotaAdjusterSettings") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}", + 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(QuotaAdjusterSettings.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + updateQuotaAdjusterSettingsCallable; + private final UnaryCallable + getQuotaAdjusterSettingsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonQuotaAdjusterSettingsManagerStub create( + QuotaAdjusterSettingsManagerStubSettings settings) throws IOException { + return new HttpJsonQuotaAdjusterSettingsManagerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonQuotaAdjusterSettingsManagerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonQuotaAdjusterSettingsManagerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonQuotaAdjusterSettingsManagerStub, 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 HttpJsonQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonQuotaAdjusterSettingsManagerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonQuotaAdjusterSettingsManagerStub, 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 HttpJsonQuotaAdjusterSettingsManagerStub( + QuotaAdjusterSettingsManagerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + updateQuotaAdjusterSettingsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(updateQuotaAdjusterSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_adjuster_settings.name", + String.valueOf(request.getQuotaAdjusterSettings().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getQuotaAdjusterSettingsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getQuotaAdjusterSettingsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.updateQuotaAdjusterSettingsCallable = + callableFactory.createUnaryCallable( + updateQuotaAdjusterSettingsTransportSettings, + settings.updateQuotaAdjusterSettingsSettings(), + clientContext); + this.getQuotaAdjusterSettingsCallable = + callableFactory.createUnaryCallable( + getQuotaAdjusterSettingsTransportSettings, + settings.getQuotaAdjusterSettingsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(updateQuotaAdjusterSettingsMethodDescriptor); + methodDescriptors.add(getQuotaAdjusterSettingsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + updateQuotaAdjusterSettingsCallable() { + return updateQuotaAdjusterSettingsCallable; + } + + @Override + public UnaryCallable + getQuotaAdjusterSettingsCallable() { + return getQuotaAdjusterSettingsCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStub.java new file mode 100644 index 000000000000..dbb7d333c34c --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStub.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the QuotaAdjusterSettingsManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class QuotaAdjusterSettingsManagerStub implements BackgroundResource { + + public UnaryCallable + updateQuotaAdjusterSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateQuotaAdjusterSettingsCallable()"); + } + + public UnaryCallable + getQuotaAdjusterSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getQuotaAdjusterSettingsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStubSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStubSettings.java new file mode 100644 index 000000000000..2a704df3705e --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1beta/stub/QuotaAdjusterSettingsManagerStubSettings.java @@ -0,0 +1,382 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub; + +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.api.core.ApiFunction; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.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.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link QuotaAdjusterSettingsManagerStub}. + * + *

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

    + *
  • The default service address (cloudquotas.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of updateQuotaAdjusterSettings: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * QuotaAdjusterSettingsManagerStubSettings.Builder quotaAdjusterSettingsManagerSettingsBuilder =
+ *     QuotaAdjusterSettingsManagerStubSettings.newBuilder();
+ * quotaAdjusterSettingsManagerSettingsBuilder
+ *     .updateQuotaAdjusterSettingsSettings()
+ *     .setRetrySettings(
+ *         quotaAdjusterSettingsManagerSettingsBuilder
+ *             .updateQuotaAdjusterSettingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * QuotaAdjusterSettingsManagerStubSettings quotaAdjusterSettingsManagerSettings =
+ *     quotaAdjusterSettingsManagerSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaAdjusterSettingsManagerStubSettings + 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 + updateQuotaAdjusterSettingsSettings; + private final UnaryCallSettings + getQuotaAdjusterSettingsSettings; + + /** Returns the object with the settings used for calls to updateQuotaAdjusterSettings. */ + public UnaryCallSettings + updateQuotaAdjusterSettingsSettings() { + return updateQuotaAdjusterSettingsSettings; + } + + /** Returns the object with the settings used for calls to getQuotaAdjusterSettings. */ + public UnaryCallSettings + getQuotaAdjusterSettingsSettings() { + return getQuotaAdjusterSettingsSettings; + } + + public QuotaAdjusterSettingsManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcQuotaAdjusterSettingsManagerStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonQuotaAdjusterSettingsManagerStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudquotas"; + } + + /** 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 "cloudquotas.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudquotas.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(QuotaAdjusterSettingsManagerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(QuotaAdjusterSettingsManagerStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QuotaAdjusterSettingsManagerStubSettings.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 QuotaAdjusterSettingsManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + updateQuotaAdjusterSettingsSettings = + settingsBuilder.updateQuotaAdjusterSettingsSettings().build(); + getQuotaAdjusterSettingsSettings = settingsBuilder.getQuotaAdjusterSettingsSettings().build(); + } + + /** Builder for QuotaAdjusterSettingsManagerStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + UpdateQuotaAdjusterSettingsRequest, QuotaAdjusterSettings> + updateQuotaAdjusterSettingsSettings; + private final UnaryCallSettings.Builder + getQuotaAdjusterSettingsSettings; + 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))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + updateQuotaAdjusterSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getQuotaAdjusterSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + updateQuotaAdjusterSettingsSettings, getQuotaAdjusterSettingsSettings); + initDefaults(this); + } + + protected Builder(QuotaAdjusterSettingsManagerStubSettings settings) { + super(settings); + + updateQuotaAdjusterSettingsSettings = + settings.updateQuotaAdjusterSettingsSettings.toBuilder(); + getQuotaAdjusterSettingsSettings = settings.getQuotaAdjusterSettingsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + updateQuotaAdjusterSettingsSettings, getQuotaAdjusterSettingsSettings); + } + + 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 + .updateQuotaAdjusterSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getQuotaAdjusterSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_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 updateQuotaAdjusterSettings. */ + public UnaryCallSettings.Builder + updateQuotaAdjusterSettingsSettings() { + return updateQuotaAdjusterSettingsSettings; + } + + /** Returns the builder for the settings used for calls to getQuotaAdjusterSettings. */ + public UnaryCallSettings.Builder + getQuotaAdjusterSettingsSettings() { + return getQuotaAdjusterSettingsSettings; + } + + @Override + public QuotaAdjusterSettingsManagerStubSettings build() throws IOException { + return new QuotaAdjusterSettingsManagerStubSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1beta/reflect-config.json b/java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1beta/reflect-config.json new file mode 100644 index 000000000000..8c210b01db3a --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1beta/reflect-config.json @@ -0,0 +1,1730 @@ +[ + { + "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.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$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.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.DimensionsInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.DimensionsInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings$Enablement", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaConfig$Origin", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility$IneligibilityReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaInfo$ContainerType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaPreference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaPreference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.QuotaSafetyCheck", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.RolloutInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.RolloutInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$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.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$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.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.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$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.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientHttpJsonTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientHttpJsonTest.java new file mode 100644 index 000000000000..215dc81990c8 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientHttpJsonTest.java @@ -0,0 +1,865 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1beta.stub.HttpJsonCloudQuotasStub; +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.common.collect.Lists; +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 CloudQuotasClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudQuotasClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudQuotasStub.getMethodDescriptors(), + CloudQuotasSettings.getDefaultEndpoint()); + CloudQuotasSettings settings = + CloudQuotasSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudQuotasSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudQuotasClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listQuotaInfosTest() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().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 listQuotaInfosExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaInfosTest2() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4913/locations/location-4913/services/service-4913"; + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().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 listQuotaInfosExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-4913/locations/location-4913/services/service-4913"; + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockService.addResponse(expectedResponse); + + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + + QuotaInfo actualResponse = client.getQuotaInfo(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 getQuotaInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest2() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-4073/locations/location-4073/services/service-4073/quotaInfos/quotaInfo-4073"; + + QuotaInfo actualResponse = client.getQuotaInfo(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 getQuotaInfoExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-4073/locations/location-4073/services/service-4073/quotaInfos/quotaInfo-4073"; + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().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 listQuotaPreferencesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest2() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().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 listQuotaPreferencesExceptionTest2() 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.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + + QuotaPreference actualResponse = client.getQuotaPreference(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 getQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3280/locations/location-3280/quotaPreferences/quotaPreference-3280"; + + QuotaPreference actualResponse = client.getQuotaPreference(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 getQuotaPreferenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3280/locations/location-3280/quotaPreferences/quotaPreference-3280"; + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + 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 createQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + 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 createQuotaPreferenceExceptionTest2() 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"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest3() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + 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 createQuotaPreferenceExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest4() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + 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 createQuotaPreferenceExceptionTest4() 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"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockService.addResponse(expectedResponse); + + QuotaPreference quotaPreference = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaPreference actualResponse = client.updateQuotaPreference(quotaPreference, 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 updateQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaPreference quotaPreference = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaPreference(quotaPreference, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientTest.java new file mode 100644 index 000000000000..dd5be0b65466 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/CloudQuotasClientTest.java @@ -0,0 +1,768 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1beta.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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 CloudQuotasClientTest { + private static MockCloudQuotas mockCloudQuotas; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudQuotasClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudQuotas = new MockCloudQuotas(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCloudQuotas)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudQuotasSettings settings = + CloudQuotasSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudQuotasClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listQuotaInfosTest() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaInfosRequest actualRequest = ((ListQuotaInfosRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaInfosExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaInfosTest2() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaInfosRequest actualRequest = ((ListQuotaInfosRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaInfosExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaInfoRequest actualRequest = ((GetQuotaInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest2() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String name = "name3373707"; + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaInfoRequest actualRequest = ((GetQuotaInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaInfoExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String name = "name3373707"; + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaPreferencesRequest actualRequest = + ((ListQuotaPreferencesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaPreferencesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest2() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaPreferencesRequest actualRequest = + ((ListQuotaPreferencesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaPreferencesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaPreferenceRequest actualRequest = ((GetQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String name = "name3373707"; + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaPreferenceRequest actualRequest = ((GetQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaPreferenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String name = "name3373707"; + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest3() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(quotaPreferenceId, actualRequest.getQuotaPreferenceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest4() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(quotaPreferenceId, actualRequest.getQuotaPreferenceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .setContactEmail("contactEmail1253690204") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaPreference actualResponse = client.updateQuotaPreference(quotaPreference, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateQuotaPreferenceRequest actualRequest = + ((UpdateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaPreference(quotaPreference, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotas.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotas.java new file mode 100644 index 000000000000..0a83e686f786 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotas.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +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 MockCloudQuotas implements MockGrpcService { + private final MockCloudQuotasImpl serviceImpl; + + public MockCloudQuotas() { + serviceImpl = new MockCloudQuotasImpl(); + } + + @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-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotasImpl.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotasImpl.java new file mode 100644 index 000000000000..ca4ea099bb72 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockCloudQuotasImpl.java @@ -0,0 +1,187 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.CloudQuotasGrpc.CloudQuotasImplBase; +import com.google.api.core.BetaApi; +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 MockCloudQuotasImpl extends CloudQuotasImplBase { + private List requests; + private Queue responses; + + public MockCloudQuotasImpl() { + 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 listQuotaInfos( + ListQuotaInfosRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQuotaInfosResponse) { + requests.add(request); + responseObserver.onNext(((ListQuotaInfosResponse) 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 ListQuotaInfos, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQuotaInfosResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQuotaInfo( + GetQuotaInfoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaInfo) { + requests.add(request); + responseObserver.onNext(((QuotaInfo) 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 GetQuotaInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaInfo.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listQuotaPreferences( + ListQuotaPreferencesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQuotaPreferencesResponse) { + requests.add(request); + responseObserver.onNext(((ListQuotaPreferencesResponse) 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 ListQuotaPreferences, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQuotaPreferencesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQuotaPreference( + GetQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 GetQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createQuotaPreference( + CreateQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 CreateQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateQuotaPreference( + UpdateQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 UpdateQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManager.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManager.java new file mode 100644 index 000000000000..711c708893b8 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManager.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +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 MockQuotaAdjusterSettingsManager implements MockGrpcService { + private final MockQuotaAdjusterSettingsManagerImpl serviceImpl; + + public MockQuotaAdjusterSettingsManager() { + serviceImpl = new MockQuotaAdjusterSettingsManagerImpl(); + } + + @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-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManagerImpl.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManagerImpl.java new file mode 100644 index 000000000000..2ff16a632043 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/MockQuotaAdjusterSettingsManagerImpl.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerGrpc.QuotaAdjusterSettingsManagerImplBase; +import com.google.api.core.BetaApi; +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 MockQuotaAdjusterSettingsManagerImpl extends QuotaAdjusterSettingsManagerImplBase { + private List requests; + private Queue responses; + + public MockQuotaAdjusterSettingsManagerImpl() { + 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 updateQuotaAdjusterSettings( + UpdateQuotaAdjusterSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaAdjusterSettings) { + requests.add(request); + responseObserver.onNext(((QuotaAdjusterSettings) 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 UpdateQuotaAdjusterSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaAdjusterSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQuotaAdjusterSettings( + GetQuotaAdjusterSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaAdjusterSettings) { + requests.add(request); + responseObserver.onNext(((QuotaAdjusterSettings) 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 GetQuotaAdjusterSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaAdjusterSettings.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientHttpJsonTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientHttpJsonTest.java new file mode 100644 index 000000000000..f76f198daec1 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientHttpJsonTest.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.cloudquotas.v1beta.stub.HttpJsonQuotaAdjusterSettingsManagerStub; +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.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +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 QuotaAdjusterSettingsManagerClientHttpJsonTest { + private static MockHttpService mockService; + private static QuotaAdjusterSettingsManagerClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonQuotaAdjusterSettingsManagerStub.getMethodDescriptors(), + QuotaAdjusterSettingsManagerSettings.getDefaultEndpoint()); + QuotaAdjusterSettingsManagerSettings settings = + QuotaAdjusterSettingsManagerSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + QuotaAdjusterSettingsManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QuotaAdjusterSettingsManagerClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void updateQuotaAdjusterSettingsTest() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + QuotaAdjusterSettings quotaAdjusterSettings = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaAdjusterSettings actualResponse = + client.updateQuotaAdjusterSettings(quotaAdjusterSettings, 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 updateQuotaAdjusterSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaAdjusterSettings quotaAdjusterSettings = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaAdjusterSettings(quotaAdjusterSettings, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaAdjusterSettingsTest() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]"); + + QuotaAdjusterSettings actualResponse = client.getQuotaAdjusterSettings(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 getQuotaAdjusterSettingsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]"); + client.getQuotaAdjusterSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaAdjusterSettingsTest2() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1422/locations/location-1422/quotaAdjusterSettings"; + + QuotaAdjusterSettings actualResponse = client.getQuotaAdjusterSettings(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 getQuotaAdjusterSettingsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1422/locations/location-1422/quotaAdjusterSettings"; + client.getQuotaAdjusterSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientTest.java new file mode 100644 index 000000000000..e09293997a73 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerClientTest.java @@ -0,0 +1,207 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +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.protobuf.AbstractMessage; +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.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 QuotaAdjusterSettingsManagerClientTest { + private static MockQuotaAdjusterSettingsManager mockQuotaAdjusterSettingsManager; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private QuotaAdjusterSettingsManagerClient client; + + @BeforeClass + public static void startStaticServer() { + mockQuotaAdjusterSettingsManager = new MockQuotaAdjusterSettingsManager(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockQuotaAdjusterSettingsManager)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + QuotaAdjusterSettingsManagerSettings settings = + QuotaAdjusterSettingsManagerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QuotaAdjusterSettingsManagerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void updateQuotaAdjusterSettingsTest() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockQuotaAdjusterSettingsManager.addResponse(expectedResponse); + + QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaAdjusterSettings actualResponse = + client.updateQuotaAdjusterSettings(quotaAdjusterSettings, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockQuotaAdjusterSettingsManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateQuotaAdjusterSettingsRequest actualRequest = + ((UpdateQuotaAdjusterSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(quotaAdjusterSettings, actualRequest.getQuotaAdjusterSettings()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateQuotaAdjusterSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaAdjusterSettingsManager.addException(exception); + + try { + QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaAdjusterSettings(quotaAdjusterSettings, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaAdjusterSettingsTest() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockQuotaAdjusterSettingsManager.addResponse(expectedResponse); + + QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]"); + + QuotaAdjusterSettings actualResponse = client.getQuotaAdjusterSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockQuotaAdjusterSettingsManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaAdjusterSettingsRequest actualRequest = + ((GetQuotaAdjusterSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaAdjusterSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaAdjusterSettingsManager.addException(exception); + + try { + QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]"); + client.getQuotaAdjusterSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaAdjusterSettingsTest2() throws Exception { + QuotaAdjusterSettings expectedResponse = + QuotaAdjusterSettings.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockQuotaAdjusterSettingsManager.addResponse(expectedResponse); + + String name = "name3373707"; + + QuotaAdjusterSettings actualResponse = client.getQuotaAdjusterSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockQuotaAdjusterSettingsManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaAdjusterSettingsRequest actualRequest = + ((GetQuotaAdjusterSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaAdjusterSettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaAdjusterSettingsManager.addException(exception); + + try { + String name = "name3373707"; + client.getQuotaAdjusterSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/pom.xml b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/pom.xml new file mode 100644 index 000000000000..65875765fa85 --- /dev/null +++ b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + grpc-google-cloud-cloudquotas-v1beta + GRPC library for google-cloud-cloudquotas + + com.google.cloud + google-cloud-cloudquotas-parent + 0.24.0-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-cloudquotas-v1beta + + + com.google.guava + guava + + + diff --git a/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasGrpc.java b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasGrpc.java new file mode 100644 index 000000000000..3990f8c99c1f --- /dev/null +++ b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudQuotasGrpc.java @@ -0,0 +1,1022 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.cloudquotas.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+ * service consumers list and manage their resource usage limits.
+ * - List/Get the metadata and current status of the quotas for a service.
+ * - Create/Update quota preferencess that declare the preferred quota values.
+ * - Check the status of a quota preference request.
+ * - List/Get pending and historical quota preference.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/api/cloudquotas/v1beta/cloudquotas.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudQuotasGrpc { + + private CloudQuotasGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.api.cloudquotas.v1beta.CloudQuotas"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse> + getListQuotaInfosMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQuotaInfos", + requestType = com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.class, + responseType = com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse> + getListQuotaInfosMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse> + getListQuotaInfosMethod; + if ((getListQuotaInfosMethod = CloudQuotasGrpc.getListQuotaInfosMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getListQuotaInfosMethod = CloudQuotasGrpc.getListQuotaInfosMethod) == null) { + CloudQuotasGrpc.getListQuotaInfosMethod = + getListQuotaInfosMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListQuotaInfos")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("ListQuotaInfos")) + .build(); + } + } + } + return getListQuotaInfosMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1beta.QuotaInfo> + getGetQuotaInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQuotaInfo", + requestType = com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaInfo.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1beta.QuotaInfo> + getGetQuotaInfoMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1beta.QuotaInfo> + getGetQuotaInfoMethod; + if ((getGetQuotaInfoMethod = CloudQuotasGrpc.getGetQuotaInfoMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getGetQuotaInfoMethod = CloudQuotasGrpc.getGetQuotaInfoMethod) == null) { + CloudQuotasGrpc.getGetQuotaInfoMethod = + getGetQuotaInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetQuotaInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaInfo.getDefaultInstance())) + .setSchemaDescriptor(new CloudQuotasMethodDescriptorSupplier("GetQuotaInfo")) + .build(); + } + } + } + return getGetQuotaInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQuotaPreferences", + requestType = com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.class, + responseType = com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod; + if ((getListQuotaPreferencesMethod = CloudQuotasGrpc.getListQuotaPreferencesMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getListQuotaPreferencesMethod = CloudQuotasGrpc.getListQuotaPreferencesMethod) + == null) { + CloudQuotasGrpc.getListQuotaPreferencesMethod = + getListQuotaPreferencesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListQuotaPreferences")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("ListQuotaPreferences")) + .build(); + } + } + } + return getListQuotaPreferencesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getGetQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQuotaPreference", + requestType = com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getGetQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getGetQuotaPreferenceMethod; + if ((getGetQuotaPreferenceMethod = CloudQuotasGrpc.getGetQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getGetQuotaPreferenceMethod = CloudQuotasGrpc.getGetQuotaPreferenceMethod) == null) { + CloudQuotasGrpc.getGetQuotaPreferenceMethod = + getGetQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaPreference + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("GetQuotaPreference")) + .build(); + } + } + } + return getGetQuotaPreferenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getCreateQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateQuotaPreference", + requestType = com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getCreateQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getCreateQuotaPreferenceMethod; + if ((getCreateQuotaPreferenceMethod = CloudQuotasGrpc.getCreateQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getCreateQuotaPreferenceMethod = CloudQuotasGrpc.getCreateQuotaPreferenceMethod) + == null) { + CloudQuotasGrpc.getCreateQuotaPreferenceMethod = + getCreateQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaPreference + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("CreateQuotaPreference")) + .build(); + } + } + } + return getCreateQuotaPreferenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getUpdateQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateQuotaPreference", + requestType = com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getUpdateQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference> + getUpdateQuotaPreferenceMethod; + if ((getUpdateQuotaPreferenceMethod = CloudQuotasGrpc.getUpdateQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getUpdateQuotaPreferenceMethod = CloudQuotasGrpc.getUpdateQuotaPreferenceMethod) + == null) { + CloudQuotasGrpc.getUpdateQuotaPreferenceMethod = + getUpdateQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaPreference + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("UpdateQuotaPreference")) + .build(); + } + } + } + return getUpdateQuotaPreferenceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudQuotasStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasStub(channel, callOptions); + } + }; + return CloudQuotasStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudQuotasBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasBlockingStub(channel, callOptions); + } + }; + return CloudQuotasBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudQuotasFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasFutureStub(channel, callOptions); + } + }; + return CloudQuotasFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + default void listQuotaInfos( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQuotaInfosMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + default void getQuotaInfo( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQuotaInfoMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + default void listQuotaPreferences( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQuotaPreferencesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + default void getQuotaPreference( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQuotaPreferenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + default void createQuotaPreference( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateQuotaPreferenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + default void updateQuotaPreference( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateQuotaPreferenceMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public abstract static class CloudQuotasImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudQuotasGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudQuotasStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public void listQuotaInfos( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQuotaInfosMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public void getQuotaInfo( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQuotaInfoMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public void listQuotaPreferences( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQuotaPreferencesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public void getQuotaPreference( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public void createQuotaPreference( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public void updateQuotaPreference( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudQuotasBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse listQuotaInfos( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQuotaInfosMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaInfo getQuotaInfo( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQuotaInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse listQuotaPreferences( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQuotaPreferencesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQuotaPreferenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaPreference createQuotaPreference( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateQuotaPreferenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaPreference updateQuotaPreference( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateQuotaPreferenceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudQuotasFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse> + listQuotaInfos(com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQuotaInfosMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaInfo> + getQuotaInfo(com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQuotaInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse> + listQuotaPreferences( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQuotaPreferencesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaPreference> + getQuotaPreference(com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQuotaPreferenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaPreference> + createQuotaPreference( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateQuotaPreferenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaPreference> + updateQuotaPreference( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateQuotaPreferenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_QUOTA_INFOS = 0; + private static final int METHODID_GET_QUOTA_INFO = 1; + private static final int METHODID_LIST_QUOTA_PREFERENCES = 2; + private static final int METHODID_GET_QUOTA_PREFERENCE = 3; + private static final int METHODID_CREATE_QUOTA_PREFERENCE = 4; + private static final int METHODID_UPDATE_QUOTA_PREFERENCE = 5; + + 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_LIST_QUOTA_INFOS: + serviceImpl.listQuotaInfos( + (com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest) request, + (io.grpc.stub.StreamObserver< + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse>) + responseObserver); + break; + case METHODID_GET_QUOTA_INFO: + serviceImpl.getQuotaInfo( + (com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_QUOTA_PREFERENCES: + serviceImpl.listQuotaPreferences( + (com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse>) + responseObserver); + break; + case METHODID_GET_QUOTA_PREFERENCE: + serviceImpl.getQuotaPreference( + (com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_QUOTA_PREFERENCE: + serviceImpl.createQuotaPreference( + (com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_QUOTA_PREFERENCE: + serviceImpl.updateQuotaPreference( + (com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) 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( + getListQuotaInfosMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse>( + service, METHODID_LIST_QUOTA_INFOS))) + .addMethod( + getGetQuotaInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1beta.QuotaInfo>(service, METHODID_GET_QUOTA_INFO))) + .addMethod( + getListQuotaPreferencesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse>( + service, METHODID_LIST_QUOTA_PREFERENCES))) + .addMethod( + getGetQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference>( + service, METHODID_GET_QUOTA_PREFERENCE))) + .addMethod( + getCreateQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference>( + service, METHODID_CREATE_QUOTA_PREFERENCE))) + .addMethod( + getUpdateQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1beta.QuotaPreference>( + service, METHODID_UPDATE_QUOTA_PREFERENCE))) + .build(); + } + + private abstract static class CloudQuotasBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudQuotasBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudQuotas"); + } + } + + private static final class CloudQuotasFileDescriptorSupplier + extends CloudQuotasBaseDescriptorSupplier { + CloudQuotasFileDescriptorSupplier() {} + } + + private static final class CloudQuotasMethodDescriptorSupplier + extends CloudQuotasBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudQuotasMethodDescriptorSupplier(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 (CloudQuotasGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudQuotasFileDescriptorSupplier()) + .addMethod(getListQuotaInfosMethod()) + .addMethod(getGetQuotaInfoMethod()) + .addMethod(getListQuotaPreferencesMethod()) + .addMethod(getGetQuotaPreferenceMethod()) + .addMethod(getCreateQuotaPreferenceMethod()) + .addMethod(getUpdateQuotaPreferenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerGrpc.java b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerGrpc.java new file mode 100644 index 000000000000..30f3fef66209 --- /dev/null +++ b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsManagerGrpc.java @@ -0,0 +1,543 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.cloudquotas.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Quotas Adjuster Settings API is an infrastructure service for Google
+ *  Cloud that lets service consumers view and update their quota adjuster
+ *  settings.
+ * - Update quota adjuster settings.
+ * - Get the name of the configurations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class QuotaAdjusterSettingsManagerGrpc { + + private QuotaAdjusterSettingsManagerGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getUpdateQuotaAdjusterSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateQuotaAdjusterSettings", + requestType = com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getUpdateQuotaAdjusterSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getUpdateQuotaAdjusterSettingsMethod; + if ((getUpdateQuotaAdjusterSettingsMethod = + QuotaAdjusterSettingsManagerGrpc.getUpdateQuotaAdjusterSettingsMethod) + == null) { + synchronized (QuotaAdjusterSettingsManagerGrpc.class) { + if ((getUpdateQuotaAdjusterSettingsMethod = + QuotaAdjusterSettingsManagerGrpc.getUpdateQuotaAdjusterSettingsMethod) + == null) { + QuotaAdjusterSettingsManagerGrpc.getUpdateQuotaAdjusterSettingsMethod = + getUpdateQuotaAdjusterSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateQuotaAdjusterSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new QuotaAdjusterSettingsManagerMethodDescriptorSupplier( + "UpdateQuotaAdjusterSettings")) + .build(); + } + } + } + return getUpdateQuotaAdjusterSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getGetQuotaAdjusterSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQuotaAdjusterSettings", + requestType = com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.class, + responseType = com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getGetQuotaAdjusterSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getGetQuotaAdjusterSettingsMethod; + if ((getGetQuotaAdjusterSettingsMethod = + QuotaAdjusterSettingsManagerGrpc.getGetQuotaAdjusterSettingsMethod) + == null) { + synchronized (QuotaAdjusterSettingsManagerGrpc.class) { + if ((getGetQuotaAdjusterSettingsMethod = + QuotaAdjusterSettingsManagerGrpc.getGetQuotaAdjusterSettingsMethod) + == null) { + QuotaAdjusterSettingsManagerGrpc.getGetQuotaAdjusterSettingsMethod = + getGetQuotaAdjusterSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetQuotaAdjusterSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new QuotaAdjusterSettingsManagerMethodDescriptorSupplier( + "GetQuotaAdjusterSettings")) + .build(); + } + } + } + return getGetQuotaAdjusterSettingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static QuotaAdjusterSettingsManagerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaAdjusterSettingsManagerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerStub(channel, callOptions); + } + }; + return QuotaAdjusterSettingsManagerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static QuotaAdjusterSettingsManagerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaAdjusterSettingsManagerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerBlockingStub(channel, callOptions); + } + }; + return QuotaAdjusterSettingsManagerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static QuotaAdjusterSettingsManagerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaAdjusterSettingsManagerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerFutureStub(channel, callOptions); + } + }; + return QuotaAdjusterSettingsManagerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Quotas Adjuster Settings API is an infrastructure service for Google
+   *  Cloud that lets service consumers view and update their quota adjuster
+   *  settings.
+   * - Update quota adjuster settings.
+   * - Get the name of the configurations.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * RPC Method for updating QuotaAdjusterSettings based on the request
+     * 
+ */ + default void updateQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateQuotaAdjusterSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * RPC Method for getting QuotaAdjusterSettings based on the request
+     * 
+ */ + default void getQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQuotaAdjusterSettingsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service QuotaAdjusterSettingsManager. + * + *
+   * The Quotas Adjuster Settings API is an infrastructure service for Google
+   *  Cloud that lets service consumers view and update their quota adjuster
+   *  settings.
+   * - Update quota adjuster settings.
+   * - Get the name of the configurations.
+   * 
+ */ + public abstract static class QuotaAdjusterSettingsManagerImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return QuotaAdjusterSettingsManagerGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service QuotaAdjusterSettingsManager. + * + *
+   * The Quotas Adjuster Settings API is an infrastructure service for Google
+   *  Cloud that lets service consumers view and update their quota adjuster
+   *  settings.
+   * - Update quota adjuster settings.
+   * - Get the name of the configurations.
+   * 
+ */ + public static final class QuotaAdjusterSettingsManagerStub + extends io.grpc.stub.AbstractAsyncStub { + private QuotaAdjusterSettingsManagerStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaAdjusterSettingsManagerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerStub(channel, callOptions); + } + + /** + * + * + *
+     * RPC Method for updating QuotaAdjusterSettings based on the request
+     * 
+ */ + public void updateQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateQuotaAdjusterSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * RPC Method for getting QuotaAdjusterSettings based on the request
+     * 
+ */ + public void getQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQuotaAdjusterSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service QuotaAdjusterSettingsManager. + * + *
+   * The Quotas Adjuster Settings API is an infrastructure service for Google
+   *  Cloud that lets service consumers view and update their quota adjuster
+   *  settings.
+   * - Update quota adjuster settings.
+   * - Get the name of the configurations.
+   * 
+ */ + public static final class QuotaAdjusterSettingsManagerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private QuotaAdjusterSettingsManagerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaAdjusterSettingsManagerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * RPC Method for updating QuotaAdjusterSettings based on the request
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings updateQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateQuotaAdjusterSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * RPC Method for getting QuotaAdjusterSettings based on the request
+     * 
+ */ + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQuotaAdjusterSettingsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * QuotaAdjusterSettingsManager. + * + *
+   * The Quotas Adjuster Settings API is an infrastructure service for Google
+   *  Cloud that lets service consumers view and update their quota adjuster
+   *  settings.
+   * - Update quota adjuster settings.
+   * - Get the name of the configurations.
+   * 
+ */ + public static final class QuotaAdjusterSettingsManagerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private QuotaAdjusterSettingsManagerFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaAdjusterSettingsManagerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaAdjusterSettingsManagerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * RPC Method for updating QuotaAdjusterSettings based on the request
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + updateQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateQuotaAdjusterSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * RPC Method for getting QuotaAdjusterSettings based on the request
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings> + getQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQuotaAdjusterSettingsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_UPDATE_QUOTA_ADJUSTER_SETTINGS = 0; + private static final int METHODID_GET_QUOTA_ADJUSTER_SETTINGS = 1; + + 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_UPDATE_QUOTA_ADJUSTER_SETTINGS: + serviceImpl.updateQuotaAdjusterSettings( + (com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_QUOTA_ADJUSTER_SETTINGS: + serviceImpl.getQuotaAdjusterSettings( + (com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) 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( + getUpdateQuotaAdjusterSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings>( + service, METHODID_UPDATE_QUOTA_ADJUSTER_SETTINGS))) + .addMethod( + getGetQuotaAdjusterSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings>( + service, METHODID_GET_QUOTA_ADJUSTER_SETTINGS))) + .build(); + } + + private abstract static class QuotaAdjusterSettingsManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + QuotaAdjusterSettingsManagerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("QuotaAdjusterSettingsManager"); + } + } + + private static final class QuotaAdjusterSettingsManagerFileDescriptorSupplier + extends QuotaAdjusterSettingsManagerBaseDescriptorSupplier { + QuotaAdjusterSettingsManagerFileDescriptorSupplier() {} + } + + private static final class QuotaAdjusterSettingsManagerMethodDescriptorSupplier + extends QuotaAdjusterSettingsManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + QuotaAdjusterSettingsManagerMethodDescriptorSupplier(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 (QuotaAdjusterSettingsManagerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new QuotaAdjusterSettingsManagerFileDescriptorSupplier()) + .addMethod(getUpdateQuotaAdjusterSettingsMethod()) + .addMethod(getGetQuotaAdjusterSettingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudquotas/pom.xml b/java-cloudquotas/pom.xml index e4014ffcf3bc..3eab0d7cfc34 100644 --- a/java-cloudquotas/pom.xml +++ b/java-cloudquotas/pom.xml @@ -31,6 +31,16 @@ google-cloud-cloudquotas 0.24.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + com.google.api.grpc grpc-google-cloud-cloudquotas-v1 @@ -47,7 +57,9 @@ google-cloud-cloudquotas grpc-google-cloud-cloudquotas-v1 + grpc-google-cloud-cloudquotas-v1beta proto-google-cloud-cloudquotas-v1 + proto-google-cloud-cloudquotas-v1beta google-cloud-cloudquotas-bom diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/clirr-ignored-differences.xml b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..70e35c15384c --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/pom.xml b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/pom.xml new file mode 100644 index 000000000000..0301f4f730c4 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-cloudquotas-v1beta + 0.24.0-SNAPSHOT + proto-google-cloud-cloudquotas-v1beta + Proto library for google-cloud-cloudquotas + + com.google.cloud + google-cloud-cloudquotas-parent + 0.24.0-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-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudquotasProto.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudquotasProto.java new file mode 100644 index 000000000000..8f7da77e0651 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CloudquotasProto.java @@ -0,0 +1,285 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public final class CloudquotasProto { + private CloudquotasProto() {} + + 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_api_cloudquotas_v1beta_ListQuotaInfosRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_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/api/cloudquotas/v1beta/cloudquo" + + "tas.proto\022\035google.api.cloudquotas.v1beta" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032-google/api/cloudquotas/" + + "v1beta/resources.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\032 google/protobuf/field_mask.proto\"\206\001\n" + + "\025ListQuotaInfosRequest\022<\n\006parent\030\001 \001(\tB," + + "\340A\002\372A&\022$cloudquotas.googleapis.com/Quota" + + "Info\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\"p\n\026ListQuotaInfosResponse\022" + + "=\n\013quota_infos\030\001 \003(\0132(.google.api.cloudq" + + "uotas.v1beta.QuotaInfo\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"Q\n\023GetQuotaInfoRequest\022:\n\004name\030\001" + + " \001(\tB,\340A\002\372A&\n$cloudquotas.googleapis.com" + + "/QuotaInfo\"\276\001\n\033ListQuotaPreferencesReque" + + "st\022B\n\006parent\030\001 \001(\tB2\340A\002\372A,\022*cloudquotas." + + "googleapis.com/QuotaPreference\022\026\n\tpage_s" + + "ize\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\034ListQuotaPreferencesResponse\022I\n\021" + + "quota_preferences\030\001 \003(\0132..google.api.clo" + + "udquotas.v1beta.QuotaPreference\022\027\n\017next_" + + "page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"]\n" + + "\031GetQuotaPreferenceRequest\022@\n\004name\030\001 \001(\t" + + "B2\340A\002\372A,\n*cloudquotas.googleapis.com/Quo" + + "taPreference\"\242\002\n\034CreateQuotaPreferenceRe" + + "quest\022B\n\006parent\030\001 \001(\tB2\340A\002\372A,\022*cloudquot" + + "as.googleapis.com/QuotaPreference\022 \n\023quo" + + "ta_preference_id\030\002 \001(\tB\003\340A\001\022M\n\020quota_pre" + + "ference\030\003 \001(\0132..google.api.cloudquotas.v" + + "1beta.QuotaPreferenceB\003\340A\002\022M\n\024ignore_saf" + + "ety_checks\030\004 \003(\0162/.google.api.cloudquota" + + "s.v1beta.QuotaSafetyCheck\"\252\002\n\034UpdateQuot" + + "aPreferenceRequest\0224\n\013update_mask\030\001 \001(\0132" + + "\032.google.protobuf.FieldMaskB\003\340A\001\022M\n\020quot" + + "a_preference\030\002 \001(\0132..google.api.cloudquo" + + "tas.v1beta.QuotaPreferenceB\003\340A\002\022\032\n\rallow" + + "_missing\030\003 \001(\010B\003\340A\001\022\032\n\rvalidate_only\030\004 \001" + + "(\010B\003\340A\001\022M\n\024ignore_safety_checks\030\005 \003(\0162/." + + "google.api.cloudquotas.v1beta.QuotaSafet" + + "yCheck2\261\022\n\013CloudQuotas\022\325\002\n\016ListQuotaInfo" + + "s\0224.google.api.cloudquotas.v1beta.ListQu" + + "otaInfosRequest\0325.google.api.cloudquotas" + + ".v1beta.ListQuotaInfosResponse\"\325\001\332A\006pare" + + "nt\202\323\344\223\002\305\001\022=/v1beta/{parent=projects/*/lo" + + "cations/*/services/*}/quotaInfosZD\022B/v1b" + + "eta/{parent=organizations/*/locations/*/" + + "services/*}/quotaInfosZ>\022\022 + * Message for creating a QuotaPreference + * + * + * Protobuf type {@code google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} + */ +public final class CreateQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + CreateQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateQuotaPreferenceRequest.newBuilder() to construct. + private CreateQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateQuotaPreferenceRequest() { + parent_ = ""; + quotaPreferenceId_ = ""; + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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 QUOTA_PREFERENCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaPreferenceId_ = ""; + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + @java.lang.Override + public java.lang.String getQuotaPreferenceId() { + java.lang.Object ref = quotaPreferenceId_; + 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(); + quotaPreferenceId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaPreferenceIdBytes() { + java.lang.Object ref = quotaPreferenceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaPreferenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_PREFERENCE_FIELD_NUMBER = 3; + private com.google.api.cloudquotas.v1beta.QuotaPreference quotaPreference_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + @java.lang.Override + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + + public static final int IGNORE_SAFETY_CHECKS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List ignoreSafetyChecks_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck> + ignoreSafetyChecks_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>() { + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck convert( + java.lang.Integer from) { + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck result = + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck.forNumber(from); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaSafetyCheck.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return The count of ignoreSafetyChecks. + */ + @java.lang.Override + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List getIgnoreSafetyChecksValueList() { + return ignoreSafetyChecks_; + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + + private int ignoreSafetyChecksMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaPreferenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, quotaPreferenceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getQuotaPreference()); + } + if (getIgnoreSafetyChecksList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(ignoreSafetyChecksMemoizedSerializedSize); + } + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + output.writeEnumNoTag(ignoreSafetyChecks_.get(i)); + } + 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(quotaPreferenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, quotaPreferenceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQuotaPreference()); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(ignoreSafetyChecks_.get(i)); + } + size += dataSize; + if (!getIgnoreSafetyChecksList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + ignoreSafetyChecksMemoizedSerializedSize = dataSize; + } + 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQuotaPreferenceId().equals(other.getQuotaPreferenceId())) return false; + if (hasQuotaPreference() != other.hasQuotaPreference()) return false; + if (hasQuotaPreference()) { + if (!getQuotaPreference().equals(other.getQuotaPreference())) return false; + } + if (!ignoreSafetyChecks_.equals(other.ignoreSafetyChecks_)) 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) + QUOTA_PREFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreferenceId().hashCode(); + if (hasQuotaPreference()) { + hash = (37 * hash) + QUOTA_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreference().hashCode(); + } + if (getIgnoreSafetyChecksCount() > 0) { + hash = (37 * hash) + IGNORE_SAFETY_CHECKS_FIELD_NUMBER; + hash = (53 * hash) + ignoreSafetyChecks_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for creating a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQuotaPreferenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + quotaPreferenceId_ = ""; + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest result) { + if (((bitField0_ & 0x00000008) != 0)) { + ignoreSafetyChecks_ = java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.ignoreSafetyChecks_ = ignoreSafetyChecks_; + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaPreferenceId_ = quotaPreferenceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quotaPreference_ = + quotaPreferenceBuilder_ == null ? quotaPreference_ : quotaPreferenceBuilder_.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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest other) { + if (other + == com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuotaPreferenceId().isEmpty()) { + quotaPreferenceId_ = other.quotaPreferenceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasQuotaPreference()) { + mergeQuotaPreference(other.getQuotaPreference()); + } + if (!other.ignoreSafetyChecks_.isEmpty()) { + if (ignoreSafetyChecks_.isEmpty()) { + ignoreSafetyChecks_ = other.ignoreSafetyChecks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.addAll(other.ignoreSafetyChecks_); + } + 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: + { + quotaPreferenceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getQuotaPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + break; + } // case 32 + case 34: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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 quotaPreferenceId_ = ""; + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + public java.lang.String getQuotaPreferenceId() { + java.lang.Object ref = quotaPreferenceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaPreferenceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + public com.google.protobuf.ByteString getQuotaPreferenceIdBytes() { + java.lang.Object ref = quotaPreferenceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaPreferenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The quotaPreferenceId to set. + * @return This builder for chaining. + */ + public Builder setQuotaPreferenceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreferenceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaPreferenceId() { + quotaPreferenceId_ = getDefaultInstance().getQuotaPreferenceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for quotaPreferenceId to set. + * @return This builder for chaining. + */ + public Builder setQuotaPreferenceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaPreferenceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.api.cloudquotas.v1beta.QuotaPreference quotaPreference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + quotaPreferenceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference() { + if (quotaPreferenceBuilder_ == null) { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } else { + return quotaPreferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference(com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreference_ = value; + } else { + quotaPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference( + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder builderForValue) { + if (quotaPreferenceBuilder_ == null) { + quotaPreference_ = builderForValue.build(); + } else { + quotaPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaPreference(com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && quotaPreference_ != null + && quotaPreference_ + != com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance()) { + getQuotaPreferenceBuilder().mergeFrom(value); + } else { + quotaPreference_ = value; + } + } else { + quotaPreferenceBuilder_.mergeFrom(value); + } + if (quotaPreference_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaPreference() { + bitField0_ = (bitField0_ & ~0x00000004); + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference.Builder getQuotaPreferenceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getQuotaPreferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder + getQuotaPreferenceOrBuilder() { + if (quotaPreferenceBuilder_ != null) { + return quotaPreferenceBuilder_.getMessageOrBuilder(); + } else { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + getQuotaPreferenceFieldBuilder() { + if (quotaPreferenceBuilder_ == null) { + quotaPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder>( + getQuotaPreference(), getParentForChildren(), isClean()); + quotaPreference_ = null; + } + return quotaPreferenceBuilder_; + } + + private java.util.List ignoreSafetyChecks_ = + java.util.Collections.emptyList(); + + private void ensureIgnoreSafetyChecksIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + ignoreSafetyChecks_ = new java.util.ArrayList(ignoreSafetyChecks_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @return A list containing the ignoreSafetyChecks. + */ + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @return The count of ignoreSafetyChecks. + */ + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param index The index to set the value at. + * @param value The ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecks( + int index, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param value The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecks(com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param values The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecks( + java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value : values) { + ignoreSafetyChecks_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearIgnoreSafetyChecks() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + public java.util.List getIgnoreSafetyChecksValueList() { + return java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecksValue(int index, int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param value The enum numeric value on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecksValue(int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * + * @param values The enum numeric values on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecksValue(java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (int value : values) { + ignoreSafetyChecks_.add(value); + } + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CreateQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CreateQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..9443bb0390e0 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/CreateQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface CreateQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + java.lang.String getQuotaPreferenceId(); + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + com.google.protobuf.ByteString getQuotaPreferenceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + boolean hasQuotaPreference(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder(); + + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return The count of ignoreSafetyChecks. + */ + int getIgnoreSafetyChecksCount(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksValueList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + int getIgnoreSafetyChecksValue(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfo.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfo.java new file mode 100644 index 000000000000..23ff0a8aa3c5 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfo.java @@ -0,0 +1,1456 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * The detailed quota information such as effective quota value for a
+ * combination of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.DimensionsInfo} + */ +public final class DimensionsInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.DimensionsInfo) + DimensionsInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use DimensionsInfo.newBuilder() to construct. + private DimensionsInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DimensionsInfo() { + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DimensionsInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.DimensionsInfo.class, + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder.class); + } + + private int bitField0_; + public static final int DIMENSIONS_FIELD_NUMBER = 1; + + private static final class DimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DETAILS_FIELD_NUMBER = 2; + private com.google.api.cloudquotas.v1beta.QuotaDetails details_; + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return The details. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaDetails getDetails() { + return details_ == null + ? com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance() + : details_; + } + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance() + : details_; + } + + public static final int APPLICABLE_LOCATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList applicableLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + public com.google.protobuf.ProtocolStringList getApplicableLocationsList() { + return applicableLocations_; + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + public int getApplicableLocationsCount() { + return applicableLocations_.size(); + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + public java.lang.String getApplicableLocations(int index) { + return applicableLocations_.get(index); + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + public com.google.protobuf.ByteString getApplicableLocationsBytes(int index) { + return applicableLocations_.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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDimensions(), DimensionsDefaultEntryHolder.defaultEntry, 1); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getDetails()); + } + for (int i = 0; i < applicableLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, applicableLocations_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry dimensions__ = + DimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dimensions__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDetails()); + } + { + int dataSize = 0; + for (int i = 0; i < applicableLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(applicableLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getApplicableLocationsList().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.api.cloudquotas.v1beta.DimensionsInfo)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.DimensionsInfo other = + (com.google.api.cloudquotas.v1beta.DimensionsInfo) obj; + + if (!internalGetDimensions().equals(other.internalGetDimensions())) return false; + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) return false; + } + if (!getApplicableLocationsList().equals(other.getApplicableLocationsList())) 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 (!internalGetDimensions().getMap().isEmpty()) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDimensions().hashCode(); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + if (getApplicableLocationsCount() > 0) { + hash = (37 * hash) + APPLICABLE_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getApplicableLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo 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.api.cloudquotas.v1beta.DimensionsInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo 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.api.cloudquotas.v1beta.DimensionsInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo 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.api.cloudquotas.v1beta.DimensionsInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo 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.api.cloudquotas.v1beta.DimensionsInfo 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 detailed quota information such as effective quota value for a
+   * combination of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.DimensionsInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.DimensionsInfo) + com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.DimensionsInfo.class, + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.DimensionsInfo.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(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableDimensions().clear(); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.DimensionsInfo getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.DimensionsInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.DimensionsInfo build() { + com.google.api.cloudquotas.v1beta.DimensionsInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.DimensionsInfo buildPartial() { + com.google.api.cloudquotas.v1beta.DimensionsInfo result = + new com.google.api.cloudquotas.v1beta.DimensionsInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.DimensionsInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dimensions_ = internalGetDimensions(); + result.dimensions_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + applicableLocations_.makeImmutable(); + result.applicableLocations_ = applicableLocations_; + } + 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.api.cloudquotas.v1beta.DimensionsInfo) { + return mergeFrom((com.google.api.cloudquotas.v1beta.DimensionsInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.DimensionsInfo other) { + if (other == com.google.api.cloudquotas.v1beta.DimensionsInfo.getDefaultInstance()) + return this; + internalGetMutableDimensions().mergeFrom(other.internalGetDimensions()); + bitField0_ |= 0x00000001; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + if (!other.applicableLocations_.isEmpty()) { + if (applicableLocations_.isEmpty()) { + applicableLocations_ = other.applicableLocations_; + bitField0_ |= 0x00000004; + } else { + ensureApplicableLocationsIsMutable(); + applicableLocations_.addAll(other.applicableLocations_); + } + 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.protobuf.MapEntry dimensions__ = + input.readMessage( + DimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDimensions() + .getMutableMap() + .put(dimensions__.getKey(), dimensions__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(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 bitField0_; + + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField + internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableDimensions() { + if (dimensions_ == null) { + dimensions_ = + com.google.protobuf.MapField.newMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + if (!dimensions_.isMutable()) { + dimensions_ = dimensions_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDimensions() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableDimensions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder removeDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDimensions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDimensions() { + bitField0_ |= 0x00000001; + return internalGetMutableDimensions().getMutableMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder putDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder putAllDimensions(java.util.Map values) { + internalGetMutableDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + private com.google.api.cloudquotas.v1beta.QuotaDetails details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaDetails, + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder, + com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder> + detailsBuilder_; + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return The details. + */ + public com.google.api.cloudquotas.v1beta.QuotaDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public Builder setDetails(com.google.api.cloudquotas.v1beta.QuotaDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public Builder setDetails( + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public Builder mergeDetails(com.google.api.cloudquotas.v1beta.QuotaDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && details_ != null + && details_ != com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000002); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public com.google.api.cloudquotas.v1beta.QuotaDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + public com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance() + : details_; + } + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaDetails, + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder, + com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaDetails, + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder, + com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList applicableLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApplicableLocationsIsMutable() { + if (!applicableLocations_.isModifiable()) { + applicableLocations_ = new com.google.protobuf.LazyStringArrayList(applicableLocations_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + public com.google.protobuf.ProtocolStringList getApplicableLocationsList() { + applicableLocations_.makeImmutable(); + return applicableLocations_; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + public int getApplicableLocationsCount() { + return applicableLocations_.size(); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + public java.lang.String getApplicableLocations(int index) { + return applicableLocations_.get(index); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + public com.google.protobuf.ByteString getApplicableLocationsBytes(int index) { + return applicableLocations_.getByteString(index); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index to set the value at. + * @param value The applicableLocations to set. + * @return This builder for chaining. + */ + public Builder setApplicableLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableLocationsIsMutable(); + applicableLocations_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param value The applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addApplicableLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param values The applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addAllApplicableLocations(java.lang.Iterable values) { + ensureApplicableLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, applicableLocations_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return This builder for chaining. + */ + public Builder clearApplicableLocations() { + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param value The bytes of the applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addApplicableLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(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.api.cloudquotas.v1beta.DimensionsInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.DimensionsInfo) + private static final com.google.api.cloudquotas.v1beta.DimensionsInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.DimensionsInfo(); + } + + public static com.google.api.cloudquotas.v1beta.DimensionsInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DimensionsInfo 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.api.cloudquotas.v1beta.DimensionsInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfoOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfoOrBuilder.java new file mode 100644 index 000000000000..297e8a8e65b4 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/DimensionsInfoOrBuilder.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface DimensionsInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.DimensionsInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + int getDimensionsCount(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + boolean containsDimensions(java.lang.String key); + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDimensions(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + java.util.Map getDimensionsMap(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + /* nullable */ + java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + java.lang.String getDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + * + * @return The details. + */ + com.google.api.cloudquotas.v1beta.QuotaDetails getDetails(); + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaDetails details = 2; + */ + com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder getDetailsOrBuilder(); + + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + java.util.List getApplicableLocationsList(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + int getApplicableLocationsCount(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + java.lang.String getApplicableLocations(int index); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + com.google.protobuf.ByteString getApplicableLocationsBytes(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequest.java new file mode 100644 index 000000000000..a44247f237dd --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Request for getting QuotaAdjusterSettings
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} + */ +public final class GetQuotaAdjusterSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + GetQuotaAdjusterSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQuotaAdjusterSettingsRequest.newBuilder() to construct. + private GetQuotaAdjusterSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQuotaAdjusterSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQuotaAdjusterSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the config. Required to be “settings”, as only a single
+   * setting per container will be supported initially.
+   * 
+ * + * + * 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. Name of the config. Required to be “settings”, as only a single
+   * setting per container will be supported initially.
+   * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest other = + (com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest 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; + } + /** + * + * + *
+   * Request for getting QuotaAdjusterSettings
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.Builder.class); + } + + // Construct using + // com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.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.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest build() { + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest buildPartial() { + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest result = + new com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest other) { + if (other + == com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.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. Name of the config. Required to be “settings”, as only a single
+     * setting per container will be supported initially.
+     * 
+ * + * + * 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. Name of the config. Required to be “settings”, as only a single
+     * setting per container will be supported initially.
+     * 
+ * + * + * 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. Name of the config. Required to be “settings”, as only a single
+     * setting per container will be supported initially.
+     * 
+ * + * + * 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. Name of the config. Required to be “settings”, as only a single
+     * setting per container will be supported initially.
+     * 
+ * + * + * 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. Name of the config. Required to be “settings”, as only a single
+     * setting per container will be supported initially.
+     * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + private static final com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest(); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..aa3bbc980530 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaAdjusterSettingsRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface GetQuotaAdjusterSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the config. Required to be “settings”, as only a single
+   * setting per container will be supported initially.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the config. Required to be “settings”, as only a single
+   * setting per container will be supported initially.
+   * 
+ * + * + * 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-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequest.java new file mode 100644 index 000000000000..d78bb6600971 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for getting a QuotaInfo
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaInfoRequest} + */ +public final class GetQuotaInfoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.GetQuotaInfoRequest) + GetQuotaInfoRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQuotaInfoRequest.newBuilder() to construct. + private GetQuotaInfoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQuotaInfoRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQuotaInfoRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaInfoRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest other = + (com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest) 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.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest 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; + } + /** + * + * + *
+   * Message for getting a QuotaInfo
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaInfoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.GetQuotaInfoRequest) + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.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.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest build() { + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest buildPartial() { + com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest result = + new com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest other) { + if (other == com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest.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 resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * 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 resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * 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 resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaInfoRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.GetQuotaInfoRequest) + private static final com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest(); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQuotaInfoRequest 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.api.cloudquotas.v1beta.GetQuotaInfoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequestOrBuilder.java new file mode 100644 index 000000000000..af9977b3e3a5 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaInfoRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface GetQuotaInfoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.GetQuotaInfoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * 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-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequest.java new file mode 100644 index 000000000000..bf9fd61d33ad --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for getting a QuotaPreference
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} + */ +public final class GetQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + GetQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQuotaPreferenceRequest.newBuilder() to construct. + private GetQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQuotaPreferenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * 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. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for getting a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.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.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest other) { + if (other == com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.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. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * 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. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * 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. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * 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. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * 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. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQuotaPreferenceRequest 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.api.cloudquotas.v1beta.GetQuotaPreferenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..0daf932e1532 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/GetQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface GetQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * 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-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequest.java new file mode 100644 index 000000000000..d89af69af061 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequest.java @@ -0,0 +1,968 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for requesting list of QuotaInfos
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaInfosRequest} + */ +public final class ListQuotaInfosRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.ListQuotaInfosRequest) + ListQuotaInfosRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaInfosRequest.newBuilder() to construct. + private ListQuotaInfosRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaInfosRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaInfosRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.class, + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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.api.cloudquotas.v1beta.ListQuotaInfosRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest other = + (com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest) 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.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest 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; + } + /** + * + * + *
+   * Message for requesting list of QuotaInfos
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaInfosRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.ListQuotaInfosRequest) + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.class, + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.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.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest build() { + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest buildPartial() { + com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest result = + new com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest other) { + if (other == com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest.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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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.api.cloudquotas.v1beta.ListQuotaInfosRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.ListQuotaInfosRequest) + private static final com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest(); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaInfosRequest 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.api.cloudquotas.v1beta.ListQuotaInfosRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequestOrBuilder.java new file mode 100644 index 000000000000..7466f938654b --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface ListQuotaInfosRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.ListQuotaInfosRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponse.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponse.java new file mode 100644 index 000000000000..448a4d071933 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponse.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for response to listing QuotaInfos
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaInfosResponse} + */ +public final class ListQuotaInfosResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.ListQuotaInfosResponse) + ListQuotaInfosResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaInfosResponse.newBuilder() to construct. + private ListQuotaInfosResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaInfosResponse() { + quotaInfos_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaInfosResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.class, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.Builder.class); + } + + public static final int QUOTA_INFOS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List quotaInfos_; + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public java.util.List getQuotaInfosList() { + return quotaInfos_; + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public java.util.List + getQuotaInfosOrBuilderList() { + return quotaInfos_; + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public int getQuotaInfosCount() { + return quotaInfos_.size(); + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo getQuotaInfos(int index) { + return quotaInfos_.get(index); + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder getQuotaInfosOrBuilder(int index) { + return quotaInfos_.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 < quotaInfos_.size(); i++) { + output.writeMessage(1, quotaInfos_.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 < quotaInfos_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotaInfos_.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.api.cloudquotas.v1beta.ListQuotaInfosResponse)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse other = + (com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse) obj; + + if (!getQuotaInfosList().equals(other.getQuotaInfosList())) 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 (getQuotaInfosCount() > 0) { + hash = (37 * hash) + QUOTA_INFOS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaInfosList().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.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse 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; + } + /** + * + * + *
+   * Message for response to listing QuotaInfos
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaInfosResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.ListQuotaInfosResponse) + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.class, + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (quotaInfosBuilder_ == null) { + quotaInfos_ = java.util.Collections.emptyList(); + } else { + quotaInfos_ = null; + quotaInfosBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse build() { + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse buildPartial() { + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse result = + new com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse result) { + if (quotaInfosBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + quotaInfos_ = java.util.Collections.unmodifiableList(quotaInfos_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.quotaInfos_ = quotaInfos_; + } else { + result.quotaInfos_ = quotaInfosBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse) { + return mergeFrom((com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse other) { + if (other == com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse.getDefaultInstance()) + return this; + if (quotaInfosBuilder_ == null) { + if (!other.quotaInfos_.isEmpty()) { + if (quotaInfos_.isEmpty()) { + quotaInfos_ = other.quotaInfos_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuotaInfosIsMutable(); + quotaInfos_.addAll(other.quotaInfos_); + } + onChanged(); + } + } else { + if (!other.quotaInfos_.isEmpty()) { + if (quotaInfosBuilder_.isEmpty()) { + quotaInfosBuilder_.dispose(); + quotaInfosBuilder_ = null; + quotaInfos_ = other.quotaInfos_; + bitField0_ = (bitField0_ & ~0x00000001); + quotaInfosBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaInfosFieldBuilder() + : null; + } else { + quotaInfosBuilder_.addAllMessages(other.quotaInfos_); + } + } + } + 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.api.cloudquotas.v1beta.QuotaInfo m = + input.readMessage( + com.google.api.cloudquotas.v1beta.QuotaInfo.parser(), extensionRegistry); + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(m); + } else { + quotaInfosBuilder_.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 quotaInfos_ = + java.util.Collections.emptyList(); + + private void ensureQuotaInfosIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + quotaInfos_ = + new java.util.ArrayList(quotaInfos_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaInfo, + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder, + com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder> + quotaInfosBuilder_; + + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public java.util.List getQuotaInfosList() { + if (quotaInfosBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaInfos_); + } else { + return quotaInfosBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public int getQuotaInfosCount() { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.size(); + } else { + return quotaInfosBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaInfo getQuotaInfos(int index) { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.get(index); + } else { + return quotaInfosBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder setQuotaInfos(int index, com.google.api.cloudquotas.v1beta.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.set(index, value); + onChanged(); + } else { + quotaInfosBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder setQuotaInfos( + int index, com.google.api.cloudquotas.v1beta.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos(com.google.api.cloudquotas.v1beta.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.add(value); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos(int index, com.google.api.cloudquotas.v1beta.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.add(index, value); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos( + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos( + int index, com.google.api.cloudquotas.v1beta.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder addAllQuotaInfos( + java.lang.Iterable values) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaInfos_); + onChanged(); + } else { + quotaInfosBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder clearQuotaInfos() { + if (quotaInfosBuilder_ == null) { + quotaInfos_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + quotaInfosBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public Builder removeQuotaInfos(int index) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.remove(index); + onChanged(); + } else { + quotaInfosBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaInfo.Builder getQuotaInfosBuilder(int index) { + return getQuotaInfosFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder getQuotaInfosOrBuilder(int index) { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.get(index); + } else { + return quotaInfosBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public java.util.List + getQuotaInfosOrBuilderList() { + if (quotaInfosBuilder_ != null) { + return quotaInfosBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaInfos_); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaInfo.Builder addQuotaInfosBuilder() { + return getQuotaInfosFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1beta.QuotaInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaInfo.Builder addQuotaInfosBuilder(int index) { + return getQuotaInfosFieldBuilder() + .addBuilder(index, com.google.api.cloudquotas.v1beta.QuotaInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + public java.util.List + getQuotaInfosBuilderList() { + return getQuotaInfosFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaInfo, + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder, + com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder> + getQuotaInfosFieldBuilder() { + if (quotaInfosBuilder_ == null) { + quotaInfosBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaInfo, + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder, + com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder>( + quotaInfos_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + quotaInfos_ = null; + } + return quotaInfosBuilder_; + } + + 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.api.cloudquotas.v1beta.ListQuotaInfosResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.ListQuotaInfosResponse) + private static final com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse(); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaInfosResponse 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.api.cloudquotas.v1beta.ListQuotaInfosResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponseOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponseOrBuilder.java new file mode 100644 index 000000000000..40410a672a53 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaInfosResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface ListQuotaInfosResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.ListQuotaInfosResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + java.util.List getQuotaInfosList(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + com.google.api.cloudquotas.v1beta.QuotaInfo getQuotaInfos(int index); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + int getQuotaInfosCount(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + java.util.List + getQuotaInfosOrBuilderList(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaInfo quota_infos = 1; + */ + com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder getQuotaInfosOrBuilder(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-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequest.java new file mode 100644 index 000000000000..9131a7c1b271 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequest.java @@ -0,0 +1,1420 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for requesting list of QuotaPreferences
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} + */ +public final class ListQuotaPreferencesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + ListQuotaPreferencesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaPreferencesRequest.newBuilder() to construct. + private ListQuotaPreferencesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaPreferencesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaPreferencesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.class, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+   * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+   * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+   * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+   * 
+ * + * 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. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `quota_id`,
+   * `service, create_time`
+   * 
+ * + * 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. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `quota_id`,
+   * `service, create_time`
+   * 
+ * + * 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest other = + (com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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; + } + /** + * + * + *
+   * Message for requesting list of QuotaPreferences
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.class, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.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.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest build() { + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest buildPartial() { + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest result = + new com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest other) { + if (other + == com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+     * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+     * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+     * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+     * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+     * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+     * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+     * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+     * 
+ * + * 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. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+     * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+     * 
+ * + * 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. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `quota_id`,
+     * `service, create_time`
+     * 
+ * + * 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. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `quota_id`,
+     * `service, create_time`
+     * 
+ * + * 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. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `quota_id`,
+     * `service, create_time`
+     * 
+ * + * 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. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `quota_id`,
+     * `service, create_time`
+     * 
+ * + * 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. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `quota_id`,
+     * `service, create_time`
+     * 
+ * + * 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + private static final com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest(); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaPreferencesRequest 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.api.cloudquotas.v1beta.ListQuotaPreferencesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequestOrBuilder.java new file mode 100644 index 000000000000..fc300934fdd9 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface ListQuotaPreferencesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+   * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `reconciling=true AND request_type=CLOUD_CONSOLE`,
+   * `reconciling=true OR creation_time>2022-12-03T10:30:00`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `quota_id`,
+   * `service, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `quota_id`,
+   * `service, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponse.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponse.java new file mode 100644 index 000000000000..d6a1a5d77c3a --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponse.java @@ -0,0 +1,1425 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for response to listing QuotaPreferences
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} + */ +public final class ListQuotaPreferencesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + ListQuotaPreferencesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaPreferencesResponse.newBuilder() to construct. + private ListQuotaPreferencesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaPreferencesResponse() { + quotaPreferences_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaPreferencesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.class, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.Builder.class); + } + + public static final int QUOTA_PREFERENCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List quotaPreferences_; + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public java.util.List + getQuotaPreferencesList() { + return quotaPreferences_; + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public java.util.List + getQuotaPreferencesOrBuilderList() { + return quotaPreferences_; + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public int getQuotaPreferencesCount() { + return quotaPreferences_.size(); + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreferences(int index) { + return quotaPreferences_.get(index); + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder( + int index) { + return quotaPreferences_.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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.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 < quotaPreferences_.size(); i++) { + output.writeMessage(1, quotaPreferences_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < quotaPreferences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotaPreferences_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse other = + (com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) obj; + + if (!getQuotaPreferencesList().equals(other.getQuotaPreferencesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getQuotaPreferencesCount() > 0) { + hash = (37 * hash) + QUOTA_PREFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreferencesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse 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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse 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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse 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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse 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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse 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; + } + /** + * + * + *
+   * Message for response to listing QuotaPreferences
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.class, + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (quotaPreferencesBuilder_ == null) { + quotaPreferences_ = java.util.Collections.emptyList(); + } else { + quotaPreferences_ = null; + quotaPreferencesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse build() { + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse buildPartial() { + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse result = + new com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse result) { + if (quotaPreferencesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + quotaPreferences_ = java.util.Collections.unmodifiableList(quotaPreferences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.quotaPreferences_ = quotaPreferences_; + } else { + result.quotaPreferences_ = quotaPreferencesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) { + return mergeFrom((com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse other) { + if (other + == com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.getDefaultInstance()) + return this; + if (quotaPreferencesBuilder_ == null) { + if (!other.quotaPreferences_.isEmpty()) { + if (quotaPreferences_.isEmpty()) { + quotaPreferences_ = other.quotaPreferences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.addAll(other.quotaPreferences_); + } + onChanged(); + } + } else { + if (!other.quotaPreferences_.isEmpty()) { + if (quotaPreferencesBuilder_.isEmpty()) { + quotaPreferencesBuilder_.dispose(); + quotaPreferencesBuilder_ = null; + quotaPreferences_ = other.quotaPreferences_; + bitField0_ = (bitField0_ & ~0x00000001); + quotaPreferencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaPreferencesFieldBuilder() + : null; + } else { + quotaPreferencesBuilder_.addAllMessages(other.quotaPreferences_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.api.cloudquotas.v1beta.QuotaPreference m = + input.readMessage( + com.google.api.cloudquotas.v1beta.QuotaPreference.parser(), + extensionRegistry); + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(m); + } else { + quotaPreferencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(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 bitField0_; + + private java.util.List quotaPreferences_ = + java.util.Collections.emptyList(); + + private void ensureQuotaPreferencesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + quotaPreferences_ = + new java.util.ArrayList( + quotaPreferences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + quotaPreferencesBuilder_; + + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public java.util.List + getQuotaPreferencesList() { + if (quotaPreferencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaPreferences_); + } else { + return quotaPreferencesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public int getQuotaPreferencesCount() { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.size(); + } else { + return quotaPreferencesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreferences(int index) { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.get(index); + } else { + return quotaPreferencesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder setQuotaPreferences( + int index, com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.set(index, value); + onChanged(); + } else { + quotaPreferencesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder setQuotaPreferences( + int index, com.google.api.cloudquotas.v1beta.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences(com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(value); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + int index, com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(index, value); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + int index, com.google.api.cloudquotas.v1beta.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder addAllQuotaPreferences( + java.lang.Iterable values) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaPreferences_); + onChanged(); + } else { + quotaPreferencesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder clearQuotaPreferences() { + if (quotaPreferencesBuilder_ == null) { + quotaPreferences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + quotaPreferencesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public Builder removeQuotaPreferences(int index) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.remove(index); + onChanged(); + } else { + quotaPreferencesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference.Builder getQuotaPreferencesBuilder( + int index) { + return getQuotaPreferencesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder( + int index) { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.get(index); + } else { + return quotaPreferencesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public java.util.List + getQuotaPreferencesOrBuilderList() { + if (quotaPreferencesBuilder_ != null) { + return quotaPreferencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaPreferences_); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference.Builder addQuotaPreferencesBuilder() { + return getQuotaPreferencesFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference.Builder addQuotaPreferencesBuilder( + int index) { + return getQuotaPreferencesFieldBuilder() + .addBuilder( + index, com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + public java.util.List + getQuotaPreferencesBuilderList() { + return getQuotaPreferencesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + getQuotaPreferencesFieldBuilder() { + if (quotaPreferencesBuilder_ == null) { + quotaPreferencesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder>( + quotaPreferences_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + quotaPreferences_ = null; + } + return quotaPreferencesBuilder_; + } + + 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; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + private static final com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse(); + } + + public static com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaPreferencesResponse 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.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponseOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponseOrBuilder.java new file mode 100644 index 000000000000..e5fcf31ea926 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ListQuotaPreferencesResponseOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface ListQuotaPreferencesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + java.util.List getQuotaPreferencesList(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreferences(int index); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + int getQuotaPreferencesCount(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + java.util.List + getQuotaPreferencesOrBuilderList(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaPreference quota_preferences = 1; + */ + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder( + 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(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/LocationName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/LocationName.java new file mode 100644 index 000000000000..bc89cd46c633 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/LocationName.java @@ -0,0 +1,359 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 static final PathTemplate FOLDER_LOCATION = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/locations/{location}"); + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String folder; + private final String organization; + + @Deprecated + protected LocationName() { + project = null; + location = null; + folder = null; + organization = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION; + } + + private LocationName(FolderLocationBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION; + } + + private LocationName(OrganizationLocationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationBuilder() { + return new Builder(); + } + + public static FolderLocationBuilder newFolderLocationBuilder() { + return new FolderLocationBuilder(); + } + + public static OrganizationLocationBuilder newOrganizationLocationBuilder() { + return new OrganizationLocationBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static LocationName ofProjectLocationName(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static LocationName ofFolderLocationName(String folder, String location) { + return newFolderLocationBuilder().setFolder(folder).setLocation(location).build(); + } + + public static LocationName ofOrganizationLocationName(String organization, String location) { + return newOrganizationLocationBuilder() + .setOrganization(organization) + .setLocation(location) + .build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static String formatProjectLocationName(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static String formatFolderLocationName(String folder, String location) { + return newFolderLocationBuilder().setFolder(folder).setLocation(location).build().toString(); + } + + public static String formatOrganizationLocationName(String organization, String location) { + return newOrganizationLocationBuilder() + .setOrganization(organization) + .setLocation(location) + .build() + .toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION.match(formattedString); + return ofProjectLocationName(matchMap.get("project"), matchMap.get("location")); + } else if (FOLDER_LOCATION.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION.match(formattedString); + return ofFolderLocationName(matchMap.get("folder"), matchMap.get("location")); + } else if (ORGANIZATION_LOCATION.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION.match(formattedString); + return ofOrganizationLocationName(matchMap.get("organization"), matchMap.get("location")); + } + throw new ValidationException("LocationName.parse: formattedString not in valid format"); + } + + 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) + || FOLDER_LOCATION.matches(formattedString) + || ORGANIZATION_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); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @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) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + 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) { + Preconditions.checkArgument( + Objects.equals(locationName.pathTemplate, PROJECT_LOCATION), + "toBuilder is only supported when LocationName has the pattern of projects/{project}/locations/{location}"); + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}. */ + public static class FolderLocationBuilder { + private String folder; + private String location; + + protected FolderLocationBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public FolderLocationBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public LocationName build() { + return new LocationName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}. */ + public static class OrganizationLocationBuilder { + private String organization; + private String location; + + protected OrganizationLocationBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public OrganizationLocationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettings.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettings.java new file mode 100644 index 000000000000..ff737bd07d80 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettings.java @@ -0,0 +1,1471 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * The QuotaAdjusterSettings resource defines the settings for the Quota
+ * Adjuster.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaAdjusterSettings} + */ +public final class QuotaAdjusterSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaAdjusterSettings) + QuotaAdjusterSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaAdjusterSettings.newBuilder() to construct. + private QuotaAdjusterSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaAdjusterSettings() { + name_ = ""; + enablement_ = 0; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaAdjusterSettings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.class, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder.class); + } + + /** + * + * + *
+   * The enablement status of the quota adjuster.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement} + */ + public enum Enablement implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The quota adjuster is in an unknown state.
+     * 
+ * + * ENABLEMENT_UNSPECIFIED = 0; + */ + ENABLEMENT_UNSPECIFIED(0), + /** + * + * + *
+     * The quota adjuster is enabled.
+     * 
+ * + * ENABLED = 2; + */ + ENABLED(2), + /** + * + * + *
+     * The quota adjuster is disabled.
+     * 
+ * + * DISABLED = 3; + */ + DISABLED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The quota adjuster is in an unknown state.
+     * 
+ * + * ENABLEMENT_UNSPECIFIED = 0; + */ + public static final int ENABLEMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The quota adjuster is enabled.
+     * 
+ * + * ENABLED = 2; + */ + public static final int ENABLED_VALUE = 2; + /** + * + * + *
+     * The quota adjuster is disabled.
+     * 
+ * + * DISABLED = 3; + */ + public static final int DISABLED_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 Enablement 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 Enablement forNumber(int value) { + switch (value) { + case 0: + return ENABLEMENT_UNSPECIFIED; + case 2: + return ENABLED; + case 3: + 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 Enablement findValueByNumber(int number) { + return Enablement.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.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Enablement[] VALUES = values(); + + public static Enablement 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 Enablement(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Name of the config would be of the format:
+   *   projects/12345/locations/global/quotaAdjusterSettings
+   * 
+ * + * 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. Name of the config would be of the format:
+   *   projects/12345/locations/global/quotaAdjusterSettings
+   * 
+ * + * 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 ENABLEMENT_FIELD_NUMBER = 2; + private int enablement_ = 0; + /** + * + * + *
+   * Required. The configured value of the enablement at the given resource.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for enablement. + */ + @java.lang.Override + public int getEnablementValue() { + return enablement_; + } + /** + * + * + *
+   * Required. The configured value of the enablement at the given resource.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enablement. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement getEnablement() { + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement result = + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.forNumber(enablement_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.UNRECOGNIZED + : result; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp when the QuotaAdjusterSettings 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_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The timestamp when the QuotaAdjusterSettings 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 timestamp when the QuotaAdjusterSettings 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 ETAG_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+   * provided on update and does not match the current server's etag of the
+   * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+   * will be returned. See https://google.aip.dev/134#etags for more details on
+   * etags.
+   * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+   * provided on update and does not match the current server's etag of the
+   * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+   * will be returned. See https://google.aip.dev/134#etags for more details on
+   * etags.
+   * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (enablement_ + != com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.ENABLEMENT_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, enablement_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + } + 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 (enablement_ + != com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.ENABLEMENT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, enablement_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + } + 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.api.cloudquotas.v1beta.QuotaAdjusterSettings)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings other = + (com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings) obj; + + if (!getName().equals(other.getName())) return false; + if (enablement_ != other.enablement_) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!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) + ENABLEMENT_FIELD_NUMBER; + hash = (53 * hash) + enablement_; + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings 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.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings 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.api.cloudquotas.v1beta.QuotaAdjusterSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings 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.api.cloudquotas.v1beta.QuotaAdjusterSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings 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.api.cloudquotas.v1beta.QuotaAdjusterSettings 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 QuotaAdjusterSettings resource defines the settings for the Quota
+   * Adjuster.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaAdjusterSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaAdjusterSettings) + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.class, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + enablement_ = 0; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings build() { + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings result = + new com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enablement_ = enablement_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + 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.api.cloudquotas.v1beta.QuotaAdjusterSettings) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.enablement_ != 0) { + setEnablementValue(other.getEnablementValue()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + enablement_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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. Name of the config would be of the format:
+     *   projects/12345/locations/global/quotaAdjusterSettings
+     * 
+ * + * 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. Name of the config would be of the format:
+     *   projects/12345/locations/global/quotaAdjusterSettings
+     * 
+ * + * 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. Name of the config would be of the format:
+     *   projects/12345/locations/global/quotaAdjusterSettings
+     * 
+ * + * 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. Name of the config would be of the format:
+     *   projects/12345/locations/global/quotaAdjusterSettings
+     * 
+ * + * 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. Name of the config would be of the format:
+     *   projects/12345/locations/global/quotaAdjusterSettings
+     * 
+ * + * 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 enablement_ = 0; + /** + * + * + *
+     * Required. The configured value of the enablement at the given resource.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for enablement. + */ + @java.lang.Override + public int getEnablementValue() { + return enablement_; + } + /** + * + * + *
+     * Required. The configured value of the enablement at the given resource.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for enablement to set. + * @return This builder for chaining. + */ + public Builder setEnablementValue(int value) { + enablement_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The configured value of the enablement at the given resource.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enablement. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement getEnablement() { + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement result = + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.forNumber(enablement_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The configured value of the enablement at the given resource.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enablement to set. + * @return This builder for chaining. + */ + public Builder setEnablement( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + enablement_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The configured value of the enablement at the given resource.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearEnablement() { + bitField0_ = (bitField0_ & ~0x00000002); + enablement_ = 0; + onChanged(); + return this; + } + + 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 timestamp when the QuotaAdjusterSettings 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_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The timestamp when the QuotaAdjusterSettings 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 timestamp when the QuotaAdjusterSettings 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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the QuotaAdjusterSettings 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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the QuotaAdjusterSettings 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_ & 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. The timestamp when the QuotaAdjusterSettings was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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. The timestamp when the QuotaAdjusterSettings was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the QuotaAdjusterSettings 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 timestamp when the QuotaAdjusterSettings 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 java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+     * provided on update and does not match the current server's etag of the
+     * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+     * will be returned. See https://google.aip.dev/134#etags for more details on
+     * etags.
+     * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+     * provided on update and does not match the current server's etag of the
+     * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+     * will be returned. See https://google.aip.dev/134#etags for more details on
+     * etags.
+     * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+     * provided on update and does not match the current server's etag of the
+     * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+     * will be returned. See https://google.aip.dev/134#etags for more details on
+     * etags.
+     * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+     * provided on update and does not match the current server's etag of the
+     * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+     * will be returned. See https://google.aip.dev/134#etags for more details on
+     * etags.
+     * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+     * provided on update and does not match the current server's etag of the
+     * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+     * will be returned. See https://google.aip.dev/134#etags for more details on
+     * etags.
+     * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + 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.api.cloudquotas.v1beta.QuotaAdjusterSettings) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaAdjusterSettings) + private static final com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaAdjusterSettings 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.api.cloudquotas.v1beta.QuotaAdjusterSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsName.java new file mode 100644 index 000000000000..6d92e06a09c4 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsName.java @@ -0,0 +1,194 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +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 QuotaAdjusterSettingsName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/quotaAdjusterSettings"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected QuotaAdjusterSettingsName() { + project = null; + location = null; + } + + private QuotaAdjusterSettingsName(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 QuotaAdjusterSettingsName 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 QuotaAdjusterSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, + "QuotaAdjusterSettingsName.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 (QuotaAdjusterSettingsName 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()) { + QuotaAdjusterSettingsName that = ((QuotaAdjusterSettingsName) 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}/quotaAdjusterSettings. */ + 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(QuotaAdjusterSettingsName quotaAdjusterSettingsName) { + this.project = quotaAdjusterSettingsName.project; + this.location = quotaAdjusterSettingsName.location; + } + + public QuotaAdjusterSettingsName build() { + return new QuotaAdjusterSettingsName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsOrBuilder.java new file mode 100644 index 000000000000..ae73b8e39de8 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaAdjusterSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaAdjusterSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Name of the config would be of the format:
+   *   projects/12345/locations/global/quotaAdjusterSettings
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Name of the config would be of the format:
+   *   projects/12345/locations/global/quotaAdjusterSettings
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The configured value of the enablement at the given resource.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for enablement. + */ + int getEnablementValue(); + /** + * + * + *
+   * Required. The configured value of the enablement at the given resource.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement enablement = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enablement. + */ + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement getEnablement(); + + /** + * + * + *
+   * Output only. The timestamp when the QuotaAdjusterSettings 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 timestamp when the QuotaAdjusterSettings 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 timestamp when the QuotaAdjusterSettings was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+   * provided on update and does not match the current server's etag of the
+   * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+   * will be returned. See https://google.aip.dev/134#etags for more details on
+   * etags.
+   * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the QuotaAdjusterSettings. If an etag is
+   * provided on update and does not match the current server's etag of the
+   * QuotaAdjusterSettings, the request will be blocked and an ABORTED error
+   * will be returned. See https://google.aip.dev/134#etags for more details on
+   * etags.
+   * 
+ * + * string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsProto.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsProto.java new file mode 100644 index 000000000000..794e6cceb229 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaAdjusterSettingsProto.java @@ -0,0 +1,157 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public final class QuotaAdjusterSettingsProto { + private QuotaAdjusterSettingsProto() {} + + 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_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_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/api/cloudquotas/v1beta/quota_ad" + + "juster_settings.proto\022\035google.api.cloudq" + + "uotas.v1beta\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032 google/protobuf/field_mask.prot" + + "o\032\037google/protobuf/timestamp.proto\"i\n\037Ge" + + "tQuotaAdjusterSettingsRequest\022F\n\004name\030\001 " + + "\001(\tB8\340A\002\372A2\n0cloudquotas.googleapis.com/" + + "QuotaAdjusterSettings\"\322\001\n\"UpdateQuotaAdj" + + "usterSettingsRequest\022Z\n\027quota_adjuster_s" + + "ettings\030\001 \001(\01324.google.api.cloudquotas.v" + + "1beta.QuotaAdjusterSettingsB\003\340A\002\0224\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\001\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\"\273\003\n\025Q" + + "uotaAdjusterSettings\022\021\n\004name\030\001 \001(\tB\003\340A\010\022" + + "X\n\nenablement\030\002 \001(\0162?.google.api.cloudqu" + + "otas.v1beta.QuotaAdjusterSettings.Enable" + + "mentB\003\340A\002\0224\n\013update_time\030\005 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\022\021\n\004etag\030\006 \001(\tB\003\340" + + "A\001\"C\n\nEnablement\022\032\n\026ENABLEMENT_UNSPECIFI" + + "ED\020\000\022\013\n\007ENABLED\020\002\022\014\n\010DISABLED\020\003:\246\001\352A\242\001\n0" + + "cloudquotas.googleapis.com/QuotaAdjuster" + + "Settings\022=projects/{project}/locations/{" + + "location}/quotaAdjusterSettings*\025quotaAd" + + "justerSettings2\025quotaAdjusterSettingsR\001\001" + + "2\203\005\n\034QuotaAdjusterSettingsManager\022\263\002\n\033Up" + + "dateQuotaAdjusterSettings\022A.google.api.c" + + "loudquotas.v1beta.UpdateQuotaAdjusterSet" + + "tingsRequest\0324.google.api.cloudquotas.v1" + + "beta.QuotaAdjusterSettings\"\232\001\332A#quota_ad" + + "juster_settings,update_mask\202\323\344\223\002n2S/v1be" + + "ta/{quota_adjuster_settings.name=project" + + "s/*/locations/*/quotaAdjusterSettings}:\027" + + "quota_adjuster_settings\022\334\001\n\030GetQuotaAdju" + + "sterSettings\022>.google.api.cloudquotas.v1" + + "beta.GetQuotaAdjusterSettingsRequest\0324.g" + + "oogle.api.cloudquotas.v1beta.QuotaAdjust" + + "erSettings\"J\332A\004name\202\323\344\223\002=\022;/v1beta/{name" + + "=projects/*/locations/*/quotaAdjusterSet" + + "tings}\032N\312A\032cloudquotas.googleapis.com\322A." + + "https://www.googleapis.com/auth/cloud-pl" + + "atformB\361\001\n!com.google.api.cloudquotas.v1" + + "betaB\032QuotaAdjusterSettingsProtoP\001ZEclou" + + "d.google.com/go/cloudquotas/apiv1beta/cl" + + "oudquotaspb;cloudquotaspb\252\002\037Google.Cloud" + + ".CloudQuotas.V1Beta\312\002\037Google\\Cloud\\Cloud" + + "Quotas\\V1beta\352\002\"Google::Cloud::CloudQuot" + + "as::V1betab\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.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_GetQuotaAdjusterSettingsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor, + new java.lang.String[] { + "QuotaAdjusterSettings", "UpdateMask", "ValidateOnly", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaAdjusterSettings_descriptor, + new java.lang.String[] { + "Name", "Enablement", "UpdateTime", "Etag", + }); + 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.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfig.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfig.java new file mode 100644 index 000000000000..87a5b2e93b87 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfig.java @@ -0,0 +1,1932 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * The preferred quota configuration.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaConfig} + */ +public final class QuotaConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaConfig) + QuotaConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaConfig.newBuilder() to construct. + private QuotaConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaConfig() { + stateDetail_ = ""; + traceId_ = ""; + requestOrigin_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaConfig.class, + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder.class); + } + + /** + * + * + *
+   * The enumeration of the origins of quota preference requests.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1beta.QuotaConfig.Origin} + */ + public enum Origin implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The unspecified value.
+     * 
+ * + * ORIGIN_UNSPECIFIED = 0; + */ + ORIGIN_UNSPECIFIED(0), + /** + * + * + *
+     * Created through Cloud Console.
+     * 
+ * + * CLOUD_CONSOLE = 1; + */ + CLOUD_CONSOLE(1), + /** + * + * + *
+     * Generated by automatic quota adjustment.
+     * 
+ * + * AUTO_ADJUSTER = 2; + */ + AUTO_ADJUSTER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The unspecified value.
+     * 
+ * + * ORIGIN_UNSPECIFIED = 0; + */ + public static final int ORIGIN_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Created through Cloud Console.
+     * 
+ * + * CLOUD_CONSOLE = 1; + */ + public static final int CLOUD_CONSOLE_VALUE = 1; + /** + * + * + *
+     * Generated by automatic quota adjustment.
+     * 
+ * + * AUTO_ADJUSTER = 2; + */ + public static final int AUTO_ADJUSTER_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 Origin 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 Origin forNumber(int value) { + switch (value) { + case 0: + return ORIGIN_UNSPECIFIED; + case 1: + return CLOUD_CONSOLE; + case 2: + return AUTO_ADJUSTER; + 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 Origin findValueByNumber(int number) { + return Origin.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.api.cloudquotas.v1beta.QuotaConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final Origin[] VALUES = values(); + + public static Origin 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 Origin(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1beta.QuotaConfig.Origin) + } + + private int bitField0_; + public static final int PREFERRED_VALUE_FIELD_NUMBER = 1; + private long preferredValue_ = 0L; + /** + * + * + *
+   * Required. The preferred value. Must be greater than or equal to -1. If set
+   * to -1, it means the value is "unlimited".
+   * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + @java.lang.Override + public long getPreferredValue() { + return preferredValue_; + } + + public static final int STATE_DETAIL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateDetail_ = ""; + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + @java.lang.Override + public java.lang.String getStateDetail() { + java.lang.Object ref = stateDetail_; + 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(); + stateDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateDetailBytes() { + java.lang.Object ref = stateDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRANTED_VALUE_FIELD_NUMBER = 3; + private com.google.protobuf.Int64Value grantedValue_; + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + @java.lang.Override + public boolean hasGrantedValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getGrantedValue() { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder() { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + + public static final int TRACE_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object traceId_ = ""; + /** + * + * + *
+   * Output only. The trace id that the Google Cloud uses to provision the
+   * requested quota. This trace id may be used by the client to contact Cloud
+   * support to track the state of a quota preference request. The trace id is
+   * only produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + @java.lang.Override + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + 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(); + traceId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The trace id that the Google Cloud uses to provision the
+   * requested quota. This trace id may be used by the client to contact Cloud
+   * support to track the state of a quota preference request. The trace id is
+   * only produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int REQUEST_ORIGIN_FIELD_NUMBER = 6; + private int requestOrigin_ = 0; + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + @java.lang.Override + public int getRequestOriginValue() { + return requestOrigin_; + } + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig.Origin getRequestOrigin() { + com.google.api.cloudquotas.v1beta.QuotaConfig.Origin result = + com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.forNumber(requestOrigin_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.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 (preferredValue_ != 0L) { + output.writeInt64(1, preferredValue_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, stateDetail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getGrantedValue()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, traceId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (requestOrigin_ + != com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.ORIGIN_UNSPECIFIED.getNumber()) { + output.writeEnum(6, requestOrigin_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (preferredValue_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, preferredValue_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, stateDetail_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getGrantedValue()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, traceId_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (requestOrigin_ + != com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.ORIGIN_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, requestOrigin_); + } + 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.api.cloudquotas.v1beta.QuotaConfig)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaConfig other = + (com.google.api.cloudquotas.v1beta.QuotaConfig) obj; + + if (getPreferredValue() != other.getPreferredValue()) return false; + if (!getStateDetail().equals(other.getStateDetail())) return false; + if (hasGrantedValue() != other.hasGrantedValue()) return false; + if (hasGrantedValue()) { + if (!getGrantedValue().equals(other.getGrantedValue())) return false; + } + if (!getTraceId().equals(other.getTraceId())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (requestOrigin_ != other.requestOrigin_) 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) + PREFERRED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPreferredValue()); + hash = (37 * hash) + STATE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStateDetail().hashCode(); + if (hasGrantedValue()) { + hash = (37 * hash) + GRANTED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getGrantedValue().hashCode(); + } + hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTraceId().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + REQUEST_ORIGIN_FIELD_NUMBER; + hash = (53 * hash) + requestOrigin_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig 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.api.cloudquotas.v1beta.QuotaConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig 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.api.cloudquotas.v1beta.QuotaConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig 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.api.cloudquotas.v1beta.QuotaConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig 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.api.cloudquotas.v1beta.QuotaConfig 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 preferred quota configuration.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaConfig) + com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaConfig.class, + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGrantedValueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + preferredValue_ = 0L; + stateDetail_ = ""; + grantedValue_ = null; + if (grantedValueBuilder_ != null) { + grantedValueBuilder_.dispose(); + grantedValueBuilder_ = null; + } + traceId_ = ""; + internalGetMutableAnnotations().clear(); + requestOrigin_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig build() { + com.google.api.cloudquotas.v1beta.QuotaConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaConfig result = + new com.google.api.cloudquotas.v1beta.QuotaConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.preferredValue_ = preferredValue_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateDetail_ = stateDetail_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.grantedValue_ = + grantedValueBuilder_ == null ? grantedValue_ : grantedValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.traceId_ = traceId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestOrigin_ = requestOrigin_; + } + 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.api.cloudquotas.v1beta.QuotaConfig) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaConfig other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance()) return this; + if (other.getPreferredValue() != 0L) { + setPreferredValue(other.getPreferredValue()); + } + if (!other.getStateDetail().isEmpty()) { + stateDetail_ = other.stateDetail_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasGrantedValue()) { + mergeGrantedValue(other.getGrantedValue()); + } + if (!other.getTraceId().isEmpty()) { + traceId_ = other.traceId_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.requestOrigin_ != 0) { + setRequestOriginValue(other.getRequestOriginValue()); + } + 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: + { + preferredValue_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + stateDetail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getGrantedValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + traceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestOrigin_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + 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 long preferredValue_; + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + @java.lang.Override + public long getPreferredValue() { + return preferredValue_; + } + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The preferredValue to set. + * @return This builder for chaining. + */ + public Builder setPreferredValue(long value) { + + preferredValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredValue() { + bitField0_ = (bitField0_ & ~0x00000001); + preferredValue_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stateDetail_ = ""; + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + public java.lang.String getStateDetail() { + java.lang.Object ref = stateDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + public com.google.protobuf.ByteString getStateDetailBytes() { + java.lang.Object ref = stateDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The stateDetail to set. + * @return This builder for chaining. + */ + public Builder setStateDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateDetail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStateDetail() { + stateDetail_ = getDefaultInstance().getStateDetail(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for stateDetail to set. + * @return This builder for chaining. + */ + public Builder setStateDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateDetail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value grantedValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + grantedValueBuilder_; + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + public boolean hasGrantedValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + public com.google.protobuf.Int64Value getGrantedValue() { + if (grantedValueBuilder_ == null) { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } else { + return grantedValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGrantedValue(com.google.protobuf.Int64Value value) { + if (grantedValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + grantedValue_ = value; + } else { + grantedValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGrantedValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (grantedValueBuilder_ == null) { + grantedValue_ = builderForValue.build(); + } else { + grantedValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeGrantedValue(com.google.protobuf.Int64Value value) { + if (grantedValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && grantedValue_ != null + && grantedValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getGrantedValueBuilder().mergeFrom(value); + } else { + grantedValue_ = value; + } + } else { + grantedValueBuilder_.mergeFrom(value); + } + if (grantedValue_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearGrantedValue() { + bitField0_ = (bitField0_ & ~0x00000004); + grantedValue_ = null; + if (grantedValueBuilder_ != null) { + grantedValueBuilder_.dispose(); + grantedValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Int64Value.Builder getGrantedValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getGrantedValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder() { + if (grantedValueBuilder_ != null) { + return grantedValueBuilder_.getMessageOrBuilder(); + } else { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getGrantedValueFieldBuilder() { + if (grantedValueBuilder_ == null) { + grantedValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getGrantedValue(), getParentForChildren(), isClean()); + grantedValue_ = null; + } + return grantedValueBuilder_; + } + + private java.lang.Object traceId_ = ""; + /** + * + * + *
+     * Output only. The trace id that the Google Cloud uses to provision the
+     * requested quota. This trace id may be used by the client to contact Cloud
+     * support to track the state of a quota preference request. The trace id is
+     * only produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The trace id that the Google Cloud uses to provision the
+     * requested quota. This trace id may be used by the client to contact Cloud
+     * support to track the state of a quota preference request. The trace id is
+     * only produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + public com.google.protobuf.ByteString getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The trace id that the Google Cloud uses to provision the
+     * requested quota. This trace id may be used by the client to contact Cloud
+     * support to track the state of a quota preference request. The trace id is
+     * only produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + traceId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The trace id that the Google Cloud uses to provision the
+     * requested quota. This trace id may be used by the client to contact Cloud
+     * support to track the state of a quota preference request. The trace id is
+     * only produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTraceId() { + traceId_ = getDefaultInstance().getTraceId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The trace id that the Google Cloud uses to provision the
+     * requested quota. This trace id may be used by the client to contact Cloud
+     * support to track the state of a quota preference request. The trace id is
+     * only produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + traceId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Optional. The annotations map for clients to store small amounts of
+     * arbitrary data. Do not put PII or other sensitive information here. See
+     * https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private int requestOrigin_ = 0; + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + @java.lang.Override + public int getRequestOriginValue() { + return requestOrigin_; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for requestOrigin to set. + * @return This builder for chaining. + */ + public Builder setRequestOriginValue(int value) { + requestOrigin_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig.Origin getRequestOrigin() { + com.google.api.cloudquotas.v1beta.QuotaConfig.Origin result = + com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.forNumber(requestOrigin_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.Origin.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The requestOrigin to set. + * @return This builder for chaining. + */ + public Builder setRequestOrigin(com.google.api.cloudquotas.v1beta.QuotaConfig.Origin value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + requestOrigin_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRequestOrigin() { + bitField0_ = (bitField0_ & ~0x00000020); + requestOrigin_ = 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.api.cloudquotas.v1beta.QuotaConfig) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaConfig) + private static final com.google.api.cloudquotas.v1beta.QuotaConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaConfig(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaConfig 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.api.cloudquotas.v1beta.QuotaConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfigOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfigOrBuilder.java new file mode 100644 index 000000000000..f657846e4452 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaConfigOrBuilder.java @@ -0,0 +1,241 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The preferred value. Must be greater than or equal to -1. If set
+   * to -1, it means the value is "unlimited".
+   * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + long getPreferredValue(); + + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + java.lang.String getStateDetail(); + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + com.google.protobuf.ByteString getStateDetailBytes(); + + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + boolean hasGrantedValue(); + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + com.google.protobuf.Int64Value getGrantedValue(); + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder(); + + /** + * + * + *
+   * Output only. The trace id that the Google Cloud uses to provision the
+   * requested quota. This trace id may be used by the client to contact Cloud
+   * support to track the state of a quota preference request. The trace id is
+   * only produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + java.lang.String getTraceId(); + /** + * + * + *
+   * Output only. The trace id that the Google Cloud uses to provision the
+   * requested quota. This trace id may be used by the client to contact Cloud
+   * support to track the state of a quota preference request. The trace id is
+   * only produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + com.google.protobuf.ByteString getTraceIdBytes(); + + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. The annotations map for clients to store small amounts of
+   * arbitrary data. Do not put PII or other sensitive information here. See
+   * https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + int getRequestOriginValue(); + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + com.google.api.cloudquotas.v1beta.QuotaConfig.Origin getRequestOrigin(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetails.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetails.java new file mode 100644 index 000000000000..c804564e4251 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetails.java @@ -0,0 +1,839 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * The quota details for a map of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaDetails} + */ +public final class QuotaDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaDetails) + QuotaDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaDetails.newBuilder() to construct. + private QuotaDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaDetails() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaDetails.class, + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private long value_ = 0L; + /** + * + * + *
+   * The value currently in effect and being enforced.
+   * 
+ * + * int64 value = 1; + * + * @return The value. + */ + @java.lang.Override + public long getValue() { + return value_; + } + + public static final int ROLLOUT_INFO_FIELD_NUMBER = 3; + private com.google.api.cloudquotas.v1beta.RolloutInfo rolloutInfo_; + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return Whether the rolloutInfo field is set. + */ + @java.lang.Override + public boolean hasRolloutInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return The rolloutInfo. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.RolloutInfo getRolloutInfo() { + return rolloutInfo_ == null + ? com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance() + : rolloutInfo_; + } + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder getRolloutInfoOrBuilder() { + return rolloutInfo_ == null + ? com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance() + : rolloutInfo_; + } + + 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 (value_ != 0L) { + output.writeInt64(1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRolloutInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (value_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRolloutInfo()); + } + 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.api.cloudquotas.v1beta.QuotaDetails)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaDetails other = + (com.google.api.cloudquotas.v1beta.QuotaDetails) obj; + + if (getValue() != other.getValue()) return false; + if (hasRolloutInfo() != other.hasRolloutInfo()) return false; + if (hasRolloutInfo()) { + if (!getRolloutInfo().equals(other.getRolloutInfo())) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getValue()); + if (hasRolloutInfo()) { + hash = (37 * hash) + ROLLOUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRolloutInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails 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.api.cloudquotas.v1beta.QuotaDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails 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.api.cloudquotas.v1beta.QuotaDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails 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.api.cloudquotas.v1beta.QuotaDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails 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.api.cloudquotas.v1beta.QuotaDetails 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 quota details for a map of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaDetails) + com.google.api.cloudquotas.v1beta.QuotaDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaDetails.class, + com.google.api.cloudquotas.v1beta.QuotaDetails.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRolloutInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0L; + rolloutInfo_ = null; + if (rolloutInfoBuilder_ != null) { + rolloutInfoBuilder_.dispose(); + rolloutInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaDetails getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaDetails build() { + com.google.api.cloudquotas.v1beta.QuotaDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaDetails buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaDetails result = + new com.google.api.cloudquotas.v1beta.QuotaDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rolloutInfo_ = + rolloutInfoBuilder_ == null ? rolloutInfo_ : rolloutInfoBuilder_.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.api.cloudquotas.v1beta.QuotaDetails) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaDetails other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaDetails.getDefaultInstance()) return this; + if (other.getValue() != 0L) { + setValue(other.getValue()); + } + if (other.hasRolloutInfo()) { + mergeRolloutInfo(other.getRolloutInfo()); + } + 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: + { + value_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage(getRolloutInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 long value_; + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @return The value. + */ + @java.lang.Override + public long getValue() { + return value_; + } + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(long value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0L; + onChanged(); + return this; + } + + private com.google.api.cloudquotas.v1beta.RolloutInfo rolloutInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.RolloutInfo, + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder, + com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder> + rolloutInfoBuilder_; + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return Whether the rolloutInfo field is set. + */ + public boolean hasRolloutInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return The rolloutInfo. + */ + public com.google.api.cloudquotas.v1beta.RolloutInfo getRolloutInfo() { + if (rolloutInfoBuilder_ == null) { + return rolloutInfo_ == null + ? com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance() + : rolloutInfo_; + } else { + return rolloutInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public Builder setRolloutInfo(com.google.api.cloudquotas.v1beta.RolloutInfo value) { + if (rolloutInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rolloutInfo_ = value; + } else { + rolloutInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public Builder setRolloutInfo( + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder builderForValue) { + if (rolloutInfoBuilder_ == null) { + rolloutInfo_ = builderForValue.build(); + } else { + rolloutInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public Builder mergeRolloutInfo(com.google.api.cloudquotas.v1beta.RolloutInfo value) { + if (rolloutInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rolloutInfo_ != null + && rolloutInfo_ != com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance()) { + getRolloutInfoBuilder().mergeFrom(value); + } else { + rolloutInfo_ = value; + } + } else { + rolloutInfoBuilder_.mergeFrom(value); + } + if (rolloutInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public Builder clearRolloutInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + rolloutInfo_ = null; + if (rolloutInfoBuilder_ != null) { + rolloutInfoBuilder_.dispose(); + rolloutInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public com.google.api.cloudquotas.v1beta.RolloutInfo.Builder getRolloutInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRolloutInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + public com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder getRolloutInfoOrBuilder() { + if (rolloutInfoBuilder_ != null) { + return rolloutInfoBuilder_.getMessageOrBuilder(); + } else { + return rolloutInfo_ == null + ? com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance() + : rolloutInfo_; + } + } + /** + * + * + *
+     * Rollout information of this quota.
+     * This field is present only if the effective limit will change due to the
+     * ongoing rollout of the service config.
+     * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.RolloutInfo, + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder, + com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder> + getRolloutInfoFieldBuilder() { + if (rolloutInfoBuilder_ == null) { + rolloutInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.RolloutInfo, + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder, + com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder>( + getRolloutInfo(), getParentForChildren(), isClean()); + rolloutInfo_ = null; + } + return rolloutInfoBuilder_; + } + + @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.api.cloudquotas.v1beta.QuotaDetails) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaDetails) + private static final com.google.api.cloudquotas.v1beta.QuotaDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaDetails(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaDetails 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.api.cloudquotas.v1beta.QuotaDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetailsOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetailsOrBuilder.java new file mode 100644 index 000000000000..66e1499b6e23 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaDetailsOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The value currently in effect and being enforced.
+   * 
+ * + * int64 value = 1; + * + * @return The value. + */ + long getValue(); + + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return Whether the rolloutInfo field is set. + */ + boolean hasRolloutInfo(); + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + * + * @return The rolloutInfo. + */ + com.google.api.cloudquotas.v1beta.RolloutInfo getRolloutInfo(); + /** + * + * + *
+   * Rollout information of this quota.
+   * This field is present only if the effective limit will change due to the
+   * ongoing rollout of the service config.
+   * 
+ * + * .google.api.cloudquotas.v1beta.RolloutInfo rollout_info = 3; + */ + com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder getRolloutInfoOrBuilder(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibility.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibility.java new file mode 100644 index 000000000000..aedf202d1aee --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibility.java @@ -0,0 +1,938 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Eligibility information regarding requesting increase adjustment of a quota.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} + */ +public final class QuotaIncreaseEligibility extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + QuotaIncreaseEligibilityOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaIncreaseEligibility.newBuilder() to construct. + private QuotaIncreaseEligibility(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaIncreaseEligibility() { + ineligibilityReason_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaIncreaseEligibility(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.class, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder.class); + } + + /** + * + * + *
+   * The enumeration of reasons when it is ineligible to request increase
+   * adjustment.
+   * 
+ * + * Protobuf enum {@code + * google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason} + */ + public enum IneligibilityReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value when is_eligible is true.
+     * 
+ * + * INELIGIBILITY_REASON_UNSPECIFIED = 0; + */ + INELIGIBILITY_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * The container is not linked with a valid billing account.
+     * 
+ * + * NO_VALID_BILLING_ACCOUNT = 1; + */ + NO_VALID_BILLING_ACCOUNT(1), + /** + * + * + *
+     * Quota increase is not supported for the quota.
+     * 
+ * + * NOT_SUPPORTED = 3; + */ + NOT_SUPPORTED(3), + /** + * + * + *
+     * There is not enough usage history to determine the eligibility.
+     * 
+ * + * NOT_ENOUGH_USAGE_HISTORY = 4; + */ + NOT_ENOUGH_USAGE_HISTORY(4), + /** + * + * + *
+     * Other reasons.
+     * 
+ * + * OTHER = 2; + */ + OTHER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value when is_eligible is true.
+     * 
+ * + * INELIGIBILITY_REASON_UNSPECIFIED = 0; + */ + public static final int INELIGIBILITY_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The container is not linked with a valid billing account.
+     * 
+ * + * NO_VALID_BILLING_ACCOUNT = 1; + */ + public static final int NO_VALID_BILLING_ACCOUNT_VALUE = 1; + /** + * + * + *
+     * Quota increase is not supported for the quota.
+     * 
+ * + * NOT_SUPPORTED = 3; + */ + public static final int NOT_SUPPORTED_VALUE = 3; + /** + * + * + *
+     * There is not enough usage history to determine the eligibility.
+     * 
+ * + * NOT_ENOUGH_USAGE_HISTORY = 4; + */ + public static final int NOT_ENOUGH_USAGE_HISTORY_VALUE = 4; + /** + * + * + *
+     * Other reasons.
+     * 
+ * + * 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 IneligibilityReason 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 IneligibilityReason forNumber(int value) { + switch (value) { + case 0: + return INELIGIBILITY_REASON_UNSPECIFIED; + case 1: + return NO_VALID_BILLING_ACCOUNT; + case 3: + return NOT_SUPPORTED; + case 4: + return NOT_ENOUGH_USAGE_HISTORY; + 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 IneligibilityReason findValueByNumber(int number) { + return IneligibilityReason.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.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final IneligibilityReason[] VALUES = values(); + + public static IneligibilityReason 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 IneligibilityReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason) + } + + public static final int IS_ELIGIBLE_FIELD_NUMBER = 1; + private boolean isEligible_ = false; + /** + * + * + *
+   * Whether a higher quota value can be requested for the quota.
+   * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + @java.lang.Override + public boolean getIsEligible() { + return isEligible_; + } + + public static final int INELIGIBILITY_REASON_FIELD_NUMBER = 2; + private int ineligibilityReason_ = 0; + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + @java.lang.Override + public int getIneligibilityReasonValue() { + return ineligibilityReason_; + } + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason() { + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason result = + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason.forNumber( + ineligibilityReason_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + .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 (isEligible_ != false) { + output.writeBool(1, isEligible_); + } + if (ineligibilityReason_ + != com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + .INELIGIBILITY_REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, ineligibilityReason_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (isEligible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, isEligible_); + } + if (ineligibilityReason_ + != com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + .INELIGIBILITY_REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, ineligibilityReason_); + } + 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility other = + (com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) obj; + + if (getIsEligible() != other.getIsEligible()) return false; + if (ineligibilityReason_ != other.ineligibilityReason_) 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) + IS_ELIGIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsEligible()); + hash = (37 * hash) + INELIGIBILITY_REASON_FIELD_NUMBER; + hash = (53 * hash) + ineligibilityReason_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility 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; + } + /** + * + * + *
+   * Eligibility information regarding requesting increase adjustment of a quota.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.class, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + isEligible_ = false; + ineligibilityReason_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility build() { + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility result = + new com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.isEligible_ = isEligible_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ineligibilityReason_ = ineligibilityReason_; + } + } + + @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.api.cloudquotas.v1beta.QuotaIncreaseEligibility) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance()) + return this; + if (other.getIsEligible() != false) { + setIsEligible(other.getIsEligible()); + } + if (other.ineligibilityReason_ != 0) { + setIneligibilityReasonValue(other.getIneligibilityReasonValue()); + } + 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: + { + isEligible_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + ineligibilityReason_ = 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 boolean isEligible_; + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + @java.lang.Override + public boolean getIsEligible() { + return isEligible_; + } + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @param value The isEligible to set. + * @return This builder for chaining. + */ + public Builder setIsEligible(boolean value) { + + isEligible_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @return This builder for chaining. + */ + public Builder clearIsEligible() { + bitField0_ = (bitField0_ & ~0x00000001); + isEligible_ = false; + onChanged(); + return this; + } + + private int ineligibilityReason_ = 0; + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + @java.lang.Override + public int getIneligibilityReasonValue() { + return ineligibilityReason_; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @param value The enum numeric value on the wire for ineligibilityReason to set. + * @return This builder for chaining. + */ + public Builder setIneligibilityReasonValue(int value) { + ineligibilityReason_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason() { + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason result = + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason.forNumber( + ineligibilityReason_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @param value The ineligibilityReason to set. + * @return This builder for chaining. + */ + public Builder setIneligibilityReason( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + ineligibilityReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearIneligibilityReason() { + bitField0_ = (bitField0_ & ~0x00000002); + ineligibilityReason_ = 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + private static final com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaIncreaseEligibility 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.api.cloudquotas.v1beta.QuotaIncreaseEligibility getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibilityOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibilityOrBuilder.java new file mode 100644 index 000000000000..3a604920e5ff --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaIncreaseEligibilityOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaIncreaseEligibilityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether a higher quota value can be requested for the quota.
+   * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + boolean getIsEligible(); + + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + int getIneligibilityReasonValue(); + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfo.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfo.java new file mode 100644 index 000000000000..e1b544ad63e0 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfo.java @@ -0,0 +1,3911 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * QuotaInfo represents information about a particular quota for a given
+ * project, folder or organization.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaInfo} + */ +public final class QuotaInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaInfo) + QuotaInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaInfo.newBuilder() to construct. + private QuotaInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaInfo() { + name_ = ""; + quotaId_ = ""; + metric_ = ""; + service_ = ""; + refreshInterval_ = ""; + containerType_ = 0; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metricDisplayName_ = ""; + quotaDisplayName_ = ""; + metricUnit_ = ""; + dimensionsInfos_ = java.util.Collections.emptyList(); + serviceRequestQuotaUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaInfo.class, + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder.class); + } + + /** + * + * + *
+   * The enumeration of the types of a cloud resource container.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1beta.QuotaInfo.ContainerType} + */ + public enum ContainerType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified container type.
+     * 
+ * + * CONTAINER_TYPE_UNSPECIFIED = 0; + */ + CONTAINER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * consumer project
+     * 
+ * + * PROJECT = 1; + */ + PROJECT(1), + /** + * + * + *
+     * folder
+     * 
+ * + * FOLDER = 2; + */ + FOLDER(2), + /** + * + * + *
+     * organization
+     * 
+ * + * ORGANIZATION = 3; + */ + ORGANIZATION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified container type.
+     * 
+ * + * CONTAINER_TYPE_UNSPECIFIED = 0; + */ + public static final int CONTAINER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * consumer project
+     * 
+ * + * PROJECT = 1; + */ + public static final int PROJECT_VALUE = 1; + /** + * + * + *
+     * folder
+     * 
+ * + * FOLDER = 2; + */ + public static final int FOLDER_VALUE = 2; + /** + * + * + *
+     * organization
+     * 
+ * + * ORGANIZATION = 3; + */ + public static final int ORGANIZATION_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 ContainerType 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 ContainerType forNumber(int value) { + switch (value) { + case 0: + return CONTAINER_TYPE_UNSPECIFIED; + case 1: + return PROJECT; + case 2: + return FOLDER; + case 3: + return ORGANIZATION; + 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 ContainerType findValueByNumber(int number) { + return ContainerType.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.api.cloudquotas.v1beta.QuotaInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final ContainerType[] VALUES = values(); + + public static ContainerType 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 ContainerType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1beta.QuotaInfo.ContainerType) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @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 QUOTA_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object metric_ = ""; + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The metric. + */ + @java.lang.Override + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + 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(); + metric_ = s; + return s; + } + } + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_PRECISE_FIELD_NUMBER = 5; + private boolean isPrecise_ = false; + /** + * + * + *
+   * Whether this is a precise quota. A precise quota is tracked with absolute
+   * precision. In contrast, an imprecise quota is not tracked with precision.
+   * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + @java.lang.Override + public boolean getIsPrecise() { + return isPrecise_; + } + + public static final int REFRESH_INTERVAL_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object refreshInterval_ = ""; + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + @java.lang.Override + public java.lang.String getRefreshInterval() { + java.lang.Object ref = refreshInterval_; + 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(); + refreshInterval_ = s; + return s; + } + } + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRefreshIntervalBytes() { + java.lang.Object ref = refreshInterval_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + refreshInterval_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTAINER_TYPE_FIELD_NUMBER = 7; + private int containerType_ = 0; + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + @java.lang.Override + public int getContainerTypeValue() { + return containerType_; + } + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType getContainerType() { + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType result = + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.forNumber(containerType_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.UNRECOGNIZED + : result; + } + + public static final int DIMENSIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + return dimensions_; + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + + public static final int METRIC_DISPLAY_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricDisplayName_ = ""; + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + @java.lang.Override + public java.lang.String getMetricDisplayName() { + java.lang.Object ref = metricDisplayName_; + 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(); + metricDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricDisplayNameBytes() { + java.lang.Object ref = metricDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_DISPLAY_NAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaDisplayName_ = ""; + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + @java.lang.Override + public java.lang.String getQuotaDisplayName() { + java.lang.Object ref = quotaDisplayName_; + 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(); + quotaDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaDisplayNameBytes() { + java.lang.Object ref = quotaDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_UNIT_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricUnit_ = ""; + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., "MByte".
+   * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + @java.lang.Override + public java.lang.String getMetricUnit() { + java.lang.Object ref = metricUnit_; + 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(); + metricUnit_ = s; + return s; + } + } + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., "MByte".
+   * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricUnitBytes() { + java.lang.Object ref = metricUnit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_INCREASE_ELIGIBILITY_FIELD_NUMBER = 12; + private com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quotaIncreaseEligibility_; + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + @java.lang.Override + public boolean hasQuotaIncreaseEligibility() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility getQuotaIncreaseEligibility() { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder() { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + + public static final int IS_FIXED_FIELD_NUMBER = 13; + private boolean isFixed_ = false; + /** + * + * + *
+   * Whether the quota value is fixed or adjustable
+   * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + @java.lang.Override + public boolean getIsFixed() { + return isFixed_; + } + + public static final int DIMENSIONS_INFOS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List dimensionsInfos_; + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public java.util.List getDimensionsInfosList() { + return dimensionsInfos_; + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public java.util.List + getDimensionsInfosOrBuilderList() { + return dimensionsInfos_; + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public int getDimensionsInfosCount() { + return dimensionsInfos_.size(); + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.DimensionsInfo getDimensionsInfos(int index) { + return dimensionsInfos_.get(index); + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder( + int index) { + return dimensionsInfos_.get(index); + } + + public static final int IS_CONCURRENT_FIELD_NUMBER = 15; + private boolean isConcurrent_ = false; + /** + * + * + *
+   * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+   * on the total number of concurrent operations in flight at any given time.
+   * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + @java.lang.Override + public boolean getIsConcurrent() { + return isConcurrent_; + } + + public static final int SERVICE_REQUEST_QUOTA_URI_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceRequestQuotaUri_ = ""; + /** + * + * + *
+   * URI to the page where users can request more quota for the cloud
+   * service—for example,
+   * https://console.cloud.google.com/iam-admin/quotas.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + @java.lang.Override + public java.lang.String getServiceRequestQuotaUri() { + java.lang.Object ref = serviceRequestQuotaUri_; + 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(); + serviceRequestQuotaUri_ = s; + return s; + } + } + /** + * + * + *
+   * URI to the page where users can request more quota for the cloud
+   * service—for example,
+   * https://console.cloud.google.com/iam-admin/quotas.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceRequestQuotaUriBytes() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRequestQuotaUri_ = 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(quotaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, quotaId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, metric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, service_); + } + if (isPrecise_ != false) { + output.writeBool(5, isPrecise_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refreshInterval_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, refreshInterval_); + } + if (containerType_ + != com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.CONTAINER_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, containerType_); + } + for (int i = 0; i < dimensions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, dimensions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, metricDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, quotaDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricUnit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, metricUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(12, getQuotaIncreaseEligibility()); + } + if (isFixed_ != false) { + output.writeBool(13, isFixed_); + } + for (int i = 0; i < dimensionsInfos_.size(); i++) { + output.writeMessage(14, dimensionsInfos_.get(i)); + } + if (isConcurrent_ != false) { + output.writeBool(15, isConcurrent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRequestQuotaUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, serviceRequestQuotaUri_); + } + 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(quotaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, quotaId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, metric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, service_); + } + if (isPrecise_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, isPrecise_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refreshInterval_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, refreshInterval_); + } + if (containerType_ + != com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.CONTAINER_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, containerType_); + } + { + int dataSize = 0; + for (int i = 0; i < dimensions_.size(); i++) { + dataSize += computeStringSizeNoTag(dimensions_.getRaw(i)); + } + size += dataSize; + size += 1 * getDimensionsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, metricDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, quotaDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricUnit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, metricUnit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, getQuotaIncreaseEligibility()); + } + if (isFixed_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, isFixed_); + } + for (int i = 0; i < dimensionsInfos_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, dimensionsInfos_.get(i)); + } + if (isConcurrent_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, isConcurrent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRequestQuotaUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, serviceRequestQuotaUri_); + } + 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.api.cloudquotas.v1beta.QuotaInfo)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaInfo other = + (com.google.api.cloudquotas.v1beta.QuotaInfo) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (!getMetric().equals(other.getMetric())) return false; + if (!getService().equals(other.getService())) return false; + if (getIsPrecise() != other.getIsPrecise()) return false; + if (!getRefreshInterval().equals(other.getRefreshInterval())) return false; + if (containerType_ != other.containerType_) return false; + if (!getDimensionsList().equals(other.getDimensionsList())) return false; + if (!getMetricDisplayName().equals(other.getMetricDisplayName())) return false; + if (!getQuotaDisplayName().equals(other.getQuotaDisplayName())) return false; + if (!getMetricUnit().equals(other.getMetricUnit())) return false; + if (hasQuotaIncreaseEligibility() != other.hasQuotaIncreaseEligibility()) return false; + if (hasQuotaIncreaseEligibility()) { + if (!getQuotaIncreaseEligibility().equals(other.getQuotaIncreaseEligibility())) return false; + } + if (getIsFixed() != other.getIsFixed()) return false; + if (!getDimensionsInfosList().equals(other.getDimensionsInfosList())) return false; + if (getIsConcurrent() != other.getIsConcurrent()) return false; + if (!getServiceRequestQuotaUri().equals(other.getServiceRequestQuotaUri())) 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) + QUOTA_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + IS_PRECISE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsPrecise()); + hash = (37 * hash) + REFRESH_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshInterval().hashCode(); + hash = (37 * hash) + CONTAINER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + containerType_; + if (getDimensionsCount() > 0) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDimensionsList().hashCode(); + } + hash = (37 * hash) + METRIC_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricDisplayName().hashCode(); + hash = (37 * hash) + QUOTA_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getQuotaDisplayName().hashCode(); + hash = (37 * hash) + METRIC_UNIT_FIELD_NUMBER; + hash = (53 * hash) + getMetricUnit().hashCode(); + if (hasQuotaIncreaseEligibility()) { + hash = (37 * hash) + QUOTA_INCREASE_ELIGIBILITY_FIELD_NUMBER; + hash = (53 * hash) + getQuotaIncreaseEligibility().hashCode(); + } + hash = (37 * hash) + IS_FIXED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFixed()); + if (getDimensionsInfosCount() > 0) { + hash = (37 * hash) + DIMENSIONS_INFOS_FIELD_NUMBER; + hash = (53 * hash) + getDimensionsInfosList().hashCode(); + } + hash = (37 * hash) + IS_CONCURRENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsConcurrent()); + hash = (37 * hash) + SERVICE_REQUEST_QUOTA_URI_FIELD_NUMBER; + hash = (53 * hash) + getServiceRequestQuotaUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo 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.api.cloudquotas.v1beta.QuotaInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo 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.api.cloudquotas.v1beta.QuotaInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo 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.api.cloudquotas.v1beta.QuotaInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo 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.api.cloudquotas.v1beta.QuotaInfo 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; + } + /** + * + * + *
+   * QuotaInfo represents information about a particular quota for a given
+   * project, folder or organization.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaInfo) + com.google.api.cloudquotas.v1beta.QuotaInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaInfo.class, + com.google.api.cloudquotas.v1beta.QuotaInfo.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQuotaIncreaseEligibilityFieldBuilder(); + getDimensionsInfosFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + quotaId_ = ""; + metric_ = ""; + service_ = ""; + isPrecise_ = false; + refreshInterval_ = ""; + containerType_ = 0; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metricDisplayName_ = ""; + quotaDisplayName_ = ""; + metricUnit_ = ""; + quotaIncreaseEligibility_ = null; + if (quotaIncreaseEligibilityBuilder_ != null) { + quotaIncreaseEligibilityBuilder_.dispose(); + quotaIncreaseEligibilityBuilder_ = null; + } + isFixed_ = false; + if (dimensionsInfosBuilder_ == null) { + dimensionsInfos_ = java.util.Collections.emptyList(); + } else { + dimensionsInfos_ = null; + dimensionsInfosBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + isConcurrent_ = false; + serviceRequestQuotaUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaInfo_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo build() { + com.google.api.cloudquotas.v1beta.QuotaInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaInfo result = + new com.google.api.cloudquotas.v1beta.QuotaInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.cloudquotas.v1beta.QuotaInfo result) { + if (dimensionsInfosBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + dimensionsInfos_ = java.util.Collections.unmodifiableList(dimensionsInfos_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.dimensionsInfos_ = dimensionsInfos_; + } else { + result.dimensionsInfos_ = dimensionsInfosBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metric_ = metric_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.isPrecise_ = isPrecise_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.refreshInterval_ = refreshInterval_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.containerType_ = containerType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + dimensions_.makeImmutable(); + result.dimensions_ = dimensions_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.metricDisplayName_ = metricDisplayName_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.quotaDisplayName_ = quotaDisplayName_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.metricUnit_ = metricUnit_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000800) != 0)) { + result.quotaIncreaseEligibility_ = + quotaIncreaseEligibilityBuilder_ == null + ? quotaIncreaseEligibility_ + : quotaIncreaseEligibilityBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.isFixed_ = isFixed_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.isConcurrent_ = isConcurrent_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.serviceRequestQuotaUri_ = serviceRequestQuotaUri_; + } + 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.api.cloudquotas.v1beta.QuotaInfo) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaInfo other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMetric().isEmpty()) { + metric_ = other.metric_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getIsPrecise() != false) { + setIsPrecise(other.getIsPrecise()); + } + if (!other.getRefreshInterval().isEmpty()) { + refreshInterval_ = other.refreshInterval_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.containerType_ != 0) { + setContainerTypeValue(other.getContainerTypeValue()); + } + if (!other.dimensions_.isEmpty()) { + if (dimensions_.isEmpty()) { + dimensions_ = other.dimensions_; + bitField0_ |= 0x00000080; + } else { + ensureDimensionsIsMutable(); + dimensions_.addAll(other.dimensions_); + } + onChanged(); + } + if (!other.getMetricDisplayName().isEmpty()) { + metricDisplayName_ = other.metricDisplayName_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (!other.getQuotaDisplayName().isEmpty()) { + quotaDisplayName_ = other.quotaDisplayName_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getMetricUnit().isEmpty()) { + metricUnit_ = other.metricUnit_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasQuotaIncreaseEligibility()) { + mergeQuotaIncreaseEligibility(other.getQuotaIncreaseEligibility()); + } + if (other.getIsFixed() != false) { + setIsFixed(other.getIsFixed()); + } + if (dimensionsInfosBuilder_ == null) { + if (!other.dimensionsInfos_.isEmpty()) { + if (dimensionsInfos_.isEmpty()) { + dimensionsInfos_ = other.dimensionsInfos_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.addAll(other.dimensionsInfos_); + } + onChanged(); + } + } else { + if (!other.dimensionsInfos_.isEmpty()) { + if (dimensionsInfosBuilder_.isEmpty()) { + dimensionsInfosBuilder_.dispose(); + dimensionsInfosBuilder_ = null; + dimensionsInfos_ = other.dimensionsInfos_; + bitField0_ = (bitField0_ & ~0x00002000); + dimensionsInfosBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDimensionsInfosFieldBuilder() + : null; + } else { + dimensionsInfosBuilder_.addAllMessages(other.dimensionsInfos_); + } + } + } + if (other.getIsConcurrent() != false) { + setIsConcurrent(other.getIsConcurrent()); + } + if (!other.getServiceRequestQuotaUri().isEmpty()) { + serviceRequestQuotaUri_ = other.serviceRequestQuotaUri_; + bitField0_ |= 0x00008000; + 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: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + metric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + isPrecise_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + refreshInterval_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + containerType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDimensionsIsMutable(); + dimensions_.add(s); + break; + } // case 66 + case 74: + { + metricDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + quotaDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + metricUnit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage( + getQuotaIncreaseEligibilityFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + isFixed_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + com.google.api.cloudquotas.v1beta.DimensionsInfo m = + input.readMessage( + com.google.api.cloudquotas.v1beta.DimensionsInfo.parser(), + extensionRegistry); + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(m); + } else { + dimensionsInfosBuilder_.addMessage(m); + } + break; + } // case 114 + case 120: + { + isConcurrent_ = input.readBool(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 138: + { + serviceRequestQuotaUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 138 + 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_ = ""; + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @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 quotaId_ = ""; + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object metric_ = ""; + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return The metric. + */ + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @param value The metric to set. + * @return This builder for chaining. + */ + public Builder setMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return This builder for chaining. + */ + public Builder clearMetric() { + metric_ = getDefaultInstance().getMetric(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @param value The bytes for metric to set. + * @return This builder for chaining. + */ + public Builder setMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metric_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean isPrecise_; + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + @java.lang.Override + public boolean getIsPrecise() { + return isPrecise_; + } + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @param value The isPrecise to set. + * @return This builder for chaining. + */ + public Builder setIsPrecise(boolean value) { + + isPrecise_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @return This builder for chaining. + */ + public Builder clearIsPrecise() { + bitField0_ = (bitField0_ & ~0x00000010); + isPrecise_ = false; + onChanged(); + return this; + } + + private java.lang.Object refreshInterval_ = ""; + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + public java.lang.String getRefreshInterval() { + java.lang.Object ref = refreshInterval_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshInterval_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + public com.google.protobuf.ByteString getRefreshIntervalBytes() { + java.lang.Object ref = refreshInterval_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + refreshInterval_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @param value The refreshInterval to set. + * @return This builder for chaining. + */ + public Builder setRefreshInterval(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + refreshInterval_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return This builder for chaining. + */ + public Builder clearRefreshInterval() { + refreshInterval_ = getDefaultInstance().getRefreshInterval(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @param value The bytes for refreshInterval to set. + * @return This builder for chaining. + */ + public Builder setRefreshIntervalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + refreshInterval_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int containerType_ = 0; + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + @java.lang.Override + public int getContainerTypeValue() { + return containerType_; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @param value The enum numeric value on the wire for containerType to set. + * @return This builder for chaining. + */ + public Builder setContainerTypeValue(int value) { + containerType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType getContainerType() { + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType result = + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.forNumber(containerType_); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @param value The containerType to set. + * @return This builder for chaining. + */ + public Builder setContainerType( + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + containerType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return This builder for chaining. + */ + public Builder clearContainerType() { + bitField0_ = (bitField0_ & ~0x00000040); + containerType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDimensionsIsMutable() { + if (!dimensions_.isModifiable()) { + dimensions_ = new com.google.protobuf.LazyStringArrayList(dimensions_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + dimensions_.makeImmutable(); + return dimensions_; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index to set the value at. + * @param value The dimensions to set. + * @return This builder for chaining. + */ + public Builder setDimensions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param value The dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param values The dimensions to add. + * @return This builder for chaining. + */ + public Builder addAllDimensions(java.lang.Iterable values) { + ensureDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dimensions_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return This builder for chaining. + */ + public Builder clearDimensions() { + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param value The bytes of the dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object metricDisplayName_ = ""; + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + public java.lang.String getMetricDisplayName() { + java.lang.Object ref = metricDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + public com.google.protobuf.ByteString getMetricDisplayNameBytes() { + java.lang.Object ref = metricDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @param value The metricDisplayName to set. + * @return This builder for chaining. + */ + public Builder setMetricDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metricDisplayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearMetricDisplayName() { + metricDisplayName_ = getDefaultInstance().getMetricDisplayName(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @param value The bytes for metricDisplayName to set. + * @return This builder for chaining. + */ + public Builder setMetricDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricDisplayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object quotaDisplayName_ = ""; + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + public java.lang.String getQuotaDisplayName() { + java.lang.Object ref = quotaDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + public com.google.protobuf.ByteString getQuotaDisplayNameBytes() { + java.lang.Object ref = quotaDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @param value The quotaDisplayName to set. + * @return This builder for chaining. + */ + public Builder setQuotaDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaDisplayName_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return This builder for chaining. + */ + public Builder clearQuotaDisplayName() { + quotaDisplayName_ = getDefaultInstance().getQuotaDisplayName(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @param value The bytes for quotaDisplayName to set. + * @return This builder for chaining. + */ + public Builder setQuotaDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaDisplayName_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object metricUnit_ = ""; + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., "MByte".
+     * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + public java.lang.String getMetricUnit() { + java.lang.Object ref = metricUnit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricUnit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., "MByte".
+     * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + public com.google.protobuf.ByteString getMetricUnitBytes() { + java.lang.Object ref = metricUnit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., "MByte".
+     * 
+ * + * string metric_unit = 11; + * + * @param value The metricUnit to set. + * @return This builder for chaining. + */ + public Builder setMetricUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metricUnit_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., "MByte".
+     * 
+ * + * string metric_unit = 11; + * + * @return This builder for chaining. + */ + public Builder clearMetricUnit() { + metricUnit_ = getDefaultInstance().getMetricUnit(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., "MByte".
+     * 
+ * + * string metric_unit = 11; + * + * @param value The bytes for metricUnit to set. + * @return This builder for chaining. + */ + public Builder setMetricUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricUnit_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quotaIncreaseEligibility_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder> + quotaIncreaseEligibilityBuilder_; + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + public boolean hasQuotaIncreaseEligibility() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + getQuotaIncreaseEligibility() { + if (quotaIncreaseEligibilityBuilder_ == null) { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } else { + return quotaIncreaseEligibilityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder setQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility value) { + if (quotaIncreaseEligibilityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaIncreaseEligibility_ = value; + } else { + quotaIncreaseEligibilityBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder setQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder builderForValue) { + if (quotaIncreaseEligibilityBuilder_ == null) { + quotaIncreaseEligibility_ = builderForValue.build(); + } else { + quotaIncreaseEligibilityBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder mergeQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility value) { + if (quotaIncreaseEligibilityBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && quotaIncreaseEligibility_ != null + && quotaIncreaseEligibility_ + != com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + .getDefaultInstance()) { + getQuotaIncreaseEligibilityBuilder().mergeFrom(value); + } else { + quotaIncreaseEligibility_ = value; + } + } else { + quotaIncreaseEligibilityBuilder_.mergeFrom(value); + } + if (quotaIncreaseEligibility_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder clearQuotaIncreaseEligibility() { + bitField0_ = (bitField0_ & ~0x00000800); + quotaIncreaseEligibility_ = null; + if (quotaIncreaseEligibilityBuilder_ != null) { + quotaIncreaseEligibilityBuilder_.dispose(); + quotaIncreaseEligibilityBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder + getQuotaIncreaseEligibilityBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getQuotaIncreaseEligibilityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder() { + if (quotaIncreaseEligibilityBuilder_ != null) { + return quotaIncreaseEligibilityBuilder_.getMessageOrBuilder(); + } else { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder> + getQuotaIncreaseEligibilityFieldBuilder() { + if (quotaIncreaseEligibilityBuilder_ == null) { + quotaIncreaseEligibilityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder>( + getQuotaIncreaseEligibility(), getParentForChildren(), isClean()); + quotaIncreaseEligibility_ = null; + } + return quotaIncreaseEligibilityBuilder_; + } + + private boolean isFixed_; + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + @java.lang.Override + public boolean getIsFixed() { + return isFixed_; + } + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @param value The isFixed to set. + * @return This builder for chaining. + */ + public Builder setIsFixed(boolean value) { + + isFixed_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @return This builder for chaining. + */ + public Builder clearIsFixed() { + bitField0_ = (bitField0_ & ~0x00001000); + isFixed_ = false; + onChanged(); + return this; + } + + private java.util.List dimensionsInfos_ = + java.util.Collections.emptyList(); + + private void ensureDimensionsInfosIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + dimensionsInfos_ = + new java.util.ArrayList( + dimensionsInfos_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.DimensionsInfo, + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder> + dimensionsInfosBuilder_; + + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List + getDimensionsInfosList() { + if (dimensionsInfosBuilder_ == null) { + return java.util.Collections.unmodifiableList(dimensionsInfos_); + } else { + return dimensionsInfosBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public int getDimensionsInfosCount() { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.size(); + } else { + return dimensionsInfosBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1beta.DimensionsInfo getDimensionsInfos(int index) { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.get(index); + } else { + return dimensionsInfosBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder setDimensionsInfos( + int index, com.google.api.cloudquotas.v1beta.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.set(index, value); + onChanged(); + } else { + dimensionsInfosBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder setDimensionsInfos( + int index, com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.set(index, builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos(com.google.api.cloudquotas.v1beta.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(value); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + int index, com.google.api.cloudquotas.v1beta.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(index, value); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + int index, com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(index, builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder addAllDimensionsInfos( + java.lang.Iterable values) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dimensionsInfos_); + onChanged(); + } else { + dimensionsInfosBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder clearDimensionsInfos() { + if (dimensionsInfosBuilder_ == null) { + dimensionsInfos_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + dimensionsInfosBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public Builder removeDimensionsInfos(int index) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.remove(index); + onChanged(); + } else { + dimensionsInfosBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder getDimensionsInfosBuilder( + int index) { + return getDimensionsInfosFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder( + int index) { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.get(index); + } else { + return dimensionsInfosBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List + getDimensionsInfosOrBuilderList() { + if (dimensionsInfosBuilder_ != null) { + return dimensionsInfosBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dimensionsInfos_); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder addDimensionsInfosBuilder() { + return getDimensionsInfosFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1beta.DimensionsInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder addDimensionsInfosBuilder( + int index) { + return getDimensionsInfosFieldBuilder() + .addBuilder(index, com.google.api.cloudquotas.v1beta.DimensionsInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List + getDimensionsInfosBuilderList() { + return getDimensionsInfosFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.DimensionsInfo, + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder> + getDimensionsInfosFieldBuilder() { + if (dimensionsInfosBuilder_ == null) { + dimensionsInfosBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1beta.DimensionsInfo, + com.google.api.cloudquotas.v1beta.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder>( + dimensionsInfos_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + dimensionsInfos_ = null; + } + return dimensionsInfosBuilder_; + } + + private boolean isConcurrent_; + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + @java.lang.Override + public boolean getIsConcurrent() { + return isConcurrent_; + } + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @param value The isConcurrent to set. + * @return This builder for chaining. + */ + public Builder setIsConcurrent(boolean value) { + + isConcurrent_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @return This builder for chaining. + */ + public Builder clearIsConcurrent() { + bitField0_ = (bitField0_ & ~0x00004000); + isConcurrent_ = false; + onChanged(); + return this; + } + + private java.lang.Object serviceRequestQuotaUri_ = ""; + /** + * + * + *
+     * URI to the page where users can request more quota for the cloud
+     * service—for example,
+     * https://console.cloud.google.com/iam-admin/quotas.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + public java.lang.String getServiceRequestQuotaUri() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceRequestQuotaUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URI to the page where users can request more quota for the cloud
+     * service—for example,
+     * https://console.cloud.google.com/iam-admin/quotas.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + public com.google.protobuf.ByteString getServiceRequestQuotaUriBytes() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRequestQuotaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URI to the page where users can request more quota for the cloud
+     * service—for example,
+     * https://console.cloud.google.com/iam-admin/quotas.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @param value The serviceRequestQuotaUri to set. + * @return This builder for chaining. + */ + public Builder setServiceRequestQuotaUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceRequestQuotaUri_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * URI to the page where users can request more quota for the cloud
+     * service—for example,
+     * https://console.cloud.google.com/iam-admin/quotas.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return This builder for chaining. + */ + public Builder clearServiceRequestQuotaUri() { + serviceRequestQuotaUri_ = getDefaultInstance().getServiceRequestQuotaUri(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * URI to the page where users can request more quota for the cloud
+     * service—for example,
+     * https://console.cloud.google.com/iam-admin/quotas.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @param value The bytes for serviceRequestQuotaUri to set. + * @return This builder for chaining. + */ + public Builder setServiceRequestQuotaUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceRequestQuotaUri_ = value; + bitField0_ |= 0x00008000; + 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.api.cloudquotas.v1beta.QuotaInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaInfo) + private static final com.google.api.cloudquotas.v1beta.QuotaInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaInfo(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaInfo 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.api.cloudquotas.v1beta.QuotaInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoName.java new file mode 100644 index 000000000000..da2eac1f4aae --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoName.java @@ -0,0 +1,519 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 QuotaInfoName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private static final PathTemplate FOLDER_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private static final PathTemplate ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String service; + private final String quotaInfo; + private final String folder; + private final String organization; + + @Deprecated + protected QuotaInfoName() { + project = null; + location = null; + service = null; + quotaInfo = null; + folder = null; + organization = null; + } + + private QuotaInfoName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_SERVICE_QUOTA_INFO; + } + + private QuotaInfoName(FolderLocationServiceQuotaInfoBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_SERVICE_QUOTA_INFO; + } + + private QuotaInfoName(OrganizationLocationServiceQuotaInfoBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationServiceQuotaInfoBuilder() { + return new Builder(); + } + + public static FolderLocationServiceQuotaInfoBuilder newFolderLocationServiceQuotaInfoBuilder() { + return new FolderLocationServiceQuotaInfoBuilder(); + } + + public static OrganizationLocationServiceQuotaInfoBuilder + newOrganizationLocationServiceQuotaInfoBuilder() { + return new OrganizationLocationServiceQuotaInfoBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QuotaInfoName of( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + public static QuotaInfoName ofProjectLocationServiceQuotaInfoName( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + public static QuotaInfoName ofFolderLocationServiceQuotaInfoName( + String folder, String location, String service, String quotaInfo) { + return newFolderLocationServiceQuotaInfoBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + public static QuotaInfoName ofOrganizationLocationServiceQuotaInfoName( + String organization, String location, String service, String quotaInfo) { + return newOrganizationLocationServiceQuotaInfoBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + public static String format(String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + public static String formatProjectLocationServiceQuotaInfoName( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + public static String formatFolderLocationServiceQuotaInfoName( + String folder, String location, String service, String quotaInfo) { + return newFolderLocationServiceQuotaInfoBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + public static String formatOrganizationLocationServiceQuotaInfoName( + String organization, String location, String service, String quotaInfo) { + return newOrganizationLocationServiceQuotaInfoBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + public static QuotaInfoName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofProjectLocationServiceQuotaInfoName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } else if (FOLDER_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofFolderLocationServiceQuotaInfoName( + matchMap.get("folder"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } else if (ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofOrganizationLocationServiceQuotaInfoName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } + throw new ValidationException("QuotaInfoName.parse: formattedString not in valid format"); + } + + 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 (QuotaInfoName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString) + || FOLDER_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString) + || ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.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 (service != null) { + fieldMapBuilder.put("service", service); + } + if (quotaInfo != null) { + fieldMapBuilder.put("quota_info", quotaInfo); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + QuotaInfoName that = ((QuotaInfoName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.service, that.service) + && Objects.equals(this.quotaInfo, that.quotaInfo) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(quotaInfo); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + public static class Builder { + private String project; + private String location; + private String service; + private String quotaInfo; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + public Builder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + private Builder(QuotaInfoName quotaInfoName) { + Preconditions.checkArgument( + Objects.equals(quotaInfoName.pathTemplate, PROJECT_LOCATION_SERVICE_QUOTA_INFO), + "toBuilder is only supported when QuotaInfoName has the pattern of projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + this.project = quotaInfoName.project; + this.location = quotaInfoName.location; + this.service = quotaInfoName.service; + this.quotaInfo = quotaInfoName.quotaInfo; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } + + /** + * Builder for folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + public static class FolderLocationServiceQuotaInfoBuilder { + private String folder; + private String location; + private String service; + private String quotaInfo; + + protected FolderLocationServiceQuotaInfoBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public FolderLocationServiceQuotaInfoBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setService(String service) { + this.service = service; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + public static class OrganizationLocationServiceQuotaInfoBuilder { + private String organization; + private String location; + private String service; + private String quotaInfo; + + protected OrganizationLocationServiceQuotaInfoBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public OrganizationLocationServiceQuotaInfoBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setService(String service) { + this.service = service; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoOrBuilder.java new file mode 100644 index 000000000000..2f4e29673a70 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaInfoOrBuilder.java @@ -0,0 +1,488 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The metric. + */ + java.lang.String getMetric(); + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + com.google.protobuf.ByteString getMetricBytes(); + + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * Whether this is a precise quota. A precise quota is tracked with absolute
+   * precision. In contrast, an imprecise quota is not tracked with precision.
+   * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + boolean getIsPrecise(); + + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + java.lang.String getRefreshInterval(); + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: "minute" for per minute, "day" for per day, or "10 seconds" for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + com.google.protobuf.ByteString getRefreshIntervalBytes(); + + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + int getContainerTypeValue(); + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + com.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType getContainerType(); + + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + java.util.List getDimensionsList(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + int getDimensionsCount(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + java.lang.String getDimensions(int index); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + com.google.protobuf.ByteString getDimensionsBytes(int index); + + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + java.lang.String getMetricDisplayName(); + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + com.google.protobuf.ByteString getMetricDisplayNameBytes(); + + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + java.lang.String getQuotaDisplayName(); + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + com.google.protobuf.ByteString getQuotaDisplayNameBytes(); + + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., "MByte".
+   * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + java.lang.String getMetricUnit(); + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., "MByte".
+   * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + com.google.protobuf.ByteString getMetricUnitBytes(); + + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + boolean hasQuotaIncreaseEligibility(); + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility getQuotaIncreaseEligibility(); + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1beta.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + com.google.api.cloudquotas.v1beta.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder(); + + /** + * + * + *
+   * Whether the quota value is fixed or adjustable
+   * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + boolean getIsFixed(); + + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + java.util.List getDimensionsInfosList(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + com.google.api.cloudquotas.v1beta.DimensionsInfo getDimensionsInfos(int index); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + int getDimensionsInfosCount(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + java.util.List + getDimensionsInfosOrBuilderList(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.DimensionsInfo dimensions_infos = 14; + */ + com.google.api.cloudquotas.v1beta.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder(int index); + + /** + * + * + *
+   * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+   * on the total number of concurrent operations in flight at any given time.
+   * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + boolean getIsConcurrent(); + + /** + * + * + *
+   * URI to the page where users can request more quota for the cloud
+   * service—for example,
+   * https://console.cloud.google.com/iam-admin/quotas.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + java.lang.String getServiceRequestQuotaUri(); + /** + * + * + *
+   * URI to the page where users can request more quota for the cloud
+   * service—for example,
+   * https://console.cloud.google.com/iam-admin/quotas.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + com.google.protobuf.ByteString getServiceRequestQuotaUriBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreference.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreference.java new file mode 100644 index 000000000000..65fe42dd8b20 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreference.java @@ -0,0 +1,3115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * QuotaPreference represents the preferred quota configuration specified for
+ * a project, folder or organization. There is only one QuotaPreference
+ * resource for a quota value targeting a unique set of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaPreference} + */ +public final class QuotaPreference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.QuotaPreference) + QuotaPreferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaPreference.newBuilder() to construct. + private QuotaPreference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaPreference() { + name_ = ""; + etag_ = ""; + service_ = ""; + quotaId_ = ""; + justification_ = ""; + contactEmail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaPreference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaPreference.class, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @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 except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @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 DIMENSIONS_FIELD_NUMBER = 2; + + private static final class DimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int QUOTA_CONFIG_FIELD_NUMBER = 3; + private com.google.api.cloudquotas.v1beta.QuotaConfig quotaConfig_; + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + @java.lang.Override + public boolean hasQuotaConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfig getQuotaConfig() { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder getQuotaConfigOrBuilder() { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .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_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .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. Create time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .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. Update time stamp
+   * 
+ * + * .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 SERVICE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 10; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Is the quota preference pending Google Cloud approval and
+   * fulfillment.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int JUSTIFICATION_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object justification_ = ""; + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The justification. + */ + @java.lang.Override + public java.lang.String getJustification() { + java.lang.Object ref = justification_; + 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(); + justification_ = s; + return s; + } + } + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJustificationBytes() { + java.lang.Object ref = justification_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + justification_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTACT_EMAIL_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object contactEmail_ = ""; + /** + * + * + *
+   * Input only. An email address that can be used to contact the the user, in
+   * case Google Cloud needs more information to make a decision before
+   * additional quota can be granted.
+   *
+   * When requesting a quota increase, the email address is required.
+   * When requesting a quota decrease, the email address is optional.
+   * For example, the email address is optional when the
+   * `QuotaConfig.preferred_value` is smaller than the
+   * `QuotaDetails.reset_value`.
+   * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The contactEmail. + */ + @java.lang.Override + public java.lang.String getContactEmail() { + java.lang.Object ref = contactEmail_; + 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(); + contactEmail_ = s; + return s; + } + } + /** + * + * + *
+   * Input only. An email address that can be used to contact the the user, in
+   * case Google Cloud needs more information to make a decision before
+   * additional quota can be granted.
+   *
+   * When requesting a quota increase, the email address is required.
+   * When requesting a quota decrease, the email address is optional.
+   * For example, the email address is optional when the
+   * `QuotaConfig.preferred_value` is smaller than the
+   * `QuotaDetails.reset_value`.
+   * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for contactEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContactEmailBytes() { + java.lang.Object ref = contactEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contactEmail_ = 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_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDimensions(), DimensionsDefaultEntryHolder.defaultEntry, 2); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getQuotaConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, quotaId_); + } + if (reconciling_ != false) { + output.writeBool(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(justification_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, justification_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contactEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, contactEmail_); + } + 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_); + } + for (java.util.Map.Entry entry : + internalGetDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry dimensions__ = + DimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, dimensions__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQuotaConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, quotaId_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(justification_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, justification_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contactEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, contactEmail_); + } + 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.api.cloudquotas.v1beta.QuotaPreference)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.QuotaPreference other = + (com.google.api.cloudquotas.v1beta.QuotaPreference) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetDimensions().equals(other.internalGetDimensions())) return false; + if (hasQuotaConfig() != other.hasQuotaConfig()) return false; + if (hasQuotaConfig()) { + if (!getQuotaConfig().equals(other.getQuotaConfig())) return false; + } + if (!getEtag().equals(other.getEtag())) 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 (!getService().equals(other.getService())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getJustification().equals(other.getJustification())) return false; + if (!getContactEmail().equals(other.getContactEmail())) 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 (!internalGetDimensions().getMap().isEmpty()) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDimensions().hashCode(); + } + if (hasQuotaConfig()) { + hash = (37 * hash) + QUOTA_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getQuotaConfig().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().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) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + QUOTA_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + JUSTIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getJustification().hashCode(); + hash = (37 * hash) + CONTACT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getContactEmail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference 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.api.cloudquotas.v1beta.QuotaPreference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference 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.api.cloudquotas.v1beta.QuotaPreference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference 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.api.cloudquotas.v1beta.QuotaPreference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference 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.api.cloudquotas.v1beta.QuotaPreference 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; + } + /** + * + * + *
+   * QuotaPreference represents the preferred quota configuration specified for
+   * a project, folder or organization. There is only one QuotaPreference
+   * resource for a quota value targeting a unique set of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.QuotaPreference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.QuotaPreference) + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.QuotaPreference.class, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.QuotaPreference.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQuotaConfigFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableDimensions().clear(); + quotaConfig_ = null; + if (quotaConfigBuilder_ != null) { + quotaConfigBuilder_.dispose(); + quotaConfigBuilder_ = null; + } + etag_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + service_ = ""; + quotaId_ = ""; + reconciling_ = false; + justification_ = ""; + contactEmail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference build() { + com.google.api.cloudquotas.v1beta.QuotaPreference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference buildPartial() { + com.google.api.cloudquotas.v1beta.QuotaPreference result = + new com.google.api.cloudquotas.v1beta.QuotaPreference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.QuotaPreference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dimensions_ = internalGetDimensions(); + result.dimensions_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quotaConfig_ = + quotaConfigBuilder_ == null ? quotaConfig_ : quotaConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.justification_ = justification_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.contactEmail_ = contactEmail_; + } + 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.api.cloudquotas.v1beta.QuotaPreference) { + return mergeFrom((com.google.api.cloudquotas.v1beta.QuotaPreference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.QuotaPreference other) { + if (other == com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableDimensions().mergeFrom(other.internalGetDimensions()); + bitField0_ |= 0x00000002; + if (other.hasQuotaConfig()) { + mergeQuotaConfig(other.getQuotaConfig()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getJustification().isEmpty()) { + justification_ = other.justification_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getContactEmail().isEmpty()) { + contactEmail_ = other.contactEmail_; + bitField0_ |= 0x00000400; + 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: + { + com.google.protobuf.MapEntry dimensions__ = + input.readMessage( + DimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDimensions() + .getMutableMap() + .put(dimensions__.getKey(), dimensions__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getQuotaConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 80: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 90: + { + justification_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 90 + case 98: + { + contactEmail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 98 + 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 except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @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 except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @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 except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @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 except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @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.MapField dimensions_; + + private com.google.protobuf.MapField + internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableDimensions() { + if (dimensions_ == null) { + dimensions_ = + com.google.protobuf.MapField.newMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + if (!dimensions_.isMutable()) { + dimensions_ = dimensions_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDimensions() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableDimensions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder removeDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDimensions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDimensions() { + bitField0_ |= 0x00000002; + return internalGetMutableDimensions().getMutableMap(); + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder putDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * Immutable. The dimensions that this quota preference applies to. The key of
+     * the map entry is the name of a dimension, such as "region", "zone",
+     * "network_id", and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder putAllDimensions(java.util.Map values) { + internalGetMutableDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + private com.google.api.cloudquotas.v1beta.QuotaConfig quotaConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaConfig, + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder, + com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder> + quotaConfigBuilder_; + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + public boolean hasQuotaConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + public com.google.api.cloudquotas.v1beta.QuotaConfig getQuotaConfig() { + if (quotaConfigBuilder_ == null) { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } else { + return quotaConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaConfig(com.google.api.cloudquotas.v1beta.QuotaConfig value) { + if (quotaConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaConfig_ = value; + } else { + quotaConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaConfig( + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder builderForValue) { + if (quotaConfigBuilder_ == null) { + quotaConfig_ = builderForValue.build(); + } else { + quotaConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaConfig(com.google.api.cloudquotas.v1beta.QuotaConfig value) { + if (quotaConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && quotaConfig_ != null + && quotaConfig_ != com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance()) { + getQuotaConfigBuilder().mergeFrom(value); + } else { + quotaConfig_ = value; + } + } else { + quotaConfigBuilder_.mergeFrom(value); + } + if (quotaConfig_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + quotaConfig_ = null; + if (quotaConfigBuilder_ != null) { + quotaConfigBuilder_.dispose(); + quotaConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaConfig.Builder getQuotaConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getQuotaConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder getQuotaConfigOrBuilder() { + if (quotaConfigBuilder_ != null) { + return quotaConfigBuilder_.getMessageOrBuilder(); + } else { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1beta.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaConfig, + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder, + com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder> + getQuotaConfigFieldBuilder() { + if (quotaConfigBuilder_ == null) { + quotaConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaConfig, + com.google.api.cloudquotas.v1beta.QuotaConfig.Builder, + com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder>( + getQuotaConfig(), getParentForChildren(), isClean()); + quotaConfig_ = null; + } + return quotaConfigBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + 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 stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Create time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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. Update time stamp
+     * 
+ * + * + * .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 java.lang.Object service_ = ""; + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object quotaId_ = ""; + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Is the quota preference pending Google Cloud approval and
+     * fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Is the quota preference pending Google Cloud approval and
+     * fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Is the quota preference pending Google Cloud approval and
+     * fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000100); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object justification_ = ""; + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return The justification. + */ + public java.lang.String getJustification() { + java.lang.Object ref = justification_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + justification_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + public com.google.protobuf.ByteString getJustificationBytes() { + java.lang.Object ref = justification_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + justification_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @param value The justification to set. + * @return This builder for chaining. + */ + public Builder setJustification(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + justification_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return This builder for chaining. + */ + public Builder clearJustification() { + justification_ = getDefaultInstance().getJustification(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @param value The bytes for justification to set. + * @return This builder for chaining. + */ + public Builder setJustificationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + justification_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object contactEmail_ = ""; + /** + * + * + *
+     * Input only. An email address that can be used to contact the the user, in
+     * case Google Cloud needs more information to make a decision before
+     * additional quota can be granted.
+     *
+     * When requesting a quota increase, the email address is required.
+     * When requesting a quota decrease, the email address is optional.
+     * For example, the email address is optional when the
+     * `QuotaConfig.preferred_value` is smaller than the
+     * `QuotaDetails.reset_value`.
+     * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The contactEmail. + */ + public java.lang.String getContactEmail() { + java.lang.Object ref = contactEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contactEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input only. An email address that can be used to contact the the user, in
+     * case Google Cloud needs more information to make a decision before
+     * additional quota can be granted.
+     *
+     * When requesting a quota increase, the email address is required.
+     * When requesting a quota decrease, the email address is optional.
+     * For example, the email address is optional when the
+     * `QuotaConfig.preferred_value` is smaller than the
+     * `QuotaDetails.reset_value`.
+     * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for contactEmail. + */ + public com.google.protobuf.ByteString getContactEmailBytes() { + java.lang.Object ref = contactEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contactEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input only. An email address that can be used to contact the the user, in
+     * case Google Cloud needs more information to make a decision before
+     * additional quota can be granted.
+     *
+     * When requesting a quota increase, the email address is required.
+     * When requesting a quota decrease, the email address is optional.
+     * For example, the email address is optional when the
+     * `QuotaConfig.preferred_value` is smaller than the
+     * `QuotaDetails.reset_value`.
+     * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The contactEmail to set. + * @return This builder for chaining. + */ + public Builder setContactEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contactEmail_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. An email address that can be used to contact the the user, in
+     * case Google Cloud needs more information to make a decision before
+     * additional quota can be granted.
+     *
+     * When requesting a quota increase, the email address is required.
+     * When requesting a quota decrease, the email address is optional.
+     * For example, the email address is optional when the
+     * `QuotaConfig.preferred_value` is smaller than the
+     * `QuotaDetails.reset_value`.
+     * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearContactEmail() { + contactEmail_ = getDefaultInstance().getContactEmail(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. An email address that can be used to contact the the user, in
+     * case Google Cloud needs more information to make a decision before
+     * additional quota can be granted.
+     *
+     * When requesting a quota increase, the email address is required.
+     * When requesting a quota decrease, the email address is optional.
+     * For example, the email address is optional when the
+     * `QuotaConfig.preferred_value` is smaller than the
+     * `QuotaDetails.reset_value`.
+     * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The bytes for contactEmail to set. + * @return This builder for chaining. + */ + public Builder setContactEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contactEmail_ = value; + bitField0_ |= 0x00000400; + 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.api.cloudquotas.v1beta.QuotaPreference) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.QuotaPreference) + private static final com.google.api.cloudquotas.v1beta.QuotaPreference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.QuotaPreference(); + } + + public static com.google.api.cloudquotas.v1beta.QuotaPreference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaPreference 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.api.cloudquotas.v1beta.QuotaPreference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceName.java new file mode 100644 index 000000000000..2cd30ed85f95 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceName.java @@ -0,0 +1,450 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 QuotaPreferenceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}"); + private static final PathTemplate FOLDER_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}"); + private static final PathTemplate ORGANIZATION_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String quotaPreference; + private final String folder; + private final String organization; + + @Deprecated + protected QuotaPreferenceName() { + project = null; + location = null; + quotaPreference = null; + folder = null; + organization = null; + } + + private QuotaPreferenceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_QUOTA_PREFERENCE; + } + + private QuotaPreferenceName(FolderLocationQuotaPreferenceBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_QUOTA_PREFERENCE; + } + + private QuotaPreferenceName(OrganizationLocationQuotaPreferenceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_QUOTA_PREFERENCE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationQuotaPreferenceBuilder() { + return new Builder(); + } + + public static FolderLocationQuotaPreferenceBuilder newFolderLocationQuotaPreferenceBuilder() { + return new FolderLocationQuotaPreferenceBuilder(); + } + + public static OrganizationLocationQuotaPreferenceBuilder + newOrganizationLocationQuotaPreferenceBuilder() { + return new OrganizationLocationQuotaPreferenceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QuotaPreferenceName of(String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + public static QuotaPreferenceName ofProjectLocationQuotaPreferenceName( + String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + public static QuotaPreferenceName ofFolderLocationQuotaPreferenceName( + String folder, String location, String quotaPreference) { + return newFolderLocationQuotaPreferenceBuilder() + .setFolder(folder) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + public static QuotaPreferenceName ofOrganizationLocationQuotaPreferenceName( + String organization, String location, String quotaPreference) { + return newOrganizationLocationQuotaPreferenceBuilder() + .setOrganization(organization) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + public static String format(String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + public static String formatProjectLocationQuotaPreferenceName( + String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + public static String formatFolderLocationQuotaPreferenceName( + String folder, String location, String quotaPreference) { + return newFolderLocationQuotaPreferenceBuilder() + .setFolder(folder) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + public static String formatOrganizationLocationQuotaPreferenceName( + String organization, String location, String quotaPreference) { + return newOrganizationLocationQuotaPreferenceBuilder() + .setOrganization(organization) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + public static QuotaPreferenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofProjectLocationQuotaPreferenceName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("quota_preference")); + } else if (FOLDER_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofFolderLocationQuotaPreferenceName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("quota_preference")); + } else if (ORGANIZATION_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofOrganizationLocationQuotaPreferenceName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("quota_preference")); + } + throw new ValidationException("QuotaPreferenceName.parse: formattedString not in valid format"); + } + + 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 (QuotaPreferenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_QUOTA_PREFERENCE.matches(formattedString) + || FOLDER_LOCATION_QUOTA_PREFERENCE.matches(formattedString) + || ORGANIZATION_LOCATION_QUOTA_PREFERENCE.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 (quotaPreference != null) { + fieldMapBuilder.put("quota_preference", quotaPreference); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + QuotaPreferenceName that = ((QuotaPreferenceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.quotaPreference, that.quotaPreference) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(quotaPreference); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/locations/{location}/quotaPreferences/{quota_preference}. */ + public static class Builder { + private String project; + private String location; + private String quotaPreference; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + private Builder(QuotaPreferenceName quotaPreferenceName) { + Preconditions.checkArgument( + Objects.equals(quotaPreferenceName.pathTemplate, PROJECT_LOCATION_QUOTA_PREFERENCE), + "toBuilder is only supported when QuotaPreferenceName has the pattern of projects/{project}/locations/{location}/quotaPreferences/{quota_preference}"); + this.project = quotaPreferenceName.project; + this.location = quotaPreferenceName.location; + this.quotaPreference = quotaPreferenceName.quotaPreference; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}. */ + public static class FolderLocationQuotaPreferenceBuilder { + private String folder; + private String location; + private String quotaPreference; + + protected FolderLocationQuotaPreferenceBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public FolderLocationQuotaPreferenceBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationQuotaPreferenceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationQuotaPreferenceBuilder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}. + */ + public static class OrganizationLocationQuotaPreferenceBuilder { + private String organization; + private String location; + private String quotaPreference; + + protected OrganizationLocationQuotaPreferenceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public OrganizationLocationQuotaPreferenceBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationQuotaPreferenceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationQuotaPreferenceBuilder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceOrBuilder.java new file mode 100644 index 000000000000..2590d7e68859 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaPreferenceOrBuilder.java @@ -0,0 +1,467 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface QuotaPreferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.QuotaPreference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + int getDimensionsCount(); + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + boolean containsDimensions(java.lang.String key); + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDimensions(); + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.Map getDimensionsMap(); + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + /* nullable */ + java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Immutable. The dimensions that this quota preference applies to. The key of
+   * the map entry is the name of a dimension, such as "region", "zone",
+   * "network_id", and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.lang.String getDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + boolean hasQuotaConfig(); + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + com.google.api.cloudquotas.v1beta.QuotaConfig getQuotaConfig(); + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1beta.QuotaConfigOrBuilder getQuotaConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
+   * Output only. Is the quota preference pending Google Cloud approval and
+   * fulfillment.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The justification. + */ + java.lang.String getJustification(); + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + com.google.protobuf.ByteString getJustificationBytes(); + + /** + * + * + *
+   * Input only. An email address that can be used to contact the the user, in
+   * case Google Cloud needs more information to make a decision before
+   * additional quota can be granted.
+   *
+   * When requesting a quota increase, the email address is required.
+   * When requesting a quota decrease, the email address is optional.
+   * For example, the email address is optional when the
+   * `QuotaConfig.preferred_value` is smaller than the
+   * `QuotaDetails.reset_value`.
+   * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The contactEmail. + */ + java.lang.String getContactEmail(); + /** + * + * + *
+   * Input only. An email address that can be used to contact the the user, in
+   * case Google Cloud needs more information to make a decision before
+   * additional quota can be granted.
+   *
+   * When requesting a quota increase, the email address is required.
+   * When requesting a quota decrease, the email address is optional.
+   * For example, the email address is optional when the
+   * `QuotaConfig.preferred_value` is smaller than the
+   * `QuotaDetails.reset_value`.
+   * 
+ * + * string contact_email = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for contactEmail. + */ + com.google.protobuf.ByteString getContactEmailBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaSafetyCheck.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaSafetyCheck.java new file mode 100644 index 000000000000..784c2bef4bbb --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/QuotaSafetyCheck.java @@ -0,0 +1,181 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Enumerations of quota safety checks.
+ * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1beta.QuotaSafetyCheck} + */ +public enum QuotaSafetyCheck implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified quota safety check.
+   * 
+ * + * QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + */ + QUOTA_SAFETY_CHECK_UNSPECIFIED(0), + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to be lower than the consumer's quota usage.
+   * 
+ * + * QUOTA_DECREASE_BELOW_USAGE = 1; + */ + QUOTA_DECREASE_BELOW_USAGE(1), + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to decrease by more than 10 percent.
+   * 
+ * + * QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; + */ + QUOTA_DECREASE_PERCENTAGE_TOO_HIGH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified quota safety check.
+   * 
+ * + * QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + */ + public static final int QUOTA_SAFETY_CHECK_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to be lower than the consumer's quota usage.
+   * 
+ * + * QUOTA_DECREASE_BELOW_USAGE = 1; + */ + public static final int QUOTA_DECREASE_BELOW_USAGE_VALUE = 1; + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to decrease by more than 10 percent.
+   * 
+ * + * QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; + */ + public static final int QUOTA_DECREASE_PERCENTAGE_TOO_HIGH_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 QuotaSafetyCheck 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 QuotaSafetyCheck forNumber(int value) { + switch (value) { + case 0: + return QUOTA_SAFETY_CHECK_UNSPECIFIED; + case 1: + return QUOTA_DECREASE_BELOW_USAGE; + case 2: + return QUOTA_DECREASE_PERCENTAGE_TOO_HIGH; + 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 QuotaSafetyCheck findValueByNumber(int number) { + return QuotaSafetyCheck.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.api.cloudquotas.v1beta.ResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final QuotaSafetyCheck[] VALUES = values(); + + public static QuotaSafetyCheck 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 QuotaSafetyCheck(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1beta.QuotaSafetyCheck) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ResourcesProto.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ResourcesProto.java new file mode 100644 index 000000000000..458f7dae49be --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ResourcesProto.java @@ -0,0 +1,305 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public final class ResourcesProto { + private ResourcesProto() {} + + 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_api_cloudquotas_v1beta_QuotaInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_QuotaDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1beta_RolloutInfo_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/api/cloudquotas/v1beta/resource" + + "s.proto\022\035google.api.cloudquotas.v1beta\032\037" + + "google/api/field_behavior.proto\032\031google/" + + "api/resource.proto\032\037google/protobuf/time" + + "stamp.proto\032\036google/protobuf/wrappers.pr" + + "oto\"\253\007\n\tQuotaInfo\022\014\n\004name\030\001 \001(\t\022\020\n\010quota" + + "_id\030\002 \001(\t\022\016\n\006metric\030\003 \001(\t\022\017\n\007service\030\004 \001" + + "(\t\022\022\n\nis_precise\030\005 \001(\010\022\030\n\020refresh_interv" + + "al\030\006 \001(\t\022N\n\016container_type\030\007 \001(\01626.googl" + + "e.api.cloudquotas.v1beta.QuotaInfo.Conta" + + "inerType\022\022\n\ndimensions\030\010 \003(\t\022\033\n\023metric_d" + + "isplay_name\030\t \001(\t\022\032\n\022quota_display_name\030" + + "\n \001(\t\022\023\n\013metric_unit\030\013 \001(\t\022[\n\032quota_incr" + + "ease_eligibility\030\014 \001(\01327.google.api.clou" + + "dquotas.v1beta.QuotaIncreaseEligibility\022" + + "\020\n\010is_fixed\030\r \001(\010\022G\n\020dimensions_infos\030\016 " + + "\003(\0132-.google.api.cloudquotas.v1beta.Dime" + + "nsionsInfo\022\025\n\ris_concurrent\030\017 \001(\010\022!\n\031ser" + + "vice_request_quota_uri\030\021 \001(\t\"Z\n\rContaine" + + "rType\022\036\n\032CONTAINER_TYPE_UNSPECIFIED\020\000\022\013\n" + + "\007PROJECT\020\001\022\n\n\006FOLDER\020\002\022\020\n\014ORGANIZATION\020\003" + + ":\256\002\352A\252\002\n$cloudquotas.googleapis.com/Quot" + + "aInfo\022Rprojects/{project}/locations/{loc" + + "ation}/services/{service}/quotaInfos/{qu" + + "ota_info}\022Pfolders/{folder}/locations/{l" + + "ocation}/services/{service}/quotaInfos/{" + + "quota_info}\022\\organizations/{organization" + + "}/locations/{location}/services/{service" + + "}/quotaInfos/{quota_info}\"\262\002\n\030QuotaIncre" + + "aseEligibility\022\023\n\013is_eligible\030\001 \001(\010\022i\n\024i" + + "neligibility_reason\030\002 \001(\0162K.google.api.c" + + "loudquotas.v1beta.QuotaIncreaseEligibili" + + "ty.IneligibilityReason\"\225\001\n\023Ineligibility" + + "Reason\022$\n INELIGIBILITY_REASON_UNSPECIFI" + + "ED\020\000\022\034\n\030NO_VALID_BILLING_ACCOUNT\020\001\022\021\n\rNO" + + "T_SUPPORTED\020\003\022\034\n\030NOT_ENOUGH_USAGE_HISTOR" + + "Y\020\004\022\t\n\005OTHER\020\002\"\215\006\n\017QuotaPreference\022\014\n\004na" + + "me\030\001 \001(\t\022W\n\ndimensions\030\002 \003(\0132>.google.ap" + + "i.cloudquotas.v1beta.QuotaPreference.Dim" + + "ensionsEntryB\003\340A\005\022E\n\014quota_config\030\003 \001(\0132" + + "*.google.api.cloudquotas.v1beta.QuotaCon" + + "figB\003\340A\002\022\021\n\004etag\030\004 \001(\tB\003\340A\001\0224\n\013create_ti" + + "me\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A" + + "\003\0224\n\013update_time\030\006 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\003\022\024\n\007service\030\007 \001(\tB\003\340A\002\022\025\n" + + "\010quota_id\030\010 \001(\tB\003\340A\002\022\030\n\013reconciling\030\n \001(" + + "\010B\003\340A\003\022\025\n\rjustification\030\013 \001(\t\022\032\n\rcontact" + + "_email\030\014 \001(\tB\003\340A\004\0321\n\017DimensionsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\237\002\352A\233\002\n*clo" + + "udquotas.googleapis.com/QuotaPreference\022" + + "Kprojects/{project}/locations/{location}" + + "/quotaPreferences/{quota_preference}\022Ifo" + + "lders/{folder}/locations/{location}/quot" + + "aPreferences/{quota_preference}\022Uorganiz" + + "ations/{organization}/locations/{locatio" + + "n}/quotaPreferences/{quota_preference}\"\271" + + "\003\n\013QuotaConfig\022\034\n\017preferred_value\030\001 \001(\003B" + + "\003\340A\002\022\031\n\014state_detail\030\002 \001(\tB\003\340A\003\0227\n\rgrant" + + "ed_value\030\003 \001(\0132\033.google.protobuf.Int64Va" + + "lueB\003\340A\003\022\025\n\010trace_id\030\004 \001(\tB\003\340A\003\022U\n\013annot" + + "ations\030\005 \003(\0132;.google.api.cloudquotas.v1" + + "beta.QuotaConfig.AnnotationsEntryB\003\340A\001\022N" + + "\n\016request_origin\030\006 \001(\01621.google.api.clou" + + "dquotas.v1beta.QuotaConfig.OriginB\003\340A\003\0322" + + "\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\"F\n\006Origin\022\026\n\022ORIGIN_UNSPECIFI" + + "ED\020\000\022\021\n\rCLOUD_CONSOLE\020\001\022\021\n\rAUTO_ADJUSTER" + + "\020\002\"\362\001\n\016DimensionsInfo\022Q\n\ndimensions\030\001 \003(" + + "\0132=.google.api.cloudquotas.v1beta.Dimens" + + "ionsInfo.DimensionsEntry\022<\n\007details\030\002 \001(" + + "\0132+.google.api.cloudquotas.v1beta.QuotaD" + + "etails\022\034\n\024applicable_locations\030\003 \003(\t\0321\n\017" + + "DimensionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\"_\n\014QuotaDetails\022\r\n\005value\030\001 \001(\003\022@" + + "\n\014rollout_info\030\003 \001(\0132*.google.api.cloudq" + + "uotas.v1beta.RolloutInfo\"&\n\013RolloutInfo\022" + + "\027\n\017ongoing_rollout\030\001 \001(\010*~\n\020QuotaSafetyC" + + "heck\022\"\n\036QUOTA_SAFETY_CHECK_UNSPECIFIED\020\000" + + "\022\036\n\032QUOTA_DECREASE_BELOW_USAGE\020\001\022&\n\"QUOT" + + "A_DECREASE_PERCENTAGE_TOO_HIGH\020\002B\345\001\n!com" + + ".google.api.cloudquotas.v1betaB\016Resource" + + "sProtoP\001ZEcloud.google.com/go/cloudquota" + + "s/apiv1beta/cloudquotaspb;cloudquotaspb\252" + + "\002\037Google.Cloud.CloudQuotas.V1Beta\312\002\037Goog" + + "le\\Cloud\\CloudQuotas\\V1beta\352\002\"Google::Cl" + + "oud::CloudQuotas::V1betab\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(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_api_cloudquotas_v1beta_QuotaInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_cloudquotas_v1beta_QuotaInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaInfo_descriptor, + new java.lang.String[] { + "Name", + "QuotaId", + "Metric", + "Service", + "IsPrecise", + "RefreshInterval", + "ContainerType", + "Dimensions", + "MetricDisplayName", + "QuotaDisplayName", + "MetricUnit", + "QuotaIncreaseEligibility", + "IsFixed", + "DimensionsInfos", + "IsConcurrent", + "ServiceRequestQuotaUri", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaIncreaseEligibility_descriptor, + new java.lang.String[] { + "IsEligible", "IneligibilityReason", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor, + new java.lang.String[] { + "Name", + "Dimensions", + "QuotaConfig", + "Etag", + "CreateTime", + "UpdateTime", + "Service", + "QuotaId", + "Reconciling", + "Justification", + "ContactEmail", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_descriptor = + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaPreference_DimensionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor, + new java.lang.String[] { + "PreferredValue", + "StateDetail", + "GrantedValue", + "TraceId", + "Annotations", + "RequestOrigin", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_descriptor = + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaConfig_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor, + new java.lang.String[] { + "Dimensions", "Details", "ApplicableLocations", + }); + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_descriptor = + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_DimensionsInfo_DimensionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_api_cloudquotas_v1beta_QuotaDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_QuotaDetails_descriptor, + new java.lang.String[] { + "Value", "RolloutInfo", + }); + internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_api_cloudquotas_v1beta_RolloutInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor, + new java.lang.String[] { + "OngoingRollout", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfo.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfo.java new file mode 100644 index 000000000000..7d74d4b0642a --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfo.java @@ -0,0 +1,534 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * [Output only] Rollout information of a quota.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.RolloutInfo} + */ +public final class RolloutInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.RolloutInfo) + RolloutInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use RolloutInfo.newBuilder() to construct. + private RolloutInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RolloutInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RolloutInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_RolloutInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.RolloutInfo.class, + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder.class); + } + + public static final int ONGOING_ROLLOUT_FIELD_NUMBER = 1; + private boolean ongoingRollout_ = false; + /** + * + * + *
+   * Whether there is an ongoing rollout for a quota or not.
+   * 
+ * + * bool ongoing_rollout = 1; + * + * @return The ongoingRollout. + */ + @java.lang.Override + public boolean getOngoingRollout() { + return ongoingRollout_; + } + + 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 (ongoingRollout_ != false) { + output.writeBool(1, ongoingRollout_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ongoingRollout_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, ongoingRollout_); + } + 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.api.cloudquotas.v1beta.RolloutInfo)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.RolloutInfo other = + (com.google.api.cloudquotas.v1beta.RolloutInfo) obj; + + if (getOngoingRollout() != other.getOngoingRollout()) 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) + ONGOING_ROLLOUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getOngoingRollout()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo 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.api.cloudquotas.v1beta.RolloutInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo 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.api.cloudquotas.v1beta.RolloutInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo 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.api.cloudquotas.v1beta.RolloutInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo 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.api.cloudquotas.v1beta.RolloutInfo 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; + } + /** + * + * + *
+   * [Output only] Rollout information of a quota.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.RolloutInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.RolloutInfo) + com.google.api.cloudquotas.v1beta.RolloutInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_RolloutInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.RolloutInfo.class, + com.google.api.cloudquotas.v1beta.RolloutInfo.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.RolloutInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ongoingRollout_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.ResourcesProto + .internal_static_google_api_cloudquotas_v1beta_RolloutInfo_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.RolloutInfo getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.RolloutInfo build() { + com.google.api.cloudquotas.v1beta.RolloutInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.RolloutInfo buildPartial() { + com.google.api.cloudquotas.v1beta.RolloutInfo result = + new com.google.api.cloudquotas.v1beta.RolloutInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1beta.RolloutInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ongoingRollout_ = ongoingRollout_; + } + } + + @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.api.cloudquotas.v1beta.RolloutInfo) { + return mergeFrom((com.google.api.cloudquotas.v1beta.RolloutInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.RolloutInfo other) { + if (other == com.google.api.cloudquotas.v1beta.RolloutInfo.getDefaultInstance()) return this; + if (other.getOngoingRollout() != false) { + setOngoingRollout(other.getOngoingRollout()); + } + 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: + { + ongoingRollout_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + 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 boolean ongoingRollout_; + /** + * + * + *
+     * Whether there is an ongoing rollout for a quota or not.
+     * 
+ * + * bool ongoing_rollout = 1; + * + * @return The ongoingRollout. + */ + @java.lang.Override + public boolean getOngoingRollout() { + return ongoingRollout_; + } + /** + * + * + *
+     * Whether there is an ongoing rollout for a quota or not.
+     * 
+ * + * bool ongoing_rollout = 1; + * + * @param value The ongoingRollout to set. + * @return This builder for chaining. + */ + public Builder setOngoingRollout(boolean value) { + + ongoingRollout_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether there is an ongoing rollout for a quota or not.
+     * 
+ * + * bool ongoing_rollout = 1; + * + * @return This builder for chaining. + */ + public Builder clearOngoingRollout() { + bitField0_ = (bitField0_ & ~0x00000001); + ongoingRollout_ = 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.api.cloudquotas.v1beta.RolloutInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.RolloutInfo) + private static final com.google.api.cloudquotas.v1beta.RolloutInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.RolloutInfo(); + } + + public static com.google.api.cloudquotas.v1beta.RolloutInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RolloutInfo 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.api.cloudquotas.v1beta.RolloutInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfoOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfoOrBuilder.java new file mode 100644 index 000000000000..b37405f3bcdb --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/RolloutInfoOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface RolloutInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.RolloutInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether there is an ongoing rollout for a quota or not.
+   * 
+ * + * bool ongoing_rollout = 1; + * + * @return The ongoingRollout. + */ + boolean getOngoingRollout(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ServiceName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ServiceName.java new file mode 100644 index 000000000000..e520b5ba2a06 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/ServiceName.java @@ -0,0 +1,438 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 ServiceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/services/{service}"); + private static final PathTemplate FOLDER_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/services/{service}"); + private static final PathTemplate ORGANIZATION_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/services/{service}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String service; + private final String folder; + private final String organization; + + @Deprecated + protected ServiceName() { + project = null; + location = null; + service = null; + folder = null; + organization = null; + } + + private ServiceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_SERVICE; + } + + private ServiceName(FolderLocationServiceBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_SERVICE; + } + + private ServiceName(OrganizationLocationServiceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_SERVICE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationServiceBuilder() { + return new Builder(); + } + + public static FolderLocationServiceBuilder newFolderLocationServiceBuilder() { + return new FolderLocationServiceBuilder(); + } + + public static OrganizationLocationServiceBuilder newOrganizationLocationServiceBuilder() { + return new OrganizationLocationServiceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServiceName of(String project, String location, String service) { + return newBuilder().setProject(project).setLocation(location).setService(service).build(); + } + + public static ServiceName ofProjectLocationServiceName( + String project, String location, String service) { + return newBuilder().setProject(project).setLocation(location).setService(service).build(); + } + + public static ServiceName ofFolderLocationServiceName( + String folder, String location, String service) { + return newFolderLocationServiceBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .build(); + } + + public static ServiceName ofOrganizationLocationServiceName( + String organization, String location, String service) { + return newOrganizationLocationServiceBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .build(); + } + + public static String format(String project, String location, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + public static String formatProjectLocationServiceName( + String project, String location, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + public static String formatFolderLocationServiceName( + String folder, String location, String service) { + return newFolderLocationServiceBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + public static String formatOrganizationLocationServiceName( + String organization, String location, String service) { + return newOrganizationLocationServiceBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + public static ServiceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_SERVICE.match(formattedString); + return ofProjectLocationServiceName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("service")); + } else if (FOLDER_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_SERVICE.match(formattedString); + return ofFolderLocationServiceName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("service")); + } else if (ORGANIZATION_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_SERVICE.match(formattedString); + return ofOrganizationLocationServiceName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("service")); + } + throw new ValidationException("ServiceName.parse: formattedString not in valid format"); + } + + 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 (ServiceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SERVICE.matches(formattedString) + || FOLDER_LOCATION_SERVICE.matches(formattedString) + || ORGANIZATION_LOCATION_SERVICE.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 (service != null) { + fieldMapBuilder.put("service", service); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ServiceName that = ((ServiceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.service, that.service) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/locations/{location}/services/{service}. */ + public static class Builder { + private String project; + private String location; + private String service; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + private Builder(ServiceName serviceName) { + Preconditions.checkArgument( + Objects.equals(serviceName.pathTemplate, PROJECT_LOCATION_SERVICE), + "toBuilder is only supported when ServiceName has the pattern of projects/{project}/locations/{location}/services/{service}"); + this.project = serviceName.project; + this.location = serviceName.location; + this.service = serviceName.service; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/services/{service}. */ + public static class FolderLocationServiceBuilder { + private String folder; + private String location; + private String service; + + protected FolderLocationServiceBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public FolderLocationServiceBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationServiceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}/services/{service}. */ + public static class OrganizationLocationServiceBuilder { + private String organization; + private String location; + private String service; + + protected OrganizationLocationServiceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public OrganizationLocationServiceBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationServiceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequest.java new file mode 100644 index 000000000000..ef8162783c0b --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequest.java @@ -0,0 +1,1147 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Request for updating QuotaAdjusterSettings
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} + */ +public final class UpdateQuotaAdjusterSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + UpdateQuotaAdjusterSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateQuotaAdjusterSettingsRequest.newBuilder() to construct. + private UpdateQuotaAdjusterSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateQuotaAdjusterSettingsRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateQuotaAdjusterSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.class, + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.Builder.class); + } + + private int bitField0_; + public static final int QUOTA_ADJUSTER_SETTINGS_FIELD_NUMBER = 1; + private com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings quotaAdjusterSettings_; + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaAdjusterSettings field is set. + */ + @java.lang.Override + public boolean hasQuotaAdjusterSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaAdjusterSettings. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getQuotaAdjusterSettings() { + return quotaAdjusterSettings_ == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance() + : quotaAdjusterSettings_; + } + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder + getQuotaAdjusterSettingsOrBuilder() { + return quotaAdjusterSettings_ == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance() + : quotaAdjusterSettings_; + } + + 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_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getQuotaAdjusterSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + 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, getQuotaAdjusterSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest other = + (com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) obj; + + if (hasQuotaAdjusterSettings() != other.hasQuotaAdjusterSettings()) return false; + if (hasQuotaAdjusterSettings()) { + if (!getQuotaAdjusterSettings().equals(other.getQuotaAdjusterSettings())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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 (hasQuotaAdjusterSettings()) { + hash = (37 * hash) + QUOTA_ADJUSTER_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaAdjusterSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest 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; + } + /** + * + * + *
+   * Request for updating QuotaAdjusterSettings
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.class, + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.Builder.class); + } + + // Construct using + // com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getQuotaAdjusterSettingsFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + quotaAdjusterSettings_ = null; + if (quotaAdjusterSettingsBuilder_ != null) { + quotaAdjusterSettingsBuilder_.dispose(); + quotaAdjusterSettingsBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaAdjusterSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest build() { + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest buildPartial() { + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest result = + new com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.quotaAdjusterSettings_ = + quotaAdjusterSettingsBuilder_ == null + ? quotaAdjusterSettings_ + : quotaAdjusterSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) { + return mergeFrom( + (com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest other) { + if (other + == com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + .getDefaultInstance()) return this; + if (other.hasQuotaAdjusterSettings()) { + mergeQuotaAdjusterSettings(other.getQuotaAdjusterSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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( + getQuotaAdjusterSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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.api.cloudquotas.v1beta.QuotaAdjusterSettings quotaAdjusterSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder> + quotaAdjusterSettingsBuilder_; + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaAdjusterSettings field is set. + */ + public boolean hasQuotaAdjusterSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaAdjusterSettings. + */ + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getQuotaAdjusterSettings() { + if (quotaAdjusterSettingsBuilder_ == null) { + return quotaAdjusterSettings_ == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance() + : quotaAdjusterSettings_; + } else { + return quotaAdjusterSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings value) { + if (quotaAdjusterSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaAdjusterSettings_ = value; + } else { + quotaAdjusterSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder builderForValue) { + if (quotaAdjusterSettingsBuilder_ == null) { + quotaAdjusterSettings_ = builderForValue.build(); + } else { + quotaAdjusterSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaAdjusterSettings( + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings value) { + if (quotaAdjusterSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && quotaAdjusterSettings_ != null + && quotaAdjusterSettings_ + != com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance()) { + getQuotaAdjusterSettingsBuilder().mergeFrom(value); + } else { + quotaAdjusterSettings_ = value; + } + } else { + quotaAdjusterSettingsBuilder_.mergeFrom(value); + } + if (quotaAdjusterSettings_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaAdjusterSettings() { + bitField0_ = (bitField0_ & ~0x00000001); + quotaAdjusterSettings_ = null; + if (quotaAdjusterSettingsBuilder_ != null) { + quotaAdjusterSettingsBuilder_.dispose(); + quotaAdjusterSettingsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder + getQuotaAdjusterSettingsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getQuotaAdjusterSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder + getQuotaAdjusterSettingsOrBuilder() { + if (quotaAdjusterSettingsBuilder_ != null) { + return quotaAdjusterSettingsBuilder_.getMessageOrBuilder(); + } else { + return quotaAdjusterSettings_ == null + ? com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.getDefaultInstance() + : quotaAdjusterSettings_; + } + } + /** + * + * + *
+     * Required. The QuotaAdjusterSettings to update.
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder> + getQuotaAdjusterSettingsFieldBuilder() { + if (quotaAdjusterSettingsBuilder_ == null) { + quotaAdjusterSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Builder, + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder>( + getQuotaAdjusterSettings(), getParentForChildren(), isClean()); + quotaAdjusterSettings_ = null; + } + return quotaAdjusterSettingsBuilder_; + } + + 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_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + private static final com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest(); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateQuotaAdjusterSettingsRequest 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.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..e5bab6e3cb83 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaAdjusterSettingsRequestOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/quota_adjuster_settings.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface UpdateQuotaAdjusterSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaAdjusterSettings field is set. + */ + boolean hasQuotaAdjusterSettings(); + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaAdjusterSettings. + */ + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings getQuotaAdjusterSettings(); + /** + * + * + *
+   * Required. The QuotaAdjusterSettings to update.
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaAdjusterSettings quota_adjuster_settings = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsOrBuilder + getQuotaAdjusterSettingsOrBuilder(); + + /** + * + * + *
+   * 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(); + + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequest.java new file mode 100644 index 000000000000..4926ea55c27a --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequest.java @@ -0,0 +1,1685 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +/** + * + * + *
+ * Message for updating a QuotaPreference
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} + */ +public final class UpdateQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + UpdateQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateQuotaPreferenceRequest.newBuilder() to construct. + private UpdateQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateQuotaPreferenceRequest() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int QUOTA_PREFERENCE_FIELD_NUMBER = 2; + private com.google.api.cloudquotas.v1beta.QuotaPreference quotaPreference_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + @java.lang.Override + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, and the quota preference is not found, a new one
+   * will be created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int IGNORE_SAFETY_CHECKS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List ignoreSafetyChecks_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck> + ignoreSafetyChecks_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>() { + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck convert( + java.lang.Integer from) { + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck result = + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck.forNumber(from); + return result == null + ? com.google.api.cloudquotas.v1beta.QuotaSafetyCheck.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return The count of ignoreSafetyChecks. + */ + @java.lang.Override + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List getIgnoreSafetyChecksValueList() { + return ignoreSafetyChecks_; + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + + private int ignoreSafetyChecksMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getQuotaPreference()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (getIgnoreSafetyChecksList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(ignoreSafetyChecksMemoizedSerializedSize); + } + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + output.writeEnumNoTag(ignoreSafetyChecks_.get(i)); + } + 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, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuotaPreference()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(ignoreSafetyChecks_.get(i)); + } + size += dataSize; + if (!getIgnoreSafetyChecksList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + ignoreSafetyChecksMemoizedSerializedSize = dataSize; + } + 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasQuotaPreference() != other.hasQuotaPreference()) return false; + if (hasQuotaPreference()) { + if (!getQuotaPreference().equals(other.getQuotaPreference())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!ignoreSafetyChecks_.equals(other.ignoreSafetyChecks_)) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasQuotaPreference()) { + hash = (37 * hash) + QUOTA_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreference().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + if (getIgnoreSafetyChecksCount() > 0) { + hash = (37 * hash) + IGNORE_SAFETY_CHECKS_FIELD_NUMBER; + hash = (53 * hash) + ignoreSafetyChecks_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for updating a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + getQuotaPreferenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + allowMissing_ = false; + validateOnly_ = false; + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1beta.CloudquotasProto + .internal_static_google_api_cloudquotas_v1beta_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest result) { + if (((bitField0_ & 0x00000010) != 0)) { + ignoreSafetyChecks_ = java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.ignoreSafetyChecks_ = ignoreSafetyChecks_; + } + + private void buildPartial0( + com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaPreference_ = + quotaPreferenceBuilder_ == null ? quotaPreference_ : quotaPreferenceBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowMissing_ = allowMissing_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest other) { + if (other + == com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasQuotaPreference()) { + mergeQuotaPreference(other.getQuotaPreference()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.ignoreSafetyChecks_.isEmpty()) { + if (ignoreSafetyChecks_.isEmpty()) { + ignoreSafetyChecks_ = other.ignoreSafetyChecks_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.addAll(other.ignoreSafetyChecks_); + } + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQuotaPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 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. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.api.cloudquotas.v1beta.QuotaPreference quotaPreference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + quotaPreferenceBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference() { + if (quotaPreferenceBuilder_ == null) { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } else { + return quotaPreferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference(com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreference_ = value; + } else { + quotaPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference( + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder builderForValue) { + if (quotaPreferenceBuilder_ == null) { + quotaPreference_ = builderForValue.build(); + } else { + quotaPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaPreference(com.google.api.cloudquotas.v1beta.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && quotaPreference_ != null + && quotaPreference_ + != com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance()) { + getQuotaPreferenceBuilder().mergeFrom(value); + } else { + quotaPreference_ = value; + } + } else { + quotaPreferenceBuilder_.mergeFrom(value); + } + if (quotaPreference_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaPreference() { + bitField0_ = (bitField0_ & ~0x00000002); + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaPreference.Builder getQuotaPreferenceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQuotaPreferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder + getQuotaPreferenceOrBuilder() { + if (quotaPreferenceBuilder_ != null) { + return quotaPreferenceBuilder_.getMessageOrBuilder(); + } else { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1beta.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder> + getQuotaPreferenceFieldBuilder() { + if (quotaPreferenceBuilder_ == null) { + quotaPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1beta.QuotaPreference, + com.google.api.cloudquotas.v1beta.QuotaPreference.Builder, + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder>( + getQuotaPreference(), getParentForChildren(), isClean()); + quotaPreference_ = null; + } + return quotaPreferenceBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000004); + allowMissing_ = false; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.util.List ignoreSafetyChecks_ = + java.util.Collections.emptyList(); + + private void ensureIgnoreSafetyChecksIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + ignoreSafetyChecks_ = new java.util.ArrayList(ignoreSafetyChecks_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @return A list containing the ignoreSafetyChecks. + */ + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @return The count of ignoreSafetyChecks. + */ + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + public com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param index The index to set the value at. + * @param value The ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecks( + int index, com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param value The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecks(com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param values The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecks( + java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (com.google.api.cloudquotas.v1beta.QuotaSafetyCheck value : values) { + ignoreSafetyChecks_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearIgnoreSafetyChecks() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + public java.util.List getIgnoreSafetyChecksValueList() { + return java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecksValue(int index, int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param value The enum numeric value on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecksValue(int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * + * @param values The enum numeric values on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecksValue(java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (int value : values) { + ignoreSafetyChecks_.add(value); + } + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..819dc871da8c --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/java/com/google/api/cloudquotas/v1beta/UpdateQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,209 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1beta/cloudquotas.proto + +// Protobuf Java Version: 3.25.5 +package com.google.api.cloudquotas.v1beta; + +public interface UpdateQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + boolean hasQuotaPreference(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + com.google.api.cloudquotas.v1beta.QuotaPreference getQuotaPreference(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1beta.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1beta.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder(); + + /** + * + * + *
+   * Optional. If set to true, and the quota preference is not found, a new one
+   * will be created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); + + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return The count of ignoreSafetyChecks. + */ + int getIgnoreSafetyChecksCount(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + com.google.api.cloudquotas.v1beta.QuotaSafetyCheck getIgnoreSafetyChecks(int index); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksValueList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1beta.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + int getIgnoreSafetyChecksValue(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/cloudquotas.proto b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/cloudquotas.proto new file mode 100644 index 000000000000..df1d68833fc6 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/cloudquotas.proto @@ -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 +// +// 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.api.cloudquotas.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/cloudquotas/v1beta/resources.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "CloudquotasProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" + pattern: "folders/{folder}/locations/{location}/services/{service}" + pattern: "organizations/{organization}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" + pattern: "folders/{folder}/locations/{location}" + pattern: "organizations/{organization}/locations/{location}" +}; + +// The Cloud Quotas API is an infrastructure service for Google Cloud that lets +// service consumers list and manage their resource usage limits. +// +// - List/Get the metadata and current status of the quotas for a service. +// - Create/Update quota preferencess that declare the preferred quota values. +// - Check the status of a quota preference request. +// - List/Get pending and historical quota preference. +service CloudQuotas { + option (google.api.default_host) = "cloudquotas.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists QuotaInfos of all quotas for a given project, folder or organization. + rpc ListQuotaInfos(ListQuotaInfosRequest) returns (ListQuotaInfosResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/services/*}/quotaInfos" + additional_bindings { + get: "/v1beta/{parent=organizations/*/locations/*/services/*}/quotaInfos" + } + additional_bindings { + get: "/v1beta/{parent=folders/*/locations/*/services/*}/quotaInfos" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the QuotaInfo of a quota for a project, folder or organization. + rpc GetQuotaInfo(GetQuotaInfoRequest) returns (QuotaInfo) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/services/*/quotaInfos/*}" + additional_bindings { + get: "/v1beta/{name=organizations/*/locations/*/services/*/quotaInfos/*}" + } + additional_bindings { + get: "/v1beta/{name=folders/*/locations/*/services/*/quotaInfos/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists QuotaPreferences in a given project, folder or organization. + rpc ListQuotaPreferences(ListQuotaPreferencesRequest) + returns (ListQuotaPreferencesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/quotaPreferences" + additional_bindings { + get: "/v1beta/{parent=folders/*/locations/*}/quotaPreferences" + } + additional_bindings { + get: "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single QuotaPreference. + rpc GetQuotaPreference(GetQuotaPreferenceRequest) returns (QuotaPreference) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/quotaPreferences/*}" + additional_bindings { + get: "/v1beta/{name=organizations/*/locations/*/quotaPreferences/*}" + } + additional_bindings { + get: "/v1beta/{name=folders/*/locations/*/quotaPreferences/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new QuotaPreference that declares the desired value for a quota. + rpc CreateQuotaPreference(CreateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/quotaPreferences" + body: "quota_preference" + additional_bindings { + post: "/v1beta/{parent=folders/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + additional_bindings { + post: "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + }; + option (google.api.method_signature) = + "parent,quota_preference,quota_preference_id"; + option (google.api.method_signature) = "parent,quota_preference"; + } + + // Updates the parameters of a single QuotaPreference. It can updates the + // config in any states, not just the ones pending approval. + rpc UpdateQuotaPreference(UpdateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + patch: "/v1beta/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + additional_bindings { + patch: "/v1beta/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + additional_bindings { + patch: "/v1beta/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + }; + option (google.api.method_signature) = "quota_preference,update_mask"; + } +} + +// Message for requesting list of QuotaInfos +message ListQuotaInfosRequest { + // Required. Parent value of QuotaInfo resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // Example names: + // `projects/123/locations/global/services/compute.googleapis.com` + // `folders/234/locations/global/services/compute.googleapis.com` + // `organizations/345/locations/global/services/compute.googleapis.com` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaInfos +message ListQuotaInfosResponse { + // The list of QuotaInfo + repeated QuotaInfo quota_infos = 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; +} + +// Message for getting a QuotaInfo +message GetQuotaInfoRequest { + // Required. The resource name of the quota info. + // + // An example name: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; +} + +// Message for requesting list of QuotaPreferences +message ListQuotaPreferencesRequest { + // Required. Parent value of QuotaPreference resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // When the value starts with 'folders' or 'organizations', it lists the + // QuotaPreferences for org quotas in the container. It does not list the + // QuotaPreferences in the descendant projects of the container. + // + // Example parents: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter result QuotaPreferences by their state, type, + // create/update time range. + // + // Example filters: + // `reconciling=true AND request_type=CLOUD_CONSOLE`, + // `reconciling=true OR creation_time>2022-12-03T10:30:00` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How to order of the results. By default, the results are ordered + // by create time. + // + // Example orders: + // `quota_id`, + // `service, create_time` + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaPreferences +message ListQuotaPreferencesResponse { + // The list of QuotaPreference + repeated QuotaPreference quota_preferences = 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; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a QuotaPreference +message GetQuotaPreferenceRequest { + // Required. Name of the resource + // + // Example name: + // `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; +} + +// Message for creating a QuotaPreference +message CreateQuotaPreferenceRequest { + // Required. Value for parent. + // + // Example: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Id of the requesting object, must be unique under its parent. + // If client does not set this field, the service will generate one. + string quota_preference_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being created + QuotaPreference quota_preference = 3 [(google.api.field_behavior) = REQUIRED]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 4; +} + +// Message for updating a QuotaPreference +message UpdateQuotaPreferenceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // QuotaPreference resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + QuotaPreference quota_preference = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set to true, and the quota preference is not found, a new one + // will be created. In this situation, `update_mask` is ignored. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, validate the request, but do not actually update. + // Note that a request being valid does not mean that the request is + // guaranteed to be fulfilled. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 5; +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto new file mode 100644 index 000000000000..ac887ed6e03c --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto @@ -0,0 +1,134 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.api.cloudquotas.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "QuotaAdjusterSettingsProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; + +// The Quotas Adjuster Settings API is an infrastructure service for Google +// Cloud that lets service consumers view and update their quota adjuster +// settings. +// +// - Update quota adjuster settings. +// - Get the name of the configurations. +service QuotaAdjusterSettingsManager { + option (google.api.default_host) = "cloudquotas.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // RPC Method for updating QuotaAdjusterSettings based on the request + rpc UpdateQuotaAdjusterSettings(UpdateQuotaAdjusterSettingsRequest) + returns (QuotaAdjusterSettings) { + option (google.api.http) = { + patch: "/v1beta/{quota_adjuster_settings.name=projects/*/locations/*/quotaAdjusterSettings}" + body: "quota_adjuster_settings" + }; + option (google.api.method_signature) = + "quota_adjuster_settings,update_mask"; + } + + // RPC Method for getting QuotaAdjusterSettings based on the request + rpc GetQuotaAdjusterSettings(GetQuotaAdjusterSettingsRequest) + returns (QuotaAdjusterSettings) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for getting QuotaAdjusterSettings +message GetQuotaAdjusterSettingsRequest { + // Required. Name of the config. Required to be “settings”, as only a single + // setting per container will be supported initially. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaAdjusterSettings" + } + ]; +} + +// Request for updating QuotaAdjusterSettings +message UpdateQuotaAdjusterSettingsRequest { + // Required. The QuotaAdjusterSettings to update. + QuotaAdjusterSettings quota_adjuster_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, validate the request, but do not actually update. + // Note that a request being valid does not mean that the request is + // guaranteed to be fulfilled. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The QuotaAdjusterSettings resource defines the settings for the Quota +// Adjuster. +message QuotaAdjusterSettings { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaAdjusterSettings" + pattern: "projects/{project}/locations/{location}/quotaAdjusterSettings" + plural: "quotaAdjusterSettings" + singular: "quotaAdjusterSettings" + style: DECLARATIVE_FRIENDLY + }; + + // The enablement status of the quota adjuster. + enum Enablement { + // The quota adjuster is in an unknown state. + ENABLEMENT_UNSPECIFIED = 0; + + // The quota adjuster is enabled. + ENABLED = 2; + + // The quota adjuster is disabled. + DISABLED = 3; + } + + // Identifier. Name of the config would be of the format: + // projects/12345/locations/global/quotaAdjusterSettings + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The configured value of the enablement at the given resource. + Enablement enablement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the QuotaAdjusterSettings was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The current etag of the QuotaAdjusterSettings. If an etag is + // provided on update and does not match the current server's etag of the + // QuotaAdjusterSettings, the request will be blocked and an ABORTED error + // will be returned. See https://google.aip.dev/134#etags for more details on + // etags. + string etag = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/resources.proto b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/resources.proto new file mode 100644 index 000000000000..387a91dbe8d7 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1beta/src/main/proto/google/api/cloudquotas/v1beta/resources.proto @@ -0,0 +1,321 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.api.cloudquotas.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; + +// Enumerations of quota safety checks. +enum QuotaSafetyCheck { + // Unspecified quota safety check. + QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to be lower than the consumer's quota usage. + QUOTA_DECREASE_BELOW_USAGE = 1; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to decrease by more than 10 percent. + QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; +} + +// QuotaInfo represents information about a particular quota for a given +// project, folder or organization. +message QuotaInfo { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + pattern: "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + }; + + // The enumeration of the types of a cloud resource container. + enum ContainerType { + // Unspecified container type. + CONTAINER_TYPE_UNSPECIFIED = 0; + + // consumer project + PROJECT = 1; + + // folder + FOLDER = 2; + + // organization + ORGANIZATION = 3; + } + + // Resource name of this QuotaInfo. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1; + + // The id of the quota, which is unquie within the service. + // Example: `CpusPerProjectPerRegion` + string quota_id = 2; + + // The metric of the quota. It specifies the resources consumption the quota + // is defined for. + // Example: `compute.googleapis.com/cpus` + string metric = 3; + + // The name of the service in which the quota is defined. + // Example: `compute.googleapis.com` + string service = 4; + + // Whether this is a precise quota. A precise quota is tracked with absolute + // precision. In contrast, an imprecise quota is not tracked with precision. + bool is_precise = 5; + + // The reset time interval for the quota. Refresh interval applies to rate + // quota only. + // Example: "minute" for per minute, "day" for per day, or "10 seconds" for + // every 10 seconds. + string refresh_interval = 6; + + // The container type of the QuotaInfo. + ContainerType container_type = 7; + + // The dimensions the quota is defined on. + repeated string dimensions = 8; + + // The display name of the quota metric + string metric_display_name = 9; + + // The display name of the quota. + string quota_display_name = 10; + + // The unit in which the metric value is reported, e.g., "MByte". + string metric_unit = 11; + + // Whether it is eligible to request a higher quota value for this quota. + QuotaIncreaseEligibility quota_increase_eligibility = 12; + + // Whether the quota value is fixed or adjustable + bool is_fixed = 13; + + // The collection of dimensions info ordered by their dimensions from more + // specific ones to less specific ones. + repeated DimensionsInfo dimensions_infos = 14; + + // Whether the quota is a concurrent quota. Concurrent quotas are enforced + // on the total number of concurrent operations in flight at any given time. + bool is_concurrent = 15; + + // URI to the page where users can request more quota for the cloud + // service—for example, + // https://console.cloud.google.com/iam-admin/quotas. + string service_request_quota_uri = 17; +} + +// Eligibility information regarding requesting increase adjustment of a quota. +message QuotaIncreaseEligibility { + // The enumeration of reasons when it is ineligible to request increase + // adjustment. + enum IneligibilityReason { + // Default value when is_eligible is true. + INELIGIBILITY_REASON_UNSPECIFIED = 0; + + // The container is not linked with a valid billing account. + NO_VALID_BILLING_ACCOUNT = 1; + + // Quota increase is not supported for the quota. + NOT_SUPPORTED = 3; + + // There is not enough usage history to determine the eligibility. + NOT_ENOUGH_USAGE_HISTORY = 4; + + // Other reasons. + OTHER = 2; + } + + // Whether a higher quota value can be requested for the quota. + bool is_eligible = 1; + + // The reason of why it is ineligible to request increased value of the quota. + // If the is_eligible field is true, it defaults to + // INELIGIBILITY_REASON_UNSPECIFIED. + IneligibilityReason ineligibility_reason = 2; +} + +// QuotaPreference represents the preferred quota configuration specified for +// a project, folder or organization. There is only one QuotaPreference +// resource for a quota value targeting a unique set of dimensions. +message QuotaPreference { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + pattern: "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}" + }; + + // Required except in the CREATE requests. + // The resource name of the quota preference. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + string name = 1; + + // Immutable. The dimensions that this quota preference applies to. The key of + // the map entry is the name of a dimension, such as "region", "zone", + // "network_id", and the value of the map entry is the dimension value. + // + // If a dimension is missing from the map of dimensions, the quota preference + // applies to all the dimension values except for those that have other quota + // preferences configured for the specific value. + // + // NOTE: QuotaPreferences can only be applied across all values of "user" and + // "resource" dimension. Do not set values for "user" or "resource" in the + // dimension map. + // + // Example: {"provider", "Foo Inc"} where "provider" is a service specific + // dimension. + map dimensions = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Preferred quota configuration. + QuotaConfig quota_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The current etag of the quota preference. If an etag is provided + // on update and does not match the current server's etag of the quota + // preference, the request will be blocked and an ABORTED error will be + // returned. See https://google.aip.dev/134#etags for more details on etags. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the service to which the quota preference is applied. + string service = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the quota to which the quota preference is applied. A + // quota name is unique in the service. Example: `CpusPerProjectPerRegion` + string quota_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Is the quota preference pending Google Cloud approval and + // fulfillment. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The reason / justification for this quota preference. + string justification = 11; + + // Input only. An email address that can be used to contact the the user, in + // case Google Cloud needs more information to make a decision before + // additional quota can be granted. + // + // When requesting a quota increase, the email address is required. + // When requesting a quota decrease, the email address is optional. + // For example, the email address is optional when the + // `QuotaConfig.preferred_value` is smaller than the + // `QuotaDetails.reset_value`. + string contact_email = 12 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// The preferred quota configuration. +message QuotaConfig { + // The enumeration of the origins of quota preference requests. + enum Origin { + // The unspecified value. + ORIGIN_UNSPECIFIED = 0; + + // Created through Cloud Console. + CLOUD_CONSOLE = 1; + + // Generated by automatic quota adjustment. + AUTO_ADJUSTER = 2; + } + + // Required. The preferred value. Must be greater than or equal to -1. If set + // to -1, it means the value is "unlimited". + int64 preferred_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Optional details about the state of this quota preference. + string state_detail = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Granted quota value. + google.protobuf.Int64Value granted_value = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The trace id that the Google Cloud uses to provision the + // requested quota. This trace id may be used by the client to contact Cloud + // support to track the state of a quota preference request. The trace id is + // only produced for increase requests and is unique for each request. The + // quota decrease requests do not have a trace id. + string trace_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The annotations map for clients to store small amounts of + // arbitrary data. Do not put PII or other sensitive information here. See + // https://google.aip.dev/128#annotations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The origin of the quota preference request. + Origin request_origin = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The detailed quota information such as effective quota value for a +// combination of dimensions. +message DimensionsInfo { + // The map of dimensions for this dimensions info. The key of a map entry + // is "region", "zone" or the name of a service specific dimension, and the + // value of a map entry is the value of the dimension. If a dimension does + // not appear in the map of dimensions, the dimensions info applies to all + // the dimension values except for those that have another DimenisonInfo + // instance configured for the specific value. + // Example: {"provider" : "Foo Inc"} where "provider" is a service specific + // dimension of a quota. + map dimensions = 1; + + // Quota details for the specified dimensions. + QuotaDetails details = 2; + + // The applicable regions or zones of this dimensions info. The field will be + // set to ['global'] for quotas that are not per region or per zone. + // Otherwise, it will be set to the list of locations this dimension info is + // applicable to. + repeated string applicable_locations = 3; +} + +// The quota details for a map of dimensions. +message QuotaDetails { + // The value currently in effect and being enforced. + int64 value = 1; + + // Rollout information of this quota. + // This field is present only if the effective limit will change due to the + // ongoing rollout of the service config. + RolloutInfo rollout_info = 3; +} + +// [Output only] Rollout information of a quota. +message RolloutInfo { + // Whether there is an ongoing rollout for a quota or not. + bool ongoing_rollout = 1; +} diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetCredentialsProvider.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..55ed469f2107 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_Create_SetCredentialsProvider_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.CloudQuotasSettings; +import com.google.api.cloudquotas.v1beta.myCredentials; +import com.google.api.gax.core.FixedCredentialsProvider; + +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 + CloudQuotasSettings cloudQuotasSettings = + CloudQuotasSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_Create_SetCredentialsProvider_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetEndpoint.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..d70e5398bd4e --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_Create_SetEndpoint_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.CloudQuotasSettings; +import com.google.api.cloudquotas.v1beta.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 + CloudQuotasSettings cloudQuotasSettings = + CloudQuotasSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_Create_SetEndpoint_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateUseHttpJsonTransport.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..a3ef3d619a53 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_Create_UseHttpJsonTransport_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.CloudQuotasSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudQuotasSettings cloudQuotasSettings = CloudQuotasSettings.newHttpJsonBuilder().build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_Create_UseHttpJsonTransport_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java new file mode 100644 index 000000000000..c77def519ad4 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaSafetyCheck; +import com.google.api.core.ApiFuture; +import java.util.ArrayList; + +public class AsyncCreateQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncCreateQuotaPreference(); + } + + public static void asyncCreateQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setQuotaPreferenceId("quotaPreferenceId-948332050") + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + ApiFuture future = + cloudQuotasClient.createQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java new file mode 100644 index 000000000000..1aee619976e2 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaSafetyCheck; +import java.util.ArrayList; + +public class SyncCreateQuotaPreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreference(); + } + + public static void syncCreateQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setQuotaPreferenceId("quotaPreferenceId-948332050") + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(request); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java new file mode 100644 index 000000000000..2b1a45509086 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreference_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncCreateQuotaPreferenceLocationnameQuotapreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceLocationnameQuotapreference(); + } + + public static void syncCreateQuotaPreferenceLocationnameQuotapreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java new file mode 100644 index 000000000000..01edd7feaf44 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreferenceString_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncCreateQuotaPreferenceLocationnameQuotapreferenceString { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceLocationnameQuotapreferenceString(); + } + + public static void syncCreateQuotaPreferenceLocationnameQuotapreferenceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + QuotaPreference response = + cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreferenceString_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java new file mode 100644 index 000000000000..4cb0199bd70f --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreference_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncCreateQuotaPreferenceStringQuotapreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceStringQuotapreference(); + } + + public static void syncCreateQuotaPreferenceStringQuotapreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java new file mode 100644 index 000000000000..0eecacd3b07c --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreferenceString_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncCreateQuotaPreferenceStringQuotapreferenceString { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceStringQuotapreferenceString(); + } + + public static void syncCreateQuotaPreferenceStringQuotapreferenceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + QuotaPreference response = + cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreferenceString_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java new file mode 100644 index 000000000000..88c5f7bcf577 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaInfoName; +import com.google.api.core.ApiFuture; + +public class AsyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + asyncGetQuotaInfo(); + } + + public static void asyncGetQuotaInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .build(); + ApiFuture future = cloudQuotasClient.getQuotaInfoCallable().futureCall(request); + // Do something. + QuotaInfo response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..c6954dd5e9f4 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaInfoName; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .build(); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(request); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java new file mode 100644 index 000000000000..e2cf3f350a9b --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_Quotainfoname_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaInfoName; + +public class SyncGetQuotaInfoQuotainfoname { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfoQuotainfoname(); + } + + public static void syncGetQuotaInfoQuotainfoname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(name); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_Quotainfoname_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java new file mode 100644 index 000000000000..33538e15f078 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_String_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.QuotaInfoName; + +public class SyncGetQuotaInfoString { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfoString(); + } + + public static void syncGetQuotaInfoString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString(); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(name); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java new file mode 100644 index 000000000000..1a20874b606d --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaPreferenceName; +import com.google.api.core.ApiFuture; + +public class AsyncGetQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncGetQuotaPreference(); + } + + public static void asyncGetQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .build(); + ApiFuture future = + cloudQuotasClient.getQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreference.java new file mode 100644 index 000000000000..7ec0d17712ca --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreference.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaPreferenceName; + +public class SyncGetQuotaPreference { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreference(); + } + + public static void syncGetQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .build(); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(request); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java new file mode 100644 index 000000000000..c72460cbe234 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_Quotapreferencename_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaPreferenceName; + +public class SyncGetQuotaPreferenceQuotapreferencename { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreferenceQuotapreferencename(); + } + + public static void syncGetQuotaPreferenceQuotapreferencename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(name); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_Quotapreferencename_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java new file mode 100644 index 000000000000..b39d3443b18a --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_String_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaPreferenceName; + +public class SyncGetQuotaPreferenceString { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreferenceString(); + } + + public static void syncGetQuotaPreferenceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString(); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(name); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfos.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfos.java new file mode 100644 index 000000000000..82ebb92b48ae --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfos.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.ServiceName; +import com.google.api.core.ApiFuture; + +public class AsyncListQuotaInfos { + + public static void main(String[] args) throws Exception { + asyncListQuotaInfos(); + } + + public static void asyncListQuotaInfos() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudQuotasClient.listQuotaInfosPagedCallable().futureCall(request); + // Do something. + for (QuotaInfo element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java new file mode 100644 index 000000000000..0170539590b5 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_Paged_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.ServiceName; +import com.google.common.base.Strings; + +public class AsyncListQuotaInfosPaged { + + public static void main(String[] args) throws Exception { + asyncListQuotaInfosPaged(); + } + + public static void asyncListQuotaInfosPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListQuotaInfosResponse response = cloudQuotasClient.listQuotaInfosCallable().call(request); + for (QuotaInfo element : response.getQuotaInfosList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_Paged_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfos.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfos.java new file mode 100644 index 000000000000..bc518cadb413 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfos.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.ServiceName; + +public class SyncListQuotaInfos { + + public static void main(String[] args) throws Exception { + syncListQuotaInfos(); + } + + public static void syncListQuotaInfos() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java new file mode 100644 index 000000000000..a95babde01d3 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_Servicename_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.ServiceName; + +public class SyncListQuotaInfosServicename { + + public static void main(String[] args) throws Exception { + syncListQuotaInfosServicename(); + } + + public static void syncListQuotaInfosServicename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_Servicename_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosString.java new file mode 100644 index 000000000000..cb76f0b65ba9 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotainfos/SyncListQuotaInfosString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_String_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaInfo; +import com.google.api.cloudquotas.v1beta.ServiceName; + +public class SyncListQuotaInfosString { + + public static void main(String[] args) throws Exception { + syncListQuotaInfosString(); + } + + public static void syncListQuotaInfosString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString(); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java new file mode 100644 index 000000000000..05e3646a5e6e --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.core.ApiFuture; + +public class AsyncListQuotaPreferences { + + public static void main(String[] args) throws Exception { + asyncListQuotaPreferences(); + } + + public static void asyncListQuotaPreferences() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudQuotasClient.listQuotaPreferencesPagedCallable().futureCall(request); + // Do something. + for (QuotaPreference element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java new file mode 100644 index 000000000000..13e72d5831cc --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_Paged_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.common.base.Strings; + +public class AsyncListQuotaPreferencesPaged { + + public static void main(String[] args) throws Exception { + asyncListQuotaPreferencesPaged(); + } + + public static void asyncListQuotaPreferencesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListQuotaPreferencesResponse response = + cloudQuotasClient.listQuotaPreferencesCallable().call(request); + for (QuotaPreference element : response.getQuotaPreferencesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_Paged_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java new file mode 100644 index 000000000000..e3dd0778be36 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncListQuotaPreferences { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferences(); + } + + public static void syncListQuotaPreferences() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java new file mode 100644 index 000000000000..80b2ffcf0a97 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_Locationname_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncListQuotaPreferencesLocationname { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferencesLocationname(); + } + + public static void syncListQuotaPreferencesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_Locationname_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java new file mode 100644 index 000000000000..be1f3054f753 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_String_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.LocationName; +import com.google.api.cloudquotas.v1beta.QuotaPreference; + +public class SyncListQuotaPreferencesString { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferencesString(); + } + + public static void syncListQuotaPreferencesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java new file mode 100644 index 000000000000..bb5291b0fd1a --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaSafetyCheck; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class AsyncUpdateQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncUpdateQuotaPreference(); + } + + public static void asyncUpdateQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + ApiFuture future = + cloudQuotasClient.updateQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java new file mode 100644 index 000000000000..b97985e015c9 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.api.cloudquotas.v1beta.QuotaSafetyCheck; +import com.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class SyncUpdateQuotaPreference { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaPreference(); + } + + public static void syncUpdateQuotaPreference() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + QuotaPreference response = cloudQuotasClient.updateQuotaPreference(request); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java new file mode 100644 index 000000000000..3218621ddb1b --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_QuotapreferenceFieldmask_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasClient; +import com.google.api.cloudquotas.v1beta.QuotaPreference; +import com.google.protobuf.FieldMask; + +public class SyncUpdateQuotaPreferenceQuotapreferenceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaPreferenceQuotapreferenceFieldmask(); + } + + public static void syncUpdateQuotaPreferenceQuotapreferenceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + QuotaPreference response = + cloudQuotasClient.updateQuotaPreference(quotaPreference, updateMask); + } + } +} +// [END cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_QuotapreferenceFieldmask_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..8f505de26cd8 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotasSettings_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1beta.CloudQuotasSettings; +import java.time.Duration; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudQuotasSettings.Builder cloudQuotasSettingsBuilder = CloudQuotasSettings.newBuilder(); + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .setRetrySettings( + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + CloudQuotasSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build(); + } +} +// [END cloudquotas_v1beta_generated_CloudQuotasSettings_GetQuotaInfo_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetCredentialsProvider.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..2aaefb674a17 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_SetCredentialsProvider_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerSettings; +import com.google.api.cloudquotas.v1beta.myCredentials; +import com.google.api.gax.core.FixedCredentialsProvider; + +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 + QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings = + QuotaAdjusterSettingsManagerSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings); + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_SetCredentialsProvider_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetEndpoint.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..854e59c02a61 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_SetEndpoint_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerSettings; +import com.google.api.cloudquotas.v1beta.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 + QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings = + QuotaAdjusterSettingsManagerSettings.newBuilder().setEndpoint(myEndpoint).build(); + QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings); + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_SetEndpoint_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateUseHttpJsonTransport.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..6bcb6658522d --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_UseHttpJsonTransport_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings = + QuotaAdjusterSettingsManagerSettings.newHttpJsonBuilder().build(); + QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings); + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_Create_UseHttpJsonTransport_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/AsyncGetQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/AsyncGetQuotaAdjusterSettings.java new file mode 100644 index 000000000000..80aacc9da022 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/AsyncGetQuotaAdjusterSettings.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async] +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsName; +import com.google.api.core.ApiFuture; + +public class AsyncGetQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + asyncGetQuotaAdjusterSettings(); + } + + public static void asyncGetQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + GetQuotaAdjusterSettingsRequest request = + GetQuotaAdjusterSettingsRequest.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettingsCallable().futureCall(request); + // Do something. + QuotaAdjusterSettings response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettings.java new file mode 100644 index 000000000000..3206358506e1 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_sync] +import com.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsName; + +public class SyncGetQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + syncGetQuotaAdjusterSettings(); + } + + public static void syncGetQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + GetQuotaAdjusterSettingsRequest request = + GetQuotaAdjusterSettingsRequest.newBuilder() + .setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + QuotaAdjusterSettings response = + quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(request); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsQuotaadjustersettingsname.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsQuotaadjustersettingsname.java new file mode 100644 index 000000000000..828ad8bc8f55 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsQuotaadjustersettingsname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_Quotaadjustersettingsname_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsName; + +public class SyncGetQuotaAdjusterSettingsQuotaadjustersettingsname { + + public static void main(String[] args) throws Exception { + syncGetQuotaAdjusterSettingsQuotaadjustersettingsname(); + } + + public static void syncGetQuotaAdjusterSettingsQuotaadjustersettingsname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]"); + QuotaAdjusterSettings response = + quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_Quotaadjustersettingsname_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsString.java new file mode 100644 index 000000000000..f14319be15e6 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/getquotaadjustersettings/SyncGetQuotaAdjusterSettingsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_String_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsName; + +public class SyncGetQuotaAdjusterSettingsString { + + public static void main(String[] args) throws Exception { + syncGetQuotaAdjusterSettingsString(); + } + + public static void syncGetQuotaAdjusterSettingsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + String name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString(); + QuotaAdjusterSettings response = + quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/AsyncUpdateQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/AsyncUpdateQuotaAdjusterSettings.java new file mode 100644 index 000000000000..3e8eb2b3d5ad --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/AsyncUpdateQuotaAdjusterSettings.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + asyncUpdateQuotaAdjusterSettings(); + } + + public static void asyncUpdateQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + UpdateQuotaAdjusterSettingsRequest request = + UpdateQuotaAdjusterSettingsRequest.newBuilder() + .setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = + quotaAdjusterSettingsManagerClient + .updateQuotaAdjusterSettingsCallable() + .futureCall(request); + // Do something. + QuotaAdjusterSettings response = future.get(); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java new file mode 100644 index 000000000000..80013cfc6f43 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaAdjusterSettings(); + } + + public static void syncUpdateQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + UpdateQuotaAdjusterSettingsRequest request = + UpdateQuotaAdjusterSettingsRequest.newBuilder() + .setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + QuotaAdjusterSettings response = + quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(request); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask.java new file mode 100644 index 000000000000..f299dee07608 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanager/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_QuotaadjustersettingsFieldmask_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettings; +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask(); + } + + public static void syncUpdateQuotaAdjusterSettingsQuotaadjustersettingsFieldmask() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient = + QuotaAdjusterSettingsManagerClient.create()) { + QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + QuotaAdjusterSettings response = + quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings( + quotaAdjusterSettings, updateMask); + } + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_QuotaadjustersettingsFieldmask_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanagersettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanagersettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java new file mode 100644 index 000000000000..5e1aeab99428 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/quotaadjustersettingsmanagersettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManagerSettings_UpdateQuotaAdjusterSettings_sync] +import com.google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerSettings; +import java.time.Duration; + +public class SyncUpdateQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaAdjusterSettings(); + } + + public static void syncUpdateQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + QuotaAdjusterSettingsManagerSettings.Builder quotaAdjusterSettingsManagerSettingsBuilder = + QuotaAdjusterSettingsManagerSettings.newBuilder(); + quotaAdjusterSettingsManagerSettingsBuilder + .updateQuotaAdjusterSettingsSettings() + .setRetrySettings( + quotaAdjusterSettingsManagerSettingsBuilder + .updateQuotaAdjusterSettingsSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings = + quotaAdjusterSettingsManagerSettingsBuilder.build(); + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManagerSettings_UpdateQuotaAdjusterSettings_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..ddf90ebfca35 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub.samples; + +// [START cloudquotas_v1beta_generated_CloudQuotasStubSettings_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1beta.stub.CloudQuotasStubSettings; +import java.time.Duration; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudQuotasStubSettings.Builder cloudQuotasSettingsBuilder = + CloudQuotasStubSettings.newBuilder(); + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .setRetrySettings( + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + CloudQuotasStubSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build(); + } +} +// [END cloudquotas_v1beta_generated_CloudQuotasStubSettings_GetQuotaInfo_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/quotaadjustersettingsmanagerstubsettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/quotaadjustersettingsmanagerstubsettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java new file mode 100644 index 000000000000..e8b9bd872a24 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1beta/stub/quotaadjustersettingsmanagerstubsettings/updatequotaadjustersettings/SyncUpdateQuotaAdjusterSettings.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1beta.stub.samples; + +// [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManagerStubSettings_UpdateQuotaAdjusterSettings_sync] +import com.google.api.cloudquotas.v1beta.stub.QuotaAdjusterSettingsManagerStubSettings; +import java.time.Duration; + +public class SyncUpdateQuotaAdjusterSettings { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaAdjusterSettings(); + } + + public static void syncUpdateQuotaAdjusterSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + QuotaAdjusterSettingsManagerStubSettings.Builder quotaAdjusterSettingsManagerSettingsBuilder = + QuotaAdjusterSettingsManagerStubSettings.newBuilder(); + quotaAdjusterSettingsManagerSettingsBuilder + .updateQuotaAdjusterSettingsSettings() + .setRetrySettings( + quotaAdjusterSettingsManagerSettingsBuilder + .updateQuotaAdjusterSettingsSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + QuotaAdjusterSettingsManagerStubSettings quotaAdjusterSettingsManagerSettings = + quotaAdjusterSettingsManagerSettingsBuilder.build(); + } +} +// [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManagerStubSettings_UpdateQuotaAdjusterSettings_sync] diff --git a/versions.txt b/versions.txt index 00fcbfbfd5bb..b5c980875724 100644 --- a/versions.txt +++ b/versions.txt @@ -823,3 +823,5 @@ grpc-google-shopping-merchant-reviews-v1beta:0.1.0:0.2.0-SNAPSHOT google-cloud-valkey:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-valkey-v1:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-valkey-v1beta:0.1.0:0.2.0-SNAPSHOT +proto-google-cloud-cloudquotas-v1beta:0.23.0:0.24.0-SNAPSHOT +grpc-google-cloud-cloudquotas-v1beta:0.23.0:0.24.0-SNAPSHOT