/*
 * 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 Feed model module.
 * @module feeds_2021-06-30/js-client.feeds_2021-06-30.model/Feed
 * @version 2021-06-30
 */
export class Feed {
  /**
   * Constructs a new <code>Feed</code>.
   * Detailed information about the feed.
   * @alias module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/Feed
   * @class
   * @param feedId {String} The identifier for the feed. This identifier is unique only in combination with a seller ID.
   * @param feedType {String} The feed type.
   * @param createdTime {Date} The date and time when the feed was created, in ISO 8601 date time format.
   * @param processingStatus {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/Feed.ProcessingStatusEnum} The processing status of the feed.
   */
  constructor(feedId, feedType, createdTime, processingStatus) {
    this.feedId = feedId;
    this.feedType = feedType;
    this.createdTime = createdTime;
    this.processingStatus = processingStatus;
  }

  /**
   * Constructs a <code>Feed</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/Feed} obj Optional instance to populate.
   * @return {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/Feed} The populated <code>Feed</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new Feed();
      if (data.hasOwnProperty("feedId"))
        obj.feedId = ApiClient.convertToType(data["feedId"], "String");
      if (data.hasOwnProperty("feedType"))
        obj.feedType = ApiClient.convertToType(data["feedType"], "String");
      if (data.hasOwnProperty("marketplaceIds"))
        obj.marketplaceIds = ApiClient.convertToType(data["marketplaceIds"], [
          "String",
        ]);
      if (data.hasOwnProperty("createdTime"))
        obj.createdTime = ApiClient.convertToType(data["createdTime"], "Date");
      if (data.hasOwnProperty("processingStatus"))
        obj.processingStatus = ApiClient.convertToType(
          data["processingStatus"],
          "String",
        );
      if (data.hasOwnProperty("processingStartTime"))
        obj.processingStartTime = ApiClient.convertToType(
          data["processingStartTime"],
          "Date",
        );
      if (data.hasOwnProperty("processingEndTime"))
        obj.processingEndTime = ApiClient.convertToType(
          data["processingEndTime"],
          "Date",
        );
      if (data.hasOwnProperty("resultFeedDocumentId"))
        obj.resultFeedDocumentId = ApiClient.convertToType(
          data["resultFeedDocumentId"],
          "String",
        );
    }
    return obj;
  }
}

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

/**
 * The feed type.
 * @member {String} feedType
 */
Feed.prototype.feedType = undefined;

/**
 * A list of identifiers for the marketplaces that the feed is applied to.
 * @member {Array.<String>} marketplaceIds
 */
Feed.prototype.marketplaceIds = undefined;

/**
 * The date and time when the feed was created, in ISO 8601 date time format.
 * @member {Date} createdTime
 */
Feed.prototype.createdTime = undefined;

/**
 * Allowed values for the <code>processingStatus</code> property.
 * @enum {String}
 * @readonly
 */
Feed.ProcessingStatusEnum = {
  /**
   * value: "CANCELLED"
   * @const
   */
  CANCELLED: "CANCELLED",

  /**
   * value: "DONE"
   * @const
   */
  DONE: "DONE",

  /**
   * value: "FATAL"
   * @const
   */
  FATAL: "FATAL",

  /**
   * value: "IN_PROGRESS"
   * @const
   */
  IN_PROGRESS: "IN_PROGRESS",

  /**
   * value: "IN_QUEUE"
   * @const
   */
  IN_QUEUE: "IN_QUEUE",
};

/**
 * The processing status of the feed.
 * @member {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/Feed.ProcessingStatusEnum} processingStatus
 */
Feed.prototype.processingStatus = undefined;

/**
 * The date and time when feed processing started, in ISO 8601 date time format.
 * @member {Date} processingStartTime
 */
Feed.prototype.processingStartTime = undefined;

/**
 * The date and time when feed processing completed, in ISO 8601 date time format.
 * @member {Date} processingEndTime
 */
Feed.prototype.processingEndTime = undefined;

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