line-bot-sdk-rust 3.0.0

LINE Messaging API SDK for Rust
Documentation
/*
* Copyright (C) 2016 LINE Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
 * LINE Messaging API
 *
 * This document describes LINE Messaging API.
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// CouponResponse : Detailed information about a coupon, including all properties and current status.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CouponResponse {
    #[serde(
        rename = "acquisitionCondition",
        skip_serializing_if = "Option::is_none"
    )]
    pub acquisition_condition: Option<Box<models::AcquisitionConditionResponse>>,
    /// URL of the barcode image associated with the coupon. Used for in-store redemption.
    #[serde(rename = "barcodeImageUrl", skip_serializing_if = "Option::is_none")]
    pub barcode_image_url: Option<String>,
    /// Unique code to be presented by the user to redeem the coupon.
    #[serde(rename = "couponCode", skip_serializing_if = "Option::is_none")]
    pub coupon_code: Option<String>,
    /// Detailed description of the coupon. Displayed to users.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Coupon expiration time (epoch seconds). Coupon cannot be used after this time.
    #[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none")]
    pub end_timestamp: Option<i64>,
    /// URL of the main image representing the coupon. Displayed in the coupon list.
    #[serde(rename = "imageUrl", skip_serializing_if = "Option::is_none")]
    pub image_url: Option<String>,
    /// Maximum number of coupons that can be issued in total.
    #[serde(rename = "maxAcquireCount", skip_serializing_if = "Option::is_none")]
    pub max_acquire_count: Option<i64>,
    /// Maximum number of times a single coupon ticket can be used.
    #[serde(
        rename = "maxUseCountPerTicket",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_use_count_per_ticket: Option<i32>,
    /// Maximum number of coupon tickets a single user can acquire.
    #[serde(rename = "maxTicketPerUser", skip_serializing_if = "Option::is_none")]
    pub max_ticket_per_user: Option<i64>,
    /// Coupon start time (epoch seconds). Coupon can be used from this time.
    #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none")]
    pub start_timestamp: Option<i64>,
    /// Title of the coupon. Displayed in the coupon list.
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Conditions for using the coupon. Shown to users.
    #[serde(rename = "usageCondition", skip_serializing_if = "Option::is_none")]
    pub usage_condition: Option<String>,
    #[serde(rename = "reward", skip_serializing_if = "Option::is_none")]
    pub reward: Option<Box<models::CouponRewardResponse>>,
    /// Visibility of the coupon. Determines who can see or acquire the coupon.
    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
    pub visibility: Option<Visibility>,
    /// Timezone for interpreting start and end timestamps.
    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
    pub timezone: Option<Timezone>,
    /// Unique identifier of the coupon.
    #[serde(rename = "couponId", skip_serializing_if = "Option::is_none")]
    pub coupon_id: Option<String>,
    /// Created timestamp (seconds) of the coupon.
    #[serde(rename = "createdTimestamp", skip_serializing_if = "Option::is_none")]
    pub created_timestamp: Option<i64>,
    /// Current status of the coupon.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
}

impl CouponResponse {
    /// Detailed information about a coupon, including all properties and current status.
    pub fn new() -> CouponResponse {
        CouponResponse {
            acquisition_condition: None,
            barcode_image_url: None,
            coupon_code: None,
            description: None,
            end_timestamp: None,
            image_url: None,
            max_acquire_count: None,
            max_use_count_per_ticket: None,
            max_ticket_per_user: None,
            start_timestamp: None,
            title: None,
            usage_condition: None,
            reward: None,
            visibility: None,
            timezone: None,
            coupon_id: None,
            created_timestamp: None,
            status: None,
        }
    }
}
/// Visibility of the coupon. Determines who can see or acquire the coupon.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
pub enum Visibility {
    #[serde(rename = "UNLISTED")]
    Unlisted,
    #[serde(rename = "PUBLIC")]
    Public,
    #[serde(rename = "PRIVATE")]
    Private,
}

impl Default for Visibility {
    fn default() -> Visibility {
        Self::Unlisted
    }
}
/// Timezone for interpreting start and end timestamps.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
pub enum Timezone {
    #[serde(rename = "ETC_GMT_MINUS_12")]
    EtcGmtMinus12,
    #[serde(rename = "ETC_GMT_MINUS_11")]
    EtcGmtMinus11,
    #[serde(rename = "PACIFIC_HONOLULU")]
    PacificHonolulu,
    #[serde(rename = "AMERICA_ANCHORAGE")]
    AmericaAnchorage,
    #[serde(rename = "AMERICA_LOS_ANGELES")]
    AmericaLosAngeles,
    #[serde(rename = "AMERICA_PHOENIX")]
    AmericaPhoenix,
    #[serde(rename = "AMERICA_CHICAGO")]
    AmericaChicago,
    #[serde(rename = "AMERICA_NEW_YORK")]
    AmericaNewYork,
    #[serde(rename = "AMERICA_CARACAS")]
    AmericaCaracas,
    #[serde(rename = "AMERICA_SANTIAGO")]
    AmericaSantiago,
    #[serde(rename = "AMERICA_ST_JOHNS")]
    AmericaStJohns,
    #[serde(rename = "AMERICA_SAO_PAULO")]
    AmericaSaoPaulo,
    #[serde(rename = "ETC_GMT_MINUS_2")]
    EtcGmtMinus2,
    #[serde(rename = "ATLANTIC_CAPE_VERDE")]
    AtlanticCapeVerde,
    #[serde(rename = "EUROPE_LONDON")]
    EuropeLondon,
    #[serde(rename = "EUROPE_PARIS")]
    EuropeParis,
    #[serde(rename = "EUROPE_ISTANBUL")]
    EuropeIstanbul,
    #[serde(rename = "EUROPE_MOSCOW")]
    EuropeMoscow,
    #[serde(rename = "ASIA_TEHRAN")]
    AsiaTehran,
    #[serde(rename = "ASIA_TBILISI")]
    AsiaTbilisi,
    #[serde(rename = "ASIA_KABUL")]
    AsiaKabul,
    #[serde(rename = "ASIA_TASHKENT")]
    AsiaTashkent,
    #[serde(rename = "ASIA_COLOMBO")]
    AsiaColombo,
    #[serde(rename = "ASIA_KATHMANDU")]
    AsiaKathmandu,
    #[serde(rename = "ASIA_ALMATY")]
    AsiaAlmaty,
    #[serde(rename = "ASIA_RANGOON")]
    AsiaRangoon,
    #[serde(rename = "ASIA_BANGKOK")]
    AsiaBangkok,
    #[serde(rename = "ASIA_TAIPEI")]
    AsiaTaipei,
    #[serde(rename = "ASIA_TOKYO")]
    AsiaTokyo,
    #[serde(rename = "AUSTRALIA_DARWIN")]
    AustraliaDarwin,
    #[serde(rename = "AUSTRALIA_SYDNEY")]
    AustraliaSydney,
    #[serde(rename = "ASIA_VLADIVOSTOK")]
    AsiaVladivostok,
    #[serde(rename = "ETC_GMT_PLUS_12")]
    EtcGmtPlus12,
    #[serde(rename = "PACIFIC_TONGATAPU")]
    PacificTongatapu,
}

impl Default for Timezone {
    fn default() -> Timezone {
        Self::EtcGmtMinus12
    }
}
/// Current status of the coupon.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
pub enum Status {
    #[serde(rename = "DRAFT")]
    Draft,
    #[serde(rename = "RUNNING")]
    Running,
    #[serde(rename = "CLOSED")]
    Closed,
}

impl Default for Status {
    fn default() -> Status {
        Self::Draft
    }
}