1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4use super::{AsyncInvokeStatus, Rest};
5
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8#[derive(gproxy_protocol_macros::WireBuilder)]
9#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
10pub struct StartAsyncInvokeRequest {
11 #[serde(skip_serializing_if = "Option::is_none")]
12 pub client_request_token: Option<String>,
13 pub model_id: String,
14 pub model_input: Value,
15 pub output_data_config: AsyncInvokeOutputDataConfig,
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub tags: Option<Vec<Tag>>,
18 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
19 pub rest: Rest,
20}
21
22#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
23#[serde(rename_all = "camelCase")]
24#[derive(gproxy_protocol_macros::WireBuilder)]
25#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
26pub struct StartAsyncInvokeResponse {
27 pub invocation_arn: String,
28 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
29 pub rest: Rest,
30}
31
32#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
33#[serde(rename_all = "camelCase")]
34#[derive(gproxy_protocol_macros::WireBuilder)]
35#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
36pub struct GetAsyncInvokeRequest {
37 pub invocation_arn: String,
38 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
39 pub rest: Rest,
40}
41
42#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
43#[serde(rename_all = "camelCase")]
44#[derive(gproxy_protocol_macros::WireBuilder)]
45#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
46pub struct GetAsyncInvokeResponse {
47 pub invocation_arn: String,
48 pub model_arn: String,
49 pub status: AsyncInvokeStatus,
50 pub submit_time: String,
51 pub output_data_config: AsyncInvokeOutputDataConfig,
52 #[serde(skip_serializing_if = "Option::is_none")]
53 pub client_request_token: Option<String>,
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub failure_message: Option<String>,
56 #[serde(skip_serializing_if = "Option::is_none")]
57 pub last_modified_time: Option<String>,
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub end_time: Option<String>,
60 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
61 pub rest: Rest,
62}
63
64#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
65#[serde(untagged)]
66#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
67pub enum AsyncInvokeOutputDataConfig {
68 S3 {
69 #[serde(rename = "s3OutputDataConfig")]
70 s3_output_data_config: AsyncInvokeS3OutputDataConfig,
71 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
72 rest: Rest,
73 },
74 Raw(Value),
75}
76
77#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
78#[serde(rename_all = "camelCase")]
79#[derive(gproxy_protocol_macros::WireBuilder)]
80#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
81pub struct AsyncInvokeS3OutputDataConfig {
82 pub s3_uri: String,
83 #[serde(skip_serializing_if = "Option::is_none")]
84 pub kms_key_id: Option<String>,
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub bucket_owner: Option<String>,
87 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
88 pub rest: Rest,
89}
90
91#[derive(
92 Debug, Clone, PartialEq, Eq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder,
93)]
94#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
95pub struct Tag {
96 pub key: String,
97 pub value: String,
98 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
99 pub rest: Rest,
100}