asana 0.1.1

asana bindings for rust
Documentation
/*
 * Asana
 *
 * This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml).
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

/// BatchRequestAction : An action object for use in a batch request.

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BatchRequestAction {
    /// The path of the desired endpoint relative to the API’s base URL. Query parameters are not accepted here; put them in `data` instead.
    #[serde(rename = "relative_path")]
    pub relative_path: String,
    /// The HTTP method you wish to emulate for the action.
    #[serde(rename = "method")]
    pub method: Method,
    /// For `GET` requests, this should be a map of query parameters you would have normally passed in the URL. Options and pagination are not accepted here; put them in `options` instead. For `POST`, `PATCH`, and `PUT` methods, this should be the content you would have normally put in the data field of the body.
    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
    #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
    pub options: Option<Box<crate::models::BatchRequestActionOptions>>,
}

impl BatchRequestAction {
    /// An action object for use in a batch request.
    pub fn new(relative_path: String, method: Method) -> BatchRequestAction {
        BatchRequestAction { relative_path, method, data: None, options: None }
    }
}

/// The HTTP method you wish to emulate for the action.
#[derive(
    Clone,
    Copy,
    Debug,
    Eq,
    PartialEq,
    Ord,
    PartialOrd,
    Hash,
    Serialize,
    Deserialize
)]
pub enum Method {
    #[serde(rename = "get")]
    Get,
    #[serde(rename = "post")]
    Post,
    #[serde(rename = "put")]
    Put,
    #[serde(rename = "delete")]
    Delete,
    #[serde(rename = "patch")]
    Patch,
    #[serde(rename = "head")]
    Head,
}