aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
Documentation
// 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, ::std::fmt::Debug)]
pub struct SearchPrincipalsInput {
    /// The ID of the domain to search within.
    pub domain_id: ::std::option::Option<::std::string::String>,
    /// A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
    pub search_query: ::std::option::Option<::std::string::String>,
    /// The maximum number of results to return. Defaults to 10. Valid only when searchQuery is *; other searches reject this parameter and return at most 10 results.
    pub max_results: ::std::option::Option<i32>,
    /// A token to retrieve the next page of results. Valid only when searchQuery is *; other searches do not paginate and reject this parameter. Tokens expire after 24 hours.
    pub next_token: ::std::option::Option<::std::string::String>,
}
impl SearchPrincipalsInput {
    /// The ID of the domain to search within.
    pub fn domain_id(&self) -> ::std::option::Option<&str> {
        self.domain_id.as_deref()
    }
    /// A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
    pub fn search_query(&self) -> ::std::option::Option<&str> {
        self.search_query.as_deref()
    }
    /// The maximum number of results to return. Defaults to 10. Valid only when searchQuery is *; other searches reject this parameter and return at most 10 results.
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// A token to retrieve the next page of results. Valid only when searchQuery is *; other searches do not paginate and reject this parameter. Tokens expire after 24 hours.
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl SearchPrincipalsInput {
    /// Creates a new builder-style object to manufacture [`SearchPrincipalsInput`](crate::operation::search_principals::SearchPrincipalsInput).
    pub fn builder() -> crate::operation::search_principals::builders::SearchPrincipalsInputBuilder {
        crate::operation::search_principals::builders::SearchPrincipalsInputBuilder::default()
    }
}

/// A builder for [`SearchPrincipalsInput`](crate::operation::search_principals::SearchPrincipalsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SearchPrincipalsInputBuilder {
    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
    pub(crate) search_query: ::std::option::Option<::std::string::String>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
}
impl SearchPrincipalsInputBuilder {
    /// The ID of the domain to search within.
    /// This field is required.
    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the domain to search within.
    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_id = input;
        self
    }
    /// The ID of the domain to search within.
    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_id
    }
    /// A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
    /// This field is required.
    pub fn search_query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.search_query = ::std::option::Option::Some(input.into());
        self
    }
    /// A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
    pub fn set_search_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.search_query = input;
        self
    }
    /// A search term to match against user names, display names, and IDs. Pass * to list all principals. Maximum 128 characters.
    pub fn get_search_query(&self) -> &::std::option::Option<::std::string::String> {
        &self.search_query
    }
    /// The maximum number of results to return. Defaults to 10. Valid only when searchQuery is *; other searches reject this parameter and return at most 10 results.
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// The maximum number of results to return. Defaults to 10. Valid only when searchQuery is *; other searches reject this parameter and return at most 10 results.
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// The maximum number of results to return. Defaults to 10. Valid only when searchQuery is *; other searches reject this parameter and return at most 10 results.
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// A token to retrieve the next page of results. Valid only when searchQuery is *; other searches do not paginate and reject this parameter. Tokens expire after 24 hours.
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// A token to retrieve the next page of results. Valid only when searchQuery is *; other searches do not paginate and reject this parameter. Tokens expire after 24 hours.
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// A token to retrieve the next page of results. Valid only when searchQuery is *; other searches do not paginate and reject this parameter. Tokens expire after 24 hours.
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Consumes the builder and constructs a [`SearchPrincipalsInput`](crate::operation::search_principals::SearchPrincipalsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::search_principals::SearchPrincipalsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::search_principals::SearchPrincipalsInput {
            domain_id: self.domain_id,
            search_query: self.search_query,
            max_results: self.max_results,
            next_token: self.next_token,
        })
    }
}