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

/**
 * The ItemContributor model module.
 * @module catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemContributor
 * @version 2022-04-01
 */
export class ItemContributor {
  /**
   * Constructs a new <code>ItemContributor</code>.
   * Individual contributor to the creation of an item, such as an author or actor.
   * @alias module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemContributor
   * @class
   * @param role {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemContributorRole}
   * @param value {String} Name of the contributor, such as Jane Austen.
   */
  constructor(role, value) {
    this.role = role;
    this.value = value;
  }

  /**
   * Constructs a <code>ItemContributor</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/ItemContributor} obj Optional instance to populate.
   * @return {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemContributor} The populated <code>ItemContributor</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new ItemContributor();
      if (data.hasOwnProperty("role"))
        obj.role = ItemContributorRole.constructFromObject(data["role"]);
      if (data.hasOwnProperty("value"))
        obj.value = ApiClient.convertToType(data["value"], "String");
    }
    return obj;
  }
}

/**
 * @member {module:catalogItems_2022-04-01/js-client.catalogItems_2022-04-01.model/ItemContributorRole} role
 */
ItemContributor.prototype.role = undefined;

/**
 * Name of the contributor, such as Jane Austen.
 * @member {String} value
 */
ItemContributor.prototype.value = undefined;
