/*
 * Licensed under the Apache License, Version 2.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.firebasestorage.v1beta;

/**
 * Service definition for Firebasestorage (v1beta).
 *
 * <p>
 * The Cloud Storage for Firebase API enables programmatic management of Cloud Storage buckets for use in Firebase projects
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://firebase.google.com/docs/storage" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link FirebasestorageRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Firebasestorage 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 >= 32 ||
        (com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 &&
        com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1)),
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.31.1 of google-api-client to run version " +
        "1.32.1 of the Cloud Storage for Firebase 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://firebasestorage.googleapis.com/";

  /**
   * The default encoded mTLS root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.31
   */
  public static final String DEFAULT_MTLS_ROOT_URL = "https://firebasestorage.mtls.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 Firebasestorage(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
   */
  Firebasestorage(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 Projects collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Firebasestorage firebasestorage = new Firebasestorage(...);}
   *   {@code Firebasestorage.Projects.List request = firebasestorage.projects().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Projects projects() {
    return new Projects();
  }

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

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

    /**
     * The "buckets" collection of methods.
     */
    public class Buckets {

      /**
       * Links a Google Cloud Storage bucket to a Firebase project.
       *
       * Create a request for the method "buckets.addFirebase".
       *
       * This request holds the parameters needed by the firebasestorage server.  After setting any
       * optional parameters, call the {@link AddFirebase#execute()} method to invoke the remote
       * operation.
       *
       * @param bucket Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
       * @param content the {@link com.google.api.services.firebasestorage.v1beta.model.AddFirebaseRequest}
       * @return the request
       */
      public AddFirebase addFirebase(java.lang.String bucket, com.google.api.services.firebasestorage.v1beta.model.AddFirebaseRequest content) throws java.io.IOException {
        AddFirebase result = new AddFirebase(bucket, content);
        initialize(result);
        return result;
      }

      public class AddFirebase extends FirebasestorageRequest<com.google.api.services.firebasestorage.v1beta.model.Bucket> {

        private static final String REST_PATH = "v1beta/{+bucket}:addFirebase";

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

        /**
         * Links a Google Cloud Storage bucket to a Firebase project.
         *
         * Create a request for the method "buckets.addFirebase".
         *
         * This request holds the parameters needed by the the firebasestorage server.  After setting any
         * optional parameters, call the {@link AddFirebase#execute()} method to invoke the remote
         * operation. <p> {@link
         * AddFirebase#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param bucket Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
         * @param content the {@link com.google.api.services.firebasestorage.v1beta.model.AddFirebaseRequest}
         * @since 1.13
         */
        protected AddFirebase(java.lang.String bucket, com.google.api.services.firebasestorage.v1beta.model.AddFirebaseRequest content) {
          super(Firebasestorage.this, "POST", REST_PATH, content, com.google.api.services.firebasestorage.v1beta.model.Bucket.class);
          this.bucket = com.google.api.client.util.Preconditions.checkNotNull(bucket, "Required parameter bucket must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(BUCKET_PATTERN.matcher(bucket).matches(),
                "Parameter bucket must conform to the pattern " +
                "^projects/[^/]+/buckets/[^/]+$");
          }
        }

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

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

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

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

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

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

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

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

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

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

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

        /**
         * Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        @com.google.api.client.util.Key
        private java.lang.String bucket;

        /** Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage
       bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        public java.lang.String getBucket() {
          return bucket;
        }

        /**
         * Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        public AddFirebase setBucket(java.lang.String bucket) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(BUCKET_PATTERN.matcher(bucket).matches(),
                "Parameter bucket must conform to the pattern " +
                "^projects/[^/]+/buckets/[^/]+$");
          }
          this.bucket = bucket;
          return this;
        }

        @Override
        public AddFirebase set(String parameterName, Object value) {
          return (AddFirebase) super.set(parameterName, value);
        }
      }
      /**
       * Gets a single linked storage bucket.
       *
       * Create a request for the method "buckets.get".
       *
       * This request holds the parameters needed by the firebasestorage server.  After setting any
       * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
       *
       * @param name Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
       * @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 FirebasestorageRequest<com.google.api.services.firebasestorage.v1beta.model.Bucket> {

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

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

        /**
         * Gets a single linked storage bucket.
         *
         * Create a request for the method "buckets.get".
         *
         * This request holds the parameters needed by the the firebasestorage 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. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(Firebasestorage.this, "GET", REST_PATH, null, com.google.api.services.firebasestorage.v1beta.model.Bucket.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/[^/]+/buckets/[^/]+$");
          }
        }

        @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. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage
       bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        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 " +
                "^projects/[^/]+/buckets/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Get set(String parameterName, Object value) {
          return (Get) super.set(parameterName, value);
        }
      }
      /**
       * Lists the linked storage buckets for a project.
       *
       * Create a request for the method "buckets.list".
       *
       * This request holds the parameters needed by the firebasestorage server.  After setting any
       * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param parent Required. Resource name of the parent Firebase project, `projects/{project_number}`.
       * @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 FirebasestorageRequest<com.google.api.services.firebasestorage.v1beta.model.ListBucketsResponse> {

        private static final String REST_PATH = "v1beta/{+parent}/buckets";

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

        /**
         * Lists the linked storage buckets for a project.
         *
         * Create a request for the method "buckets.list".
         *
         * This request holds the parameters needed by the the firebasestorage 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. Resource name of the parent Firebase project, `projects/{project_number}`.
         * @since 1.13
         */
        protected List(java.lang.String parent) {
          super(Firebasestorage.this, "GET", REST_PATH, null, com.google.api.services.firebasestorage.v1beta.model.ListBucketsResponse.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 " +
                "^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 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. Resource name of the parent Firebase project, `projects/{project_number}`. */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. Resource name of the parent Firebase project, `projects/{project_number}`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /** Required. Resource name of the parent Firebase project, `projects/{project_number}`. */
        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 " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /**
         * The maximum number of buckets to return. If not set, the server will use a reasonable
         * default.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** The maximum number of buckets to return. If not set, the server will use a reasonable default.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * The maximum number of buckets to return. If not set, the server will use a reasonable
         * default.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * A page token, received from a previous `ListBuckets` call. Provide this to retrieve the
         * subsequent page. When paginating, all other parameters provided to `ListBuckets` must
         * match the call that provided the page token.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** A page token, received from a previous `ListBuckets` call. Provide this to retrieve the subsequent
       page. When paginating, all other parameters provided to `ListBuckets` must match the call that
       provided the page token.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * A page token, received from a previous `ListBuckets` call. Provide this to retrieve the
         * subsequent page. When paginating, all other parameters provided to `ListBuckets` must
         * match the call that provided the page token.
         */
        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);
        }
      }
      /**
       * Unlinks a linked Google Cloud Storage bucket from a Firebase project.
       *
       * Create a request for the method "buckets.removeFirebase".
       *
       * This request holds the parameters needed by the firebasestorage server.  After setting any
       * optional parameters, call the {@link RemoveFirebase#execute()} method to invoke the remote
       * operation.
       *
       * @param bucket Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
       * @param content the {@link com.google.api.services.firebasestorage.v1beta.model.RemoveFirebaseRequest}
       * @return the request
       */
      public RemoveFirebase removeFirebase(java.lang.String bucket, com.google.api.services.firebasestorage.v1beta.model.RemoveFirebaseRequest content) throws java.io.IOException {
        RemoveFirebase result = new RemoveFirebase(bucket, content);
        initialize(result);
        return result;
      }

      public class RemoveFirebase extends FirebasestorageRequest<com.google.api.services.firebasestorage.v1beta.model.Empty> {

        private static final String REST_PATH = "v1beta/{+bucket}:removeFirebase";

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

        /**
         * Unlinks a linked Google Cloud Storage bucket from a Firebase project.
         *
         * Create a request for the method "buckets.removeFirebase".
         *
         * This request holds the parameters needed by the the firebasestorage server.  After setting any
         * optional parameters, call the {@link RemoveFirebase#execute()} method to invoke the remote
         * operation. <p> {@link RemoveFirebase#initialize(com.google.api.client.googleapis.services.Abstr
         * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
         * the constructor. </p>
         *
         * @param bucket Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket,
       *        `projects/{project_number}/buckets/{bucket_id}`.
         * @param content the {@link com.google.api.services.firebasestorage.v1beta.model.RemoveFirebaseRequest}
         * @since 1.13
         */
        protected RemoveFirebase(java.lang.String bucket, com.google.api.services.firebasestorage.v1beta.model.RemoveFirebaseRequest content) {
          super(Firebasestorage.this, "POST", REST_PATH, content, com.google.api.services.firebasestorage.v1beta.model.Empty.class);
          this.bucket = com.google.api.client.util.Preconditions.checkNotNull(bucket, "Required parameter bucket must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(BUCKET_PATTERN.matcher(bucket).matches(),
                "Parameter bucket must conform to the pattern " +
                "^projects/[^/]+/buckets/[^/]+$");
          }
        }

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

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

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

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

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

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

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

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

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

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

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

        /**
         * Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        @com.google.api.client.util.Key
        private java.lang.String bucket;

        /** Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage
       bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        public java.lang.String getBucket() {
          return bucket;
        }

        /**
         * Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud
         * Storage bucket, `projects/{project_number}/buckets/{bucket_id}`.
         */
        public RemoveFirebase setBucket(java.lang.String bucket) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(BUCKET_PATTERN.matcher(bucket).matches(),
                "Parameter bucket must conform to the pattern " +
                "^projects/[^/]+/buckets/[^/]+$");
          }
          this.bucket = bucket;
          return this;
        }

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

    }
  }

  /**
   * Builder for {@link Firebasestorage}.
   *
   * <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 {

    private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) {
      // If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint.
      // If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS.
      // Use the regular endpoint for all other cases.
      String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT");
      useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint;
      if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) {
        return DEFAULT_MTLS_ROOT_URL;
      }
      return DEFAULT_ROOT_URL;
    }

    /**
     * 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,
          Builder.chooseEndpoint(transport),
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Firebasestorage}. */
    @Override
    public Firebasestorage build() {
      return new Firebasestorage(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 FirebasestorageRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setFirebasestorageRequestInitializer(
        FirebasestorageRequestInitializer firebasestorageRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(firebasestorageRequestInitializer);
    }

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