#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutRecordBatchInput {
pub delivery_stream_name: ::std::option::Option<::std::string::String>,
pub records: ::std::option::Option<::std::vec::Vec<crate::types::Record>>,
}
impl PutRecordBatchInput {
pub fn delivery_stream_name(&self) -> ::std::option::Option<&str> {
self.delivery_stream_name.as_deref()
}
pub fn records(&self) -> &[crate::types::Record] {
self.records.as_deref().unwrap_or_default()
}
}
impl PutRecordBatchInput {
pub fn builder() -> crate::operation::put_record_batch::builders::PutRecordBatchInputBuilder {
crate::operation::put_record_batch::builders::PutRecordBatchInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PutRecordBatchInputBuilder {
pub(crate) delivery_stream_name: ::std::option::Option<::std::string::String>,
pub(crate) records: ::std::option::Option<::std::vec::Vec<crate::types::Record>>,
}
impl PutRecordBatchInputBuilder {
pub fn delivery_stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.delivery_stream_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_delivery_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.delivery_stream_name = input;
self
}
pub fn get_delivery_stream_name(&self) -> &::std::option::Option<::std::string::String> {
&self.delivery_stream_name
}
pub fn records(mut self, input: crate::types::Record) -> Self {
let mut v = self.records.unwrap_or_default();
v.push(input);
self.records = ::std::option::Option::Some(v);
self
}
pub fn set_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Record>>) -> Self {
self.records = input;
self
}
pub fn get_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Record>> {
&self.records
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_record_batch::PutRecordBatchInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_record_batch::PutRecordBatchInput {
delivery_stream_name: self.delivery_stream_name,
records: self.records,
})
}
}