amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Orders
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// PrescriptionDetail : Information about the prescription that is used to verify a regulated product. This must be provided once per order and reflect the seller’s own records. Only approved orders can have prescriptions.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PrescriptionDetail {
    /// The identifier for the prescription used to verify the regulated product.
    #[serde(rename = "prescriptionId")]
    pub prescription_id: String,
    /// The expiration date of the prescription used to verify the regulated product, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
    #[serde(rename = "expirationDate")]
    pub expiration_date: String,
    /// The number of units in each fill as provided in the prescription.
    #[serde(rename = "writtenQuantity")]
    pub written_quantity: i32,
    /// The total number of refills written in the original prescription used to verify the regulated product. If a prescription originally had no refills, this value must be 0.
    #[serde(rename = "totalRefillsAuthorized")]
    pub total_refills_authorized: i32,
    /// The number of refills remaining for the prescription used to verify the regulated product. If a prescription originally had 10 total refills, this value must be `10` for the first order, `9` for the second order, and `0` for the eleventh order. If a prescription originally had no refills, this value must be 0.
    #[serde(rename = "refillsRemaining")]
    pub refills_remaining: i32,
    /// The identifier for the clinic which provided the prescription used to verify the regulated product.
    #[serde(rename = "clinicId")]
    pub clinic_id: String,
    /// The instructions for the prescription as provided by the approver of the regulated product.
    #[serde(rename = "usageInstructions")]
    pub usage_instructions: String,
}

impl PrescriptionDetail {
    /// Information about the prescription that is used to verify a regulated product. This must be provided once per order and reflect the seller’s own records. Only approved orders can have prescriptions.
    pub fn new(prescription_id: String, expiration_date: String, written_quantity: i32, total_refills_authorized: i32, refills_remaining: i32, clinic_id: String, usage_instructions: String) -> PrescriptionDetail {
        PrescriptionDetail {
            prescription_id,
            expiration_date,
            written_quantity,
            total_refills_authorized,
            refills_remaining,
            clinic_id,
            usage_instructions,
        }
    }
}