/*
 * Licensed under the Apache License, Version 2.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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudbilling;

/**
 * Service definition for Cloudbilling (v1).
 *
 * <p>
 * Allows developers to manage billing for their Google Cloud Platform projects
    programmatically.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://cloud.google.com/billing/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link CloudbillingRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Cloudbilling extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {

  // Note: Leave this static initializer at the top of the file.
  static {
    com.google.api.client.util.Preconditions.checkState(
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
        com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.15 of google-api-client to run version " +
        "1.28.0 of the Cloud Billing API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
  }

  /**
   * The default encoded root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_ROOT_URL = "https://cloudbilling.googleapis.com/";

  /**
   * The default encoded service path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_SERVICE_PATH = "";

  /**
   * The default encoded batch path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.23
   */
  public static final String DEFAULT_BATCH_PATH = "batch";

  /**
   * The default encoded base URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   */
  public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;

  /**
   * Constructor.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport HTTP transport, which should normally be:
   *        <ul>
   *        <li>Google App Engine:
   *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
   *        <li>Android: {@code newCompatibleTransport} from
   *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
   *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
   *        </li>
   *        </ul>
   * @param jsonFactory JSON factory, which may be:
   *        <ul>
   *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
   *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
   *        <li>Android Honeycomb or higher:
   *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
   *        </ul>
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Cloudbilling(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
      com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
    this(new Builder(transport, jsonFactory, httpRequestInitializer));
  }

  /**
   * @param builder builder
   */
  Cloudbilling(Builder builder) {
    super(builder);
  }

  @Override
  protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
    super.initialize(httpClientRequest);
  }

  /**
   * An accessor for creating requests from the BillingAccounts collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Cloudbilling cloudbilling = new Cloudbilling(...);}
   *   {@code Cloudbilling.BillingAccounts.List request = cloudbilling.billingAccounts().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public BillingAccounts billingAccounts() {
    return new BillingAccounts();
  }

  /**
   * The "billingAccounts" collection of methods.
   */
  public class BillingAccounts {

    /**
     * Creates a billing account. This method can only be used to create [billing
     * subaccounts](https://cloud.google.com/billing/docs/concepts) by GCP resellers. When creating a
     * subaccount, the current authenticated user must have the `billing.accounts.update` IAM permission
     * on the master account, which is typically given to billing account
     * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will
     * return an error if the master account has not been provisioned as a reseller account.
     *
     * Create a request for the method "billingAccounts.create".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link Create#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.cloudbilling.model.BillingAccount}
     * @return the request
     */
    public Create create(com.google.api.services.cloudbilling.model.BillingAccount content) throws java.io.IOException {
      Create result = new Create(content);
      initialize(result);
      return result;
    }

    public class Create extends CloudbillingRequest<com.google.api.services.cloudbilling.model.BillingAccount> {

      private static final String REST_PATH = "v1/billingAccounts";

      /**
       * Creates a billing account. This method can only be used to create [billing
       * subaccounts](https://cloud.google.com/billing/docs/concepts) by GCP resellers. When creating a
       * subaccount, the current authenticated user must have the `billing.accounts.update` IAM
       * permission on the master account, which is typically given to billing account
       * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will
       * return an error if the master account has not been provisioned as a reseller account.
       *
       * Create a request for the method "billingAccounts.create".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
       * <p> {@link
       * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
       * be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param content the {@link com.google.api.services.cloudbilling.model.BillingAccount}
       * @since 1.13
       */
      protected Create(com.google.api.services.cloudbilling.model.BillingAccount content) {
        super(Cloudbilling.this, "POST", REST_PATH, content, com.google.api.services.cloudbilling.model.BillingAccount.class);
      }

      @Override
      public Create set$Xgafv(java.lang.String $Xgafv) {
        return (Create) super.set$Xgafv($Xgafv);
      }

      @Override
      public Create setAccessToken(java.lang.String accessToken) {
        return (Create) super.setAccessToken(accessToken);
      }

      @Override
      public Create setAlt(java.lang.String alt) {
        return (Create) super.setAlt(alt);
      }

      @Override
      public Create setCallback(java.lang.String callback) {
        return (Create) super.setCallback(callback);
      }

      @Override
      public Create setFields(java.lang.String fields) {
        return (Create) super.setFields(fields);
      }

      @Override
      public Create setKey(java.lang.String key) {
        return (Create) super.setKey(key);
      }

      @Override
      public Create setOauthToken(java.lang.String oauthToken) {
        return (Create) super.setOauthToken(oauthToken);
      }

      @Override
      public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Create) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Create setQuotaUser(java.lang.String quotaUser) {
        return (Create) super.setQuotaUser(quotaUser);
      }

      @Override
      public Create setUploadType(java.lang.String uploadType) {
        return (Create) super.setUploadType(uploadType);
      }

      @Override
      public Create setUploadProtocol(java.lang.String uploadProtocol) {
        return (Create) super.setUploadProtocol(uploadProtocol);
      }

      @Override
      public Create set(String parameterName, Object value) {
        return (Create) super.set(parameterName, value);
      }
    }
    /**
     * Gets information about a billing account. The current authenticated user must be a [viewer of the
     * billing account](https://cloud.google.com/billing/docs/how-to/billing-access).
     *
     * Create a request for the method "billingAccounts.get".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param name Required. The resource name of the billing account to retrieve. For example,
     *        `billingAccounts/012345-567890-ABCDEF`.
     * @return the request
     */
    public Get get(java.lang.String name) throws java.io.IOException {
      Get result = new Get(name);
      initialize(result);
      return result;
    }

    public class Get extends CloudbillingRequest<com.google.api.services.cloudbilling.model.BillingAccount> {

      private static final String REST_PATH = "v1/{+name}";

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

      /**
       * Gets information about a billing account. The current authenticated user must be a [viewer of
       * the billing account](https://cloud.google.com/billing/docs/how-to/billing-access).
       *
       * Create a request for the method "billingAccounts.get".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
       * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param name Required. The resource name of the billing account to retrieve. For example,
     *        `billingAccounts/012345-567890-ABCDEF`.
       * @since 1.13
       */
      protected Get(java.lang.String name) {
        super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.BillingAccount.class);
        this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get set$Xgafv(java.lang.String $Xgafv) {
        return (Get) super.set$Xgafv($Xgafv);
      }

      @Override
      public Get setAccessToken(java.lang.String accessToken) {
        return (Get) super.setAccessToken(accessToken);
      }

      @Override
      public Get setAlt(java.lang.String alt) {
        return (Get) super.setAlt(alt);
      }

      @Override
      public Get setCallback(java.lang.String callback) {
        return (Get) super.setCallback(callback);
      }

      @Override
      public Get setFields(java.lang.String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setKey(java.lang.String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setOauthToken(java.lang.String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setQuotaUser(java.lang.String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setUploadType(java.lang.String uploadType) {
        return (Get) super.setUploadType(uploadType);
      }

      @Override
      public Get setUploadProtocol(java.lang.String uploadProtocol) {
        return (Get) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * Required. The resource name of the billing account to retrieve. For example,
       * `billingAccounts/012345-567890-ABCDEF`.
       */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The resource name of the billing account to retrieve. For example,
     `billingAccounts/012345-567890-ABCDEF`.
       */
      public java.lang.String getName() {
        return name;
      }

      /**
       * Required. The resource name of the billing account to retrieve. For example,
       * `billingAccounts/012345-567890-ABCDEF`.
       */
      public Get setName(java.lang.String name) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }
    /**
     * Gets the access control policy for a billing account. The caller must have the
     * `billing.accounts.getIamPolicy` permission on the account, which is often given to billing
     * account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
     *
     * Create a request for the method "billingAccounts.getIamPolicy".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote operation.
     *
     * @param resource REQUIRED: The resource for which the policy is being requested.
    See the operation documentation for
     *        the appropriate value for this field.
     * @return the request
     */
    public GetIamPolicy getIamPolicy(java.lang.String resource) throws java.io.IOException {
      GetIamPolicy result = new GetIamPolicy(resource);
      initialize(result);
      return result;
    }

    public class GetIamPolicy extends CloudbillingRequest<com.google.api.services.cloudbilling.model.Policy> {

      private static final String REST_PATH = "v1/{+resource}:getIamPolicy";

      private final java.util.regex.Pattern RESOURCE_PATTERN =
          java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

      /**
       * Gets the access control policy for a billing account. The caller must have the
       * `billing.accounts.getIamPolicy` permission on the account, which is often given to billing
       * account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
       *
       * Create a request for the method "billingAccounts.getIamPolicy".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote
       * operation. <p> {@link
       * GetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param resource REQUIRED: The resource for which the policy is being requested.
    See the operation documentation for
     *        the appropriate value for this field.
       * @since 1.13
       */
      protected GetIamPolicy(java.lang.String resource) {
        super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.Policy.class);
        this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public GetIamPolicy set$Xgafv(java.lang.String $Xgafv) {
        return (GetIamPolicy) super.set$Xgafv($Xgafv);
      }

      @Override
      public GetIamPolicy setAccessToken(java.lang.String accessToken) {
        return (GetIamPolicy) super.setAccessToken(accessToken);
      }

      @Override
      public GetIamPolicy setAlt(java.lang.String alt) {
        return (GetIamPolicy) super.setAlt(alt);
      }

      @Override
      public GetIamPolicy setCallback(java.lang.String callback) {
        return (GetIamPolicy) super.setCallback(callback);
      }

      @Override
      public GetIamPolicy setFields(java.lang.String fields) {
        return (GetIamPolicy) super.setFields(fields);
      }

      @Override
      public GetIamPolicy setKey(java.lang.String key) {
        return (GetIamPolicy) super.setKey(key);
      }

      @Override
      public GetIamPolicy setOauthToken(java.lang.String oauthToken) {
        return (GetIamPolicy) super.setOauthToken(oauthToken);
      }

      @Override
      public GetIamPolicy setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (GetIamPolicy) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public GetIamPolicy setQuotaUser(java.lang.String quotaUser) {
        return (GetIamPolicy) super.setQuotaUser(quotaUser);
      }

      @Override
      public GetIamPolicy setUploadType(java.lang.String uploadType) {
        return (GetIamPolicy) super.setUploadType(uploadType);
      }

      @Override
      public GetIamPolicy setUploadProtocol(java.lang.String uploadProtocol) {
        return (GetIamPolicy) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * REQUIRED: The resource for which the policy is being requested. See the operation
       * documentation for the appropriate value for this field.
       */
      @com.google.api.client.util.Key
      private java.lang.String resource;

      /** REQUIRED: The resource for which the policy is being requested. See the operation documentation for
     the appropriate value for this field.
       */
      public java.lang.String getResource() {
        return resource;
      }

      /**
       * REQUIRED: The resource for which the policy is being requested. See the operation
       * documentation for the appropriate value for this field.
       */
      public GetIamPolicy setResource(java.lang.String resource) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
        this.resource = resource;
        return this;
      }

      /**
       * Optional. The policy format version to be returned.
       *
       * Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.
       *
       * Requests for policies with any conditional bindings must specify version 3. Policies
       * without any conditional bindings may specify any valid value or leave the field unset.
       */
      @com.google.api.client.util.Key("options.requestedPolicyVersion")
      private java.lang.Integer optionsRequestedPolicyVersion;

      /** Optional. The policy format version to be returned.

     Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.

     Requests for policies with any conditional bindings must specify version 3. Policies without any
     conditional bindings may specify any valid value or leave the field unset.
       */
      public java.lang.Integer getOptionsRequestedPolicyVersion() {
        return optionsRequestedPolicyVersion;
      }

      /**
       * Optional. The policy format version to be returned.
       *
       * Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.
       *
       * Requests for policies with any conditional bindings must specify version 3. Policies
       * without any conditional bindings may specify any valid value or leave the field unset.
       */
      public GetIamPolicy setOptionsRequestedPolicyVersion(java.lang.Integer optionsRequestedPolicyVersion) {
        this.optionsRequestedPolicyVersion = optionsRequestedPolicyVersion;
        return this;
      }

      @Override
      public GetIamPolicy set(String parameterName, Object value) {
        return (GetIamPolicy) super.set(parameterName, value);
      }
    }
    /**
     * Lists the billing accounts that the current authenticated user has permission to
     * [view](https://cloud.google.com/billing/docs/how-to/billing-access).
     *
     * Create a request for the method "billingAccounts.list".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @return the request
     */
    public List list() throws java.io.IOException {
      List result = new List();
      initialize(result);
      return result;
    }

    public class List extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ListBillingAccountsResponse> {

      private static final String REST_PATH = "v1/billingAccounts";

      /**
       * Lists the billing accounts that the current authenticated user has permission to
       * [view](https://cloud.google.com/billing/docs/how-to/billing-access).
       *
       * Create a request for the method "billingAccounts.list".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
       * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @since 1.13
       */
      protected List() {
        super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.ListBillingAccountsResponse.class);
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List set$Xgafv(java.lang.String $Xgafv) {
        return (List) super.set$Xgafv($Xgafv);
      }

      @Override
      public List setAccessToken(java.lang.String accessToken) {
        return (List) super.setAccessToken(accessToken);
      }

      @Override
      public List setAlt(java.lang.String alt) {
        return (List) super.setAlt(alt);
      }

      @Override
      public List setCallback(java.lang.String callback) {
        return (List) super.setCallback(callback);
      }

      @Override
      public List setFields(java.lang.String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setKey(java.lang.String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setOauthToken(java.lang.String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setQuotaUser(java.lang.String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setUploadType(java.lang.String uploadType) {
        return (List) super.setUploadType(uploadType);
      }

      @Override
      public List setUploadProtocol(java.lang.String uploadProtocol) {
        return (List) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * Options for how to filter the returned billing accounts. Currently this only supports
       * filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single
       * provided reseller billing account. (e.g.
       * "master_billing_account=billingAccounts/012345-678901-ABCDEF"). Boolean algebra and other
       * fields are not currently supported.
       */
      @com.google.api.client.util.Key
      private java.lang.String filter;

      /** Options for how to filter the returned billing accounts. Currently this only supports filtering for
     [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided reseller
     billing account. (e.g. "master_billing_account=billingAccounts/012345-678901-ABCDEF"). Boolean
     algebra and other fields are not currently supported.
       */
      public java.lang.String getFilter() {
        return filter;
      }

      /**
       * Options for how to filter the returned billing accounts. Currently this only supports
       * filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single
       * provided reseller billing account. (e.g.
       * "master_billing_account=billingAccounts/012345-678901-ABCDEF"). Boolean algebra and other
       * fields are not currently supported.
       */
      public List setFilter(java.lang.String filter) {
        this.filter = filter;
        return this;
      }

      /**
       * Requested page size. The maximum page size is 100; this is also the default.
       */
      @com.google.api.client.util.Key
      private java.lang.Integer pageSize;

      /** Requested page size. The maximum page size is 100; this is also the default.
       */
      public java.lang.Integer getPageSize() {
        return pageSize;
      }

      /**
       * Requested page size. The maximum page size is 100; this is also the default.
       */
      public List setPageSize(java.lang.Integer pageSize) {
        this.pageSize = pageSize;
        return this;
      }

      /**
       * A token identifying a page of results to return. This should be a `next_page_token` value
       * returned from a previous `ListBillingAccounts` call. If unspecified, the first page of
       * results is returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** A token identifying a page of results to return. This should be a `next_page_token` value returned
     from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * A token identifying a page of results to return. This should be a `next_page_token` value
       * returned from a previous `ListBillingAccounts` call. If unspecified, the first page of
       * results is returned.
       */
      public List setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      @Override
      public List set(String parameterName, Object value) {
        return (List) super.set(parameterName, value);
      }
    }
    /**
     * Updates a billing account's fields. Currently the only field that can be edited is
     * `display_name`. The current authenticated user must have the `billing.accounts.update` IAM
     * permission, which is typically given to the [administrator](https://cloud.google.com/billing/docs
     * /how-to/billing-access) of the billing account.
     *
     * Create a request for the method "billingAccounts.patch".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param name Required. The name of the billing account resource to be updated.
     * @param content the {@link com.google.api.services.cloudbilling.model.BillingAccount}
     * @return the request
     */
    public Patch patch(java.lang.String name, com.google.api.services.cloudbilling.model.BillingAccount content) throws java.io.IOException {
      Patch result = new Patch(name, content);
      initialize(result);
      return result;
    }

    public class Patch extends CloudbillingRequest<com.google.api.services.cloudbilling.model.BillingAccount> {

      private static final String REST_PATH = "v1/{+name}";

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

      /**
       * Updates a billing account's fields. Currently the only field that can be edited is
       * `display_name`. The current authenticated user must have the `billing.accounts.update` IAM
       * permission, which is typically given to the
       * [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) of the billing
       * account.
       *
       * Create a request for the method "billingAccounts.patch".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
       * <p> {@link
       * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
       * be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param name Required. The name of the billing account resource to be updated.
       * @param content the {@link com.google.api.services.cloudbilling.model.BillingAccount}
       * @since 1.13
       */
      protected Patch(java.lang.String name, com.google.api.services.cloudbilling.model.BillingAccount content) {
        super(Cloudbilling.this, "PATCH", REST_PATH, content, com.google.api.services.cloudbilling.model.BillingAccount.class);
        this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
      }

      @Override
      public Patch set$Xgafv(java.lang.String $Xgafv) {
        return (Patch) super.set$Xgafv($Xgafv);
      }

      @Override
      public Patch setAccessToken(java.lang.String accessToken) {
        return (Patch) super.setAccessToken(accessToken);
      }

      @Override
      public Patch setAlt(java.lang.String alt) {
        return (Patch) super.setAlt(alt);
      }

      @Override
      public Patch setCallback(java.lang.String callback) {
        return (Patch) super.setCallback(callback);
      }

      @Override
      public Patch setFields(java.lang.String fields) {
        return (Patch) super.setFields(fields);
      }

      @Override
      public Patch setKey(java.lang.String key) {
        return (Patch) super.setKey(key);
      }

      @Override
      public Patch setOauthToken(java.lang.String oauthToken) {
        return (Patch) super.setOauthToken(oauthToken);
      }

      @Override
      public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Patch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Patch setQuotaUser(java.lang.String quotaUser) {
        return (Patch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Patch setUploadType(java.lang.String uploadType) {
        return (Patch) super.setUploadType(uploadType);
      }

      @Override
      public Patch setUploadProtocol(java.lang.String uploadProtocol) {
        return (Patch) super.setUploadProtocol(uploadProtocol);
      }

      /** Required. The name of the billing account resource to be updated. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The name of the billing account resource to be updated.
       */
      public java.lang.String getName() {
        return name;
      }

      /** Required. The name of the billing account resource to be updated. */
      public Patch setName(java.lang.String name) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
        this.name = name;
        return this;
      }

      /**
       * The update mask applied to the resource. Only "display_name" is currently supported.
       */
      @com.google.api.client.util.Key
      private String updateMask;

      /** The update mask applied to the resource. Only "display_name" is currently supported.
       */
      public String getUpdateMask() {
        return updateMask;
      }

      /**
       * The update mask applied to the resource. Only "display_name" is currently supported.
       */
      public Patch setUpdateMask(String updateMask) {
        this.updateMask = updateMask;
        return this;
      }

      @Override
      public Patch set(String parameterName, Object value) {
        return (Patch) super.set(parameterName, value);
      }
    }
    /**
     * Sets the access control policy for a billing account. Replaces any existing policy. The caller
     * must have the `billing.accounts.setIamPolicy` permission on the account, which is often given to
     * billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
     *
     * Create a request for the method "billingAccounts.setIamPolicy".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote operation.
     *
     * @param resource REQUIRED: The resource for which the policy is being specified.
    See the operation documentation for
     *        the appropriate value for this field.
     * @param content the {@link com.google.api.services.cloudbilling.model.SetIamPolicyRequest}
     * @return the request
     */
    public SetIamPolicy setIamPolicy(java.lang.String resource, com.google.api.services.cloudbilling.model.SetIamPolicyRequest content) throws java.io.IOException {
      SetIamPolicy result = new SetIamPolicy(resource, content);
      initialize(result);
      return result;
    }

    public class SetIamPolicy extends CloudbillingRequest<com.google.api.services.cloudbilling.model.Policy> {

      private static final String REST_PATH = "v1/{+resource}:setIamPolicy";

      private final java.util.regex.Pattern RESOURCE_PATTERN =
          java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

      /**
       * Sets the access control policy for a billing account. Replaces any existing policy. The caller
       * must have the `billing.accounts.setIamPolicy` permission on the account, which is often given
       * to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-
       * access).
       *
       * Create a request for the method "billingAccounts.setIamPolicy".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote
       * operation. <p> {@link
       * SetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param resource REQUIRED: The resource for which the policy is being specified.
    See the operation documentation for
     *        the appropriate value for this field.
       * @param content the {@link com.google.api.services.cloudbilling.model.SetIamPolicyRequest}
       * @since 1.13
       */
      protected SetIamPolicy(java.lang.String resource, com.google.api.services.cloudbilling.model.SetIamPolicyRequest content) {
        super(Cloudbilling.this, "POST", REST_PATH, content, com.google.api.services.cloudbilling.model.Policy.class);
        this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
      }

      @Override
      public SetIamPolicy set$Xgafv(java.lang.String $Xgafv) {
        return (SetIamPolicy) super.set$Xgafv($Xgafv);
      }

      @Override
      public SetIamPolicy setAccessToken(java.lang.String accessToken) {
        return (SetIamPolicy) super.setAccessToken(accessToken);
      }

      @Override
      public SetIamPolicy setAlt(java.lang.String alt) {
        return (SetIamPolicy) super.setAlt(alt);
      }

      @Override
      public SetIamPolicy setCallback(java.lang.String callback) {
        return (SetIamPolicy) super.setCallback(callback);
      }

      @Override
      public SetIamPolicy setFields(java.lang.String fields) {
        return (SetIamPolicy) super.setFields(fields);
      }

      @Override
      public SetIamPolicy setKey(java.lang.String key) {
        return (SetIamPolicy) super.setKey(key);
      }

      @Override
      public SetIamPolicy setOauthToken(java.lang.String oauthToken) {
        return (SetIamPolicy) super.setOauthToken(oauthToken);
      }

      @Override
      public SetIamPolicy setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (SetIamPolicy) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public SetIamPolicy setQuotaUser(java.lang.String quotaUser) {
        return (SetIamPolicy) super.setQuotaUser(quotaUser);
      }

      @Override
      public SetIamPolicy setUploadType(java.lang.String uploadType) {
        return (SetIamPolicy) super.setUploadType(uploadType);
      }

      @Override
      public SetIamPolicy setUploadProtocol(java.lang.String uploadProtocol) {
        return (SetIamPolicy) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * REQUIRED: The resource for which the policy is being specified. See the operation
       * documentation for the appropriate value for this field.
       */
      @com.google.api.client.util.Key
      private java.lang.String resource;

      /** REQUIRED: The resource for which the policy is being specified. See the operation documentation for
     the appropriate value for this field.
       */
      public java.lang.String getResource() {
        return resource;
      }

      /**
       * REQUIRED: The resource for which the policy is being specified. See the operation
       * documentation for the appropriate value for this field.
       */
      public SetIamPolicy setResource(java.lang.String resource) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
        this.resource = resource;
        return this;
      }

      @Override
      public SetIamPolicy set(String parameterName, Object value) {
        return (SetIamPolicy) super.set(parameterName, value);
      }
    }
    /**
     * Tests the access control policy for a billing account. This method takes the resource and a set
     * of permissions as input and returns the subset of the input permissions that the caller is
     * allowed for that resource.
     *
     * Create a request for the method "billingAccounts.testIamPermissions".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote operation.
     *
     * @param resource REQUIRED: The resource for which the policy detail is being requested.
    See the operation
     *        documentation for the appropriate value for this field.
     * @param content the {@link com.google.api.services.cloudbilling.model.TestIamPermissionsRequest}
     * @return the request
     */
    public TestIamPermissions testIamPermissions(java.lang.String resource, com.google.api.services.cloudbilling.model.TestIamPermissionsRequest content) throws java.io.IOException {
      TestIamPermissions result = new TestIamPermissions(resource, content);
      initialize(result);
      return result;
    }

    public class TestIamPermissions extends CloudbillingRequest<com.google.api.services.cloudbilling.model.TestIamPermissionsResponse> {

      private static final String REST_PATH = "v1/{+resource}:testIamPermissions";

      private final java.util.regex.Pattern RESOURCE_PATTERN =
          java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

      /**
       * Tests the access control policy for a billing account. This method takes the resource and a set
       * of permissions as input and returns the subset of the input permissions that the caller is
       * allowed for that resource.
       *
       * Create a request for the method "billingAccounts.testIamPermissions".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote
       * operation. <p> {@link TestIamPermissions#initialize(com.google.api.client.googleapis.services.A
       * bstractGoogleClientRequest)} must be called to initialize this instance immediately after
       * invoking the constructor. </p>
       *
       * @param resource REQUIRED: The resource for which the policy detail is being requested.
    See the operation
     *        documentation for the appropriate value for this field.
       * @param content the {@link com.google.api.services.cloudbilling.model.TestIamPermissionsRequest}
       * @since 1.13
       */
      protected TestIamPermissions(java.lang.String resource, com.google.api.services.cloudbilling.model.TestIamPermissionsRequest content) {
        super(Cloudbilling.this, "POST", REST_PATH, content, com.google.api.services.cloudbilling.model.TestIamPermissionsResponse.class);
        this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
      }

      @Override
      public TestIamPermissions set$Xgafv(java.lang.String $Xgafv) {
        return (TestIamPermissions) super.set$Xgafv($Xgafv);
      }

      @Override
      public TestIamPermissions setAccessToken(java.lang.String accessToken) {
        return (TestIamPermissions) super.setAccessToken(accessToken);
      }

      @Override
      public TestIamPermissions setAlt(java.lang.String alt) {
        return (TestIamPermissions) super.setAlt(alt);
      }

      @Override
      public TestIamPermissions setCallback(java.lang.String callback) {
        return (TestIamPermissions) super.setCallback(callback);
      }

      @Override
      public TestIamPermissions setFields(java.lang.String fields) {
        return (TestIamPermissions) super.setFields(fields);
      }

      @Override
      public TestIamPermissions setKey(java.lang.String key) {
        return (TestIamPermissions) super.setKey(key);
      }

      @Override
      public TestIamPermissions setOauthToken(java.lang.String oauthToken) {
        return (TestIamPermissions) super.setOauthToken(oauthToken);
      }

      @Override
      public TestIamPermissions setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (TestIamPermissions) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public TestIamPermissions setQuotaUser(java.lang.String quotaUser) {
        return (TestIamPermissions) super.setQuotaUser(quotaUser);
      }

      @Override
      public TestIamPermissions setUploadType(java.lang.String uploadType) {
        return (TestIamPermissions) super.setUploadType(uploadType);
      }

      @Override
      public TestIamPermissions setUploadProtocol(java.lang.String uploadProtocol) {
        return (TestIamPermissions) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * REQUIRED: The resource for which the policy detail is being requested. See the operation
       * documentation for the appropriate value for this field.
       */
      @com.google.api.client.util.Key
      private java.lang.String resource;

      /** REQUIRED: The resource for which the policy detail is being requested. See the operation
     documentation for the appropriate value for this field.
       */
      public java.lang.String getResource() {
        return resource;
      }

      /**
       * REQUIRED: The resource for which the policy detail is being requested. See the operation
       * documentation for the appropriate value for this field.
       */
      public TestIamPermissions setResource(java.lang.String resource) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
              "Parameter resource must conform to the pattern " +
              "^billingAccounts/[^/]+$");
        }
        this.resource = resource;
        return this;
      }

      @Override
      public TestIamPermissions set(String parameterName, Object value) {
        return (TestIamPermissions) super.set(parameterName, value);
      }
    }

    /**
     * An accessor for creating requests from the Projects collection.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code Cloudbilling cloudbilling = new Cloudbilling(...);}
     *   {@code Cloudbilling.Projects.List request = cloudbilling.projects().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public Projects projects() {
      return new Projects();
    }

    /**
     * The "projects" collection of methods.
     */
    public class Projects {

      /**
       * Lists the projects associated with a billing account. The current authenticated user must have
       * the `billing.resourceAssociations.list` IAM permission, which is often given to billing account
       * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
       *
       * Create a request for the method "projects.list".
       *
       * This request holds the parameters needed by the cloudbilling server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param name Required. The resource name of the billing account associated with the projects that
      you want to
       *        list. For example, `billingAccounts/012345-567890-ABCDEF`.
       * @return the request
       */
      public List list(java.lang.String name) throws java.io.IOException {
        List result = new List(name);
        initialize(result);
        return result;
      }

      public class List extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ListProjectBillingInfoResponse> {

        private static final String REST_PATH = "v1/{+name}/projects";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^billingAccounts/[^/]+$");

        /**
         * Lists the projects associated with a billing account. The current authenticated user must have
         * the `billing.resourceAssociations.list` IAM permission, which is often given to billing account
         * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
         *
         * Create a request for the method "projects.list".
         *
         * This request holds the parameters needed by the the cloudbilling server.  After setting any
         * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
         * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Required. The resource name of the billing account associated with the projects that
      you want to
       *        list. For example, `billingAccounts/012345-567890-ABCDEF`.
         * @since 1.13
         */
        protected List(java.lang.String name) {
          super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.ListProjectBillingInfoResponse.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^billingAccounts/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public List set$Xgafv(java.lang.String $Xgafv) {
          return (List) super.set$Xgafv($Xgafv);
        }

        @Override
        public List setAccessToken(java.lang.String accessToken) {
          return (List) super.setAccessToken(accessToken);
        }

        @Override
        public List setAlt(java.lang.String alt) {
          return (List) super.setAlt(alt);
        }

        @Override
        public List setCallback(java.lang.String callback) {
          return (List) super.setCallback(callback);
        }

        @Override
        public List setFields(java.lang.String fields) {
          return (List) super.setFields(fields);
        }

        @Override
        public List setKey(java.lang.String key) {
          return (List) super.setKey(key);
        }

        @Override
        public List setOauthToken(java.lang.String oauthToken) {
          return (List) super.setOauthToken(oauthToken);
        }

        @Override
        public List setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (List) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public List setQuotaUser(java.lang.String quotaUser) {
          return (List) super.setQuotaUser(quotaUser);
        }

        @Override
        public List setUploadType(java.lang.String uploadType) {
          return (List) super.setUploadType(uploadType);
        }

        @Override
        public List setUploadProtocol(java.lang.String uploadProtocol) {
          return (List) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The resource name of the billing account associated with the projects that you
         * want to list. For example, `billingAccounts/012345-567890-ABCDEF`.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. The resource name of the billing account associated with the projects that you want to
       list. For example, `billingAccounts/012345-567890-ABCDEF`.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. The resource name of the billing account associated with the projects that you
         * want to list. For example, `billingAccounts/012345-567890-ABCDEF`.
         */
        public List setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^billingAccounts/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * Requested page size. The maximum page size is 100; this is also the default.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** Requested page size. The maximum page size is 100; this is also the default.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * Requested page size. The maximum page size is 100; this is also the default.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * A token identifying a page of results to be returned. This should be a `next_page_token`
         * value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first
         * page of results is returned.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** A token identifying a page of results to be returned. This should be a `next_page_token` value
       returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results
       is returned.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * A token identifying a page of results to be returned. This should be a `next_page_token`
         * value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first
         * page of results is returned.
         */
        public List setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        @Override
        public List set(String parameterName, Object value) {
          return (List) super.set(parameterName, value);
        }
      }

    }
  }

  /**
   * An accessor for creating requests from the Projects collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Cloudbilling cloudbilling = new Cloudbilling(...);}
   *   {@code Cloudbilling.Projects.List request = cloudbilling.projects().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Projects projects() {
    return new Projects();
  }

  /**
   * The "projects" collection of methods.
   */
  public class Projects {

    /**
     * Gets the billing information for a project. The current authenticated user must have [permission
     * to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ).
     *
     * Create a request for the method "projects.getBillingInfo".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link GetBillingInfo#execute()} method to invoke the remote operation.
     *
     * @param name Required. The resource name of the project for which billing information is
    retrieved. For example,
     *        `projects/tokyo-rain-123`.
     * @return the request
     */
    public GetBillingInfo getBillingInfo(java.lang.String name) throws java.io.IOException {
      GetBillingInfo result = new GetBillingInfo(name);
      initialize(result);
      return result;
    }

    public class GetBillingInfo extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ProjectBillingInfo> {

      private static final String REST_PATH = "v1/{+name}/billingInfo";

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^projects/[^/]+$");

      /**
       * Gets the billing information for a project. The current authenticated user must have
       * [permission to view the project](https://cloud.google.com/docs/permissions-
       * overview#h.bgs0oxofvnoo ).
       *
       * Create a request for the method "projects.getBillingInfo".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link GetBillingInfo#execute()} method to invoke the remote
       * operation. <p> {@link GetBillingInfo#initialize(com.google.api.client.googleapis.services.Abstr
       * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
       * the constructor. </p>
       *
       * @param name Required. The resource name of the project for which billing information is
    retrieved. For example,
     *        `projects/tokyo-rain-123`.
       * @since 1.13
       */
      protected GetBillingInfo(java.lang.String name) {
        super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.ProjectBillingInfo.class);
        this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^projects/[^/]+$");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public GetBillingInfo set$Xgafv(java.lang.String $Xgafv) {
        return (GetBillingInfo) super.set$Xgafv($Xgafv);
      }

      @Override
      public GetBillingInfo setAccessToken(java.lang.String accessToken) {
        return (GetBillingInfo) super.setAccessToken(accessToken);
      }

      @Override
      public GetBillingInfo setAlt(java.lang.String alt) {
        return (GetBillingInfo) super.setAlt(alt);
      }

      @Override
      public GetBillingInfo setCallback(java.lang.String callback) {
        return (GetBillingInfo) super.setCallback(callback);
      }

      @Override
      public GetBillingInfo setFields(java.lang.String fields) {
        return (GetBillingInfo) super.setFields(fields);
      }

      @Override
      public GetBillingInfo setKey(java.lang.String key) {
        return (GetBillingInfo) super.setKey(key);
      }

      @Override
      public GetBillingInfo setOauthToken(java.lang.String oauthToken) {
        return (GetBillingInfo) super.setOauthToken(oauthToken);
      }

      @Override
      public GetBillingInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (GetBillingInfo) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public GetBillingInfo setQuotaUser(java.lang.String quotaUser) {
        return (GetBillingInfo) super.setQuotaUser(quotaUser);
      }

      @Override
      public GetBillingInfo setUploadType(java.lang.String uploadType) {
        return (GetBillingInfo) super.setUploadType(uploadType);
      }

      @Override
      public GetBillingInfo setUploadProtocol(java.lang.String uploadProtocol) {
        return (GetBillingInfo) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * Required. The resource name of the project for which billing information is retrieved. For
       * example, `projects/tokyo-rain-123`.
       */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The resource name of the project for which billing information is retrieved. For example,
     `projects/tokyo-rain-123`.
       */
      public java.lang.String getName() {
        return name;
      }

      /**
       * Required. The resource name of the project for which billing information is retrieved. For
       * example, `projects/tokyo-rain-123`.
       */
      public GetBillingInfo setName(java.lang.String name) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^projects/[^/]+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public GetBillingInfo set(String parameterName, Object value) {
        return (GetBillingInfo) super.set(parameterName, value);
      }
    }
    /**
     * Sets or updates the billing account associated with a project. You specify the new billing
     * account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the
     * resource name of a billing account. Associating a project with an open billing account enables
     * billing on the project and allows charges for resource usage. If the project already had a
     * billing account, this method changes the billing account used for resource usage charges.
     *
     * *Note:* Incurred charges that have not yet been reported in the transaction history of the GCP
     * Console might be billed to the new billing account, even if the charge occurred before the new
     * billing account was assigned to the project.
     *
     * The current authenticated user must have ownership privileges for both the
     * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing
     * account](https://cloud.google.com/billing/docs/how-to/billing-access).
     *
     * You can disable billing on the project by setting the `billing_account_name` field to empty. This
     * action disassociates the current billing account from the project. Any billable activity of your
     * in-use services will stop, and your application could stop functioning as expected. Any unbilled
     * charges to date will be billed to the previously associated account. The current authenticated
     * user must be either an owner of the project or an owner of the billing account for the project.
     *
     * Note that associating a project with a *closed* billing account will have much the same effect as
     * disabling billing on the project: any paid resources used by the project will be shut down. Thus,
     * unless you wish to disable billing, you should always call this method with the name of an *open*
     * billing account.
     *
     * Create a request for the method "projects.updateBillingInfo".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link UpdateBillingInfo#execute()} method to invoke the remote operation.
     *
     * @param name Required. The resource name of the project associated with the billing information
    that you want to
     *        update. For example, `projects/tokyo-rain-123`.
     * @param content the {@link com.google.api.services.cloudbilling.model.ProjectBillingInfo}
     * @return the request
     */
    public UpdateBillingInfo updateBillingInfo(java.lang.String name, com.google.api.services.cloudbilling.model.ProjectBillingInfo content) throws java.io.IOException {
      UpdateBillingInfo result = new UpdateBillingInfo(name, content);
      initialize(result);
      return result;
    }

    public class UpdateBillingInfo extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ProjectBillingInfo> {

      private static final String REST_PATH = "v1/{+name}/billingInfo";

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^projects/[^/]+$");

      /**
       * Sets or updates the billing account associated with a project. You specify the new billing
       * account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the
       * resource name of a billing account. Associating a project with an open billing account enables
       * billing on the project and allows charges for resource usage. If the project already had a
       * billing account, this method changes the billing account used for resource usage charges.
       *
       * *Note:* Incurred charges that have not yet been reported in the transaction history of the GCP
       * Console might be billed to the new billing account, even if the charge occurred before the new
       * billing account was assigned to the project.
       *
       * The current authenticated user must have ownership privileges for both the
       * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing
       * account](https://cloud.google.com/billing/docs/how-to/billing-access).
       *
       * You can disable billing on the project by setting the `billing_account_name` field to empty.
       * This action disassociates the current billing account from the project. Any billable activity
       * of your in-use services will stop, and your application could stop functioning as expected. Any
       * unbilled charges to date will be billed to the previously associated account. The current
       * authenticated user must be either an owner of the project or an owner of the billing account
       * for the project.
       *
       * Note that associating a project with a *closed* billing account will have much the same effect
       * as disabling billing on the project: any paid resources used by the project will be shut down.
       * Thus, unless you wish to disable billing, you should always call this method with the name of
       * an *open* billing account.
       *
       * Create a request for the method "projects.updateBillingInfo".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link UpdateBillingInfo#execute()} method to invoke the remote
       * operation. <p> {@link UpdateBillingInfo#initialize(com.google.api.client.googleapis.services.Ab
       * stractGoogleClientRequest)} must be called to initialize this instance immediately after
       * invoking the constructor. </p>
       *
       * @param name Required. The resource name of the project associated with the billing information
    that you want to
     *        update. For example, `projects/tokyo-rain-123`.
       * @param content the {@link com.google.api.services.cloudbilling.model.ProjectBillingInfo}
       * @since 1.13
       */
      protected UpdateBillingInfo(java.lang.String name, com.google.api.services.cloudbilling.model.ProjectBillingInfo content) {
        super(Cloudbilling.this, "PUT", REST_PATH, content, com.google.api.services.cloudbilling.model.ProjectBillingInfo.class);
        this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^projects/[^/]+$");
        }
      }

      @Override
      public UpdateBillingInfo set$Xgafv(java.lang.String $Xgafv) {
        return (UpdateBillingInfo) super.set$Xgafv($Xgafv);
      }

      @Override
      public UpdateBillingInfo setAccessToken(java.lang.String accessToken) {
        return (UpdateBillingInfo) super.setAccessToken(accessToken);
      }

      @Override
      public UpdateBillingInfo setAlt(java.lang.String alt) {
        return (UpdateBillingInfo) super.setAlt(alt);
      }

      @Override
      public UpdateBillingInfo setCallback(java.lang.String callback) {
        return (UpdateBillingInfo) super.setCallback(callback);
      }

      @Override
      public UpdateBillingInfo setFields(java.lang.String fields) {
        return (UpdateBillingInfo) super.setFields(fields);
      }

      @Override
      public UpdateBillingInfo setKey(java.lang.String key) {
        return (UpdateBillingInfo) super.setKey(key);
      }

      @Override
      public UpdateBillingInfo setOauthToken(java.lang.String oauthToken) {
        return (UpdateBillingInfo) super.setOauthToken(oauthToken);
      }

      @Override
      public UpdateBillingInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (UpdateBillingInfo) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public UpdateBillingInfo setQuotaUser(java.lang.String quotaUser) {
        return (UpdateBillingInfo) super.setQuotaUser(quotaUser);
      }

      @Override
      public UpdateBillingInfo setUploadType(java.lang.String uploadType) {
        return (UpdateBillingInfo) super.setUploadType(uploadType);
      }

      @Override
      public UpdateBillingInfo setUploadProtocol(java.lang.String uploadProtocol) {
        return (UpdateBillingInfo) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * Required. The resource name of the project associated with the billing information that you
       * want to update. For example, `projects/tokyo-rain-123`.
       */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The resource name of the project associated with the billing information that you want to
     update. For example, `projects/tokyo-rain-123`.
       */
      public java.lang.String getName() {
        return name;
      }

      /**
       * Required. The resource name of the project associated with the billing information that you
       * want to update. For example, `projects/tokyo-rain-123`.
       */
      public UpdateBillingInfo setName(java.lang.String name) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^projects/[^/]+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public UpdateBillingInfo set(String parameterName, Object value) {
        return (UpdateBillingInfo) super.set(parameterName, value);
      }
    }

  }

  /**
   * An accessor for creating requests from the Services collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Cloudbilling cloudbilling = new Cloudbilling(...);}
   *   {@code Cloudbilling.Services.List request = cloudbilling.services().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Services services() {
    return new Services();
  }

  /**
   * The "services" collection of methods.
   */
  public class Services {

    /**
     * Lists all public cloud services.
     *
     * Create a request for the method "services.list".
     *
     * This request holds the parameters needed by the cloudbilling server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @return the request
     */
    public List list() throws java.io.IOException {
      List result = new List();
      initialize(result);
      return result;
    }

    public class List extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ListServicesResponse> {

      private static final String REST_PATH = "v1/services";

      /**
       * Lists all public cloud services.
       *
       * Create a request for the method "services.list".
       *
       * This request holds the parameters needed by the the cloudbilling server.  After setting any
       * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
       * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @since 1.13
       */
      protected List() {
        super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.ListServicesResponse.class);
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List set$Xgafv(java.lang.String $Xgafv) {
        return (List) super.set$Xgafv($Xgafv);
      }

      @Override
      public List setAccessToken(java.lang.String accessToken) {
        return (List) super.setAccessToken(accessToken);
      }

      @Override
      public List setAlt(java.lang.String alt) {
        return (List) super.setAlt(alt);
      }

      @Override
      public List setCallback(java.lang.String callback) {
        return (List) super.setCallback(callback);
      }

      @Override
      public List setFields(java.lang.String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setKey(java.lang.String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setOauthToken(java.lang.String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setQuotaUser(java.lang.String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setUploadType(java.lang.String uploadType) {
        return (List) super.setUploadType(uploadType);
      }

      @Override
      public List setUploadProtocol(java.lang.String uploadProtocol) {
        return (List) super.setUploadProtocol(uploadProtocol);
      }

      /** Requested page size. Defaults to 5000. */
      @com.google.api.client.util.Key
      private java.lang.Integer pageSize;

      /** Requested page size. Defaults to 5000.
       */
      public java.lang.Integer getPageSize() {
        return pageSize;
      }

      /** Requested page size. Defaults to 5000. */
      public List setPageSize(java.lang.Integer pageSize) {
        this.pageSize = pageSize;
        return this;
      }

      /**
       * A token identifying a page of results to return. This should be a `next_page_token` value
       * returned from a previous `ListServices` call. If unspecified, the first page of results is
       * returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** A token identifying a page of results to return. This should be a `next_page_token` value returned
     from a previous `ListServices` call. If unspecified, the first page of results is returned.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * A token identifying a page of results to return. This should be a `next_page_token` value
       * returned from a previous `ListServices` call. If unspecified, the first page of results is
       * returned.
       */
      public List setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      @Override
      public List set(String parameterName, Object value) {
        return (List) super.set(parameterName, value);
      }
    }

    /**
     * An accessor for creating requests from the Skus collection.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code Cloudbilling cloudbilling = new Cloudbilling(...);}
     *   {@code Cloudbilling.Skus.List request = cloudbilling.skus().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public Skus skus() {
      return new Skus();
    }

    /**
     * The "skus" collection of methods.
     */
    public class Skus {

      /**
       * Lists all publicly available SKUs for a given cloud service.
       *
       * Create a request for the method "skus.list".
       *
       * This request holds the parameters needed by the cloudbilling server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The name of the service.
      Example: "services/DA34-426B-A397"
       * @return the request
       */
      public List list(java.lang.String parent) throws java.io.IOException {
        List result = new List(parent);
        initialize(result);
        return result;
      }

      public class List extends CloudbillingRequest<com.google.api.services.cloudbilling.model.ListSkusResponse> {

        private static final String REST_PATH = "v1/{+parent}/skus";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^services/[^/]+$");

        /**
         * Lists all publicly available SKUs for a given cloud service.
         *
         * Create a request for the method "skus.list".
         *
         * This request holds the parameters needed by the the cloudbilling server.  After setting any
         * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
         * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The name of the service.
      Example: "services/DA34-426B-A397"
         * @since 1.13
         */
        protected List(java.lang.String parent) {
          super(Cloudbilling.this, "GET", REST_PATH, null, com.google.api.services.cloudbilling.model.ListSkusResponse.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^services/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public List set$Xgafv(java.lang.String $Xgafv) {
          return (List) super.set$Xgafv($Xgafv);
        }

        @Override
        public List setAccessToken(java.lang.String accessToken) {
          return (List) super.setAccessToken(accessToken);
        }

        @Override
        public List setAlt(java.lang.String alt) {
          return (List) super.setAlt(alt);
        }

        @Override
        public List setCallback(java.lang.String callback) {
          return (List) super.setCallback(callback);
        }

        @Override
        public List setFields(java.lang.String fields) {
          return (List) super.setFields(fields);
        }

        @Override
        public List setKey(java.lang.String key) {
          return (List) super.setKey(key);
        }

        @Override
        public List setOauthToken(java.lang.String oauthToken) {
          return (List) super.setOauthToken(oauthToken);
        }

        @Override
        public List setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (List) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public List setQuotaUser(java.lang.String quotaUser) {
          return (List) super.setQuotaUser(quotaUser);
        }

        @Override
        public List setUploadType(java.lang.String uploadType) {
          return (List) super.setUploadType(uploadType);
        }

        @Override
        public List setUploadProtocol(java.lang.String uploadProtocol) {
          return (List) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The name of the service. Example: "services/DA34-426B-A397"
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The name of the service. Example: "services/DA34-426B-A397"
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The name of the service. Example: "services/DA34-426B-A397"
         */
        public List setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^services/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /**
         * The ISO 4217 currency code for the pricing info in the response proto. Will use the
         * conversion rate as of start_time. Optional. If not specified USD will be used.
         */
        @com.google.api.client.util.Key
        private java.lang.String currencyCode;

        /** The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate
       as of start_time. Optional. If not specified USD will be used.
         */
        public java.lang.String getCurrencyCode() {
          return currencyCode;
        }

        /**
         * The ISO 4217 currency code for the pricing info in the response proto. Will use the
         * conversion rate as of start_time. Optional. If not specified USD will be used.
         */
        public List setCurrencyCode(java.lang.String currencyCode) {
          this.currencyCode = currencyCode;
          return this;
        }

        /**
         * Optional exclusive end time of the time range for which the pricing versions will be
         * returned. Timestamps in the future are not allowed. The time range has to be within a
         * single calendar month in America/Los_Angeles timezone. Time range as a whole is optional.
         * If not specified, the latest pricing will be returned (up to 12 hours old at most).
         */
        @com.google.api.client.util.Key
        private String endTime;

        /** Optional exclusive end time of the time range for which the pricing versions will be returned.
       Timestamps in the future are not allowed. The time range has to be within a single calendar month
       in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest
       pricing will be returned (up to 12 hours old at most).
         */
        public String getEndTime() {
          return endTime;
        }

        /**
         * Optional exclusive end time of the time range for which the pricing versions will be
         * returned. Timestamps in the future are not allowed. The time range has to be within a
         * single calendar month in America/Los_Angeles timezone. Time range as a whole is optional.
         * If not specified, the latest pricing will be returned (up to 12 hours old at most).
         */
        public List setEndTime(String endTime) {
          this.endTime = endTime;
          return this;
        }

        /** Requested page size. Defaults to 5000. */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** Requested page size. Defaults to 5000.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /** Requested page size. Defaults to 5000. */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * A token identifying a page of results to return. This should be a `next_page_token` value
         * returned from a previous `ListSkus` call. If unspecified, the first page of results is
         * returned.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** A token identifying a page of results to return. This should be a `next_page_token` value returned
       from a previous `ListSkus` call. If unspecified, the first page of results is returned.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * A token identifying a page of results to return. This should be a `next_page_token` value
         * returned from a previous `ListSkus` call. If unspecified, the first page of results is
         * returned.
         */
        public List setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        /**
         * Optional inclusive start time of the time range for which the pricing versions will be
         * returned. Timestamps in the future are not allowed. The time range has to be within a
         * single calendar month in America/Los_Angeles timezone. Time range as a whole is optional.
         * If not specified, the latest pricing will be returned (up to 12 hours old at most).
         */
        @com.google.api.client.util.Key
        private String startTime;

        /** Optional inclusive start time of the time range for which the pricing versions will be returned.
       Timestamps in the future are not allowed. The time range has to be within a single calendar month
       in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest
       pricing will be returned (up to 12 hours old at most).
         */
        public String getStartTime() {
          return startTime;
        }

        /**
         * Optional inclusive start time of the time range for which the pricing versions will be
         * returned. Timestamps in the future are not allowed. The time range has to be within a
         * single calendar month in America/Los_Angeles timezone. Time range as a whole is optional.
         * If not specified, the latest pricing will be returned (up to 12 hours old at most).
         */
        public List setStartTime(String startTime) {
          this.startTime = startTime;
          return this;
        }

        @Override
        public List set(String parameterName, Object value) {
          return (List) super.set(parameterName, value);
        }
      }

    }
  }

  /**
   * Builder for {@link Cloudbilling}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {

    /**
     * Returns an instance of a new builder.
     *
     * @param transport HTTP transport, which should normally be:
     *        <ul>
     *        <li>Google App Engine:
     *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
     *        <li>Android: {@code newCompatibleTransport} from
     *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
     *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
     *        </li>
     *        </ul>
     * @param jsonFactory JSON factory, which may be:
     *        <ul>
     *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
     *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
     *        <li>Android Honeycomb or higher:
     *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
     *        </ul>
     * @param httpRequestInitializer HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
        com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      super(
          transport,
          jsonFactory,
          DEFAULT_ROOT_URL,
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Cloudbilling}. */
    @Override
    public Cloudbilling build() {
      return new Cloudbilling(this);
    }

    @Override
    public Builder setRootUrl(String rootUrl) {
      return (Builder) super.setRootUrl(rootUrl);
    }

    @Override
    public Builder setServicePath(String servicePath) {
      return (Builder) super.setServicePath(servicePath);
    }

    @Override
    public Builder setBatchPath(String batchPath) {
      return (Builder) super.setBatchPath(batchPath);
    }

    @Override
    public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
    }

    @Override
    public Builder setApplicationName(String applicationName) {
      return (Builder) super.setApplicationName(applicationName);
    }

    @Override
    public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
      return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
    }

    @Override
    public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
      return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
    }

    @Override
    public Builder setSuppressAllChecks(boolean suppressAllChecks) {
      return (Builder) super.setSuppressAllChecks(suppressAllChecks);
    }

    /**
     * Set the {@link CloudbillingRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setCloudbillingRequestInitializer(
        CloudbillingRequestInitializer cloudbillingRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(cloudbillingRequestInitializer);
    }

    @Override
    public Builder setGoogleClientRequestInitializer(
        com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
    }
  }
}
