btcpay-client 0.1.0

A client library for BTCPay Server.
Documentation
/*
 * BTCPay Greenfield API
 *
 * A full API to use your BTCPay Server
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AppsCreatePointOfSaleAppRequest {
    /// The name of the app (shown in admin UI)
    #[serde(rename = "appName", skip_serializing_if = "Option::is_none")]
    pub app_name: Option<String>,
    /// The title of the app (shown to the user)
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// The description of the app
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Template for items available in the app
    #[serde(rename = "template", skip_serializing_if = "Option::is_none")]
    pub template: Option<String>,
    /// Template for items available in the app
    #[serde(rename = "defaultView", skip_serializing_if = "Option::is_none")]
    pub default_view: Option<DefaultView>,
    /// Currency to use for the app. Defaults to the currency used by the store if not specified
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// Whether to include a special item in the store which allows user to input a custom payment amount
    #[serde(rename = "showCustomAmount", skip_serializing_if = "Option::is_none")]
    pub show_custom_amount: Option<bool>,
    /// Whether to allow user to input a discount amount. Applies to Cart view only. Not recommended for customer self-checkout
    #[serde(rename = "showDiscount", skip_serializing_if = "Option::is_none")]
    pub show_discount: Option<bool>,
    /// Whether to allow user to input a tip amount. Applies to Cart and Light views only
    #[serde(rename = "enableTips", skip_serializing_if = "Option::is_none")]
    pub enable_tips: Option<bool>,
    /// Payment button text which appears for items which allow user to input a custom amount
    #[serde(rename = "customAmountPayButtonText", skip_serializing_if = "Option::is_none")]
    pub custom_amount_pay_button_text: Option<String>,
    /// Payment button text which appears for items which have a fixed price
    #[serde(rename = "fixedAmountPayButtonText", skip_serializing_if = "Option::is_none")]
    pub fixed_amount_pay_button_text: Option<String>,
    /// Prompt which appears next to the tip amount field if tipping is enabled
    #[serde(rename = "tipText", skip_serializing_if = "Option::is_none")]
    pub tip_text: Option<String>,
    /// Link to a custom CSS stylesheet to be used in the app
    #[serde(rename = "customCSSLink", skip_serializing_if = "Option::is_none")]
    pub custom_css_link: Option<String>,
    /// Custom CSS to embed into the app
    #[serde(rename = "embeddedCSS", skip_serializing_if = "Option::is_none")]
    pub embedded_css: Option<String>,
    /// Callback notification url to POST to once when invoice is paid for and once when there are enough blockchain confirmations
    #[serde(rename = "notificationUrl", skip_serializing_if = "Option::is_none")]
    pub notification_url: Option<String>,
    /// URL to redirect user to once invoice is paid
    #[serde(rename = "redirectUrl", skip_serializing_if = "Option::is_none")]
    pub redirect_url: Option<String>,
    /// Whether to redirect user to redirect URL automatically once invoice is paid. Defaults to what is set in the store settings
    #[serde(rename = "redirectAutomatically", skip_serializing_if = "Option::is_none")]
    pub redirect_automatically: Option<bool>,
    /// Whether to redirect user to redirect URL automatically once invoice is paid. Defaults to what is set in the store settings
    #[serde(rename = "requiresRefundEmail", skip_serializing_if = "Option::is_none")]
    pub requires_refund_email: Option<bool>,
}

impl AppsCreatePointOfSaleAppRequest {
    pub fn new() -> AppsCreatePointOfSaleAppRequest {
        AppsCreatePointOfSaleAppRequest {
            app_name: None,
            title: None,
            description: None,
            template: None,
            default_view: None,
            currency: None,
            show_custom_amount: None,
            show_discount: None,
            enable_tips: None,
            custom_amount_pay_button_text: None,
            fixed_amount_pay_button_text: None,
            tip_text: None,
            custom_css_link: None,
            embedded_css: None,
            notification_url: None,
            redirect_url: None,
            redirect_automatically: None,
            requires_refund_email: None,
        }
    }
}

/// Template for items available in the app
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DefaultView {
    #[serde(rename = "Static")]
    _Static,
    #[serde(rename = "Cart")]
    Cart,
    #[serde(rename = "Light")]
    Light,
    #[serde(rename = "Print")]
    Print,
}

impl Default for DefaultView {
    fn default() -> DefaultView {
        Self::_Static
    }
}