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: + * + *
+ *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * Budget response = budgetServiceClient.createBudget(parent, budget);
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the budgetServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
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 BudgetServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
+ *
+ * BudgetServiceSettings budgetServiceSettings =
+ * BudgetServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * BudgetServiceClient budgetServiceClient =
+ * BudgetServiceClient.create(budgetServiceSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * BudgetServiceSettings budgetServiceSettings =
+ * BudgetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * BudgetServiceClient budgetServiceClient =
+ * BudgetServiceClient.create(budgetServiceSettings);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class BudgetServiceClient implements BackgroundResource {
+ private final BudgetServiceSettings settings;
+ private final BudgetServiceStub stub;
+
+ /** Constructs an instance of BudgetServiceClient with default settings. */
+ public static final BudgetServiceClient create() throws IOException {
+ return create(BudgetServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of BudgetServiceClient, 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 BudgetServiceClient create(BudgetServiceSettings settings)
+ throws IOException {
+ return new BudgetServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of BudgetServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use BudgetServiceSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final BudgetServiceClient create(BudgetServiceStub stub) {
+ return new BudgetServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of BudgetServiceClient, 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 BudgetServiceClient(BudgetServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((BudgetServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected BudgetServiceClient(BudgetServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final BudgetServiceSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public BudgetServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new budget. See [Quotas and limits](https://cloud.google.com/billing/quotas) for more
+ * information on the limits of the number of budgets you can create.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * Budget response = budgetServiceClient.createBudget(parent, budget);
+ * }
+ *
+ *
+ * @param parent Required. The name of the billing account to create the budget in. Values are of
+ * the form `billingAccounts/{billingAccountId}`.
+ * @param budget Required. Budget to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Budget createBudget(BillingAccountName parent, Budget budget) {
+ CreateBudgetRequest request =
+ CreateBudgetRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setBudget(budget)
+ .build();
+ return createBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new budget. See [Quotas and limits](https://cloud.google.com/billing/quotas) for more
+ * information on the limits of the number of budgets you can create.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * Budget response = budgetServiceClient.createBudget(parent.toString(), budget);
+ * }
+ *
+ *
+ * @param parent Required. The name of the billing account to create the budget in. Values are of
+ * the form `billingAccounts/{billingAccountId}`.
+ * @param budget Required. Budget to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Budget createBudget(String parent, Budget budget) {
+ CreateBudgetRequest request =
+ CreateBudgetRequest.newBuilder().setParent(parent).setBudget(budget).build();
+ return createBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new budget. See [Quotas and limits](https://cloud.google.com/billing/quotas) for more
+ * information on the limits of the number of budgets you can create.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * CreateBudgetRequest request = CreateBudgetRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setBudget(budget)
+ * .build();
+ * Budget response = budgetServiceClient.createBudget(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 Budget createBudget(CreateBudgetRequest request) {
+ return createBudgetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new budget. See [Quotas and limits](https://cloud.google.com/billing/quotas) for more
+ * information on the limits of the number of budgets you can create.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * CreateBudgetRequest request = CreateBudgetRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setBudget(budget)
+ * .build();
+ * ApiFuture<Budget> future = budgetServiceClient.createBudgetCallable().futureCall(request);
+ * // Do something
+ * Budget response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableWARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. Budget fields that are not exposed in this API will not be changed by this method. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * Budget budget = Budget.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Budget response = budgetServiceClient.updateBudget(budget, updateMask);
+ * }
+ *
+ *
+ * @param budget Required. The updated budget object. The budget to update is specified by the
+ * budget name in the budget.
+ * @param updateMask Optional. Indicates which fields in the provided budget to update. Read-only
+ * fields (such as `name`) cannot be changed. If this is not provided, then only fields with
+ * non-default values from the request are updated. See
+ * https://developers.google.com/protocol-buffers/docs/proto3#default for more details about
+ * default values.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Budget updateBudget(Budget budget, FieldMask updateMask) {
+ UpdateBudgetRequest request =
+ UpdateBudgetRequest.newBuilder().setBudget(budget).setUpdateMask(updateMask).build();
+ return updateBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a budget and returns the updated budget.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. Budget fields that are not exposed in this API will not be changed by this method. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * Budget budget = Budget.newBuilder().build();
+ * UpdateBudgetRequest request = UpdateBudgetRequest.newBuilder()
+ * .setBudget(budget)
+ * .build();
+ * Budget response = budgetServiceClient.updateBudget(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 Budget updateBudget(UpdateBudgetRequest request) {
+ return updateBudgetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a budget and returns the updated budget.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. Budget fields that are not exposed in this API will not be changed by this method. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * Budget budget = Budget.newBuilder().build();
+ * UpdateBudgetRequest request = UpdateBudgetRequest.newBuilder()
+ * .setBudget(budget)
+ * .build();
+ * ApiFuture<Budget> future = budgetServiceClient.updateBudgetCallable().futureCall(request);
+ * // Do something
+ * Budget response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableWARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * Budget response = budgetServiceClient.getBudget(name);
+ * }
+ *
+ *
+ * @param name Required. Name of budget to get. Values are of the form
+ * `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Budget getBudget(BudgetName name) {
+ GetBudgetRequest request =
+ GetBudgetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a budget.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * Budget response = budgetServiceClient.getBudget(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Name of budget to get. Values are of the form
+ * `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Budget getBudget(String name) {
+ GetBudgetRequest request = GetBudgetRequest.newBuilder().setName(name).build();
+ return getBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a budget.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * GetBudgetRequest request = GetBudgetRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * Budget response = budgetServiceClient.getBudget(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 Budget getBudget(GetBudgetRequest request) {
+ return getBudgetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a budget.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * GetBudgetRequest request = GetBudgetRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Budget> future = budgetServiceClient.getBudgetCallable().futureCall(request);
+ * // Do something
+ * Budget response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableWARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * for (Budget element : budgetServiceClient.listBudgets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of billing account to list budgets under. Values are of the form
+ * `billingAccounts/{billingAccountId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBudgetsPagedResponse listBudgets(BillingAccountName parent) {
+ ListBudgetsRequest request =
+ ListBudgetsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBudgets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a list of budgets for a billing account.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * for (Budget element : budgetServiceClient.listBudgets(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. Name of billing account to list budgets under. Values are of the form
+ * `billingAccounts/{billingAccountId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBudgetsPagedResponse listBudgets(String parent) {
+ ListBudgetsRequest request = ListBudgetsRequest.newBuilder().setParent(parent).build();
+ return listBudgets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a list of budgets for a billing account.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * ListBudgetsRequest request = ListBudgetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (Budget element : budgetServiceClient.listBudgets(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 ListBudgetsPagedResponse listBudgets(ListBudgetsRequest request) {
+ return listBudgetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns a list of budgets for a billing account.
+ *
+ * WARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * ListBudgetsRequest request = ListBudgetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListBudgetsPagedResponse> future = budgetServiceClient.listBudgetsPagedCallable().futureCall(request);
+ * // Do something
+ * for (Budget element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableWARNING: There are some fields exposed on the Google Cloud Console that aren't available on + * this API. When reading from the API, you will not see these fields in the return value, though + * they may have been set in the Cloud Console. + * + *
Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * ListBudgetsRequest request = ListBudgetsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListBudgetsResponse response = budgetServiceClient.listBudgetsCallable().call(request);
+ * for (Budget element : response.getBudgetsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * budgetServiceClient.deleteBudget(name);
+ * }
+ *
+ *
+ * @param name Required. Name of the budget to delete. Values are of the form
+ * `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBudget(BudgetName name) {
+ DeleteBudgetRequest request =
+ DeleteBudgetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a budget. Returns successfully if already deleted.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * budgetServiceClient.deleteBudget(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Name of the budget to delete. Values are of the form
+ * `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBudget(String name) {
+ DeleteBudgetRequest request = DeleteBudgetRequest.newBuilder().setName(name).build();
+ deleteBudget(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a budget. Returns successfully if already deleted.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * DeleteBudgetRequest request = DeleteBudgetRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * budgetServiceClient.deleteBudget(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteBudget(DeleteBudgetRequest request) {
+ deleteBudgetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a budget. Returns successfully if already deleted.
+ *
+ * Sample code: + * + *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BudgetName name = BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]");
+ * DeleteBudgetRequest request = DeleteBudgetRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = budgetServiceClient.deleteBudgetCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createBudget to 30 seconds: + * + *
+ *
+ * BudgetServiceSettings.Builder budgetServiceSettingsBuilder =
+ * BudgetServiceSettings.newBuilder();
+ * budgetServiceSettingsBuilder
+ * .createBudgetSettings()
+ * .setRetrySettings(
+ * budgetServiceSettingsBuilder.createBudgetSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * BudgetServiceSettings budgetServiceSettings = budgetServiceSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class BudgetServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * =================== BudgetServiceClient ===================
+ *
+ * Service Description: BudgetService stores Cloud Billing budgets, which define a budget plan
+ * and rules to execute as we track spend against that plan.
+ *
+ * Sample for BudgetServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public abstract class BudgetServiceStub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of createBudget to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator")
+@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+public class GrpcBudgetServiceCallableFactory implements GrpcStubCallableFactory {
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public class GrpcBudgetServiceStub extends BudgetServiceStub {
+
+ private static final MethodDescriptor
+ *
+ */
+@Generated("by gapic-generator")
+package com.google.cloud.billing.budgets.v1;
+
+import javax.annotation.Generated;
diff --git a/google-cloud-billingbudgets/src/main/java/com/google/cloud/billing/budgets/v1/stub/BudgetServiceStub.java b/google-cloud-billingbudgets/src/main/java/com/google/cloud/billing/budgets/v1/stub/BudgetServiceStub.java
new file mode 100644
index 00000000..0072ef6b
--- /dev/null
+++ b/google-cloud-billingbudgets/src/main/java/com/google/cloud/billing/budgets/v1/stub/BudgetServiceStub.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.billing.budgets.v1.stub;
+
+import static com.google.cloud.billing.budgets.v1.BudgetServiceClient.ListBudgetsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.billing.budgets.v1.Budget;
+import com.google.cloud.billing.budgets.v1.CreateBudgetRequest;
+import com.google.cloud.billing.budgets.v1.DeleteBudgetRequest;
+import com.google.cloud.billing.budgets.v1.GetBudgetRequest;
+import com.google.cloud.billing.budgets.v1.ListBudgetsRequest;
+import com.google.cloud.billing.budgets.v1.ListBudgetsResponse;
+import com.google.cloud.billing.budgets.v1.UpdateBudgetRequest;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Base stub class for Cloud Billing Budget API.
+ *
+ *
+ * try (BudgetServiceClient budgetServiceClient = BudgetServiceClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * Budget budget = Budget.newBuilder().build();
+ * Budget response = budgetServiceClient.createBudget(parent, budget);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class BudgetServiceStubSettings extends StubSettings
+ * BudgetServiceStubSettings.Builder budgetServiceSettingsBuilder =
+ * BudgetServiceStubSettings.newBuilder();
+ * budgetServiceSettingsBuilder
+ * .createBudgetSettings()
+ * .setRetrySettings(
+ * budgetServiceSettingsBuilder.createBudgetSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * BudgetServiceStubSettings budgetServiceSettings = budgetServiceSettingsBuilder.build();
+ *
+ *
+ * A budget is a plan that describes what you expect to spend on Cloud + * projects, plus the rules to execute as spend is tracked against that plan, + * (for example, send an alert when 90% of the target spend is met). + * Currently all plans are monthly budgets so the usage period(s) tracked are + * implied (calendar months of usage back-to-back). + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.Budget} + */ +public final class Budget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.Budget) + BudgetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Budget.newBuilder() to construct. + private Budget(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private Budget() { + name_ = ""; + displayName_ = ""; + thresholdRules_ = java.util.Collections.emptyList(); + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Budget(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Budget( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + com.google.cloud.billing.budgets.v1.Filter.Builder subBuilder = null; + if (budgetFilter_ != null) { + subBuilder = budgetFilter_.toBuilder(); + } + budgetFilter_ = + input.readMessage( + com.google.cloud.billing.budgets.v1.Filter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(budgetFilter_); + budgetFilter_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.billing.budgets.v1.BudgetAmount.Builder subBuilder = null; + if (amount_ != null) { + subBuilder = amount_.toBuilder(); + } + amount_ = + input.readMessage( + com.google.cloud.billing.budgets.v1.BudgetAmount.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(amount_); + amount_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + thresholdRules_ = + new java.util.ArrayList
+ * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The name.
+ */
+ @java.lang.Override
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DISPLAY_NAME_FIELD_NUMBER = 2;
+ private volatile java.lang.Object displayName_;
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The displayName.
+ */
+ @java.lang.Override
+ public java.lang.String getDisplayName() {
+ java.lang.Object ref = displayName_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ displayName_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The bytes for displayName.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getDisplayNameBytes() {
+ java.lang.Object ref = displayName_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ displayName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int BUDGET_FILTER_FIELD_NUMBER = 3;
+ private com.google.cloud.billing.budgets.v1.Filter budgetFilter_;
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the budgetFilter field is set.
+ */
+ @java.lang.Override
+ public boolean hasBudgetFilter() {
+ return budgetFilter_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The budgetFilter.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Filter getBudgetFilter() {
+ return budgetFilter_ == null
+ ? com.google.cloud.billing.budgets.v1.Filter.getDefaultInstance()
+ : budgetFilter_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.FilterOrBuilder getBudgetFilterOrBuilder() {
+ return getBudgetFilter();
+ }
+
+ public static final int AMOUNT_FIELD_NUMBER = 4;
+ private com.google.cloud.billing.budgets.v1.BudgetAmount amount_;
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the amount field is set.
+ */
+ @java.lang.Override
+ public boolean hasAmount() {
+ return amount_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The amount.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.BudgetAmount getAmount() {
+ return amount_ == null
+ ? com.google.cloud.billing.budgets.v1.BudgetAmount.getDefaultInstance()
+ : amount_;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder getAmountOrBuilder() {
+ return getAmount();
+ }
+
+ public static final int THRESHOLD_RULES_FIELD_NUMBER = 5;
+ private java.util.List+ * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.List+ * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder>
+ getThresholdRulesOrBuilderList() {
+ return thresholdRules_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public int getThresholdRulesCount() {
+ return thresholdRules_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.ThresholdRule getThresholdRules(int index) {
+ return thresholdRules_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder getThresholdRulesOrBuilder(
+ int index) {
+ return thresholdRules_.get(index);
+ }
+
+ public static final int NOTIFICATIONS_RULE_FIELD_NUMBER = 6;
+ private com.google.cloud.billing.budgets.v1.NotificationsRule notificationsRule_;
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the notificationsRule field is set.
+ */
+ @java.lang.Override
+ public boolean hasNotificationsRule() {
+ return notificationsRule_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The notificationsRule.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.NotificationsRule getNotificationsRule() {
+ return notificationsRule_ == null
+ ? com.google.cloud.billing.budgets.v1.NotificationsRule.getDefaultInstance()
+ : notificationsRule_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder
+ getNotificationsRuleOrBuilder() {
+ return getNotificationsRule();
+ }
+
+ public static final int ETAG_FIELD_NUMBER = 7;
+ private volatile java.lang.Object etag_;
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.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. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for etag.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getEtagBytes() {
+ java.lang.Object ref = etag_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ etag_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!getNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
+ }
+ if (!getDisplayNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
+ }
+ if (budgetFilter_ != null) {
+ output.writeMessage(3, getBudgetFilter());
+ }
+ if (amount_ != null) {
+ output.writeMessage(4, getAmount());
+ }
+ for (int i = 0; i < thresholdRules_.size(); i++) {
+ output.writeMessage(5, thresholdRules_.get(i));
+ }
+ if (notificationsRule_ != null) {
+ output.writeMessage(6, getNotificationsRule());
+ }
+ if (!getEtagBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 7, etag_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
+ }
+ if (!getDisplayNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_);
+ }
+ if (budgetFilter_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBudgetFilter());
+ }
+ if (amount_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAmount());
+ }
+ for (int i = 0; i < thresholdRules_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, thresholdRules_.get(i));
+ }
+ if (notificationsRule_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getNotificationsRule());
+ }
+ if (!getEtagBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, etag_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.Budget)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.Budget other =
+ (com.google.cloud.billing.budgets.v1.Budget) obj;
+
+ if (!getName().equals(other.getName())) return false;
+ if (!getDisplayName().equals(other.getDisplayName())) return false;
+ if (hasBudgetFilter() != other.hasBudgetFilter()) return false;
+ if (hasBudgetFilter()) {
+ if (!getBudgetFilter().equals(other.getBudgetFilter())) return false;
+ }
+ if (hasAmount() != other.hasAmount()) return false;
+ if (hasAmount()) {
+ if (!getAmount().equals(other.getAmount())) return false;
+ }
+ if (!getThresholdRulesList().equals(other.getThresholdRulesList())) return false;
+ if (hasNotificationsRule() != other.hasNotificationsRule()) return false;
+ if (hasNotificationsRule()) {
+ if (!getNotificationsRule().equals(other.getNotificationsRule())) return false;
+ }
+ if (!getEtag().equals(other.getEtag())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getDisplayName().hashCode();
+ if (hasBudgetFilter()) {
+ hash = (37 * hash) + BUDGET_FILTER_FIELD_NUMBER;
+ hash = (53 * hash) + getBudgetFilter().hashCode();
+ }
+ if (hasAmount()) {
+ hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getAmount().hashCode();
+ }
+ if (getThresholdRulesCount() > 0) {
+ hash = (37 * hash) + THRESHOLD_RULES_FIELD_NUMBER;
+ hash = (53 * hash) + getThresholdRulesList().hashCode();
+ }
+ if (hasNotificationsRule()) {
+ hash = (37 * hash) + NOTIFICATIONS_RULE_FIELD_NUMBER;
+ hash = (53 * hash) + getNotificationsRule().hashCode();
+ }
+ hash = (37 * hash) + ETAG_FIELD_NUMBER;
+ hash = (53 * hash) + getEtag().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.cloud.billing.budgets.v1.Budget prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ * + * A budget is a plan that describes what you expect to spend on Cloud + * projects, plus the rules to execute as spend is tracked against that plan, + * (for example, send an alert when 90% of the target spend is met). + * Currently all plans are monthly budgets so the usage period(s) tracked are + * implied (calendar months of usage back-to-back). + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.Budget} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The name.
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The bytes for name.
+ */
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @param value The name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @param value The bytes for name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object displayName_ = "";
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The displayName.
+ */
+ public java.lang.String getDisplayName() {
+ java.lang.Object ref = displayName_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ displayName_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The bytes for displayName.
+ */
+ public com.google.protobuf.ByteString getDisplayNameBytes() {
+ java.lang.Object ref = displayName_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ displayName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @param value The displayName to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDisplayName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ displayName_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDisplayName() {
+
+ displayName_ = getDefaultInstance().getDisplayName();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @param value The bytes for displayName to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ displayName_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.billing.budgets.v1.Filter budgetFilter_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Filter,
+ com.google.cloud.billing.budgets.v1.Filter.Builder,
+ com.google.cloud.billing.budgets.v1.FilterOrBuilder>
+ budgetFilterBuilder_;
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the budgetFilter field is set.
+ */
+ public boolean hasBudgetFilter() {
+ return budgetFilterBuilder_ != null || budgetFilter_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The budgetFilter.
+ */
+ public com.google.cloud.billing.budgets.v1.Filter getBudgetFilter() {
+ if (budgetFilterBuilder_ == null) {
+ return budgetFilter_ == null
+ ? com.google.cloud.billing.budgets.v1.Filter.getDefaultInstance()
+ : budgetFilter_;
+ } else {
+ return budgetFilterBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setBudgetFilter(com.google.cloud.billing.budgets.v1.Filter value) {
+ if (budgetFilterBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ budgetFilter_ = value;
+ onChanged();
+ } else {
+ budgetFilterBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setBudgetFilter(
+ com.google.cloud.billing.budgets.v1.Filter.Builder builderForValue) {
+ if (budgetFilterBuilder_ == null) {
+ budgetFilter_ = builderForValue.build();
+ onChanged();
+ } else {
+ budgetFilterBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder mergeBudgetFilter(com.google.cloud.billing.budgets.v1.Filter value) {
+ if (budgetFilterBuilder_ == null) {
+ if (budgetFilter_ != null) {
+ budgetFilter_ =
+ com.google.cloud.billing.budgets.v1.Filter.newBuilder(budgetFilter_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ budgetFilter_ = value;
+ }
+ onChanged();
+ } else {
+ budgetFilterBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearBudgetFilter() {
+ if (budgetFilterBuilder_ == null) {
+ budgetFilter_ = null;
+ onChanged();
+ } else {
+ budgetFilter_ = null;
+ budgetFilterBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.Filter.Builder getBudgetFilterBuilder() {
+
+ onChanged();
+ return getBudgetFilterFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.FilterOrBuilder getBudgetFilterOrBuilder() {
+ if (budgetFilterBuilder_ != null) {
+ return budgetFilterBuilder_.getMessageOrBuilder();
+ } else {
+ return budgetFilter_ == null
+ ? com.google.cloud.billing.budgets.v1.Filter.getDefaultInstance()
+ : budgetFilter_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Filter,
+ com.google.cloud.billing.budgets.v1.Filter.Builder,
+ com.google.cloud.billing.budgets.v1.FilterOrBuilder>
+ getBudgetFilterFieldBuilder() {
+ if (budgetFilterBuilder_ == null) {
+ budgetFilterBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Filter,
+ com.google.cloud.billing.budgets.v1.Filter.Builder,
+ com.google.cloud.billing.budgets.v1.FilterOrBuilder>(
+ getBudgetFilter(), getParentForChildren(), isClean());
+ budgetFilter_ = null;
+ }
+ return budgetFilterBuilder_;
+ }
+
+ private com.google.cloud.billing.budgets.v1.BudgetAmount amount_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.BudgetAmount,
+ com.google.cloud.billing.budgets.v1.BudgetAmount.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder>
+ amountBuilder_;
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the amount field is set.
+ */
+ public boolean hasAmount() {
+ return amountBuilder_ != null || amount_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The amount.
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetAmount getAmount() {
+ if (amountBuilder_ == null) {
+ return amount_ == null
+ ? com.google.cloud.billing.budgets.v1.BudgetAmount.getDefaultInstance()
+ : amount_;
+ } else {
+ return amountBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setAmount(com.google.cloud.billing.budgets.v1.BudgetAmount value) {
+ if (amountBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ amount_ = value;
+ onChanged();
+ } else {
+ amountBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setAmount(
+ com.google.cloud.billing.budgets.v1.BudgetAmount.Builder builderForValue) {
+ if (amountBuilder_ == null) {
+ amount_ = builderForValue.build();
+ onChanged();
+ } else {
+ amountBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder mergeAmount(com.google.cloud.billing.budgets.v1.BudgetAmount value) {
+ if (amountBuilder_ == null) {
+ if (amount_ != null) {
+ amount_ =
+ com.google.cloud.billing.budgets.v1.BudgetAmount.newBuilder(amount_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ amount_ = value;
+ }
+ onChanged();
+ } else {
+ amountBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearAmount() {
+ if (amountBuilder_ == null) {
+ amount_ = null;
+ onChanged();
+ } else {
+ amount_ = null;
+ amountBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetAmount.Builder getAmountBuilder() {
+
+ onChanged();
+ return getAmountFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder getAmountOrBuilder() {
+ if (amountBuilder_ != null) {
+ return amountBuilder_.getMessageOrBuilder();
+ } else {
+ return amount_ == null
+ ? com.google.cloud.billing.budgets.v1.BudgetAmount.getDefaultInstance()
+ : amount_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.BudgetAmount,
+ com.google.cloud.billing.budgets.v1.BudgetAmount.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder>
+ getAmountFieldBuilder() {
+ if (amountBuilder_ == null) {
+ amountBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.BudgetAmount,
+ com.google.cloud.billing.budgets.v1.BudgetAmount.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder>(
+ getAmount(), getParentForChildren(), isClean());
+ amount_ = null;
+ }
+ return amountBuilder_;
+ }
+
+ private java.util.List+ * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List+ * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public int getThresholdRulesCount() {
+ if (thresholdRulesBuilder_ == null) {
+ return thresholdRules_.size();
+ } else {
+ return thresholdRulesBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.ThresholdRule getThresholdRules(int index) {
+ if (thresholdRulesBuilder_ == null) {
+ return thresholdRules_.get(index);
+ } else {
+ return thresholdRulesBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setThresholdRules(
+ int index, com.google.cloud.billing.budgets.v1.ThresholdRule value) {
+ if (thresholdRulesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.set(index, value);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setThresholdRules(
+ int index, com.google.cloud.billing.budgets.v1.ThresholdRule.Builder builderForValue) {
+ if (thresholdRulesBuilder_ == null) {
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addThresholdRules(com.google.cloud.billing.budgets.v1.ThresholdRule value) {
+ if (thresholdRulesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.add(value);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addThresholdRules(
+ int index, com.google.cloud.billing.budgets.v1.ThresholdRule value) {
+ if (thresholdRulesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.add(index, value);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addThresholdRules(
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Builder builderForValue) {
+ if (thresholdRulesBuilder_ == null) {
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.add(builderForValue.build());
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addThresholdRules(
+ int index, com.google.cloud.billing.budgets.v1.ThresholdRule.Builder builderForValue) {
+ if (thresholdRulesBuilder_ == null) {
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder addAllThresholdRules(
+ java.lang.Iterable extends com.google.cloud.billing.budgets.v1.ThresholdRule> values) {
+ if (thresholdRulesBuilder_ == null) {
+ ensureThresholdRulesIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, thresholdRules_);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearThresholdRules() {
+ if (thresholdRulesBuilder_ == null) {
+ thresholdRules_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder removeThresholdRules(int index) {
+ if (thresholdRulesBuilder_ == null) {
+ ensureThresholdRulesIsMutable();
+ thresholdRules_.remove(index);
+ onChanged();
+ } else {
+ thresholdRulesBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.ThresholdRule.Builder getThresholdRulesBuilder(
+ int index) {
+ return getThresholdRulesFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder getThresholdRulesOrBuilder(
+ int index) {
+ if (thresholdRulesBuilder_ == null) {
+ return thresholdRules_.get(index);
+ } else {
+ return thresholdRulesBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List extends com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder>
+ getThresholdRulesOrBuilderList() {
+ if (thresholdRulesBuilder_ != null) {
+ return thresholdRulesBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(thresholdRules_);
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.ThresholdRule.Builder addThresholdRulesBuilder() {
+ return getThresholdRulesFieldBuilder()
+ .addBuilder(com.google.cloud.billing.budgets.v1.ThresholdRule.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.ThresholdRule.Builder addThresholdRulesBuilder(
+ int index) {
+ return getThresholdRulesFieldBuilder()
+ .addBuilder(
+ index, com.google.cloud.billing.budgets.v1.ThresholdRule.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public java.util.List+ * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the notificationsRule field is set.
+ */
+ public boolean hasNotificationsRule() {
+ return notificationsRuleBuilder_ != null || notificationsRule_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The notificationsRule.
+ */
+ public com.google.cloud.billing.budgets.v1.NotificationsRule getNotificationsRule() {
+ if (notificationsRuleBuilder_ == null) {
+ return notificationsRule_ == null
+ ? com.google.cloud.billing.budgets.v1.NotificationsRule.getDefaultInstance()
+ : notificationsRule_;
+ } else {
+ return notificationsRuleBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setNotificationsRule(
+ com.google.cloud.billing.budgets.v1.NotificationsRule value) {
+ if (notificationsRuleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ notificationsRule_ = value;
+ onChanged();
+ } else {
+ notificationsRuleBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setNotificationsRule(
+ com.google.cloud.billing.budgets.v1.NotificationsRule.Builder builderForValue) {
+ if (notificationsRuleBuilder_ == null) {
+ notificationsRule_ = builderForValue.build();
+ onChanged();
+ } else {
+ notificationsRuleBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder mergeNotificationsRule(
+ com.google.cloud.billing.budgets.v1.NotificationsRule value) {
+ if (notificationsRuleBuilder_ == null) {
+ if (notificationsRule_ != null) {
+ notificationsRule_ =
+ com.google.cloud.billing.budgets.v1.NotificationsRule.newBuilder(notificationsRule_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ notificationsRule_ = value;
+ }
+ onChanged();
+ } else {
+ notificationsRuleBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearNotificationsRule() {
+ if (notificationsRuleBuilder_ == null) {
+ notificationsRule_ = null;
+ onChanged();
+ } else {
+ notificationsRule_ = null;
+ notificationsRuleBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.NotificationsRule.Builder
+ getNotificationsRuleBuilder() {
+
+ onChanged();
+ return getNotificationsRuleFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder
+ getNotificationsRuleOrBuilder() {
+ if (notificationsRuleBuilder_ != null) {
+ return notificationsRuleBuilder_.getMessageOrBuilder();
+ } else {
+ return notificationsRule_ == null
+ ? com.google.cloud.billing.budgets.v1.NotificationsRule.getDefaultInstance()
+ : notificationsRule_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.NotificationsRule,
+ com.google.cloud.billing.budgets.v1.NotificationsRule.Builder,
+ com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder>
+ getNotificationsRuleFieldBuilder() {
+ if (notificationsRuleBuilder_ == null) {
+ notificationsRuleBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.NotificationsRule,
+ com.google.cloud.billing.budgets.v1.NotificationsRule.Builder,
+ com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder>(
+ getNotificationsRule(), getParentForChildren(), isClean());
+ notificationsRule_ = null;
+ }
+ return notificationsRuleBuilder_;
+ }
+
+ private java.lang.Object etag_ = "";
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.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. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.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. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The etag to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEtag(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ etag_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearEtag() {
+
+ etag_ = getDefaultInstance().getEtag();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes for etag to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEtagBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ etag_ = value;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.Budget)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.Budget)
+ private static final com.google.cloud.billing.budgets.v1.Budget DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.Budget();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.Budget getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The budgeted amount for each usage period. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.BudgetAmount} + */ +public final class BudgetAmount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.BudgetAmount) + BudgetAmountOrBuilder { + private static final long serialVersionUID = 0L; + // Use BudgetAmount.newBuilder() to construct. + private BudgetAmount(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private BudgetAmount() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BudgetAmount(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BudgetAmount( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.type.Money.Builder subBuilder = null; + if (budgetAmountCase_ == 1) { + subBuilder = ((com.google.type.Money) budgetAmount_).toBuilder(); + } + budgetAmount_ = input.readMessage(com.google.type.Money.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.type.Money) budgetAmount_); + budgetAmount_ = subBuilder.buildPartial(); + } + budgetAmountCase_ = 1; + break; + } + case 18: + { + com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder subBuilder = null; + if (budgetAmountCase_ == 2) { + subBuilder = + ((com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_) + .toBuilder(); + } + budgetAmount_ = + input.readMessage( + com.google.cloud.billing.budgets.v1.LastPeriodAmount.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_); + budgetAmount_ = subBuilder.buildPartial(); + } + budgetAmountCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_BudgetAmount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_BudgetAmount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.BudgetAmount.class, + com.google.cloud.billing.budgets.v1.BudgetAmount.Builder.class); + } + + private int budgetAmountCase_ = 0; + private java.lang.Object budgetAmount_; + + public enum BudgetAmountCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SPECIFIED_AMOUNT(1), + LAST_PERIOD_AMOUNT(2), + BUDGETAMOUNT_NOT_SET(0); + private final int value; + + private BudgetAmountCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BudgetAmountCase valueOf(int value) { + return forNumber(value); + } + + public static BudgetAmountCase forNumber(int value) { + switch (value) { + case 1: + return SPECIFIED_AMOUNT; + case 2: + return LAST_PERIOD_AMOUNT; + case 0: + return BUDGETAMOUNT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public BudgetAmountCase getBudgetAmountCase() { + return BudgetAmountCase.forNumber(budgetAmountCase_); + } + + public static final int SPECIFIED_AMOUNT_FIELD_NUMBER = 1; + /** + * + * + *
+ * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return Whether the specifiedAmount field is set.
+ */
+ @java.lang.Override
+ public boolean hasSpecifiedAmount() {
+ return budgetAmountCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return The specifiedAmount.
+ */
+ @java.lang.Override
+ public com.google.type.Money getSpecifiedAmount() {
+ if (budgetAmountCase_ == 1) {
+ return (com.google.type.Money) budgetAmount_;
+ }
+ return com.google.type.Money.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ @java.lang.Override
+ public com.google.type.MoneyOrBuilder getSpecifiedAmountOrBuilder() {
+ if (budgetAmountCase_ == 1) {
+ return (com.google.type.Money) budgetAmount_;
+ }
+ return com.google.type.Money.getDefaultInstance();
+ }
+
+ public static final int LAST_PERIOD_AMOUNT_FIELD_NUMBER = 2;
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return Whether the lastPeriodAmount field is set.
+ */
+ @java.lang.Override
+ public boolean hasLastPeriodAmount() {
+ return budgetAmountCase_ == 2;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return The lastPeriodAmount.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.LastPeriodAmount getLastPeriodAmount() {
+ if (budgetAmountCase_ == 2) {
+ return (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_;
+ }
+ return com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder
+ getLastPeriodAmountOrBuilder() {
+ if (budgetAmountCase_ == 2) {
+ return (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_;
+ }
+ return com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (budgetAmountCase_ == 1) {
+ output.writeMessage(1, (com.google.type.Money) budgetAmount_);
+ }
+ if (budgetAmountCase_ == 2) {
+ output.writeMessage(2, (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (budgetAmountCase_ == 1) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 1, (com.google.type.Money) budgetAmount_);
+ }
+ if (budgetAmountCase_ == 2) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 2, (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.BudgetAmount)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.BudgetAmount other =
+ (com.google.cloud.billing.budgets.v1.BudgetAmount) obj;
+
+ if (!getBudgetAmountCase().equals(other.getBudgetAmountCase())) return false;
+ switch (budgetAmountCase_) {
+ case 1:
+ if (!getSpecifiedAmount().equals(other.getSpecifiedAmount())) return false;
+ break;
+ case 2:
+ if (!getLastPeriodAmount().equals(other.getLastPeriodAmount())) return false;
+ break;
+ case 0:
+ default:
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ switch (budgetAmountCase_) {
+ case 1:
+ hash = (37 * hash) + SPECIFIED_AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getSpecifiedAmount().hashCode();
+ break;
+ case 2:
+ hash = (37 * hash) + LAST_PERIOD_AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getLastPeriodAmount().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.cloud.billing.budgets.v1.BudgetAmount 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 budgeted amount for each usage period. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.BudgetAmount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return Whether the specifiedAmount field is set.
+ */
+ @java.lang.Override
+ public boolean hasSpecifiedAmount() {
+ return budgetAmountCase_ == 1;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return The specifiedAmount.
+ */
+ @java.lang.Override
+ public com.google.type.Money getSpecifiedAmount() {
+ if (specifiedAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 1) {
+ return (com.google.type.Money) budgetAmount_;
+ }
+ return com.google.type.Money.getDefaultInstance();
+ } else {
+ if (budgetAmountCase_ == 1) {
+ return specifiedAmountBuilder_.getMessage();
+ }
+ return com.google.type.Money.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ public Builder setSpecifiedAmount(com.google.type.Money value) {
+ if (specifiedAmountBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ budgetAmount_ = value;
+ onChanged();
+ } else {
+ specifiedAmountBuilder_.setMessage(value);
+ }
+ budgetAmountCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ public Builder setSpecifiedAmount(com.google.type.Money.Builder builderForValue) {
+ if (specifiedAmountBuilder_ == null) {
+ budgetAmount_ = builderForValue.build();
+ onChanged();
+ } else {
+ specifiedAmountBuilder_.setMessage(builderForValue.build());
+ }
+ budgetAmountCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ public Builder mergeSpecifiedAmount(com.google.type.Money value) {
+ if (specifiedAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 1 && budgetAmount_ != com.google.type.Money.getDefaultInstance()) {
+ budgetAmount_ =
+ com.google.type.Money.newBuilder((com.google.type.Money) budgetAmount_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ budgetAmount_ = value;
+ }
+ onChanged();
+ } else {
+ if (budgetAmountCase_ == 1) {
+ specifiedAmountBuilder_.mergeFrom(value);
+ }
+ specifiedAmountBuilder_.setMessage(value);
+ }
+ budgetAmountCase_ = 1;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ public Builder clearSpecifiedAmount() {
+ if (specifiedAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 1) {
+ budgetAmountCase_ = 0;
+ budgetAmount_ = null;
+ onChanged();
+ }
+ } else {
+ if (budgetAmountCase_ == 1) {
+ budgetAmountCase_ = 0;
+ budgetAmount_ = null;
+ }
+ specifiedAmountBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ public com.google.type.Money.Builder getSpecifiedAmountBuilder() {
+ return getSpecifiedAmountFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ @java.lang.Override
+ public com.google.type.MoneyOrBuilder getSpecifiedAmountOrBuilder() {
+ if ((budgetAmountCase_ == 1) && (specifiedAmountBuilder_ != null)) {
+ return specifiedAmountBuilder_.getMessageOrBuilder();
+ } else {
+ if (budgetAmountCase_ == 1) {
+ return (com.google.type.Money) budgetAmount_;
+ }
+ return com.google.type.Money.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder>
+ getSpecifiedAmountFieldBuilder() {
+ if (specifiedAmountBuilder_ == null) {
+ if (!(budgetAmountCase_ == 1)) {
+ budgetAmount_ = com.google.type.Money.getDefaultInstance();
+ }
+ specifiedAmountBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Money,
+ com.google.type.Money.Builder,
+ com.google.type.MoneyOrBuilder>(
+ (com.google.type.Money) budgetAmount_, getParentForChildren(), isClean());
+ budgetAmount_ = null;
+ }
+ budgetAmountCase_ = 1;
+ onChanged();
+ ;
+ return specifiedAmountBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder>
+ lastPeriodAmountBuilder_;
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return Whether the lastPeriodAmount field is set.
+ */
+ @java.lang.Override
+ public boolean hasLastPeriodAmount() {
+ return budgetAmountCase_ == 2;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return The lastPeriodAmount.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.LastPeriodAmount getLastPeriodAmount() {
+ if (lastPeriodAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 2) {
+ return (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_;
+ }
+ return com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ } else {
+ if (budgetAmountCase_ == 2) {
+ return lastPeriodAmountBuilder_.getMessage();
+ }
+ return com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ public Builder setLastPeriodAmount(com.google.cloud.billing.budgets.v1.LastPeriodAmount value) {
+ if (lastPeriodAmountBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ budgetAmount_ = value;
+ onChanged();
+ } else {
+ lastPeriodAmountBuilder_.setMessage(value);
+ }
+ budgetAmountCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ public Builder setLastPeriodAmount(
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder builderForValue) {
+ if (lastPeriodAmountBuilder_ == null) {
+ budgetAmount_ = builderForValue.build();
+ onChanged();
+ } else {
+ lastPeriodAmountBuilder_.setMessage(builderForValue.build());
+ }
+ budgetAmountCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ public Builder mergeLastPeriodAmount(
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount value) {
+ if (lastPeriodAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 2
+ && budgetAmount_
+ != com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance()) {
+ budgetAmount_ =
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount.newBuilder(
+ (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ budgetAmount_ = value;
+ }
+ onChanged();
+ } else {
+ if (budgetAmountCase_ == 2) {
+ lastPeriodAmountBuilder_.mergeFrom(value);
+ }
+ lastPeriodAmountBuilder_.setMessage(value);
+ }
+ budgetAmountCase_ = 2;
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ public Builder clearLastPeriodAmount() {
+ if (lastPeriodAmountBuilder_ == null) {
+ if (budgetAmountCase_ == 2) {
+ budgetAmountCase_ = 0;
+ budgetAmount_ = null;
+ onChanged();
+ }
+ } else {
+ if (budgetAmountCase_ == 2) {
+ budgetAmountCase_ = 0;
+ budgetAmount_ = null;
+ }
+ lastPeriodAmountBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ public com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder
+ getLastPeriodAmountBuilder() {
+ return getLastPeriodAmountFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder
+ getLastPeriodAmountOrBuilder() {
+ if ((budgetAmountCase_ == 2) && (lastPeriodAmountBuilder_ != null)) {
+ return lastPeriodAmountBuilder_.getMessageOrBuilder();
+ } else {
+ if (budgetAmountCase_ == 2) {
+ return (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_;
+ }
+ return com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ }
+ }
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder>
+ getLastPeriodAmountFieldBuilder() {
+ if (lastPeriodAmountBuilder_ == null) {
+ if (!(budgetAmountCase_ == 2)) {
+ budgetAmount_ = com.google.cloud.billing.budgets.v1.LastPeriodAmount.getDefaultInstance();
+ }
+ lastPeriodAmountBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder,
+ com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder>(
+ (com.google.cloud.billing.budgets.v1.LastPeriodAmount) budgetAmount_,
+ getParentForChildren(),
+ isClean());
+ budgetAmount_ = null;
+ }
+ budgetAmountCase_ = 2;
+ onChanged();
+ ;
+ return lastPeriodAmountBuilder_;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.BudgetAmount)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.BudgetAmount)
+ private static final com.google.cloud.billing.budgets.v1.BudgetAmount DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.BudgetAmount();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.BudgetAmount getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return Whether the specifiedAmount field is set.
+ */
+ boolean hasSpecifiedAmount();
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ *
+ * @return The specifiedAmount.
+ */
+ com.google.type.Money getSpecifiedAmount();
+ /**
+ *
+ *
+ * + * A specified amount to use as the budget. + * `currency_code` is optional. If specified, it must match the + * currency of the billing account. The `currency_code` is provided on + * output. + *+ * + *
.google.type.Money specified_amount = 1;
+ */
+ com.google.type.MoneyOrBuilder getSpecifiedAmountOrBuilder();
+
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return Whether the lastPeriodAmount field is set.
+ */
+ boolean hasLastPeriodAmount();
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ *
+ * @return The lastPeriodAmount.
+ */
+ com.google.cloud.billing.budgets.v1.LastPeriodAmount getLastPeriodAmount();
+ /**
+ *
+ *
+ * + * Use the last period's actual spend as the budget for the present period. + *+ * + *
.google.cloud.billing.budgets.v1.LastPeriodAmount last_period_amount = 2;
+ */
+ com.google.cloud.billing.budgets.v1.LastPeriodAmountOrBuilder getLastPeriodAmountOrBuilder();
+
+ public com.google.cloud.billing.budgets.v1.BudgetAmount.BudgetAmountCase getBudgetAmountCase();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetModelProto.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetModelProto.java
new file mode 100644
index 00000000..056668d6
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetModelProto.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_model.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+public final class BudgetModelProto {
+ private BudgetModelProto() {}
+
+ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
+
+ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_Budget_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_Budget_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_BudgetAmount_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_BudgetAmount_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_ThresholdRule_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_ThresholdRule_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_NotificationsRule_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_Filter_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_Filter_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_Filter_LabelsEntry_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_Filter_LabelsEntry_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
+
+ static {
+ java.lang.String[] descriptorData = {
+ "\n2google/cloud/billing/budgets/v1/budget"
+ + "_model.proto\022\037google.cloud.billing.budge"
+ + "ts.v1\032\037google/api/field_behavior.proto\032\031"
+ + "google/api/resource.proto\032\034google/protob"
+ + "uf/struct.proto\032\027google/type/money.proto"
+ + "\"\317\003\n\006Budget\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024\n\014displa"
+ + "y_name\030\002 \001(\t\022C\n\rbudget_filter\030\003 \001(\0132\'.go"
+ + "ogle.cloud.billing.budgets.v1.FilterB\003\340A"
+ + "\001\022B\n\006amount\030\004 \001(\0132-.google.cloud.billing"
+ + ".budgets.v1.BudgetAmountB\003\340A\002\022L\n\017thresho"
+ + "ld_rules\030\005 \003(\0132..google.cloud.billing.bu"
+ + "dgets.v1.ThresholdRuleB\003\340A\001\022S\n\022notificat"
+ + "ions_rule\030\006 \001(\01322.google.cloud.billing.b"
+ + "udgets.v1.NotificationsRuleB\003\340A\001\022\021\n\004etag"
+ + "\030\007 \001(\tB\003\340A\001:]\352AZ\n$billingbudgets.googlea"
+ + "pis.com/Budget\0222billingAccounts/{billing"
+ + "_account}/budgets/{budget}\"\240\001\n\014BudgetAmo"
+ + "unt\022.\n\020specified_amount\030\001 \001(\0132\022.google.t"
+ + "ype.MoneyH\000\022O\n\022last_period_amount\030\002 \001(\0132"
+ + "1.google.cloud.billing.budgets.v1.LastPe"
+ + "riodAmountH\000B\017\n\rbudget_amount\"\022\n\020LastPer"
+ + "iodAmount\"\310\001\n\rThresholdRule\022\036\n\021threshold"
+ + "_percent\030\001 \001(\001B\003\340A\002\022N\n\013spend_basis\030\002 \001(\016"
+ + "24.google.cloud.billing.budgets.v1.Thres"
+ + "holdRule.BasisB\003\340A\001\"G\n\005Basis\022\025\n\021BASIS_UN"
+ + "SPECIFIED\020\000\022\021\n\rCURRENT_SPEND\020\001\022\024\n\020FORECA"
+ + "STED_SPEND\020\002\"\247\001\n\021NotificationsRule\022\031\n\014pu"
+ + "bsub_topic\030\001 \001(\tB\003\340A\001\022\033\n\016schema_version\030"
+ + "\002 \001(\tB\003\340A\001\022-\n monitoring_notification_ch"
+ + "annels\030\003 \003(\tB\003\340A\001\022+\n\036disable_default_iam"
+ + "_recipients\030\004 \001(\010B\003\340A\001\"\365\003\n\006Filter\022\025\n\010pro"
+ + "jects\030\001 \003(\tB\003\340A\001\022\031\n\014credit_types\030\007 \003(\tB\003"
+ + "\340A\001\022a\n\026credit_types_treatment\030\004 \001(\0162<.go"
+ + "ogle.cloud.billing.budgets.v1.Filter.Cre"
+ + "ditTypesTreatmentB\003\340A\001\022\025\n\010services\030\003 \003(\t"
+ + "B\003\340A\001\022\030\n\013subaccounts\030\005 \003(\tB\003\340A\001\022H\n\006label"
+ + "s\030\006 \003(\01323.google.cloud.billing.budgets.v"
+ + "1.Filter.LabelsEntryB\003\340A\001\032I\n\013LabelsEntry"
+ + "\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.google.pr"
+ + "otobuf.ListValue:\0028\001\"\217\001\n\024CreditTypesTrea"
+ + "tment\022&\n\"CREDIT_TYPES_TREATMENT_UNSPECIF"
+ + "IED\020\000\022\027\n\023INCLUDE_ALL_CREDITS\020\001\022\027\n\023EXCLUD"
+ + "E_ALL_CREDITS\020\002\022\035\n\031INCLUDE_SPECIFIED_CRE"
+ + "DITS\020\003B\201\001\n#com.google.cloud.billing.budg"
+ + "ets.v1B\020BudgetModelProtoP\001ZFgoogle.golan"
+ + "g.org/genproto/googleapis/cloud/billing/"
+ + "budgets/v1;budgetsb\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.StructProto.getDescriptor(),
+ com.google.type.MoneyProto.getDescriptor(),
+ });
+ internal_static_google_cloud_billing_budgets_v1_Budget_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_google_cloud_billing_budgets_v1_Budget_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_Budget_descriptor,
+ new java.lang.String[] {
+ "Name",
+ "DisplayName",
+ "BudgetFilter",
+ "Amount",
+ "ThresholdRules",
+ "NotificationsRule",
+ "Etag",
+ });
+ internal_static_google_cloud_billing_budgets_v1_BudgetAmount_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_google_cloud_billing_budgets_v1_BudgetAmount_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_BudgetAmount_descriptor,
+ new java.lang.String[] {
+ "SpecifiedAmount", "LastPeriodAmount", "BudgetAmount",
+ });
+ internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_descriptor,
+ new java.lang.String[] {});
+ internal_static_google_cloud_billing_budgets_v1_ThresholdRule_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_google_cloud_billing_budgets_v1_ThresholdRule_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_ThresholdRule_descriptor,
+ new java.lang.String[] {
+ "ThresholdPercent", "SpendBasis",
+ });
+ internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_google_cloud_billing_budgets_v1_NotificationsRule_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor,
+ new java.lang.String[] {
+ "PubsubTopic",
+ "SchemaVersion",
+ "MonitoringNotificationChannels",
+ "DisableDefaultIamRecipients",
+ });
+ internal_static_google_cloud_billing_budgets_v1_Filter_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_google_cloud_billing_budgets_v1_Filter_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_Filter_descriptor,
+ new java.lang.String[] {
+ "Projects",
+ "CreditTypes",
+ "CreditTypesTreatment",
+ "Services",
+ "Subaccounts",
+ "Labels",
+ });
+ internal_static_google_cloud_billing_budgets_v1_Filter_LabelsEntry_descriptor =
+ internal_static_google_cloud_billing_budgets_v1_Filter_descriptor.getNestedTypes().get(0);
+ internal_static_google_cloud_billing_budgets_v1_Filter_LabelsEntry_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_Filter_LabelsEntry_descriptor,
+ new java.lang.String[] {
+ "Key", "Value",
+ });
+ com.google.protobuf.ExtensionRegistry registry =
+ com.google.protobuf.ExtensionRegistry.newInstance();
+ registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
+ registry.add(com.google.api.ResourceProto.resource);
+ com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
+ descriptor, registry);
+ com.google.api.FieldBehaviorProto.getDescriptor();
+ com.google.api.ResourceProto.getDescriptor();
+ com.google.protobuf.StructProto.getDescriptor();
+ com.google.type.MoneyProto.getDescriptor();
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetName.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetName.java
new file mode 100644
index 00000000..e7b6d62e
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetName.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.billing.budgets.v1;
+
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/** AUTO-GENERATED DOCUMENTATION AND CLASS */
+@javax.annotation.Generated("by GAPIC protoc plugin")
+public class BudgetName implements ResourceName {
+
+ private static final PathTemplate PATH_TEMPLATE =
+ PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/budgets/{budget}");
+
+ private volatile Map+ * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+ /**
+ *
+ *
+ * + * Output only. Resource name of the budget. + * The resource name implies the scope of a budget. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ *
+ * @return The bytes for name.
+ */
+ com.google.protobuf.ByteString getNameBytes();
+
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The displayName.
+ */
+ java.lang.String getDisplayName();
+ /**
+ *
+ *
+ * + * User data for display name in UI. The name must be less than or equal to 60 + * characters. + *+ * + *
string display_name = 2;
+ *
+ * @return The bytes for displayName.
+ */
+ com.google.protobuf.ByteString getDisplayNameBytes();
+
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the budgetFilter field is set.
+ */
+ boolean hasBudgetFilter();
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The budgetFilter.
+ */
+ com.google.cloud.billing.budgets.v1.Filter getBudgetFilter();
+ /**
+ *
+ *
+ * + * Optional. Filters that define which resources are used to compute + * the actual spend against the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.FilterOrBuilder getBudgetFilterOrBuilder();
+
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the amount field is set.
+ */
+ boolean hasAmount();
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The amount.
+ */
+ com.google.cloud.billing.budgets.v1.BudgetAmount getAmount();
+ /**
+ *
+ *
+ * + * Required. Budgeted amount. + *+ * + *
+ * .google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.BudgetAmountOrBuilder getAmountOrBuilder();
+
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ java.util.List+ * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.ThresholdRule getThresholdRules(int index);
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ int getThresholdRulesCount();
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ java.util.List extends com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder>
+ getThresholdRulesOrBuilderList();
+ /**
+ *
+ *
+ * + * Optional. Rules that trigger alerts (notifications of thresholds + * being crossed) when spend exceeds the specified percentages of the budget. + *+ * + *
+ * repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder getThresholdRulesOrBuilder(int index);
+
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the notificationsRule field is set.
+ */
+ boolean hasNotificationsRule();
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The notificationsRule.
+ */
+ com.google.cloud.billing.budgets.v1.NotificationsRule getNotificationsRule();
+ /**
+ *
+ *
+ * + * Optional. Rules to apply to notifications sent based on budget spend and + * thresholds. + *+ * + *
+ * .google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.NotificationsRuleOrBuilder getNotificationsRuleOrBuilder();
+
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The etag.
+ */
+ java.lang.String getEtag();
+ /**
+ *
+ *
+ * + * Optional. Etag to validate that the object is unchanged for a + * read-modify-write operation. + * An empty etag will cause an update to overwrite other changes. + *+ * + *
string etag = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for etag.
+ */
+ com.google.protobuf.ByteString getEtagBytes();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetServiceProto.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetServiceProto.java
new file mode 100644
index 00000000..0b65f9b2
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/BudgetServiceProto.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+public final class BudgetServiceProto {
+ private BudgetServiceProto() {}
+
+ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
+
+ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_descriptor;
+ static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
+
+ static {
+ java.lang.String[] descriptorData = {
+ "\n4google/cloud/billing/budgets/v1/budget"
+ + "_service.proto\022\037google.cloud.billing.bud"
+ + "gets.v1\032\034google/api/annotations.proto\032\027g"
+ + "oogle/api/client.proto\032\037google/api/field"
+ + "_behavior.proto\032\031google/api/resource.pro"
+ + "to\0322google/cloud/billing/budgets/v1/budg"
+ + "et_model.proto\032\033google/protobuf/empty.pr"
+ + "oto\032 google/protobuf/field_mask.proto\"\221\001"
+ + "\n\023CreateBudgetRequest\022<\n\006parent\030\001 \001(\tB,\340"
+ + "A\002\372A&\022$billingbudgets.googleapis.com/Bud"
+ + "get\022<\n\006budget\030\002 \001(\0132\'.google.cloud.billi"
+ + "ng.budgets.v1.BudgetB\003\340A\002\"\211\001\n\023UpdateBudg"
+ + "etRequest\022<\n\006budget\030\001 \001(\0132\'.google.cloud"
+ + ".billing.budgets.v1.BudgetB\003\340A\002\0224\n\013updat"
+ + "e_mask\030\002 \001(\0132\032.google.protobuf.FieldMask"
+ + "B\003\340A\001\"N\n\020GetBudgetRequest\022:\n\004name\030\001 \001(\tB"
+ + ",\340A\002\372A&\n$billingbudgets.googleapis.com/B"
+ + "udget\"\203\001\n\022ListBudgetsRequest\022<\n\006parent\030\001"
+ + " \001(\tB,\340A\002\372A&\022$billingbudgets.googleapis."
+ + "com/Budget\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npa"
+ + "ge_token\030\003 \001(\tB\003\340A\001\"h\n\023ListBudgetsRespon"
+ + "se\0228\n\007budgets\030\001 \003(\0132\'.google.cloud.billi"
+ + "ng.budgets.v1.Budget\022\027\n\017next_page_token\030"
+ + "\002 \001(\t\"Q\n\023DeleteBudgetRequest\022:\n\004name\030\001 \001"
+ + "(\tB,\340A\002\372A&\n$billingbudgets.googleapis.co"
+ + "m/Budget2\367\007\n\rBudgetService\022\265\001\n\014CreateBud"
+ + "get\0224.google.cloud.billing.budgets.v1.Cr"
+ + "eateBudgetRequest\032\'.google.cloud.billing"
+ + ".budgets.v1.Budget\"F\202\323\344\223\0020\"&/v1/{parent="
+ + "billingAccounts/*}/budgets:\006budget\332A\rpar"
+ + "ent,budget\022\301\001\n\014UpdateBudget\0224.google.clo"
+ + "ud.billing.budgets.v1.UpdateBudgetReques"
+ + "t\032\'.google.cloud.billing.budgets.v1.Budg"
+ + "et\"R\202\323\344\223\00272-/v1/{budget.name=billingAcco"
+ + "unts/*/budgets/*}:\006budget\332A\022budget,updat"
+ + "e_mask\022\236\001\n\tGetBudget\0221.google.cloud.bill"
+ + "ing.budgets.v1.GetBudgetRequest\032\'.google"
+ + ".cloud.billing.budgets.v1.Budget\"5\202\323\344\223\002("
+ + "\022&/v1/{name=billingAccounts/*/budgets/*}"
+ + "\332A\004name\022\261\001\n\013ListBudgets\0223.google.cloud.b"
+ + "illing.budgets.v1.ListBudgetsRequest\0324.g"
+ + "oogle.cloud.billing.budgets.v1.ListBudge"
+ + "tsResponse\"7\202\323\344\223\002(\022&/v1/{parent=billingA"
+ + "ccounts/*}/budgets\332A\006parent\022\223\001\n\014DeleteBu"
+ + "dget\0224.google.cloud.billing.budgets.v1.D"
+ + "eleteBudgetRequest\032\026.google.protobuf.Emp"
+ + "ty\"5\202\323\344\223\002(*&/v1/{name=billingAccounts/*/"
+ + "budgets/*}\332A\004name\032\177\312A\035billingbudgets.goo"
+ + "gleapis.com\322A\\https://www.googleapis.com"
+ + "/auth/cloud-billing,https://www.googleap"
+ + "is.com/auth/cloud-platformB\203\001\n#com.googl"
+ + "e.cloud.billing.budgets.v1B\022BudgetServic"
+ + "eProtoP\001ZFgoogle.golang.org/genproto/goo"
+ + "gleapis/cloud/billing/budgets/v1;budgets"
+ + "b\006proto3"
+ };
+ descriptor =
+ com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
+ descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ com.google.api.AnnotationsProto.getDescriptor(),
+ com.google.api.ClientProto.getDescriptor(),
+ com.google.api.FieldBehaviorProto.getDescriptor(),
+ com.google.api.ResourceProto.getDescriptor(),
+ com.google.cloud.billing.budgets.v1.BudgetModelProto.getDescriptor(),
+ com.google.protobuf.EmptyProto.getDescriptor(),
+ com.google.protobuf.FieldMaskProto.getDescriptor(),
+ });
+ internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_descriptor,
+ new java.lang.String[] {
+ "Parent", "Budget",
+ });
+ internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_descriptor,
+ new java.lang.String[] {
+ "Budget", "UpdateMask",
+ });
+ internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_descriptor,
+ new java.lang.String[] {
+ "Name",
+ });
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_descriptor,
+ new java.lang.String[] {
+ "Parent", "PageSize", "PageToken",
+ });
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_descriptor,
+ new java.lang.String[] {
+ "Budgets", "NextPageToken",
+ });
+ internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_fieldAccessorTable =
+ new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_descriptor,
+ new java.lang.String[] {
+ "Name",
+ });
+ com.google.protobuf.ExtensionRegistry registry =
+ com.google.protobuf.ExtensionRegistry.newInstance();
+ registry.add(com.google.api.ClientProto.defaultHost);
+ registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
+ registry.add(com.google.api.AnnotationsProto.http);
+ registry.add(com.google.api.ClientProto.methodSignature);
+ registry.add(com.google.api.ClientProto.oauthScopes);
+ registry.add(com.google.api.ResourceProto.resourceReference);
+ com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
+ descriptor, registry);
+ com.google.api.AnnotationsProto.getDescriptor();
+ com.google.api.ClientProto.getDescriptor();
+ com.google.api.FieldBehaviorProto.getDescriptor();
+ com.google.api.ResourceProto.getDescriptor();
+ com.google.cloud.billing.budgets.v1.BudgetModelProto.getDescriptor();
+ com.google.protobuf.EmptyProto.getDescriptor();
+ com.google.protobuf.FieldMaskProto.getDescriptor();
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/CreateBudgetRequest.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/CreateBudgetRequest.java
new file mode 100644
index 00000000..15f7b293
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/CreateBudgetRequest.java
@@ -0,0 +1,959 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Request for CreateBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.CreateBudgetRequest} + */ +public final class CreateBudgetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.CreateBudgetRequest) + CreateBudgetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateBudgetRequest.newBuilder() to construct. + private CreateBudgetRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private CreateBudgetRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBudgetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBudgetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.billing.budgets.v1.Budget.Builder subBuilder = null; + if (budget_ != null) { + subBuilder = budget_.toBuilder(); + } + budget_ = + input.readMessage( + com.google.cloud.billing.budgets.v1.Budget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(budget_); + budget_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_CreateBudgetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.CreateBudgetRequest.class, + com.google.cloud.billing.budgets.v1.CreateBudgetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+ * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The parent.
+ */
+ @java.lang.Override
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ parent_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * 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 BUDGET_FIELD_NUMBER = 2;
+ private com.google.cloud.billing.budgets.v1.Budget budget_;
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ @java.lang.Override
+ public boolean hasBudget() {
+ return budget_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Budget getBudget() {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder() {
+ return getBudget();
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
+ }
+ if (budget_ != null) {
+ output.writeMessage(2, getBudget());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
+ }
+ if (budget_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBudget());
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.CreateBudgetRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.CreateBudgetRequest other =
+ (com.google.cloud.billing.budgets.v1.CreateBudgetRequest) obj;
+
+ if (!getParent().equals(other.getParent())) return false;
+ if (hasBudget() != other.hasBudget()) return false;
+ if (hasBudget()) {
+ if (!getBudget().equals(other.getBudget())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ if (hasBudget()) {
+ hash = (37 * hash) + BUDGET_FIELD_NUMBER;
+ hash = (53 * hash) + getBudget().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.CreateBudgetRequest 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 CreateBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.CreateBudgetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The parent.
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ parent_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for parent.
+ */
+ public com.google.protobuf.ByteString getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The parent to set.
+ * @return This builder for chaining.
+ */
+ public Builder setParent(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The bytes for parent to set.
+ * @return This builder for chaining.
+ */
+ public Builder setParentBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.billing.budgets.v1.Budget budget_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Budget,
+ com.google.cloud.billing.budgets.v1.Budget.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ budgetBuilder_;
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ public boolean hasBudget() {
+ return budgetBuilder_ != null || budget_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ public com.google.cloud.billing.budgets.v1.Budget getBudget() {
+ if (budgetBuilder_ == null) {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ } else {
+ return budgetBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setBudget(com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ budget_ = value;
+ onChanged();
+ } else {
+ budgetBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setBudget(com.google.cloud.billing.budgets.v1.Budget.Builder builderForValue) {
+ if (budgetBuilder_ == null) {
+ budget_ = builderForValue.build();
+ onChanged();
+ } else {
+ budgetBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder mergeBudget(com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetBuilder_ == null) {
+ if (budget_ != null) {
+ budget_ =
+ com.google.cloud.billing.budgets.v1.Budget.newBuilder(budget_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ budget_ = value;
+ }
+ onChanged();
+ } else {
+ budgetBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearBudget() {
+ if (budgetBuilder_ == null) {
+ budget_ = null;
+ onChanged();
+ } else {
+ budget_ = null;
+ budgetBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.Budget.Builder getBudgetBuilder() {
+
+ onChanged();
+ return getBudgetFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder() {
+ if (budgetBuilder_ != null) {
+ return budgetBuilder_.getMessageOrBuilder();
+ } else {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Budget,
+ com.google.cloud.billing.budgets.v1.Budget.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ getBudgetFieldBuilder() {
+ if (budgetBuilder_ == null) {
+ budgetBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Budget,
+ com.google.cloud.billing.budgets.v1.Budget.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder>(
+ getBudget(), getParentForChildren(), isClean());
+ budget_ = null;
+ }
+ return budgetBuilder_;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.CreateBudgetRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.CreateBudgetRequest)
+ private static final com.google.cloud.billing.budgets.v1.CreateBudgetRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.CreateBudgetRequest();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.CreateBudgetRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The parent.
+ */
+ java.lang.String getParent();
+ /**
+ *
+ *
+ * + * Required. The name of the billing account to create the budget in. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for parent.
+ */
+ com.google.protobuf.ByteString getParentBytes();
+
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ boolean hasBudget();
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ com.google.cloud.billing.budgets.v1.Budget getBudget();
+ /**
+ *
+ *
+ * + * Required. Budget to create. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 2 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/DeleteBudgetRequest.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/DeleteBudgetRequest.java
new file mode 100644
index 00000000..c891cd90
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/DeleteBudgetRequest.java
@@ -0,0 +1,658 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Request for DeleteBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.DeleteBudgetRequest} + */ +public final class DeleteBudgetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.DeleteBudgetRequest) + DeleteBudgetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBudgetRequest.newBuilder() to construct. + private DeleteBudgetRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private DeleteBudgetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBudgetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteBudgetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_DeleteBudgetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.DeleteBudgetRequest.class, + com.google.cloud.billing.budgets.v1.DeleteBudgetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+ * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!getNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.DeleteBudgetRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.DeleteBudgetRequest other =
+ (com.google.cloud.billing.budgets.v1.DeleteBudgetRequest) obj;
+
+ if (!getName().equals(other.getName())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.DeleteBudgetRequest 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 DeleteBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.DeleteBudgetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The bytes for name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.DeleteBudgetRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.DeleteBudgetRequest)
+ private static final com.google.cloud.billing.budgets.v1.DeleteBudgetRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.DeleteBudgetRequest();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.DeleteBudgetRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+ /**
+ *
+ *
+ * + * Required. Name of the budget to delete. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/Filter.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/Filter.java
new file mode 100644
index 00000000..008c0137
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/Filter.java
@@ -0,0 +1,2577 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_model.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * A filter for a budget, limiting the scope of the cost to calculate. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.Filter} + */ +public final class Filter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.Filter) + FilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use Filter.newBuilder() to construct. + private Filter(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private Filter() { + projects_ = com.google.protobuf.LazyStringArrayList.EMPTY; + creditTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + creditTypesTreatment_ = 0; + services_ = com.google.protobuf.LazyStringArrayList.EMPTY; + subaccounts_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Filter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Filter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + projects_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projects_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + services_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + services_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + creditTypesTreatment_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + subaccounts_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000008; + } + subaccounts_.add(s); + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry
+ * Specifies how credits should be treated when determining spend for + * threshold calculations. + *+ * + * Protobuf enum {@code google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment} + */ + public enum CreditTypesTreatment implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+ * This is an invalid value. + *+ * + *
CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0;
+ */
+ CREDIT_TYPES_TREATMENT_UNSPECIFIED(0),
+ /**
+ *
+ *
+ * + * All types of credit are subtracted from the gross cost to determine the + * spend for threshold calculations. + *+ * + *
INCLUDE_ALL_CREDITS = 1;
+ */
+ INCLUDE_ALL_CREDITS(1),
+ /**
+ *
+ *
+ * + * All types of credit are added to the net cost to determine the spend for + * threshold calculations. + *+ * + *
EXCLUDE_ALL_CREDITS = 2;
+ */
+ EXCLUDE_ALL_CREDITS(2),
+ /**
+ *
+ *
+ * + * Credit types specified in the credit_types field are subtracted from the + * gross cost to determine the spend for threshold calculations. + *+ * + *
INCLUDE_SPECIFIED_CREDITS = 3;
+ */
+ INCLUDE_SPECIFIED_CREDITS(3),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ *
+ *
+ * + * This is an invalid value. + *+ * + *
CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0;
+ */
+ public static final int CREDIT_TYPES_TREATMENT_UNSPECIFIED_VALUE = 0;
+ /**
+ *
+ *
+ * + * All types of credit are subtracted from the gross cost to determine the + * spend for threshold calculations. + *+ * + *
INCLUDE_ALL_CREDITS = 1;
+ */
+ public static final int INCLUDE_ALL_CREDITS_VALUE = 1;
+ /**
+ *
+ *
+ * + * All types of credit are added to the net cost to determine the spend for + * threshold calculations. + *+ * + *
EXCLUDE_ALL_CREDITS = 2;
+ */
+ public static final int EXCLUDE_ALL_CREDITS_VALUE = 2;
+ /**
+ *
+ *
+ * + * Credit types specified in the credit_types field are subtracted from the + * gross cost to determine the spend for threshold calculations. + *+ * + *
INCLUDE_SPECIFIED_CREDITS = 3;
+ */
+ public static final int INCLUDE_SPECIFIED_CREDITS_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 CreditTypesTreatment 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 CreditTypesTreatment forNumber(int value) {
+ switch (value) {
+ case 0:
+ return CREDIT_TYPES_TREATMENT_UNSPECIFIED;
+ case 1:
+ return INCLUDE_ALL_CREDITS;
+ case 2:
+ return EXCLUDE_ALL_CREDITS;
+ case 3:
+ return INCLUDE_SPECIFIED_CREDITS;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the projects.
+ */
+ public com.google.protobuf.ProtocolStringList getProjectsList() {
+ return projects_;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of projects.
+ */
+ public int getProjectsCount() {
+ return projects_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The projects at the given index.
+ */
+ public java.lang.String getProjects(int index) {
+ return projects_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the projects at the given index.
+ */
+ public com.google.protobuf.ByteString getProjectsBytes(int index) {
+ return projects_.getByteString(index);
+ }
+
+ public static final int CREDIT_TYPES_FIELD_NUMBER = 7;
+ private com.google.protobuf.LazyStringList creditTypes_;
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the creditTypes.
+ */
+ public com.google.protobuf.ProtocolStringList getCreditTypesList() {
+ return creditTypes_;
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of creditTypes.
+ */
+ public int getCreditTypesCount() {
+ return creditTypes_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The creditTypes at the given index.
+ */
+ public java.lang.String getCreditTypes(int index) {
+ return creditTypes_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the creditTypes at the given index.
+ */
+ public com.google.protobuf.ByteString getCreditTypesBytes(int index) {
+ return creditTypes_.getByteString(index);
+ }
+
+ public static final int CREDIT_TYPES_TREATMENT_FIELD_NUMBER = 4;
+ private int creditTypesTreatment_;
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for creditTypesTreatment.
+ */
+ @java.lang.Override
+ public int getCreditTypesTreatmentValue() {
+ return creditTypesTreatment_;
+ }
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The creditTypesTreatment.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment getCreditTypesTreatment() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment result =
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment.valueOf(
+ creditTypesTreatment_);
+ return result == null
+ ? com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment.UNRECOGNIZED
+ : result;
+ }
+
+ public static final int SERVICES_FIELD_NUMBER = 3;
+ private com.google.protobuf.LazyStringList services_;
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the services.
+ */
+ public com.google.protobuf.ProtocolStringList getServicesList() {
+ return services_;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of services.
+ */
+ public int getServicesCount() {
+ return services_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The services at the given index.
+ */
+ public java.lang.String getServices(int index) {
+ return services_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the services at the given index.
+ */
+ public com.google.protobuf.ByteString getServicesBytes(int index) {
+ return services_.getByteString(index);
+ }
+
+ public static final int SUBACCOUNTS_FIELD_NUMBER = 5;
+ private com.google.protobuf.LazyStringList subaccounts_;
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the subaccounts.
+ */
+ public com.google.protobuf.ProtocolStringList getSubaccountsList() {
+ return subaccounts_;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of subaccounts.
+ */
+ public int getSubaccountsCount() {
+ return subaccounts_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The subaccounts at the given index.
+ */
+ public java.lang.String getSubaccounts(int index) {
+ return subaccounts_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the subaccounts at the given index.
+ */
+ public com.google.protobuf.ByteString getSubaccountsBytes(int index) {
+ return subaccounts_.getByteString(index);
+ }
+
+ public static final int LABELS_FIELD_NUMBER = 6;
+
+ private static final class LabelsDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public boolean containsLabels(java.lang.String key) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ return internalGetLabels().getMap().containsKey(key);
+ }
+ /** Use {@link #getLabelsMap()} instead. */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.ListValue getLabelsOrDefault(
+ java.lang.String key, com.google.protobuf.ListValue defaultValue) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.ListValue getLabelsOrThrow(java.lang.String key) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ java.util.Map+ * A filter for a budget, limiting the scope of the cost to calculate. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.Filter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the projects.
+ */
+ public com.google.protobuf.ProtocolStringList getProjectsList() {
+ return projects_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of projects.
+ */
+ public int getProjectsCount() {
+ return projects_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The projects at the given index.
+ */
+ public java.lang.String getProjects(int index) {
+ return projects_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the projects at the given index.
+ */
+ public com.google.protobuf.ByteString getProjectsBytes(int index) {
+ return projects_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index to set the value at.
+ * @param value The projects to set.
+ * @return This builder for chaining.
+ */
+ public Builder setProjects(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureProjectsIsMutable();
+ projects_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The projects to add.
+ * @return This builder for chaining.
+ */
+ public Builder addProjects(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureProjectsIsMutable();
+ projects_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param values The projects to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllProjects(java.lang.Iterable+ * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearProjects() {
+ projects_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes of the projects to add.
+ * @return This builder for chaining.
+ */
+ public Builder addProjectsBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureProjectsIsMutable();
+ projects_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList creditTypes_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureCreditTypesIsMutable() {
+ if (!((bitField0_ & 0x00000002) != 0)) {
+ creditTypes_ = new com.google.protobuf.LazyStringArrayList(creditTypes_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the creditTypes.
+ */
+ public com.google.protobuf.ProtocolStringList getCreditTypesList() {
+ return creditTypes_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of creditTypes.
+ */
+ public int getCreditTypesCount() {
+ return creditTypes_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The creditTypes at the given index.
+ */
+ public java.lang.String getCreditTypes(int index) {
+ return creditTypes_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the creditTypes at the given index.
+ */
+ public com.google.protobuf.ByteString getCreditTypesBytes(int index) {
+ return creditTypes_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index to set the value at.
+ * @param value The creditTypes to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCreditTypes(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureCreditTypesIsMutable();
+ creditTypes_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The creditTypes to add.
+ * @return This builder for chaining.
+ */
+ public Builder addCreditTypes(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureCreditTypesIsMutable();
+ creditTypes_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param values The creditTypes to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllCreditTypes(java.lang.Iterable+ * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearCreditTypes() {
+ creditTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes of the creditTypes to add.
+ * @return This builder for chaining.
+ */
+ public Builder addCreditTypesBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureCreditTypesIsMutable();
+ creditTypes_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private int creditTypesTreatment_ = 0;
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for creditTypesTreatment.
+ */
+ @java.lang.Override
+ public int getCreditTypesTreatmentValue() {
+ return creditTypesTreatment_;
+ }
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The enum numeric value on the wire for creditTypesTreatment to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCreditTypesTreatmentValue(int value) {
+
+ creditTypesTreatment_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The creditTypesTreatment.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment
+ getCreditTypesTreatment() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment result =
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment.valueOf(
+ creditTypesTreatment_);
+ return result == null
+ ? com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The creditTypesTreatment to set.
+ * @return This builder for chaining.
+ */
+ public Builder setCreditTypesTreatment(
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ creditTypesTreatment_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearCreditTypesTreatment() {
+
+ creditTypesTreatment_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList services_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureServicesIsMutable() {
+ if (!((bitField0_ & 0x00000004) != 0)) {
+ services_ = new com.google.protobuf.LazyStringArrayList(services_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the services.
+ */
+ public com.google.protobuf.ProtocolStringList getServicesList() {
+ return services_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of services.
+ */
+ public int getServicesCount() {
+ return services_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The services at the given index.
+ */
+ public java.lang.String getServices(int index) {
+ return services_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the services at the given index.
+ */
+ public com.google.protobuf.ByteString getServicesBytes(int index) {
+ return services_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index to set the value at.
+ * @param value The services to set.
+ * @return This builder for chaining.
+ */
+ public Builder setServices(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureServicesIsMutable();
+ services_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The services to add.
+ * @return This builder for chaining.
+ */
+ public Builder addServices(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureServicesIsMutable();
+ services_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param values The services to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllServices(java.lang.Iterable+ * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearServices() {
+ services_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes of the services to add.
+ * @return This builder for chaining.
+ */
+ public Builder addServicesBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureServicesIsMutable();
+ services_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList subaccounts_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureSubaccountsIsMutable() {
+ if (!((bitField0_ & 0x00000008) != 0)) {
+ subaccounts_ = new com.google.protobuf.LazyStringArrayList(subaccounts_);
+ bitField0_ |= 0x00000008;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the subaccounts.
+ */
+ public com.google.protobuf.ProtocolStringList getSubaccountsList() {
+ return subaccounts_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of subaccounts.
+ */
+ public int getSubaccountsCount() {
+ return subaccounts_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The subaccounts at the given index.
+ */
+ public java.lang.String getSubaccounts(int index) {
+ return subaccounts_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the subaccounts at the given index.
+ */
+ public com.google.protobuf.ByteString getSubaccountsBytes(int index) {
+ return subaccounts_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index to set the value at.
+ * @param value The subaccounts to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSubaccounts(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureSubaccountsIsMutable();
+ subaccounts_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The subaccounts to add.
+ * @return This builder for chaining.
+ */
+ public Builder addSubaccounts(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureSubaccountsIsMutable();
+ subaccounts_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param values The subaccounts to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllSubaccounts(java.lang.Iterable+ * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearSubaccounts() {
+ subaccounts_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes of the subaccounts to add.
+ * @return This builder for chaining.
+ */
+ public Builder addSubaccountsBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureSubaccountsIsMutable();
+ subaccounts_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.MapField+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public boolean containsLabels(java.lang.String key) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ return internalGetLabels().getMap().containsKey(key);
+ }
+ /** Use {@link #getLabelsMap()} instead. */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.ListValue getLabelsOrDefault(
+ java.lang.String key, com.google.protobuf.ListValue defaultValue) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.ListValue getLabelsOrThrow(java.lang.String key) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder removeLabels(java.lang.String key) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ internalGetMutableLabels().getMutableMap().remove(key);
+ return this;
+ }
+ /** Use alternate mutation accessors instead. */
+ @java.lang.Deprecated
+ public java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder putLabels(java.lang.String key, com.google.protobuf.ListValue value) {
+ if (key == null) {
+ throw new java.lang.NullPointerException();
+ }
+ if (value == null) {
+ throw new java.lang.NullPointerException();
+ }
+ internalGetMutableLabels().getMutableMap().put(key, value);
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder putAllLabels(
+ java.util.Map+ * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the projects.
+ */
+ java.util.List+ * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of projects.
+ */
+ int getProjectsCount();
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The projects at the given index.
+ */
+ java.lang.String getProjects(int index);
+ /**
+ *
+ *
+ * + * Optional. A set of projects of the form `projects/{project}`, + * specifying that usage from only this set of projects should be + * included in the budget. If omitted, the report will include all usage for + * the billing account, regardless of which project the usage occurred on. + * Only zero or one project can be specified currently. + *+ * + *
repeated string projects = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the projects at the given index.
+ */
+ com.google.protobuf.ByteString getProjectsBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the creditTypes.
+ */
+ java.util.List+ * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of creditTypes.
+ */
+ int getCreditTypesCount();
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The creditTypes at the given index.
+ */
+ java.lang.String getCreditTypes(int index);
+ /**
+ *
+ *
+ * + * Optional. A list of credit types to be subtracted from gross cost to + * determine the spend for threshold calculations if and only if + * credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If + * credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be + * empty. See credits.type on + * https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema + * for a list of acceptable credit type values in this field. + *+ * + *
repeated string credit_types = 7 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the creditTypes at the given index.
+ */
+ com.google.protobuf.ByteString getCreditTypesBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for creditTypesTreatment.
+ */
+ int getCreditTypesTreatmentValue();
+ /**
+ *
+ *
+ * + * Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment credit_types_treatment = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The creditTypesTreatment.
+ */
+ com.google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment getCreditTypesTreatment();
+
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the services.
+ */
+ java.util.List+ * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of services.
+ */
+ int getServicesCount();
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The services at the given index.
+ */
+ java.lang.String getServices(int index);
+ /**
+ *
+ *
+ * + * Optional. A set of services of the form `services/{service_id}`, + * specifying that usage from only this set of services should be + * included in the budget. If omitted, the report will include usage for + * all the services. + * The service names are available through the Catalog API: + * https://cloud.google.com/billing/v1/how-tos/catalog-api. + *+ * + *
repeated string services = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the services at the given index.
+ */
+ com.google.protobuf.ByteString getServicesBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return A list containing the subaccounts.
+ */
+ java.util.List+ * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The count of subaccounts.
+ */
+ int getSubaccountsCount();
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the element to return.
+ * @return The subaccounts at the given index.
+ */
+ java.lang.String getSubaccounts(int index);
+ /**
+ *
+ *
+ * + * Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + * specifying that usage from only this set of subaccounts should be included + * in the budget. If a subaccount is set to the name of the parent account, + * usage from the parent account will be included. If the field is omitted, + * the report will include usage from the parent account and all subaccounts, + * if they exist. + *+ * + *
repeated string subaccounts = 5 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the subaccounts at the given index.
+ */
+ com.google.protobuf.ByteString getSubaccountsBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ int getLabelsCount();
+ /**
+ *
+ *
+ * + * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ boolean containsLabels(java.lang.String key);
+ /** Use {@link #getLabelsMap()} instead. */
+ @java.lang.Deprecated
+ java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ java.util.Map+ * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.protobuf.ListValue getLabelsOrDefault(
+ java.lang.String key, com.google.protobuf.ListValue defaultValue);
+ /**
+ *
+ *
+ * + * Optional. A single label and value pair specifying that usage from only + * this set of labeled resources should be included in the budget. Currently, + * multiple entries or multiple values per entry are not allowed. If omitted, + * the report will include all labeled and unlabeled usage. + *+ * + *
+ * map<string, .google.protobuf.ListValue> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.protobuf.ListValue getLabelsOrThrow(java.lang.String key);
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/GetBudgetRequest.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/GetBudgetRequest.java
new file mode 100644
index 00000000..a57cd0fb
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/GetBudgetRequest.java
@@ -0,0 +1,657 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Request for GetBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.GetBudgetRequest} + */ +public final class GetBudgetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.GetBudgetRequest) + GetBudgetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBudgetRequest.newBuilder() to construct. + private GetBudgetRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private GetBudgetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBudgetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBudgetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_GetBudgetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.GetBudgetRequest.class, + com.google.cloud.billing.budgets.v1.GetBudgetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+ * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for name.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!getNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.GetBudgetRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.GetBudgetRequest other =
+ (com.google.cloud.billing.budgets.v1.GetBudgetRequest) obj;
+
+ if (!getName().equals(other.getName())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.cloud.billing.budgets.v1.GetBudgetRequest 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 GetBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.GetBudgetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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 budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The bytes for name to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.GetBudgetRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.GetBudgetRequest)
+ private static final com.google.cloud.billing.budgets.v1.GetBudgetRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.GetBudgetRequest();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.GetBudgetRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The name.
+ */
+ java.lang.String getName();
+ /**
+ *
+ *
+ * + * Required. Name of budget to get. Values are of the form + * `billingAccounts/{billingAccountId}/budgets/{budgetId}`. + *+ * + *
+ * 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/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/LastPeriodAmount.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/LastPeriodAmount.java
new file mode 100644
index 00000000..0e1e4d57
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/LastPeriodAmount.java
@@ -0,0 +1,464 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_model.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Describes a budget amount targeted to last period's spend. + * At this time, the amount is automatically 100% of last period's spend; + * that is, there are no other options yet. + * Future configuration will be described here (for example, configuring a + * percentage of last period's spend). + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.LastPeriodAmount} + */ +public final class LastPeriodAmount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.LastPeriodAmount) + LastPeriodAmountOrBuilder { + private static final long serialVersionUID = 0L; + // Use LastPeriodAmount.newBuilder() to construct. + private LastPeriodAmount(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private LastPeriodAmount() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LastPeriodAmount(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LastPeriodAmount( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_LastPeriodAmount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.LastPeriodAmount.class, + com.google.cloud.billing.budgets.v1.LastPeriodAmount.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.billing.budgets.v1.LastPeriodAmount)) { + return super.equals(obj); + } + com.google.cloud.billing.budgets.v1.LastPeriodAmount other = + (com.google.cloud.billing.budgets.v1.LastPeriodAmount) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.billing.budgets.v1.LastPeriodAmount parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.billing.budgets.v1.LastPeriodAmount 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; + } + /** + * + * + *
+ * Describes a budget amount targeted to last period's spend. + * At this time, the amount is automatically 100% of last period's spend; + * that is, there are no other options yet. + * Future configuration will be described here (for example, configuring a + * percentage of last period's spend). + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.LastPeriodAmount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Request for ListBudgets + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ListBudgetsRequest} + */ +public final class ListBudgetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.ListBudgetsRequest) + ListBudgetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBudgetsRequest.newBuilder() to construct. + private ListBudgetsRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private ListBudgetsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBudgetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBudgetsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.ListBudgetsRequest.class, + com.google.cloud.billing.budgets.v1.ListBudgetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+ * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * 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. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for parent.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int PAGE_SIZE_FIELD_NUMBER = 2;
+ private int pageSize_;
+ /**
+ *
+ *
+ * + * Optional. The maximum number of budgets to return per page. + * The default and maximum value are 100. + *+ * + *
int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pageSize.
+ */
+ @java.lang.Override
+ public int getPageSize() {
+ return pageSize_;
+ }
+
+ public static final int PAGE_TOKEN_FIELD_NUMBER = 3;
+ private volatile java.lang.Object pageToken_;
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
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. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for pageToken.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getPageTokenBytes() {
+ java.lang.Object ref = pageToken_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ pageToken_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
+ }
+ if (pageSize_ != 0) {
+ output.writeInt32(2, pageSize_);
+ }
+ if (!getPageTokenBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
+ }
+ if (pageSize_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
+ }
+ if (!getPageTokenBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.ListBudgetsRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.ListBudgetsRequest other =
+ (com.google.cloud.billing.budgets.v1.ListBudgetsRequest) obj;
+
+ if (!getParent().equals(other.getParent())) return false;
+ if (getPageSize() != other.getPageSize()) return false;
+ if (!getPageToken().equals(other.getPageToken())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER;
+ hash = (53 * hash) + getPageSize();
+ hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
+ hash = (53 * hash) + getPageToken().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.ListBudgetsRequest 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 ListBudgets + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ListBudgetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * 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. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * 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. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The parent to set.
+ * @return This builder for chaining.
+ */
+ public Builder setParent(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @param value The bytes for parent to set.
+ * @return This builder for chaining.
+ */
+ public Builder setParentBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int pageSize_;
+ /**
+ *
+ *
+ * + * Optional. The maximum number of budgets to return per page. + * The default and maximum value are 100. + *+ * + *
int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pageSize.
+ */
+ @java.lang.Override
+ public int getPageSize() {
+ return pageSize_;
+ }
+ /**
+ *
+ *
+ * + * Optional. The maximum number of budgets to return per page. + * The default and maximum value are 100. + *+ * + *
int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The pageSize to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPageSize(int value) {
+
+ pageSize_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The maximum number of budgets to return per page. + * The default and maximum value are 100. + *+ * + *
int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPageSize() {
+
+ pageSize_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object pageToken_ = "";
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
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. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
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. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The pageToken to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPageToken(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ pageToken_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPageToken() {
+
+ pageToken_ = getDefaultInstance().getPageToken();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes for pageToken to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ pageToken_ = value;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.ListBudgetsRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.ListBudgetsRequest)
+ private static final com.google.cloud.billing.budgets.v1.ListBudgetsRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.ListBudgetsRequest();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The parent.
+ */
+ java.lang.String getParent();
+ /**
+ *
+ *
+ * + * Required. Name of billing account to list budgets under. Values + * are of the form `billingAccounts/{billingAccountId}`. + *+ * + *
+ * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
+ *
+ *
+ * @return The bytes for parent.
+ */
+ com.google.protobuf.ByteString getParentBytes();
+
+ /**
+ *
+ *
+ * + * Optional. The maximum number of budgets to return per page. + * The default and maximum value are 100. + *+ * + *
int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pageSize.
+ */
+ int getPageSize();
+
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pageToken.
+ */
+ java.lang.String getPageToken();
+ /**
+ *
+ *
+ * + * Optional. The value returned by the last `ListBudgetsResponse` which + * indicates that this is a continuation of a prior `ListBudgets` call, + * and that the system should return the next page of data. + *+ * + *
string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for pageToken.
+ */
+ com.google.protobuf.ByteString getPageTokenBytes();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ListBudgetsResponse.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ListBudgetsResponse.java
new file mode 100644
index 00000000..d514a8ed
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ListBudgetsResponse.java
@@ -0,0 +1,1136 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Response for ListBudgets + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ListBudgetsResponse} + */ +public final class ListBudgetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.ListBudgetsResponse) + ListBudgetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBudgetsResponse.newBuilder() to construct. + private ListBudgetsResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private ListBudgetsResponse() { + budgets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBudgetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBudgetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + budgets_ = new java.util.ArrayList
+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ @java.lang.Override
+ public java.util.List+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ getBudgetsOrBuilderList() {
+ return budgets_;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ @java.lang.Override
+ public int getBudgetsCount() {
+ return budgets_.size();
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Budget getBudgets(int index) {
+ return budgets_.get(index);
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetsOrBuilder(int index) {
+ return budgets_.get(index);
+ }
+
+ public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
+ private volatile java.lang.Object nextPageToken_;
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
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;
+ }
+ }
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
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 < budgets_.size(); i++) {
+ output.writeMessage(1, budgets_.get(i));
+ }
+ if (!getNextPageTokenBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < budgets_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, budgets_.get(i));
+ }
+ if (!getNextPageTokenBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.ListBudgetsResponse)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.ListBudgetsResponse other =
+ (com.google.cloud.billing.budgets.v1.ListBudgetsResponse) obj;
+
+ if (!getBudgetsList().equals(other.getBudgetsList())) return false;
+ if (!getNextPageToken().equals(other.getNextPageToken())) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (getBudgetsCount() > 0) {
+ hash = (37 * hash) + BUDGETS_FIELD_NUMBER;
+ hash = (53 * hash) + getBudgetsList().hashCode();
+ }
+ hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
+ hash = (53 * hash) + getNextPageToken().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.ListBudgetsResponse prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ *
+ * + * Response for ListBudgets + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ListBudgetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public java.util.List+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public int getBudgetsCount() {
+ if (budgetsBuilder_ == null) {
+ return budgets_.size();
+ } else {
+ return budgetsBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public com.google.cloud.billing.budgets.v1.Budget getBudgets(int index) {
+ if (budgetsBuilder_ == null) {
+ return budgets_.get(index);
+ } else {
+ return budgetsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder setBudgets(int index, com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBudgetsIsMutable();
+ budgets_.set(index, value);
+ onChanged();
+ } else {
+ budgetsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder setBudgets(
+ int index, com.google.cloud.billing.budgets.v1.Budget.Builder builderForValue) {
+ if (budgetsBuilder_ == null) {
+ ensureBudgetsIsMutable();
+ budgets_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ budgetsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder addBudgets(com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBudgetsIsMutable();
+ budgets_.add(value);
+ onChanged();
+ } else {
+ budgetsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder addBudgets(int index, com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBudgetsIsMutable();
+ budgets_.add(index, value);
+ onChanged();
+ } else {
+ budgetsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder addBudgets(com.google.cloud.billing.budgets.v1.Budget.Builder builderForValue) {
+ if (budgetsBuilder_ == null) {
+ ensureBudgetsIsMutable();
+ budgets_.add(builderForValue.build());
+ onChanged();
+ } else {
+ budgetsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder addBudgets(
+ int index, com.google.cloud.billing.budgets.v1.Budget.Builder builderForValue) {
+ if (budgetsBuilder_ == null) {
+ ensureBudgetsIsMutable();
+ budgets_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ budgetsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder addAllBudgets(
+ java.lang.Iterable extends com.google.cloud.billing.budgets.v1.Budget> values) {
+ if (budgetsBuilder_ == null) {
+ ensureBudgetsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, budgets_);
+ onChanged();
+ } else {
+ budgetsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder clearBudgets() {
+ if (budgetsBuilder_ == null) {
+ budgets_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ budgetsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public Builder removeBudgets(int index) {
+ if (budgetsBuilder_ == null) {
+ ensureBudgetsIsMutable();
+ budgets_.remove(index);
+ onChanged();
+ } else {
+ budgetsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public com.google.cloud.billing.budgets.v1.Budget.Builder getBudgetsBuilder(int index) {
+ return getBudgetsFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetsOrBuilder(int index) {
+ if (budgetsBuilder_ == null) {
+ return budgets_.get(index);
+ } else {
+ return budgetsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public java.util.List extends com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ getBudgetsOrBuilderList() {
+ if (budgetsBuilder_ != null) {
+ return budgetsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(budgets_);
+ }
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public com.google.cloud.billing.budgets.v1.Budget.Builder addBudgetsBuilder() {
+ return getBudgetsFieldBuilder()
+ .addBuilder(com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public com.google.cloud.billing.budgets.v1.Budget.Builder addBudgetsBuilder(int index) {
+ return getBudgetsFieldBuilder()
+ .addBuilder(index, com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ public java.util.List+ * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
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;
+ }
+ }
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
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;
+ }
+ }
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
string next_page_token = 2;
+ *
+ * @param value The nextPageToken to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNextPageToken(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ nextPageToken_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
string next_page_token = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearNextPageToken() {
+
+ nextPageToken_ = getDefaultInstance().getNextPageToken();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
string next_page_token = 2;
+ *
+ * @param value The bytes for nextPageToken to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ nextPageToken_ = value;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.ListBudgetsResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.ListBudgetsResponse)
+ private static final com.google.cloud.billing.budgets.v1.ListBudgetsResponse DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.ListBudgetsResponse();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ListBudgetsResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ java.util.List+ * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ com.google.cloud.billing.budgets.v1.Budget getBudgets(int index);
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ int getBudgetsCount();
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ java.util.List extends com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ getBudgetsOrBuilderList();
+ /**
+ *
+ *
+ * + * List of the budgets owned by the requested billing account. + *+ * + *
repeated .google.cloud.billing.budgets.v1.Budget budgets = 1;
+ */
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetsOrBuilder(int index);
+
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
string next_page_token = 2;
+ *
+ * @return The nextPageToken.
+ */
+ java.lang.String getNextPageToken();
+ /**
+ *
+ *
+ * + * If not empty, indicates that there may be more budgets that match the + * request; this value should be passed in a new `ListBudgetsRequest`. + *+ * + *
string next_page_token = 2;
+ *
+ * @return The bytes for nextPageToken.
+ */
+ com.google.protobuf.ByteString getNextPageTokenBytes();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/NotificationsRule.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/NotificationsRule.java
new file mode 100644
index 00000000..d919fe57
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/NotificationsRule.java
@@ -0,0 +1,1410 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_model.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * NotificationsRule defines notifications that are sent based on budget spend + * and thresholds. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.NotificationsRule} + */ +public final class NotificationsRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.NotificationsRule) + NotificationsRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use NotificationsRule.newBuilder() to construct. + private NotificationsRule(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private NotificationsRule() { + pubsubTopic_ = ""; + schemaVersion_ = ""; + monitoringNotificationChannels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NotificationsRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NotificationsRule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + schemaVersion_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + monitoringNotificationChannels_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + monitoringNotificationChannels_.add(s); + break; + } + case 32: + { + disableDefaultIamRecipients_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + monitoringNotificationChannels_ = monitoringNotificationChannels_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_NotificationsRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.NotificationsRule.class, + com.google.cloud.billing.budgets.v1.NotificationsRule.Builder.class); + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+ * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pubsubTopic.
+ */
+ @java.lang.Override
+ public java.lang.String getPubsubTopic() {
+ java.lang.Object ref = pubsubTopic_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ pubsubTopic_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for pubsubTopic.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getPubsubTopicBytes() {
+ java.lang.Object ref = pubsubTopic_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ pubsubTopic_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int SCHEMA_VERSION_FIELD_NUMBER = 2;
+ private volatile java.lang.Object schemaVersion_;
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The schemaVersion.
+ */
+ @java.lang.Override
+ public java.lang.String getSchemaVersion() {
+ java.lang.Object ref = schemaVersion_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaVersion_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for schemaVersion.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getSchemaVersionBytes() {
+ java.lang.Object ref = schemaVersion_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaVersion_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int MONITORING_NOTIFICATION_CHANNELS_FIELD_NUMBER = 3;
+ private com.google.protobuf.LazyStringList monitoringNotificationChannels_;
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return A list containing the monitoringNotificationChannels.
+ */
+ public com.google.protobuf.ProtocolStringList getMonitoringNotificationChannelsList() {
+ return monitoringNotificationChannels_;
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The count of monitoringNotificationChannels.
+ */
+ public int getMonitoringNotificationChannelsCount() {
+ return monitoringNotificationChannels_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the element to return.
+ * @return The monitoringNotificationChannels at the given index.
+ */
+ public java.lang.String getMonitoringNotificationChannels(int index) {
+ return monitoringNotificationChannels_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the monitoringNotificationChannels at the given index.
+ */
+ public com.google.protobuf.ByteString getMonitoringNotificationChannelsBytes(int index) {
+ return monitoringNotificationChannels_.getByteString(index);
+ }
+
+ public static final int DISABLE_DEFAULT_IAM_RECIPIENTS_FIELD_NUMBER = 4;
+ private boolean disableDefaultIamRecipients_;
+ /**
+ *
+ *
+ * + * Optional. When set to true, disables default notifications sent when a + * threshold is exceeded. Default notifications are sent to those with Billing + * Account Administrator and Billing Account User IAM roles for the target + * account. + *+ * + *
bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The disableDefaultIamRecipients.
+ */
+ @java.lang.Override
+ public boolean getDisableDefaultIamRecipients() {
+ return disableDefaultIamRecipients_;
+ }
+
+ 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 (!getPubsubTopicBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubTopic_);
+ }
+ if (!getSchemaVersionBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, schemaVersion_);
+ }
+ for (int i = 0; i < monitoringNotificationChannels_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(
+ output, 3, monitoringNotificationChannels_.getRaw(i));
+ }
+ if (disableDefaultIamRecipients_ != false) {
+ output.writeBool(4, disableDefaultIamRecipients_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getPubsubTopicBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubTopic_);
+ }
+ if (!getSchemaVersionBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, schemaVersion_);
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < monitoringNotificationChannels_.size(); i++) {
+ dataSize += computeStringSizeNoTag(monitoringNotificationChannels_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getMonitoringNotificationChannelsList().size();
+ }
+ if (disableDefaultIamRecipients_ != false) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeBoolSize(4, disableDefaultIamRecipients_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.NotificationsRule)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.NotificationsRule other =
+ (com.google.cloud.billing.budgets.v1.NotificationsRule) obj;
+
+ if (!getPubsubTopic().equals(other.getPubsubTopic())) return false;
+ if (!getSchemaVersion().equals(other.getSchemaVersion())) return false;
+ if (!getMonitoringNotificationChannelsList()
+ .equals(other.getMonitoringNotificationChannelsList())) return false;
+ if (getDisableDefaultIamRecipients() != other.getDisableDefaultIamRecipients()) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER;
+ hash = (53 * hash) + getPubsubTopic().hashCode();
+ hash = (37 * hash) + SCHEMA_VERSION_FIELD_NUMBER;
+ hash = (53 * hash) + getSchemaVersion().hashCode();
+ if (getMonitoringNotificationChannelsCount() > 0) {
+ hash = (37 * hash) + MONITORING_NOTIFICATION_CHANNELS_FIELD_NUMBER;
+ hash = (53 * hash) + getMonitoringNotificationChannelsList().hashCode();
+ }
+ hash = (37 * hash) + DISABLE_DEFAULT_IAM_RECIPIENTS_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableDefaultIamRecipients());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.NotificationsRule 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;
+ }
+ /**
+ *
+ *
+ * + * NotificationsRule defines notifications that are sent based on budget spend + * and thresholds. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.NotificationsRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pubsubTopic.
+ */
+ public java.lang.String getPubsubTopic() {
+ java.lang.Object ref = pubsubTopic_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ pubsubTopic_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for pubsubTopic.
+ */
+ public com.google.protobuf.ByteString getPubsubTopicBytes() {
+ java.lang.Object ref = pubsubTopic_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ pubsubTopic_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The pubsubTopic to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPubsubTopic(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ pubsubTopic_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPubsubTopic() {
+
+ pubsubTopic_ = getDefaultInstance().getPubsubTopic();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes for pubsubTopic to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ pubsubTopic_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object schemaVersion_ = "";
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The schemaVersion.
+ */
+ public java.lang.String getSchemaVersion() {
+ java.lang.Object ref = schemaVersion_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaVersion_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for schemaVersion.
+ */
+ public com.google.protobuf.ByteString getSchemaVersionBytes() {
+ java.lang.Object ref = schemaVersion_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaVersion_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The schemaVersion to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSchemaVersion(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ schemaVersion_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearSchemaVersion() {
+
+ schemaVersion_ = getDefaultInstance().getSchemaVersion();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @param value The bytes for schemaVersion to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSchemaVersionBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ schemaVersion_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList monitoringNotificationChannels_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureMonitoringNotificationChannelsIsMutable() {
+ if (!((bitField0_ & 0x00000001) != 0)) {
+ monitoringNotificationChannels_ =
+ new com.google.protobuf.LazyStringArrayList(monitoringNotificationChannels_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return A list containing the monitoringNotificationChannels.
+ */
+ public com.google.protobuf.ProtocolStringList getMonitoringNotificationChannelsList() {
+ return monitoringNotificationChannels_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The count of monitoringNotificationChannels.
+ */
+ public int getMonitoringNotificationChannelsCount() {
+ return monitoringNotificationChannels_.size();
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the element to return.
+ * @return The monitoringNotificationChannels at the given index.
+ */
+ public java.lang.String getMonitoringNotificationChannels(int index) {
+ return monitoringNotificationChannels_.get(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the monitoringNotificationChannels at the given index.
+ */
+ public com.google.protobuf.ByteString getMonitoringNotificationChannelsBytes(int index) {
+ return monitoringNotificationChannels_.getByteString(index);
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index to set the value at.
+ * @param value The monitoringNotificationChannels to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMonitoringNotificationChannels(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMonitoringNotificationChannelsIsMutable();
+ monitoringNotificationChannels_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The monitoringNotificationChannels to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMonitoringNotificationChannels(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMonitoringNotificationChannelsIsMutable();
+ monitoringNotificationChannels_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param values The monitoringNotificationChannels to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllMonitoringNotificationChannels(
+ java.lang.Iterable+ * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMonitoringNotificationChannels() {
+ monitoringNotificationChannels_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The bytes of the monitoringNotificationChannels to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMonitoringNotificationChannelsBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureMonitoringNotificationChannelsIsMutable();
+ monitoringNotificationChannels_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private boolean disableDefaultIamRecipients_;
+ /**
+ *
+ *
+ * + * Optional. When set to true, disables default notifications sent when a + * threshold is exceeded. Default notifications are sent to those with Billing + * Account Administrator and Billing Account User IAM roles for the target + * account. + *+ * + *
bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The disableDefaultIamRecipients.
+ */
+ @java.lang.Override
+ public boolean getDisableDefaultIamRecipients() {
+ return disableDefaultIamRecipients_;
+ }
+ /**
+ *
+ *
+ * + * Optional. When set to true, disables default notifications sent when a + * threshold is exceeded. Default notifications are sent to those with Billing + * Account Administrator and Billing Account User IAM roles for the target + * account. + *+ * + *
bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The disableDefaultIamRecipients to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDisableDefaultIamRecipients(boolean value) {
+
+ disableDefaultIamRecipients_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. When set to true, disables default notifications sent when a + * threshold is exceeded. Default notifications are sent to those with Billing + * Account Administrator and Billing Account User IAM roles for the target + * account. + *+ * + *
bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDisableDefaultIamRecipients() {
+
+ disableDefaultIamRecipients_ = false;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.NotificationsRule)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.NotificationsRule)
+ private static final com.google.cloud.billing.budgets.v1.NotificationsRule DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.NotificationsRule();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.NotificationsRule getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The pubsubTopic.
+ */
+ java.lang.String getPubsubTopic();
+ /**
+ *
+ *
+ * + * Optional. The name of the Pub/Sub topic where budget related messages will + * be published, in the form `projects/{project_id}/topics/{topic_id}`. + * Updates are sent at regular intervals to the topic. The topic needs to be + * created before the budget is created; see + * https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications + * for more details. + * Caller is expected to have + * `pubsub.topics.setIamPolicy` permission on the topic when it's set for a + * budget, otherwise, the API call will fail with PERMISSION_DENIED. See + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications + * for more details on Pub/Sub roles and permissions. + *+ * + *
string pubsub_topic = 1 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for pubsubTopic.
+ */
+ com.google.protobuf.ByteString getPubsubTopicBytes();
+
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The schemaVersion.
+ */
+ java.lang.String getSchemaVersion();
+ /**
+ *
+ *
+ * + * Optional. The schema version of the notification sent to `pubsub_topic`. + * Only "1.0" is accepted. It represents the JSON schema as defined in + * https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format + *+ * + *
string schema_version = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The bytes for schemaVersion.
+ */
+ com.google.protobuf.ByteString getSchemaVersionBytes();
+
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return A list containing the monitoringNotificationChannels.
+ */
+ java.util.List+ * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The count of monitoringNotificationChannels.
+ */
+ int getMonitoringNotificationChannelsCount();
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the element to return.
+ * @return The monitoringNotificationChannels at the given index.
+ */
+ java.lang.String getMonitoringNotificationChannels(int index);
+ /**
+ *
+ *
+ * + * Optional. Targets to send notifications to when a threshold is exceeded. + * This is in addition to default recipients who have billing account IAM + * roles. The value is the full REST resource name of a monitoring + * notification channel with the form + * `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 + * channels are allowed. See + * https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients + * for more details. + *+ * + *
+ * repeated string monitoring_notification_channels = 3 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the monitoringNotificationChannels at the given index.
+ */
+ com.google.protobuf.ByteString getMonitoringNotificationChannelsBytes(int index);
+
+ /**
+ *
+ *
+ * + * Optional. When set to true, disables default notifications sent when a + * threshold is exceeded. Default notifications are sent to those with Billing + * Account Administrator and Billing Account User IAM roles for the target + * account. + *+ * + *
bool disable_default_iam_recipients = 4 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ * @return The disableDefaultIamRecipients.
+ */
+ boolean getDisableDefaultIamRecipients();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ThresholdRule.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ThresholdRule.java
new file mode 100644
index 00000000..1e16b806
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/ThresholdRule.java
@@ -0,0 +1,909 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_model.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * ThresholdRule contains a definition of a threshold which triggers + * an alert (a notification of a threshold being crossed) to be sent when + * spend goes above the specified amount. + * Alerts are automatically e-mailed to users with the Billing Account + * Administrator role or the Billing Account User role. + * The thresholds here have no effect on notifications sent to anything + * configured under `Budget.all_updates_rule`. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ThresholdRule} + */ +public final class ThresholdRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.ThresholdRule) + ThresholdRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use ThresholdRule.newBuilder() to construct. + private ThresholdRule(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private ThresholdRule() { + spendBasis_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ThresholdRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ThresholdRule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + thresholdPercent_ = input.readDouble(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + spendBasis_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_ThresholdRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetModelProto + .internal_static_google_cloud_billing_budgets_v1_ThresholdRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.ThresholdRule.class, + com.google.cloud.billing.budgets.v1.ThresholdRule.Builder.class); + } + + /** + * + * + *
+ * The type of basis used to determine if spend has passed the threshold. + *+ * + * Protobuf enum {@code google.cloud.billing.budgets.v1.ThresholdRule.Basis} + */ + public enum Basis implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+ * Unspecified threshold basis. + *+ * + *
BASIS_UNSPECIFIED = 0;
+ */
+ BASIS_UNSPECIFIED(0),
+ /**
+ *
+ *
+ * + * Use current spend as the basis for comparison against the threshold. + *+ * + *
CURRENT_SPEND = 1;
+ */
+ CURRENT_SPEND(1),
+ /**
+ *
+ *
+ * + * Use forecasted spend for the period as the basis for comparison against + * the threshold. + *+ * + *
FORECASTED_SPEND = 2;
+ */
+ FORECASTED_SPEND(2),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ *
+ *
+ * + * Unspecified threshold basis. + *+ * + *
BASIS_UNSPECIFIED = 0;
+ */
+ public static final int BASIS_UNSPECIFIED_VALUE = 0;
+ /**
+ *
+ *
+ * + * Use current spend as the basis for comparison against the threshold. + *+ * + *
CURRENT_SPEND = 1;
+ */
+ public static final int CURRENT_SPEND_VALUE = 1;
+ /**
+ *
+ *
+ * + * Use forecasted spend for the period as the basis for comparison against + * the threshold. + *+ * + *
FORECASTED_SPEND = 2;
+ */
+ public static final int FORECASTED_SPEND_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 Basis 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 Basis forNumber(int value) {
+ switch (value) {
+ case 0:
+ return BASIS_UNSPECIFIED;
+ case 1:
+ return CURRENT_SPEND;
+ case 2:
+ return FORECASTED_SPEND;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Required. Send an alert when this threshold is exceeded. + * This is a 1.0-based percentage, so 0.5 = 50%. + * Validation: non-negative number. + *+ * + *
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The thresholdPercent.
+ */
+ @java.lang.Override
+ public double getThresholdPercent() {
+ return thresholdPercent_;
+ }
+
+ public static final int SPEND_BASIS_FIELD_NUMBER = 2;
+ private int spendBasis_;
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for spendBasis.
+ */
+ @java.lang.Override
+ public int getSpendBasisValue() {
+ return spendBasis_;
+ }
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The spendBasis.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.ThresholdRule.Basis getSpendBasis() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Basis result =
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.valueOf(spendBasis_);
+ return result == null
+ ? com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.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 (thresholdPercent_ != 0D) {
+ output.writeDouble(1, thresholdPercent_);
+ }
+ if (spendBasis_
+ != com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.BASIS_UNSPECIFIED.getNumber()) {
+ output.writeEnum(2, spendBasis_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (thresholdPercent_ != 0D) {
+ size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, thresholdPercent_);
+ }
+ if (spendBasis_
+ != com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.BASIS_UNSPECIFIED.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, spendBasis_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.ThresholdRule)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.ThresholdRule other =
+ (com.google.cloud.billing.budgets.v1.ThresholdRule) obj;
+
+ if (java.lang.Double.doubleToLongBits(getThresholdPercent())
+ != java.lang.Double.doubleToLongBits(other.getThresholdPercent())) return false;
+ if (spendBasis_ != other.spendBasis_) return false;
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + THRESHOLD_PERCENT_FIELD_NUMBER;
+ hash =
+ (53 * hash)
+ + com.google.protobuf.Internal.hashLong(
+ java.lang.Double.doubleToLongBits(getThresholdPercent()));
+ hash = (37 * hash) + SPEND_BASIS_FIELD_NUMBER;
+ hash = (53 * hash) + spendBasis_;
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(com.google.cloud.billing.budgets.v1.ThresholdRule 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;
+ }
+ /**
+ *
+ *
+ * + * ThresholdRule contains a definition of a threshold which triggers + * an alert (a notification of a threshold being crossed) to be sent when + * spend goes above the specified amount. + * Alerts are automatically e-mailed to users with the Billing Account + * Administrator role or the Billing Account User role. + * The thresholds here have no effect on notifications sent to anything + * configured under `Budget.all_updates_rule`. + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.ThresholdRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. Send an alert when this threshold is exceeded. + * This is a 1.0-based percentage, so 0.5 = 50%. + * Validation: non-negative number. + *+ * + *
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The thresholdPercent.
+ */
+ @java.lang.Override
+ public double getThresholdPercent() {
+ return thresholdPercent_;
+ }
+ /**
+ *
+ *
+ * + * Required. Send an alert when this threshold is exceeded. + * This is a 1.0-based percentage, so 0.5 = 50%. + * Validation: non-negative number. + *+ * + *
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @param value The thresholdPercent to set.
+ * @return This builder for chaining.
+ */
+ public Builder setThresholdPercent(double value) {
+
+ thresholdPercent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. Send an alert when this threshold is exceeded. + * This is a 1.0-based percentage, so 0.5 = 50%. + * Validation: non-negative number. + *+ * + *
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearThresholdPercent() {
+
+ thresholdPercent_ = 0D;
+ onChanged();
+ return this;
+ }
+
+ private int spendBasis_ = 0;
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for spendBasis.
+ */
+ @java.lang.Override
+ public int getSpendBasisValue() {
+ return spendBasis_;
+ }
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The enum numeric value on the wire for spendBasis to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSpendBasisValue(int value) {
+
+ spendBasis_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The spendBasis.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.ThresholdRule.Basis getSpendBasis() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Basis result =
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.valueOf(spendBasis_);
+ return result == null
+ ? com.google.cloud.billing.budgets.v1.ThresholdRule.Basis.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @param value The spendBasis to set.
+ * @return This builder for chaining.
+ */
+ public Builder setSpendBasis(com.google.cloud.billing.budgets.v1.ThresholdRule.Basis value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ spendBasis_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearSpendBasis() {
+
+ spendBasis_ = 0;
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.ThresholdRule)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.ThresholdRule)
+ private static final com.google.cloud.billing.budgets.v1.ThresholdRule DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.ThresholdRule();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.ThresholdRule getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. Send an alert when this threshold is exceeded. + * This is a 1.0-based percentage, so 0.5 = 50%. + * Validation: non-negative number. + *+ * + *
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ * @return The thresholdPercent.
+ */
+ double getThresholdPercent();
+
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The enum numeric value on the wire for spendBasis.
+ */
+ int getSpendBasisValue();
+ /**
+ *
+ *
+ * + * Optional. The type of basis used to determine if spend has passed the + * threshold. Behavior defaults to CURRENT_SPEND if not set. + *+ * + *
+ * .google.cloud.billing.budgets.v1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The spendBasis.
+ */
+ com.google.cloud.billing.budgets.v1.ThresholdRule.Basis getSpendBasis();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/UpdateBudgetRequest.java b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/UpdateBudgetRequest.java
new file mode 100644
index 00000000..e8716dab
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/java/com/google/cloud/billing/budgets/v1/UpdateBudgetRequest.java
@@ -0,0 +1,1114 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/billing/budgets/v1/budget_service.proto
+
+package com.google.cloud.billing.budgets.v1;
+
+/**
+ *
+ *
+ * + * Request for UpdateBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.UpdateBudgetRequest} + */ +public final class UpdateBudgetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.billing.budgets.v1.UpdateBudgetRequest) + UpdateBudgetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBudgetRequest.newBuilder() to construct. + private UpdateBudgetRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + + private UpdateBudgetRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBudgetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBudgetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.billing.budgets.v1.Budget.Builder subBuilder = null; + if (budget_ != null) { + subBuilder = budget_.toBuilder(); + } + budget_ = + input.readMessage( + com.google.cloud.billing.budgets.v1.Budget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(budget_); + budget_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.billing.budgets.v1.BudgetServiceProto + .internal_static_google_cloud_billing_budgets_v1_UpdateBudgetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.billing.budgets.v1.UpdateBudgetRequest.class, + com.google.cloud.billing.budgets.v1.UpdateBudgetRequest.Builder.class); + } + + public static final int BUDGET_FIELD_NUMBER = 1; + private com.google.cloud.billing.budgets.v1.Budget budget_; + /** + * + * + *
+ * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ @java.lang.Override
+ public boolean hasBudget() {
+ return budget_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.Budget getBudget() {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ @java.lang.Override
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder() {
+ return getBudget();
+ }
+
+ public static final int UPDATE_MASK_FIELD_NUMBER = 2;
+ private com.google.protobuf.FieldMask updateMask_;
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the updateMask field is set.
+ */
+ @java.lang.Override
+ public boolean hasUpdateMask() {
+ return updateMask_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.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. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ @java.lang.Override
+ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
+ return getUpdateMask();
+ }
+
+ private byte memoizedIsInitialized = -1;
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
+ if (budget_ != null) {
+ output.writeMessage(1, getBudget());
+ }
+ if (updateMask_ != null) {
+ output.writeMessage(2, getUpdateMask());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (budget_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBudget());
+ }
+ if (updateMask_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask());
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof com.google.cloud.billing.budgets.v1.UpdateBudgetRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.billing.budgets.v1.UpdateBudgetRequest other =
+ (com.google.cloud.billing.budgets.v1.UpdateBudgetRequest) obj;
+
+ if (hasBudget() != other.hasBudget()) return false;
+ if (hasBudget()) {
+ if (!getBudget().equals(other.getBudget())) return false;
+ }
+ if (hasUpdateMask() != other.hasUpdateMask()) return false;
+ if (hasUpdateMask()) {
+ if (!getUpdateMask().equals(other.getUpdateMask())) return false;
+ }
+ if (!unknownFields.equals(other.unknownFields)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ if (hasBudget()) {
+ hash = (37 * hash) + BUDGET_FIELD_NUMBER;
+ hash = (53 * hash) + getBudget().hashCode();
+ }
+ if (hasUpdateMask()) {
+ hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
+ hash = (53 * hash) + getUpdateMask().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseDelimitedFrom(
+ java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
+ PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() {
+ return newBuilder();
+ }
+
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+
+ public static Builder newBuilder(
+ com.google.cloud.billing.budgets.v1.UpdateBudgetRequest 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 UpdateBudget + *+ * + * Protobuf type {@code google.cloud.billing.budgets.v1.UpdateBudgetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ public boolean hasBudget() {
+ return budgetBuilder_ != null || budget_ != null;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ public com.google.cloud.billing.budgets.v1.Budget getBudget() {
+ if (budgetBuilder_ == null) {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ } else {
+ return budgetBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setBudget(com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ budget_ = value;
+ onChanged();
+ } else {
+ budgetBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder setBudget(com.google.cloud.billing.budgets.v1.Budget.Builder builderForValue) {
+ if (budgetBuilder_ == null) {
+ budget_ = builderForValue.build();
+ onChanged();
+ } else {
+ budgetBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder mergeBudget(com.google.cloud.billing.budgets.v1.Budget value) {
+ if (budgetBuilder_ == null) {
+ if (budget_ != null) {
+ budget_ =
+ com.google.cloud.billing.budgets.v1.Budget.newBuilder(budget_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ budget_ = value;
+ }
+ onChanged();
+ } else {
+ budgetBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public Builder clearBudget() {
+ if (budgetBuilder_ == null) {
+ budget_ = null;
+ onChanged();
+ } else {
+ budget_ = null;
+ budgetBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.Budget.Builder getBudgetBuilder() {
+
+ onChanged();
+ return getBudgetFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ public com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder() {
+ if (budgetBuilder_ != null) {
+ return budgetBuilder_.getMessageOrBuilder();
+ } else {
+ return budget_ == null
+ ? com.google.cloud.billing.budgets.v1.Budget.getDefaultInstance()
+ : budget_;
+ }
+ }
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Budget,
+ com.google.cloud.billing.budgets.v1.Budget.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder>
+ getBudgetFieldBuilder() {
+ if (budgetBuilder_ == null) {
+ budgetBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.billing.budgets.v1.Budget,
+ com.google.cloud.billing.budgets.v1.Budget.Builder,
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder>(
+ getBudget(), getParentForChildren(), isClean());
+ budget_ = null;
+ }
+ return budgetBuilder_;
+ }
+
+ 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. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the updateMask field is set.
+ */
+ public boolean hasUpdateMask() {
+ return updateMaskBuilder_ != null || updateMask_ != null;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.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. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
+ if (updateMaskBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ updateMask_ = value;
+ onChanged();
+ } else {
+ updateMaskBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) {
+ if (updateMaskBuilder_ == null) {
+ updateMask_ = builderForValue.build();
+ onChanged();
+ } else {
+ updateMaskBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
+ if (updateMaskBuilder_ == null) {
+ if (updateMask_ != null) {
+ updateMask_ =
+ com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
+ } else {
+ updateMask_ = value;
+ }
+ onChanged();
+ } else {
+ updateMaskBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public Builder clearUpdateMask() {
+ if (updateMaskBuilder_ == null) {
+ updateMask_ = null;
+ onChanged();
+ } else {
+ updateMask_ = null;
+ updateMaskBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {
+
+ onChanged();
+ return getUpdateMaskFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.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. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.FieldMask,
+ com.google.protobuf.FieldMask.Builder,
+ com.google.protobuf.FieldMaskOrBuilder>
+ getUpdateMaskFieldBuilder() {
+ if (updateMaskBuilder_ == null) {
+ updateMaskBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.FieldMask,
+ com.google.protobuf.FieldMask.Builder,
+ com.google.protobuf.FieldMaskOrBuilder>(
+ getUpdateMask(), getParentForChildren(), isClean());
+ updateMask_ = null;
+ }
+ return updateMaskBuilder_;
+ }
+
+ @java.lang.Override
+ public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.billing.budgets.v1.UpdateBudgetRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1.UpdateBudgetRequest)
+ private static final com.google.cloud.billing.budgets.v1.UpdateBudgetRequest DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.billing.budgets.v1.UpdateBudgetRequest();
+ }
+
+ public static com.google.cloud.billing.budgets.v1.UpdateBudgetRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return Whether the budget field is set.
+ */
+ boolean hasBudget();
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ *
+ * @return The budget.
+ */
+ com.google.cloud.billing.budgets.v1.Budget getBudget();
+ /**
+ *
+ *
+ * + * Required. The updated budget object. + * The budget to update is specified by the budget name in the budget. + *+ * + *
+ * .google.cloud.billing.budgets.v1.Budget budget = 1 [(.google.api.field_behavior) = REQUIRED];
+ *
+ */
+ com.google.cloud.billing.budgets.v1.BudgetOrBuilder getBudgetOrBuilder();
+
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return Whether the updateMask field is set.
+ */
+ boolean hasUpdateMask();
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ *
+ * @return The updateMask.
+ */
+ com.google.protobuf.FieldMask getUpdateMask();
+ /**
+ *
+ *
+ * + * Optional. Indicates which fields in the provided budget to update. + * Read-only fields (such as `name`) cannot be changed. If this is not + * provided, then only fields with non-default values from the request are + * updated. See + * https://developers.google.com/protocol-buffers/docs/proto3#default for more + * details about default values. + *+ * + *
.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];
+ *
+ */
+ com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder();
+}
diff --git a/proto-google-cloud-billingbudgets-v1/src/main/proto/google/cloud/billing/budgets/v1/budget_model.proto b/proto-google-cloud-billingbudgets-v1/src/main/proto/google/cloud/billing/budgets/v1/budget_model.proto
new file mode 100644
index 00000000..1cbdbd7b
--- /dev/null
+++ b/proto-google-cloud-billingbudgets-v1/src/main/proto/google/cloud/billing/budgets/v1/budget_model.proto
@@ -0,0 +1,228 @@
+// Copyright 2020 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package google.cloud.billing.budgets.v1;
+
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
+import "google/protobuf/struct.proto";
+import "google/type/money.proto";
+
+option go_package = "google.golang.org/genproto/googleapis/cloud/billing/budgets/v1;budgets";
+option java_multiple_files = true;
+option java_outer_classname = "BudgetModelProto";
+option java_package = "com.google.cloud.billing.budgets.v1";
+
+// A budget is a plan that describes what you expect to spend on Cloud
+// projects, plus the rules to execute as spend is tracked against that plan,
+// (for example, send an alert when 90% of the target spend is met).
+// Currently all plans are monthly budgets so the usage period(s) tracked are
+// implied (calendar months of usage back-to-back).
+message Budget {
+ option (google.api.resource) = {
+ type: "billingbudgets.googleapis.com/Budget"
+ pattern: "billingAccounts/{billing_account}/budgets/{budget}"
+ };
+
+ // Output only. Resource name of the budget.
+ // The resource name implies the scope of a budget. Values are of the form
+ // `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // User data for display name in UI. The name must be less than or equal to 60
+ // characters.
+ string display_name = 2;
+
+ // Optional. Filters that define which resources are used to compute
+ // the actual spend against the budget.
+ Filter budget_filter = 3 [(google.api.field_behavior) = OPTIONAL];
+
+ // Required. Budgeted amount.
+ BudgetAmount amount = 4 [(google.api.field_behavior) = REQUIRED];
+
+ // Optional. Rules that trigger alerts (notifications of thresholds
+ // being crossed) when spend exceeds the specified percentages of the budget.
+ repeated ThresholdRule threshold_rules = 5
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. Rules to apply to notifications sent based on budget spend and
+ // thresholds.
+ NotificationsRule notifications_rule = 6
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. Etag to validate that the object is unchanged for a
+ // read-modify-write operation.
+ // An empty etag will cause an update to overwrite other changes.
+ string etag = 7 [(google.api.field_behavior) = OPTIONAL];
+}
+
+// The budgeted amount for each usage period.
+message BudgetAmount {
+ // Specification for what amount to use as the budget.
+ oneof budget_amount {
+ // A specified amount to use as the budget.
+ // `currency_code` is optional. If specified, it must match the
+ // currency of the billing account. The `currency_code` is provided on
+ // output.
+ google.type.Money specified_amount = 1;
+
+ // Use the last period's actual spend as the budget for the present period.
+ LastPeriodAmount last_period_amount = 2;
+ }
+}
+
+// Describes a budget amount targeted to last period's spend.
+// At this time, the amount is automatically 100% of last period's spend;
+// that is, there are no other options yet.
+// Future configuration will be described here (for example, configuring a
+// percentage of last period's spend).
+message LastPeriodAmount {}
+
+// ThresholdRule contains a definition of a threshold which triggers
+// an alert (a notification of a threshold being crossed) to be sent when
+// spend goes above the specified amount.
+// Alerts are automatically e-mailed to users with the Billing Account
+// Administrator role or the Billing Account User role.
+// The thresholds here have no effect on notifications sent to anything
+// configured under `Budget.all_updates_rule`.
+message ThresholdRule {
+ // The type of basis used to determine if spend has passed the threshold.
+ enum Basis {
+ // Unspecified threshold basis.
+ BASIS_UNSPECIFIED = 0;
+
+ // Use current spend as the basis for comparison against the threshold.
+ CURRENT_SPEND = 1;
+
+ // Use forecasted spend for the period as the basis for comparison against
+ // the threshold.
+ FORECASTED_SPEND = 2;
+ }
+
+ // Required. Send an alert when this threshold is exceeded.
+ // This is a 1.0-based percentage, so 0.5 = 50%.
+ // Validation: non-negative number.
+ double threshold_percent = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // Optional. The type of basis used to determine if spend has passed the
+ // threshold. Behavior defaults to CURRENT_SPEND if not set.
+ Basis spend_basis = 2 [(google.api.field_behavior) = OPTIONAL];
+}
+
+// NotificationsRule defines notifications that are sent based on budget spend
+// and thresholds.
+message NotificationsRule {
+ // Optional. The name of the Pub/Sub topic where budget related messages will
+ // be published, in the form `projects/{project_id}/topics/{topic_id}`.
+ // Updates are sent at regular intervals to the topic. The topic needs to be
+ // created before the budget is created; see
+ // https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
+ // for more details.
+ // Caller is expected to have
+ // `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
+ // budget, otherwise, the API call will fail with PERMISSION_DENIED. See
+ // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
+ // for more details on Pub/Sub roles and permissions.
+ string pubsub_topic = 1 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. The schema version of the notification sent to `pubsub_topic`.
+ // Only "1.0" is accepted. It represents the JSON schema as defined in
+ // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
+ string schema_version = 2 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. Targets to send notifications to when a threshold is exceeded.
+ // This is in addition to default recipients who have billing account IAM
+ // roles. The value is the full REST resource name of a monitoring
+ // notification channel with the form
+ // `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
+ // channels are allowed. See
+ // https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
+ // for more details.
+ repeated string monitoring_notification_channels = 3
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. When set to true, disables default notifications sent when a
+ // threshold is exceeded. Default notifications are sent to those with Billing
+ // Account Administrator and Billing Account User IAM roles for the target
+ // account.
+ bool disable_default_iam_recipients = 4
+ [(google.api.field_behavior) = OPTIONAL];
+}
+
+// A filter for a budget, limiting the scope of the cost to calculate.
+message Filter {
+ // Specifies how credits should be treated when determining spend for
+ // threshold calculations.
+ enum CreditTypesTreatment {
+ // This is an invalid value.
+ CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0;
+
+ // All types of credit are subtracted from the gross cost to determine the
+ // spend for threshold calculations.
+ INCLUDE_ALL_CREDITS = 1;
+
+ // All types of credit are added to the net cost to determine the spend for
+ // threshold calculations.
+ EXCLUDE_ALL_CREDITS = 2;
+
+ // Credit types specified in the credit_types field are subtracted from the
+ // gross cost to determine the spend for threshold calculations.
+ INCLUDE_SPECIFIED_CREDITS = 3;
+ }
+
+ // Optional. A set of projects of the form `projects/{project}`,
+ // specifying that usage from only this set of projects should be
+ // included in the budget. If omitted, the report will include all usage for
+ // the billing account, regardless of which project the usage occurred on.
+ // Only zero or one project can be specified currently.
+ repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. A list of credit types to be subtracted from gross cost to
+ // determine the spend for threshold calculations if and only if
+ // credit_types_treatment is INCLUDE_SPECIFIED_CREDITS. If
+ // credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be
+ // empty. See credits.type on
+ // https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#data-schema
+ // for a list of acceptable credit type values in this field.
+ repeated string credit_types = 7 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
+ CreditTypesTreatment credit_types_treatment = 4
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. A set of services of the form `services/{service_id}`,
+ // specifying that usage from only this set of services should be
+ // included in the budget. If omitted, the report will include usage for
+ // all the services.
+ // The service names are available through the Catalog API:
+ // https://cloud.google.com/billing/v1/how-tos/catalog-api.
+ repeated string services = 3 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`,
+ // specifying that usage from only this set of subaccounts should be included
+ // in the budget. If a subaccount is set to the name of the parent account,
+ // usage from the parent account will be included. If the field is omitted,
+ // the report will include usage from the parent account and all subaccounts,
+ // if they exist.
+ repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. A single label and value pair specifying that usage from only
+ // this set of labeled resources should be included in the budget. Currently,
+ // multiple entries or multiple values per entry are not allowed. If omitted,
+ // the report will include all labeled and unlabeled usage.
+ map