/*
 * Selling Partner API for Listings Restrictions
 * The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog listings.  For more information, see the [Listings Restrictions API Use Case Guide](doc:listings-restrictions-api-v2021-08-01-use-case-guide).
 *
 * OpenAPI spec version: 2021-08-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";

/**
 * The Link model module.
 * @module listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link
 * @version 2021-08-01
 */
export class Link {
  /**
   * Constructs a new <code>Link</code>.
   * A link to resources related to a listing restriction.
   * @alias module:listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link
   * @class
   * @param resource {String} The URI of the related resource.
   * @param verb {module:listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link.VerbEnum} The HTTP verb used to interact with the related resource.
   */
  constructor(resource, verb) {
    this.resource = resource;
    this.verb = verb;
  }

  /**
   * Constructs a <code>Link</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:listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link} obj Optional instance to populate.
   * @return {module:listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link} The populated <code>Link</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new Link();
      if (data.hasOwnProperty("resource"))
        obj.resource = ApiClient.convertToType(data["resource"], "String");
      if (data.hasOwnProperty("verb"))
        obj.verb = ApiClient.convertToType(data["verb"], "String");
      if (data.hasOwnProperty("title"))
        obj.title = ApiClient.convertToType(data["title"], "String");
      if (data.hasOwnProperty("type"))
        obj.type = ApiClient.convertToType(data["type"], "String");
    }
    return obj;
  }
}

/**
 * The URI of the related resource.
 * @member {String} resource
 */
Link.prototype.resource = undefined;

/**
 * Allowed values for the <code>verb</code> property.
 * @enum {String}
 * @readonly
 */
Link.VerbEnum = {
  /**
   * value: "GET"
   * @const
   */
  GET: "GET",
};

/**
 * The HTTP verb used to interact with the related resource.
 * @member {module:listingsRestrictions_2021-08-01/js-client.listingsRestrictions_2021-08-01.model/Link.VerbEnum} verb
 */
Link.prototype.verb = undefined;

/**
 * The title of the related resource.
 * @member {String} title
 */
Link.prototype.title = undefined;

/**
 * The media type of the related resource.
 * @member {String} type
 */
Link.prototype.type = undefined;
