/*
 * Selling Partner API for Catalog Items
 * The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog.  For more information, refer to the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2022-04-01-use-case-guide).
 *
 * OpenAPI spec version: 2022-04-01
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 *
 * Swagger Codegen version: 2.4.9
 *
 * Do not edit the class manually.
 *
 */

import { ApiClient } from "../ApiClient.js";

/**
 * The Pagination model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Pagination
 * @version 2022-04-01
 */
export class Pagination {
  /**
   * Constructs a new <code>Pagination</code>.
   * When a request produces a response that exceeds the `pageSize`, pagination occurs. This means the response is divided into individual pages. To retrieve the next page or the previous page, you must pass the `nextToken` value or the `previousToken` value as the `pageToken` parameter in the next request. When you receive the last page, there will be no `nextToken` key in the pagination object.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Pagination
   * @class
   */
  constructor() {}

  /**
   * Constructs a <code>Pagination</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Pagination} obj Optional instance to populate.
   * @return {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/Pagination} The populated <code>Pagination</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new Pagination();
      if (data.hasOwnProperty("nextToken"))
        obj.nextToken = ApiClient.convertToType(data["nextToken"], "String");
      if (data.hasOwnProperty("previousToken"))
        obj.previousToken = ApiClient.convertToType(
          data["previousToken"],
          "String",
        );
    }
    return obj;
  }
}

/**
 * A token that can be used to fetch the next page.
 * @member {String} nextToken
 */
Pagination.prototype.nextToken = undefined;

/**
 * A token that can be used to fetch the previous page.
 * @member {String} previousToken
 */
Pagination.prototype.previousToken = undefined;
