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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvokeOutput {
/// <p>The HTTP status code is in the 200 range for a successful request. For the <code>RequestResponse</code> invocation type, this status code is 200. For the <code>Event</code> invocation type, this status code is 202. For the <code>DryRun</code> invocation type, the status code is 204.</p>
#[doc(hidden)]
pub status_code: i32,
/// <p>If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.</p>
#[doc(hidden)]
pub function_error: std::option::Option<std::string::String>,
/// <p>The last 4 KB of the execution log, which is base64-encoded.</p>
#[doc(hidden)]
pub log_result: std::option::Option<std::string::String>,
/// <p>The response from the function, or an error object.</p>
#[doc(hidden)]
pub payload: std::option::Option<aws_smithy_types::Blob>,
/// <p>The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.</p>
#[doc(hidden)]
pub executed_version: std::option::Option<std::string::String>,
_request_id: Option<String>,
}
impl InvokeOutput {
/// <p>The HTTP status code is in the 200 range for a successful request. For the <code>RequestResponse</code> invocation type, this status code is 200. For the <code>Event</code> invocation type, this status code is 202. For the <code>DryRun</code> invocation type, the status code is 204.</p>
pub fn status_code(&self) -> i32 {
self.status_code
}
/// <p>If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.</p>
pub fn function_error(&self) -> std::option::Option<&str> {
self.function_error.as_deref()
}
/// <p>The last 4 KB of the execution log, which is base64-encoded.</p>
pub fn log_result(&self) -> std::option::Option<&str> {
self.log_result.as_deref()
}
/// <p>The response from the function, or an error object.</p>
pub fn payload(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.payload.as_ref()
}
/// <p>The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.</p>
pub fn executed_version(&self) -> std::option::Option<&str> {
self.executed_version.as_deref()
}
}
impl std::fmt::Debug for InvokeOutput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvokeOutput");
formatter.field("status_code", &self.status_code);
formatter.field("function_error", &self.function_error);
formatter.field("log_result", &self.log_result);
formatter.field("payload", &"*** Sensitive Data Redacted ***");
formatter.field("executed_version", &self.executed_version);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl aws_http::request_id::RequestId for InvokeOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl InvokeOutput {
/// Creates a new builder-style object to manufacture [`InvokeOutput`](crate::operation::invoke::InvokeOutput).
pub fn builder() -> crate::operation::invoke::builders::InvokeOutputBuilder {
crate::operation::invoke::builders::InvokeOutputBuilder::default()
}
}
/// A builder for [`InvokeOutput`](crate::operation::invoke::InvokeOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct InvokeOutputBuilder {
pub(crate) status_code: std::option::Option<i32>,
pub(crate) function_error: std::option::Option<std::string::String>,
pub(crate) log_result: std::option::Option<std::string::String>,
pub(crate) payload: std::option::Option<aws_smithy_types::Blob>,
pub(crate) executed_version: std::option::Option<std::string::String>,
_request_id: Option<String>,
}
impl InvokeOutputBuilder {
/// <p>The HTTP status code is in the 200 range for a successful request. For the <code>RequestResponse</code> invocation type, this status code is 200. For the <code>Event</code> invocation type, this status code is 202. For the <code>DryRun</code> invocation type, the status code is 204.</p>
pub fn status_code(mut self, input: i32) -> Self {
self.status_code = Some(input);
self
}
/// <p>The HTTP status code is in the 200 range for a successful request. For the <code>RequestResponse</code> invocation type, this status code is 200. For the <code>Event</code> invocation type, this status code is 202. For the <code>DryRun</code> invocation type, the status code is 204.</p>
pub fn set_status_code(mut self, input: std::option::Option<i32>) -> Self {
self.status_code = input;
self
}
/// <p>If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.</p>
pub fn function_error(mut self, input: impl Into<std::string::String>) -> Self {
self.function_error = Some(input.into());
self
}
/// <p>If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.</p>
pub fn set_function_error(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_error = input;
self
}
/// <p>The last 4 KB of the execution log, which is base64-encoded.</p>
pub fn log_result(mut self, input: impl Into<std::string::String>) -> Self {
self.log_result = Some(input.into());
self
}
/// <p>The last 4 KB of the execution log, which is base64-encoded.</p>
pub fn set_log_result(mut self, input: std::option::Option<std::string::String>) -> Self {
self.log_result = input;
self
}
/// <p>The response from the function, or an error object.</p>
pub fn payload(mut self, input: aws_smithy_types::Blob) -> Self {
self.payload = Some(input);
self
}
/// <p>The response from the function, or an error object.</p>
pub fn set_payload(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.payload = input;
self
}
/// <p>The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.</p>
pub fn executed_version(mut self, input: impl Into<std::string::String>) -> Self {
self.executed_version = Some(input.into());
self
}
/// <p>The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.</p>
pub fn set_executed_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.executed_version = input;
self
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`InvokeOutput`](crate::operation::invoke::InvokeOutput).
pub fn build(self) -> crate::operation::invoke::InvokeOutput {
crate::operation::invoke::InvokeOutput {
status_code: self.status_code.unwrap_or_default(),
function_error: self.function_error,
log_result: self.log_result,
payload: self.payload,
executed_version: self.executed_version,
_request_id: self._request_id,
}
}
}
impl std::fmt::Debug for InvokeOutputBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvokeOutputBuilder");
formatter.field("status_code", &self.status_code);
formatter.field("function_error", &self.function_error);
formatter.field("log_result", &self.log_result);
formatter.field("payload", &"*** Sensitive Data Redacted ***");
formatter.field("executed_version", &self.executed_version);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}