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

/**
 * Service definition for Storagetransfer (v1).
 *
 * <p>
 * Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://cloud.google.com/storage-transfer/docs" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link StoragetransferRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Storagetransfer 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.26.0 of the Storage Transfer 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://storagetransfer.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 Storagetransfer(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
   */
  Storagetransfer(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 GoogleServiceAccounts collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Storagetransfer storagetransfer = new Storagetransfer(...);}
   *   {@code Storagetransfer.GoogleServiceAccounts.List request = storagetransfer.googleServiceAccounts().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public GoogleServiceAccounts googleServiceAccounts() {
    return new GoogleServiceAccounts();
  }

  /**
   * The "googleServiceAccounts" collection of methods.
   */
  public class GoogleServiceAccounts {

    /**
     * Returns the Google service account that is used by Storage Transfer Service to access buckets in
     * the project where transfers run or in other projects. Each Google service account is associated
     * with one Google Cloud Platform Console project. Users should add this service account to the
     * Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service
     * account is created and owned by Storage Transfer Service and can only be used by Storage Transfer
     * Service.
     *
     * Create a request for the method "googleServiceAccounts.get".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param projectId Required. The ID of the Google Cloud Platform Console project that the
    Google service account is
     *        associated with.
     * @return the request
     */
    public Get get(java.lang.String projectId) throws java.io.IOException {
      Get result = new Get(projectId);
      initialize(result);
      return result;
    }

    public class Get extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.GoogleServiceAccount> {

      private static final String REST_PATH = "v1/googleServiceAccounts/{projectId}";

      /**
       * Returns the Google service account that is used by Storage Transfer Service to access buckets
       * in the project where transfers run or in other projects. Each Google service account is
       * associated with one Google Cloud Platform Console project. Users should add this service
       * account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service.
       * This service account is created and owned by Storage Transfer Service and can only be used by
       * Storage Transfer Service.
       *
       * Create a request for the method "googleServiceAccounts.get".
       *
       * This request holds the parameters needed by the the storagetransfer 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 projectId Required. The ID of the Google Cloud Platform Console project that the
    Google service account is
     *        associated with.
       * @since 1.13
       */
      protected Get(java.lang.String projectId) {
        super(Storagetransfer.this, "GET", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.GoogleServiceAccount.class);
        this.projectId = com.google.api.client.util.Preconditions.checkNotNull(projectId, "Required parameter projectId must be specified.");
      }

      @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 ID of the Google Cloud Platform Console project that the Google service
       * account is associated with.
       */
      @com.google.api.client.util.Key
      private java.lang.String projectId;

      /** Required. The ID of the Google Cloud Platform Console project that the Google service account is
     associated with.
       */
      public java.lang.String getProjectId() {
        return projectId;
      }

      /**
       * Required. The ID of the Google Cloud Platform Console project that the Google service
       * account is associated with.
       */
      public Get setProjectId(java.lang.String projectId) {
        this.projectId = projectId;
        return this;
      }

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

  }

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

  /**
   * The "transferJobs" collection of methods.
   */
  public class TransferJobs {

    /**
     * Creates a transfer job that runs periodically.
     *
     * Create a request for the method "transferJobs.create".
     *
     * This request holds the parameters needed by the storagetransfer 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.storagetransfer.v1.model.TransferJob}
     * @return the request
     */
    public Create create(com.google.api.services.storagetransfer.v1.model.TransferJob content) throws java.io.IOException {
      Create result = new Create(content);
      initialize(result);
      return result;
    }

    public class Create extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.TransferJob> {

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

      /**
       * Creates a transfer job that runs periodically.
       *
       * Create a request for the method "transferJobs.create".
       *
       * This request holds the parameters needed by the the storagetransfer 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.storagetransfer.v1.model.TransferJob}
       * @since 1.13
       */
      protected Create(com.google.api.services.storagetransfer.v1.model.TransferJob content) {
        super(Storagetransfer.this, "POST", REST_PATH, content, com.google.api.services.storagetransfer.v1.model.TransferJob.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 a transfer job.
     *
     * Create a request for the method "transferJobs.get".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param jobName Required. The job to get.
     * @return the request
     */
    public Get get(java.lang.String jobName) throws java.io.IOException {
      Get result = new Get(jobName);
      initialize(result);
      return result;
    }

    public class Get extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.TransferJob> {

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

      private final java.util.regex.Pattern JOB_NAME_PATTERN =
          java.util.regex.Pattern.compile("^transferJobs/.+$");

      /**
       * Gets a transfer job.
       *
       * Create a request for the method "transferJobs.get".
       *
       * This request holds the parameters needed by the the storagetransfer 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 jobName Required. The job to get.
       * @since 1.13
       */
      protected Get(java.lang.String jobName) {
        super(Storagetransfer.this, "GET", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.TransferJob.class);
        this.jobName = com.google.api.client.util.Preconditions.checkNotNull(jobName, "Required parameter jobName must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(JOB_NAME_PATTERN.matcher(jobName).matches(),
              "Parameter jobName must conform to the pattern " +
              "^transferJobs/.+$");
        }
      }

      @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 job to get. */
      @com.google.api.client.util.Key
      private java.lang.String jobName;

      /** Required. The job to get.
       */
      public java.lang.String getJobName() {
        return jobName;
      }

      /** Required. The job to get. */
      public Get setJobName(java.lang.String jobName) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(JOB_NAME_PATTERN.matcher(jobName).matches(),
              "Parameter jobName must conform to the pattern " +
              "^transferJobs/.+$");
        }
        this.jobName = jobName;
        return this;
      }

      /**
       * Required. The ID of the Google Cloud Platform Console project that owns the job.
       */
      @com.google.api.client.util.Key
      private java.lang.String projectId;

      /** Required. The ID of the Google Cloud Platform Console project that owns the job.
       */
      public java.lang.String getProjectId() {
        return projectId;
      }

      /**
       * Required. The ID of the Google Cloud Platform Console project that owns the job.
       */
      public Get setProjectId(java.lang.String projectId) {
        this.projectId = projectId;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }
    /**
     * Lists transfer jobs.
     *
     * Create a request for the method "transferJobs.list".
     *
     * This request holds the parameters needed by the storagetransfer 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 StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.ListTransferJobsResponse> {

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

      /**
       * Lists transfer jobs.
       *
       * Create a request for the method "transferJobs.list".
       *
       * This request holds the parameters needed by the the storagetransfer 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(Storagetransfer.this, "GET", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.ListTransferJobsResponse.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);
      }

      /**
       * Required. A list of query parameters specified as JSON text in the form of:
       * {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
       * "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support
       * multiple values, their values must be specified with array notation. `project_id` is
       * required. `job_names` and `job_statuses` are optional.  The valid values for `job_statuses`
       * are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.
       */
      @com.google.api.client.util.Key
      private java.lang.String filter;

      /** Required. A list of query parameters specified as JSON text in the form of:
     {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
     "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support multiple
     values, their values must be specified with array notation. `project_id` is required. `job_names`
     and `job_statuses` are optional.  The valid values for `job_statuses` are case-insensitive:
     `ENABLED`, `DISABLED`, and `DELETED`.
       */
      public java.lang.String getFilter() {
        return filter;
      }

      /**
       * Required. A list of query parameters specified as JSON text in the form of:
       * {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
       * "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support
       * multiple values, their values must be specified with array notation. `project_id` is
       * required. `job_names` and `job_statuses` are optional.  The valid values for `job_statuses`
       * are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.
       */
      public List setFilter(java.lang.String filter) {
        this.filter = filter;
        return this;
      }

      /** The list page size. The max allowed value is 256. */
      @com.google.api.client.util.Key
      private java.lang.Integer pageSize;

      /** The list page size. The max allowed value is 256.
       */
      public java.lang.Integer getPageSize() {
        return pageSize;
      }

      /** The list page size. The max allowed value is 256. */
      public List setPageSize(java.lang.Integer pageSize) {
        this.pageSize = pageSize;
        return this;
      }

      /** The list page token. */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** The list page token.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /** The list 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);
      }
    }
    /**
     * Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that
     * are running already. Updating the scheduling of a job is not allowed.
     *
     * Create a request for the method "transferJobs.patch".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param jobName Required. The name of job to update.
     * @param content the {@link com.google.api.services.storagetransfer.v1.model.UpdateTransferJobRequest}
     * @return the request
     */
    public Patch patch(java.lang.String jobName, com.google.api.services.storagetransfer.v1.model.UpdateTransferJobRequest content) throws java.io.IOException {
      Patch result = new Patch(jobName, content);
      initialize(result);
      return result;
    }

    public class Patch extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.TransferJob> {

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

      private final java.util.regex.Pattern JOB_NAME_PATTERN =
          java.util.regex.Pattern.compile("^transferJobs/.+$");

      /**
       * Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that
       * are running already. Updating the scheduling of a job is not allowed.
       *
       * Create a request for the method "transferJobs.patch".
       *
       * This request holds the parameters needed by the the storagetransfer 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 jobName Required. The name of job to update.
       * @param content the {@link com.google.api.services.storagetransfer.v1.model.UpdateTransferJobRequest}
       * @since 1.13
       */
      protected Patch(java.lang.String jobName, com.google.api.services.storagetransfer.v1.model.UpdateTransferJobRequest content) {
        super(Storagetransfer.this, "PATCH", REST_PATH, content, com.google.api.services.storagetransfer.v1.model.TransferJob.class);
        this.jobName = com.google.api.client.util.Preconditions.checkNotNull(jobName, "Required parameter jobName must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(JOB_NAME_PATTERN.matcher(jobName).matches(),
              "Parameter jobName must conform to the pattern " +
              "^transferJobs/.+$");
        }
      }

      @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 job to update. */
      @com.google.api.client.util.Key
      private java.lang.String jobName;

      /** Required. The name of job to update.
       */
      public java.lang.String getJobName() {
        return jobName;
      }

      /** Required. The name of job to update. */
      public Patch setJobName(java.lang.String jobName) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(JOB_NAME_PATTERN.matcher(jobName).matches(),
              "Parameter jobName must conform to the pattern " +
              "^transferJobs/.+$");
        }
        this.jobName = jobName;
        return this;
      }

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

  }

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

  /**
   * The "transferOperations" collection of methods.
   */
  public class TransferOperations {

    /**
     * Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the
     * operation completed despite cancellation.
     *
     * Create a request for the method "transferOperations.cancel".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Cancel#execute()} method to invoke the remote operation.
     *
     * @param name The name of the operation resource to be cancelled.
     * @return the request
     */
    public Cancel cancel(java.lang.String name) throws java.io.IOException {
      Cancel result = new Cancel(name);
      initialize(result);
      return result;
    }

    public class Cancel extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.Empty> {

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

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

      /**
       * Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether
       * the operation completed despite cancellation.
       *
       * Create a request for the method "transferOperations.cancel".
       *
       * This request holds the parameters needed by the the storagetransfer server.  After setting any
       * optional parameters, call the {@link Cancel#execute()} method to invoke the remote operation.
       * <p> {@link
       * Cancel#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
       * be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param name The name of the operation resource to be cancelled.
       * @since 1.13
       */
      protected Cancel(java.lang.String name) {
        super(Storagetransfer.this, "POST", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.Empty.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 " +
              "^transferOperations/.+$");
        }
      }

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

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

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

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

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

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

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

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

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

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

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

      /** The name of the operation resource to be cancelled. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** The name of the operation resource to be cancelled.
       */
      public java.lang.String getName() {
        return name;
      }

      /** The name of the operation resource to be cancelled. */
      public Cancel 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 " +
              "^transferOperations/.+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Cancel set(String parameterName, Object value) {
        return (Cancel) super.set(parameterName, value);
      }
    }
    /**
     * This method is not supported and the server returns `UNIMPLEMENTED`.
     *
     * Create a request for the method "transferOperations.delete".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param name The name of the operation resource to be deleted.
     * @return the request
     */
    public Delete delete(java.lang.String name) throws java.io.IOException {
      Delete result = new Delete(name);
      initialize(result);
      return result;
    }

    public class Delete extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.Empty> {

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

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

      /**
       * This method is not supported and the server returns `UNIMPLEMENTED`.
       *
       * Create a request for the method "transferOperations.delete".
       *
       * This request holds the parameters needed by the the storagetransfer server.  After setting any
       * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
       * <p> {@link
       * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
       * be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param name The name of the operation resource to be deleted.
       * @since 1.13
       */
      protected Delete(java.lang.String name) {
        super(Storagetransfer.this, "DELETE", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.Empty.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 " +
              "^transferOperations/.+$");
        }
      }

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

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

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

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

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

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

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

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

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

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

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

      /** The name of the operation resource to be deleted. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** The name of the operation resource to be deleted.
       */
      public java.lang.String getName() {
        return name;
      }

      /** The name of the operation resource to be deleted. */
      public Delete 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 " +
              "^transferOperations/.+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Delete set(String parameterName, Object value) {
        return (Delete) super.set(parameterName, value);
      }
    }
    /**
     * Gets the latest state of a long-running operation.  Clients can use this method to poll the
     * operation result at intervals as recommended by the API service.
     *
     * Create a request for the method "transferOperations.get".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param name The name of the operation resource.
     * @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 StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.Operation> {

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

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

      /**
       * Gets the latest state of a long-running operation.  Clients can use this method to poll the
       * operation result at intervals as recommended by the API service.
       *
       * Create a request for the method "transferOperations.get".
       *
       * This request holds the parameters needed by the the storagetransfer 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 The name of the operation resource.
       * @since 1.13
       */
      protected Get(java.lang.String name) {
        super(Storagetransfer.this, "GET", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.Operation.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 " +
              "^transferOperations/.+$");
        }
      }

      @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);
      }

      /** The name of the operation resource. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** The name of the operation resource.
       */
      public java.lang.String getName() {
        return name;
      }

      /** The name of the operation resource. */
      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 " +
              "^transferOperations/.+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }
    /**
     * Lists operations that match the specified filter in the request. If the server doesn't support
     * this method, it returns `UNIMPLEMENTED`.
     *
     * NOTE: the `name` binding allows API services to override the binding to use different resource
     * name schemes, such as `users/operations`. To override the binding, API services can add a binding
     * such as `"/v1/{name=users}/operations"` to their service configuration. For backwards
     * compatibility, the default name includes the operations collection id, however overriding users
     * must ensure the name binding is the parent resource, without the operations collection id.
     *
     * Create a request for the method "transferOperations.list".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param name Required. The value `transferOperations`.
     * @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 StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.ListOperationsResponse> {

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

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^transferOperations$");

      /**
       * Lists operations that match the specified filter in the request. If the server doesn't support
       * this method, it returns `UNIMPLEMENTED`.
       *
       * NOTE: the `name` binding allows API services to override the binding to use different resource
       * name schemes, such as `users/operations`. To override the binding, API services can add a
       * binding such as `"/v1/{name=users}/operations"` to their service configuration. For backwards
       * compatibility, the default name includes the operations collection id, however overriding users
       * must ensure the name binding is the parent resource, without the operations collection id.
       *
       * Create a request for the method "transferOperations.list".
       *
       * This request holds the parameters needed by the the storagetransfer 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 value `transferOperations`.
       * @since 1.13
       */
      protected List(java.lang.String name) {
        super(Storagetransfer.this, "GET", REST_PATH, null, com.google.api.services.storagetransfer.v1.model.ListOperationsResponse.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 " +
              "^transferOperations$");
        }
      }

      @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 value `transferOperations`. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The value `transferOperations`.
       */
      public java.lang.String getName() {
        return name;
      }

      /** Required. The value `transferOperations`. */
      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 " +
              "^transferOperations$");
        }
        this.name = name;
        return this;
      }

      /**
       * Required. A list of query parameters specified as JSON text in the form of:
       * {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
       * "operation_names":["opid1","opid2",...], "transfer_statuses":["status1","status2",...]}.
       * Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they
       * must be specified with array notation. `project_id` is required. `job_names`,
       * `operation_names`, and `transfer_statuses` are optional. The valid values for
       * `transfer_statuses` are case-insensitive: `IN_PROGRESS`, `PAUSED`, `SUCCESS`, `FAILED`, and
       * `ABORTED`.
       */
      @com.google.api.client.util.Key
      private java.lang.String filter;

      /** Required. A list of query parameters specified as JSON text in the form of:
     {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
     "operation_names":["opid1","opid2",...], "transfer_statuses":["status1","status2",...]}. Since
     `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be
     specified with array notation. `project_id` is required. `job_names`, `operation_names`, and
     `transfer_statuses` are optional. The valid values for `transfer_statuses` are case-insensitive:
     `IN_PROGRESS`, `PAUSED`, `SUCCESS`, `FAILED`, and `ABORTED`.
       */
      public java.lang.String getFilter() {
        return filter;
      }

      /**
       * Required. A list of query parameters specified as JSON text in the form of:
       * {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...],
       * "operation_names":["opid1","opid2",...], "transfer_statuses":["status1","status2",...]}.
       * Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they
       * must be specified with array notation. `project_id` is required. `job_names`,
       * `operation_names`, and `transfer_statuses` are optional. The valid values for
       * `transfer_statuses` are case-insensitive: `IN_PROGRESS`, `PAUSED`, `SUCCESS`, `FAILED`, and
       * `ABORTED`.
       */
      public List setFilter(java.lang.String filter) {
        this.filter = filter;
        return this;
      }

      /** The list page size. The max allowed value is 256. */
      @com.google.api.client.util.Key
      private java.lang.Integer pageSize;

      /** The list page size. The max allowed value is 256.
       */
      public java.lang.Integer getPageSize() {
        return pageSize;
      }

      /** The list page size. The max allowed value is 256. */
      public List setPageSize(java.lang.Integer pageSize) {
        this.pageSize = pageSize;
        return this;
      }

      /** The list page token. */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** The list page token.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /** The list 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);
      }
    }
    /**
     * Pauses a transfer operation.
     *
     * Create a request for the method "transferOperations.pause".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Pause#execute()} method to invoke the remote operation.
     *
     * @param name Required. The name of the transfer operation.
     * @param content the {@link com.google.api.services.storagetransfer.v1.model.PauseTransferOperationRequest}
     * @return the request
     */
    public Pause pause(java.lang.String name, com.google.api.services.storagetransfer.v1.model.PauseTransferOperationRequest content) throws java.io.IOException {
      Pause result = new Pause(name, content);
      initialize(result);
      return result;
    }

    public class Pause extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.Empty> {

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

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

      /**
       * Pauses a transfer operation.
       *
       * Create a request for the method "transferOperations.pause".
       *
       * This request holds the parameters needed by the the storagetransfer server.  After setting any
       * optional parameters, call the {@link Pause#execute()} method to invoke the remote operation.
       * <p> {@link
       * Pause#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 transfer operation.
       * @param content the {@link com.google.api.services.storagetransfer.v1.model.PauseTransferOperationRequest}
       * @since 1.13
       */
      protected Pause(java.lang.String name, com.google.api.services.storagetransfer.v1.model.PauseTransferOperationRequest content) {
        super(Storagetransfer.this, "POST", REST_PATH, content, com.google.api.services.storagetransfer.v1.model.Empty.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 " +
              "^transferOperations/.+$");
        }
      }

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

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

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

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

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

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

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

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

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

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

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

      /** Required. The name of the transfer operation. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The name of the transfer operation.
       */
      public java.lang.String getName() {
        return name;
      }

      /** Required. The name of the transfer operation. */
      public Pause 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 " +
              "^transferOperations/.+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Pause set(String parameterName, Object value) {
        return (Pause) super.set(parameterName, value);
      }
    }
    /**
     * Resumes a transfer operation that is paused.
     *
     * Create a request for the method "transferOperations.resume".
     *
     * This request holds the parameters needed by the storagetransfer server.  After setting any
     * optional parameters, call the {@link Resume#execute()} method to invoke the remote operation.
     *
     * @param name Required. The name of the transfer operation.
     * @param content the {@link com.google.api.services.storagetransfer.v1.model.ResumeTransferOperationRequest}
     * @return the request
     */
    public Resume resume(java.lang.String name, com.google.api.services.storagetransfer.v1.model.ResumeTransferOperationRequest content) throws java.io.IOException {
      Resume result = new Resume(name, content);
      initialize(result);
      return result;
    }

    public class Resume extends StoragetransferRequest<com.google.api.services.storagetransfer.v1.model.Empty> {

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

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

      /**
       * Resumes a transfer operation that is paused.
       *
       * Create a request for the method "transferOperations.resume".
       *
       * This request holds the parameters needed by the the storagetransfer server.  After setting any
       * optional parameters, call the {@link Resume#execute()} method to invoke the remote operation.
       * <p> {@link
       * Resume#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 transfer operation.
       * @param content the {@link com.google.api.services.storagetransfer.v1.model.ResumeTransferOperationRequest}
       * @since 1.13
       */
      protected Resume(java.lang.String name, com.google.api.services.storagetransfer.v1.model.ResumeTransferOperationRequest content) {
        super(Storagetransfer.this, "POST", REST_PATH, content, com.google.api.services.storagetransfer.v1.model.Empty.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 " +
              "^transferOperations/.+$");
        }
      }

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

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

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

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

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

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

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

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

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

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

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

      /** Required. The name of the transfer operation. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. The name of the transfer operation.
       */
      public java.lang.String getName() {
        return name;
      }

      /** Required. The name of the transfer operation. */
      public Resume 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 " +
              "^transferOperations/.+$");
        }
        this.name = name;
        return this;
      }

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

  }

  /**
   * Builder for {@link Storagetransfer}.
   *
   * <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 Storagetransfer}. */
    @Override
    public Storagetransfer build() {
      return new Storagetransfer(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 StoragetransferRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setStoragetransferRequestInitializer(
        StoragetransferRequestInitializer storagetransferRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(storagetransferRequestInitializer);
    }

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