/*
 * Selling Partner API for Product Type Definitions
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * OpenAPI spec version: 2020-09-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 { SchemaLinkLink } from "./SchemaLinkLink.js";

/**
 * The SchemaLink model module.
 * @module definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/SchemaLink
 * @version 2020-09-01
 */
export class SchemaLink {
  /**
   * Constructs a new <code>SchemaLink</code>.
   * @alias module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/SchemaLink
   * @class
   * @param link {module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/SchemaLinkLink}
   * @param checksum {String} Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify changes between schema versions, and for caching.
   */
  constructor(link, checksum) {
    this.link = link;
    this.checksum = checksum;
  }

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

/**
 * @member {module:definitionsProductTypes_2020-09-01/js-client.definitionsProductTypes_2020-09-01.model/SchemaLinkLink} link
 */
SchemaLink.prototype.link = undefined;

/**
 * Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify changes between schema versions, and for caching.
 * @member {String} checksum
 */
SchemaLink.prototype.checksum = undefined;
