1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* 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,
}