aws_sdk_quicksight/types/
_sheet_image_static_file_source.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The source of the static file that contains the image.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SheetImageStaticFileSource {
7    /// <p>The ID of the static file that contains the image.</p>
8    pub static_file_id: ::std::string::String,
9}
10impl SheetImageStaticFileSource {
11    /// <p>The ID of the static file that contains the image.</p>
12    pub fn static_file_id(&self) -> &str {
13        use std::ops::Deref;
14        self.static_file_id.deref()
15    }
16}
17impl SheetImageStaticFileSource {
18    /// Creates a new builder-style object to manufacture [`SheetImageStaticFileSource`](crate::types::SheetImageStaticFileSource).
19    pub fn builder() -> crate::types::builders::SheetImageStaticFileSourceBuilder {
20        crate::types::builders::SheetImageStaticFileSourceBuilder::default()
21    }
22}
23
24/// A builder for [`SheetImageStaticFileSource`](crate::types::SheetImageStaticFileSource).
25#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct SheetImageStaticFileSourceBuilder {
28    pub(crate) static_file_id: ::std::option::Option<::std::string::String>,
29}
30impl SheetImageStaticFileSourceBuilder {
31    /// <p>The ID of the static file that contains the image.</p>
32    /// This field is required.
33    pub fn static_file_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
34        self.static_file_id = ::std::option::Option::Some(input.into());
35        self
36    }
37    /// <p>The ID of the static file that contains the image.</p>
38    pub fn set_static_file_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
39        self.static_file_id = input;
40        self
41    }
42    /// <p>The ID of the static file that contains the image.</p>
43    pub fn get_static_file_id(&self) -> &::std::option::Option<::std::string::String> {
44        &self.static_file_id
45    }
46    /// Consumes the builder and constructs a [`SheetImageStaticFileSource`](crate::types::SheetImageStaticFileSource).
47    /// This method will fail if any of the following fields are not set:
48    /// - [`static_file_id`](crate::types::builders::SheetImageStaticFileSourceBuilder::static_file_id)
49    pub fn build(self) -> ::std::result::Result<crate::types::SheetImageStaticFileSource, ::aws_smithy_types::error::operation::BuildError> {
50        ::std::result::Result::Ok(crate::types::SheetImageStaticFileSource {
51            static_file_id: self.static_file_id.ok_or_else(|| {
52                ::aws_smithy_types::error::operation::BuildError::missing_field(
53                    "static_file_id",
54                    "static_file_id was not specified but it is required when building SheetImageStaticFileSource",
55                )
56            })?,
57        })
58    }
59}