amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * 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).
 *
 * The version of the OpenAPI document: 2021-08-01
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Link : A link to resources related to a listing restriction.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Link {
    /// The URI of the related resource.
    #[serde(rename = "resource")]
    pub resource: String,
    /// The HTTP verb used to interact with the related resource.
    #[serde(rename = "verb")]
    pub verb: Verb,
    /// The title of the related resource.
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// The media type of the related resource.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
}

impl Link {
    /// A link to resources related to a listing restriction.
    pub fn new(resource: String, verb: Verb) -> Link {
        Link {
            resource,
            verb,
            title: None,
            r#type: None,
        }
    }
}
/// The HTTP verb used to interact with the related resource.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Verb {
    #[serde(rename = "GET")]
    Get,
}

impl Default for Verb {
    fn default() -> Verb {
        Self::Get
    }
}