/*
 * 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.poly.v1;

/**
 * Service definition for PolyService (v1).
 *
 * <p>
 * The Poly API provides read access to assets hosted on poly.google.com to all, and upload access to poly.google.com for whitelisted accounts. 
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://developers.google.com/poly/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link PolyServiceRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class PolyService 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 Poly 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://poly.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://poly.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 PolyService(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
   */
  PolyService(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 Assets collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code PolyService poly = new PolyService(...);}
   *   {@code PolyService.Assets.List request = poly.assets().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Assets assets() {
    return new Assets();
  }

  /**
   * The "assets" collection of methods.
   */
  public class Assets {

    /**
     * Returns detailed information about an asset given its name. PRIVATE assets are returned only if
     * the currently authenticated user (via OAuth token) is the author of the asset.
     *
     * Create a request for the method "assets.get".
     *
     * This request holds the parameters needed by the poly server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param name Required. An asset's name in the form `assets/{ASSET_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 PolyServiceRequest<com.google.api.services.poly.v1.model.Asset> {

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

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

      /**
       * Returns detailed information about an asset given its name. PRIVATE assets are returned only if
       * the currently authenticated user (via OAuth token) is the author of the asset.
       *
       * Create a request for the method "assets.get".
       *
       * This request holds the parameters needed by the the poly 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. An asset's name in the form `assets/{ASSET_ID}`.
       * @since 1.13
       */
      protected Get(java.lang.String name) {
        super(PolyService.this, "GET", REST_PATH, null, com.google.api.services.poly.v1.model.Asset.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 " +
              "^assets/[^/]+$");
        }
      }

      @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. An asset's name in the form `assets/{ASSET_ID}`. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** Required. An asset's name in the form `assets/{ASSET_ID}`.
       */
      public java.lang.String getName() {
        return name;
      }

      /** Required. An asset's name in the form `assets/{ASSET_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 " +
              "^assets/[^/]+$");
        }
        this.name = name;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }
    /**
     * Lists all public, remixable assets. These are assets with an access level of PUBLIC and published
     * under the CC-By license.
     *
     * Create a request for the method "assets.list".
     *
     * This request holds the parameters needed by the poly 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 PolyServiceRequest<com.google.api.services.poly.v1.model.ListAssetsResponse> {

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

      /**
       * Lists all public, remixable assets. These are assets with an access level of PUBLIC and
       * published under the CC-By license.
       *
       * Create a request for the method "assets.list".
       *
       * This request holds the parameters needed by the the poly 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(PolyService.this, "GET", REST_PATH, null, com.google.api.services.poly.v1.model.ListAssetsResponse.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);
      }

      /**
       * Filter assets based on the specified category. Supported values are: `animals`,
       * `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`, `technology`, and
       * `transport`.
       */
      @com.google.api.client.util.Key
      private java.lang.String category;

      /** Filter assets based on the specified category. Supported values are: `animals`, `architecture`,
     `art`, `food`, `nature`, `objects`, `people`, `scenes`, `technology`, and `transport`.
       */
      public java.lang.String getCategory() {
        return category;
      }

      /**
       * Filter assets based on the specified category. Supported values are: `animals`,
       * `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`, `technology`, and
       * `transport`.
       */
      public List setCategory(java.lang.String category) {
        this.category = category;
        return this;
      }

      /** Return only assets that have been curated by the Poly team. */
      @com.google.api.client.util.Key
      private java.lang.Boolean curated;

      /** Return only assets that have been curated by the Poly team.
       */
      public java.lang.Boolean getCurated() {
        return curated;
      }

      /** Return only assets that have been curated by the Poly team. */
      public List setCurated(java.lang.Boolean curated) {
        this.curated = curated;
        return this;
      }

      /**
       * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
       * `GLTF`, `GLTF2`, `OBJ`, `TILT`.
       */
      @com.google.api.client.util.Key
      private java.lang.String format;

      /** Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`,
     `GLTF2`, `OBJ`, `TILT`.
       */
      public java.lang.String getFormat() {
        return format;
      }

      /**
       * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
       * `GLTF`, `GLTF2`, `OBJ`, `TILT`.
       */
      public List setFormat(java.lang.String format) {
        this.format = format;
        return this;
      }

      /**
       * One or more search terms to be matched against all text that Poly has indexed for assets,
       * which includes display_name, description, and tags. Multiple keywords should be separated
       * by spaces.
       */
      @com.google.api.client.util.Key
      private java.lang.String keywords;

      /** One or more search terms to be matched against all text that Poly has indexed for assets, which
     includes display_name, description, and tags. Multiple keywords should be separated by spaces.
       */
      public java.lang.String getKeywords() {
        return keywords;
      }

      /**
       * One or more search terms to be matched against all text that Poly has indexed for assets,
       * which includes display_name, description, and tags. Multiple keywords should be separated
       * by spaces.
       */
      public List setKeywords(java.lang.String keywords) {
        this.keywords = keywords;
        return this;
      }

      /**
       * Returns assets that are of the specified complexity or less. Defaults to COMPLEX. For
       * example, a request for MEDIUM assets also includes SIMPLE assets.
       */
      @com.google.api.client.util.Key
      private java.lang.String maxComplexity;

      /** Returns assets that are of the specified complexity or less. Defaults to COMPLEX. For example, a
     request for MEDIUM assets also includes SIMPLE assets.
       */
      public java.lang.String getMaxComplexity() {
        return maxComplexity;
      }

      /**
       * Returns assets that are of the specified complexity or less. Defaults to COMPLEX. For
       * example, a request for MEDIUM assets also includes SIMPLE assets.
       */
      public List setMaxComplexity(java.lang.String maxComplexity) {
        this.maxComplexity = maxComplexity;
        return this;
      }

      /**
       * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`.
       * Defaults to `BEST`, which ranks assets based on a combination of popularity and other
       * features.
       */
      @com.google.api.client.util.Key
      private java.lang.String orderBy;

      /** Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to
     `BEST`, which ranks assets based on a combination of popularity and other features.
       */
      public java.lang.String getOrderBy() {
        return orderBy;
      }

      /**
       * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`.
       * Defaults to `BEST`, which ranks assets based on a combination of popularity and other
       * features.
       */
      public List setOrderBy(java.lang.String orderBy) {
        this.orderBy = orderBy;
        return this;
      }

      /**
       * The maximum number of assets to be returned. This value must be between `1` and `100`.
       * Defaults to `20`.
       */
      @com.google.api.client.util.Key
      private java.lang.Integer pageSize;

      /** The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to
     `20`.
       */
      public java.lang.Integer getPageSize() {
        return pageSize;
      }

      /**
       * The maximum number of assets to be returned. This value must be between `1` and `100`.
       * Defaults to `20`.
       */
      public List setPageSize(java.lang.Integer pageSize) {
        this.pageSize = pageSize;
        return this;
      }

      /**
       * Specifies a continuation token from a previous search whose results were split into
       * multiple pages. To get the next page, submit the same request specifying the value from
       * next_page_token.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** Specifies a continuation token from a previous search whose results were split into multiple pages.
     To get the next page, submit the same request specifying the value from next_page_token.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * Specifies a continuation token from a previous search whose results were split into
       * multiple pages. To get the next page, submit the same request specifying the value from
       * next_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);
      }
    }

  }

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

  /**
   * The "users" collection of methods.
   */
  public class Users {

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

    /**
     * The "assets" collection of methods.
     */
    public class Assets {

      /**
       * Lists assets authored by the given user. Only the value 'me', representing the currently-
       * authenticated user, is supported. May include assets with an access level of PRIVATE or UNLISTED
       * and assets which are All Rights Reserved for the currently-authenticated user.
       *
       * Create a request for the method "assets.list".
       *
       * This request holds the parameters needed by the poly server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param name A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       *        user is supported. To use 'me', you must pass an OAuth token with the request.
       * @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 PolyServiceRequest<com.google.api.services.poly.v1.model.ListUserAssetsResponse> {

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

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

        /**
         * Lists assets authored by the given user. Only the value 'me', representing the currently-
         * authenticated user, is supported. May include assets with an access level of PRIVATE or
         * UNLISTED and assets which are All Rights Reserved for the currently-authenticated user.
         *
         * Create a request for the method "assets.list".
         *
         * This request holds the parameters needed by the the poly 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 A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       *        user is supported. To use 'me', you must pass an OAuth token with the request.
         * @since 1.13
         */
        protected List(java.lang.String name) {
          super(PolyService.this, "GET", REST_PATH, null, com.google.api.services.poly.v1.model.ListUserAssetsResponse.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 " +
                "^users/[^/]+$");
          }
        }

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

        /**
         * A valid user id. Currently, only the special value 'me', representing the currently-
         * authenticated user is supported. To use 'me', you must pass an OAuth token with the
         * request.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       user is supported. To use 'me', you must pass an OAuth token with the request.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * A valid user id. Currently, only the special value 'me', representing the currently-
         * authenticated user is supported. To use 'me', you must pass an OAuth token with the
         * request.
         */
        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 " +
                "^users/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
         * `GLTF`, `GLTF2`, `OBJ`, and `TILT`.
         */
        @com.google.api.client.util.Key
        private java.lang.String format;

        /** Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`,
       `GLTF2`, `OBJ`, and `TILT`.
         */
        public java.lang.String getFormat() {
          return format;
        }

        /**
         * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
         * `GLTF`, `GLTF2`, `OBJ`, and `TILT`.
         */
        public List setFormat(java.lang.String format) {
          this.format = format;
          return this;
        }

        /**
         * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`.
         * Defaults to `BEST`, which ranks assets based on a combination of popularity and other
         * features.
         */
        @com.google.api.client.util.Key
        private java.lang.String orderBy;

        /** Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to
       `BEST`, which ranks assets based on a combination of popularity and other features.
         */
        public java.lang.String getOrderBy() {
          return orderBy;
        }

        /**
         * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`.
         * Defaults to `BEST`, which ranks assets based on a combination of popularity and other
         * features.
         */
        public List setOrderBy(java.lang.String orderBy) {
          this.orderBy = orderBy;
          return this;
        }

        /**
         * The maximum number of assets to be returned. This value must be between `1` and `100`.
         * Defaults to `20`.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to
       `20`.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * The maximum number of assets to be returned. This value must be between `1` and `100`.
         * Defaults to `20`.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * Specifies a continuation token from a previous search whose results were split into
         * multiple pages. To get the next page, submit the same request specifying the value from
         * next_page_token.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** Specifies a continuation token from a previous search whose results were split into multiple pages.
       To get the next page, submit the same request specifying the value from next_page_token.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * Specifies a continuation token from a previous search whose results were split into
         * multiple pages. To get the next page, submit the same request specifying the value from
         * next_page_token.
         */
        public List setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        /**
         * The visibility of the assets to be returned. Defaults to VISIBILITY_UNSPECIFIED which
         * returns all assets.
         */
        @com.google.api.client.util.Key
        private java.lang.String visibility;

        /** The visibility of the assets to be returned. Defaults to VISIBILITY_UNSPECIFIED which returns all
       assets.
         */
        public java.lang.String getVisibility() {
          return visibility;
        }

        /**
         * The visibility of the assets to be returned. Defaults to VISIBILITY_UNSPECIFIED which
         * returns all assets.
         */
        public List setVisibility(java.lang.String visibility) {
          this.visibility = visibility;
          return this;
        }

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

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

    /**
     * The "likedassets" collection of methods.
     */
    public class Likedassets {

      /**
       * Lists assets that the user has liked. Only the value 'me', representing the currently-
       * authenticated user, is supported. May include assets with an access level of UNLISTED.
       *
       * Create a request for the method "likedassets.list".
       *
       * This request holds the parameters needed by the poly server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param name A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       *        user is supported. To use 'me', you must pass an OAuth token with the request.
       * @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 PolyServiceRequest<com.google.api.services.poly.v1.model.ListLikedAssetsResponse> {

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

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

        /**
         * Lists assets that the user has liked. Only the value 'me', representing the currently-
         * authenticated user, is supported. May include assets with an access level of UNLISTED.
         *
         * Create a request for the method "likedassets.list".
         *
         * This request holds the parameters needed by the the poly 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 A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       *        user is supported. To use 'me', you must pass an OAuth token with the request.
         * @since 1.13
         */
        protected List(java.lang.String name) {
          super(PolyService.this, "GET", REST_PATH, null, com.google.api.services.poly.v1.model.ListLikedAssetsResponse.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 " +
                "^users/[^/]+$");
          }
        }

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

        /**
         * A valid user id. Currently, only the special value 'me', representing the currently-
         * authenticated user is supported. To use 'me', you must pass an OAuth token with the
         * request.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** A valid user id. Currently, only the special value 'me', representing the currently-authenticated
       user is supported. To use 'me', you must pass an OAuth token with the request.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * A valid user id. Currently, only the special value 'me', representing the currently-
         * authenticated user is supported. To use 'me', you must pass an OAuth token with the
         * request.
         */
        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 " +
                "^users/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
         * `GLTF`, `GLTF2`, `OBJ`, `TILT`.
         */
        @com.google.api.client.util.Key
        private java.lang.String format;

        /** Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`,
       `GLTF2`, `OBJ`, `TILT`.
         */
        public java.lang.String getFormat() {
          return format;
        }

        /**
         * Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`,
         * `GLTF`, `GLTF2`, `OBJ`, `TILT`.
         */
        public List setFormat(java.lang.String format) {
          this.format = format;
          return this;
        }

        /**
         * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`,
         * 'LIKED_TIME'. Defaults to `LIKED_TIME`, which ranks assets based on how recently they
         * were liked.
         */
        @com.google.api.client.util.Key
        private java.lang.String orderBy;

        /** Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'.
       Defaults to `LIKED_TIME`, which ranks assets based on how recently they were liked.
         */
        public java.lang.String getOrderBy() {
          return orderBy;
        }

        /**
         * Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`,
         * 'LIKED_TIME'. Defaults to `LIKED_TIME`, which ranks assets based on how recently they
         * were liked.
         */
        public List setOrderBy(java.lang.String orderBy) {
          this.orderBy = orderBy;
          return this;
        }

        /**
         * The maximum number of assets to be returned. This value must be between `1` and `100`.
         * Defaults to `20`.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to
       `20`.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * The maximum number of assets to be returned. This value must be between `1` and `100`.
         * Defaults to `20`.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * Specifies a continuation token from a previous search whose results were split into
         * multiple pages. To get the next page, submit the same request specifying the value from
         * next_page_token.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** Specifies a continuation token from a previous search whose results were split into multiple pages.
       To get the next page, submit the same request specifying the value from next_page_token.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * Specifies a continuation token from a previous search whose results were split into
         * multiple pages. To get the next page, submit the same request specifying the value from
         * next_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);
        }
      }

    }
  }

  /**
   * Builder for {@link PolyService}.
   *
   * <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 PolyService}. */
    @Override
    public PolyService build() {
      return new PolyService(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 PolyServiceRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setPolyServiceRequestInitializer(
        PolyServiceRequestInitializer polyserviceRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(polyserviceRequestInitializer);
    }

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