/*
 * 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";
import { FeedOptions } from "./FeedOptions.js";

/**
 * The CreateFeedSpecification model module.
 * @module feeds_2021-06-30/js-client.feeds_2021-06-30.model/CreateFeedSpecification
 * @version 2021-06-30
 */
export class CreateFeedSpecification {
  /**
   * Constructs a new <code>CreateFeedSpecification</code>.
   * Information required to create the feed.
   * @alias module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/CreateFeedSpecification
   * @class
   * @param feedType {String} The feed type.
   * @param marketplaceIds {Array.<String>} A list of identifiers for marketplaces that you want the feed to be applied to.
   * @param inputFeedDocumentId {String} The document identifier returned by the createFeedDocument operation. Upload the feed document contents before calling the createFeed operation.
   */
  constructor(feedType, marketplaceIds, inputFeedDocumentId) {
    this.feedType = feedType;
    this.marketplaceIds = marketplaceIds;
    this.inputFeedDocumentId = inputFeedDocumentId;
  }

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

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

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

/**
 * The document identifier returned by the createFeedDocument operation. Upload the feed document contents before calling the createFeed operation.
 * @member {String} inputFeedDocumentId
 */
CreateFeedSpecification.prototype.inputFeedDocumentId = undefined;

/**
 * @member {module:feeds_2021-06-30/js-client.feeds_2021-06-30.model/FeedOptions} feedOptions
 */
CreateFeedSpecification.prototype.feedOptions = undefined;
