/*
 * Selling Partner API for Feeds
 * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
 *
 * OpenAPI spec version: 2021-06-30
 *
 * 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 FeedDocument model module.
 * @module feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedDocument
 * @version 2021-06-30
 */
export class FeedDocument {
  /**
   * Constructs a new <code>FeedDocument</code>.
   * Information required for the feed document.
   * @alias module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedDocument
   * @class
   * @param feedDocumentId {String} The identifier for the feed document. This identifier is unique only in combination with a seller ID.
   * @param url {String} A presigned URL for the feed document. If `compressionAlgorithm` is not returned, you can download the feed directly from this URL. This URL expires after 5 minutes.
   */
  constructor(feedDocumentId, url) {
    this.feedDocumentId = feedDocumentId;
    this.url = url;
  }

  /**
   * Constructs a <code>FeedDocument</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:feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedDocument} obj Optional instance to populate.
   * @return {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedDocument} The populated <code>FeedDocument</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new FeedDocument();
      if (data.hasOwnProperty("feedDocumentId"))
        obj.feedDocumentId = ApiClient.convertToType(
          data["feedDocumentId"],
          "String",
        );
      if (data.hasOwnProperty("url"))
        obj.url = ApiClient.convertToType(data["url"], "String");
      if (data.hasOwnProperty("compressionAlgorithm"))
        obj.compressionAlgorithm = ApiClient.convertToType(
          data["compressionAlgorithm"],
          "String",
        );
    }
    return obj;
  }
}

/**
 * The identifier for the feed document. This identifier is unique only in combination with a seller ID.
 * @member {String} feedDocumentId
 */
FeedDocument.prototype.feedDocumentId = undefined;

/**
 * A presigned URL for the feed document. If `compressionAlgorithm` is not returned, you can download the feed directly from this URL. This URL expires after 5 minutes.
 * @member {String} url
 */
FeedDocument.prototype.url = undefined;

/**
 * Allowed values for the <code>compressionAlgorithm</code> property.
 * @enum {String}
 * @readonly
 */
FeedDocument.CompressionAlgorithmEnum = {
  /**
   * value: "GZIP"
   * @const
   */
  GZIP: "GZIP",
};

/**
 * If the feed document contents have been compressed, the compression algorithm used is returned in this property and you must decompress the feed when you download. Otherwise, you can download the feed directly. Refer to [Step 7. Download the feed processing report](doc:feeds-api-v2021-06-30-use-case-guide#step-7-download-the-feed-processing-report) in the use case guide, where sample code is provided.
 * @member {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedDocument.CompressionAlgorithmEnum} compressionAlgorithm
 */
FeedDocument.prototype.compressionAlgorithm = undefined;
