// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_resources_v2::_get_resources_v2_input::GetResourcesV2InputBuilder;
pub use crate::operation::get_resources_v2::_get_resources_v2_output::GetResourcesV2OutputBuilder;
impl crate::operation::get_resources_v2::builders::GetResourcesV2InputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::get_resources_v2::GetResourcesV2Output,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_resources_v2::GetResourcesV2Error,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_resources_v2();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetResourcesV2`.
///
/// <p>Returns a list of resources.</p>
/// <p>You can use the <code>Scopes</code> parameter to define the data boundary for the query. Currently, <code>Scopes</code> supports <code>AwsOrganizations</code>, which lets you retrieve resources from your entire organization or from specific organizational units. Only the delegated administrator account can use <code>Scopes</code>.</p>
/// <p>You can use the <code>Filters</code> parameter to refine results based on resource attributes. You can use <code>Scopes</code> and <code>Filters</code> independently or together. When both are provided, <code>Scopes</code> narrows the data set first, and then <code>Filters</code> refines results within that scoped data set.</p>
/// <p>For AI/ML resources, the response includes the <code>ResourceSubCategory</code> field. For self-hosted AI resources and their host resources, the response also includes <code>ResourceInfo</code> with AI-specific details. Self-hosted AI resources use a <code>ResourceType</code> with the <code>SelfHosted::AI::</code> prefix, such as <code>SelfHosted::AI::Model</code>, <code>SelfHosted::AI::Agent</code>, <code>SelfHosted::AI::InferenceEndpoint</code>, and <code>SelfHosted::AI::ExternalEndpoint</code>.</p>
/// <p>If you filter by <code>ResourceSubCategory</code>, you must also include a <code>ResourceCategory</code> string filter with comparison set to <code>EQUALS</code> and value <code>AI/ML</code> in the same request.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetResourcesV2FluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_resources_v2::builders::GetResourcesV2InputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_resources_v2::GetResourcesV2Output,
crate::operation::get_resources_v2::GetResourcesV2Error,
> for GetResourcesV2FluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_resources_v2::GetResourcesV2Output,
crate::operation::get_resources_v2::GetResourcesV2Error,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetResourcesV2FluentBuilder {
/// Creates a new `GetResourcesV2FluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the GetResourcesV2 as a reference.
pub fn as_input(&self) -> &crate::operation::get_resources_v2::builders::GetResourcesV2InputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::get_resources_v2::GetResourcesV2Output,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_resources_v2::GetResourcesV2Error,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::get_resources_v2::GetResourcesV2::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::get_resources_v2::GetResourcesV2::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::get_resources_v2::GetResourcesV2Output,
crate::operation::get_resources_v2::GetResourcesV2Error,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::operation::get_resources_v2::paginator::GetResourcesV2Paginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
pub fn into_paginator(self) -> crate::operation::get_resources_v2::paginator::GetResourcesV2Paginator {
crate::operation::get_resources_v2::paginator::GetResourcesV2Paginator::new(self.handle, self.inner)
}
/// <p>Filters resources based on a set of criteria.</p>
pub fn filters(mut self, input: crate::types::ResourcesFilters) -> Self {
self.inner = self.inner.filters(input);
self
}
/// <p>Filters resources based on a set of criteria.</p>
pub fn set_filters(mut self, input: ::std::option::Option<crate::types::ResourcesFilters>) -> Self {
self.inner = self.inner.set_filters(input);
self
}
/// <p>Filters resources based on a set of criteria.</p>
pub fn get_filters(&self) -> &::std::option::Option<crate::types::ResourcesFilters> {
self.inner.get_filters()
}
/// <p>Limits the results to resources from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an <code>AccessDeniedException</code>.</p>
/// <p>This parameter is optional. If you omit it, the delegated administrator sees resources from all accounts across the entire organization. Other accounts see only their own resources.</p>
/// <p>You can specify up to 10 entries in <code>Scopes.AwsOrganizations</code>. If multiple entries are specified, the entries are combined using OR logic.</p>
pub fn scopes(mut self, input: crate::types::ResourceScopes) -> Self {
self.inner = self.inner.scopes(input);
self
}
/// <p>Limits the results to resources from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an <code>AccessDeniedException</code>.</p>
/// <p>This parameter is optional. If you omit it, the delegated administrator sees resources from all accounts across the entire organization. Other accounts see only their own resources.</p>
/// <p>You can specify up to 10 entries in <code>Scopes.AwsOrganizations</code>. If multiple entries are specified, the entries are combined using OR logic.</p>
pub fn set_scopes(mut self, input: ::std::option::Option<crate::types::ResourceScopes>) -> Self {
self.inner = self.inner.set_scopes(input);
self
}
/// <p>Limits the results to resources from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an <code>AccessDeniedException</code>.</p>
/// <p>This parameter is optional. If you omit it, the delegated administrator sees resources from all accounts across the entire organization. Other accounts see only their own resources.</p>
/// <p>You can specify up to 10 entries in <code>Scopes.AwsOrganizations</code>. If multiple entries are specified, the entries are combined using OR logic.</p>
pub fn get_scopes(&self) -> &::std::option::Option<crate::types::ResourceScopes> {
self.inner.get_scopes()
}
///
/// Appends an item to `SortCriteria`.
///
/// To override the contents of this collection use [`set_sort_criteria`](Self::set_sort_criteria).
///
/// <p>The resource attributes used to sort the list of returned resources.</p>
pub fn sort_criteria(mut self, input: crate::types::SortCriterion) -> Self {
self.inner = self.inner.sort_criteria(input);
self
}
/// <p>The resource attributes used to sort the list of returned resources.</p>
pub fn set_sort_criteria(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>>) -> Self {
self.inner = self.inner.set_sort_criteria(input);
self
}
/// <p>The resource attributes used to sort the list of returned resources.</p>
pub fn get_sort_criteria(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>> {
self.inner.get_sort_criteria()
}
/// <p>The token required for pagination. On your first call, set the value of this parameter to <code>NULL</code>. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token required for pagination. On your first call, set the value of this parameter to <code>NULL</code>. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The token required for pagination. On your first call, set the value of this parameter to <code>NULL</code>. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_next_token()
}
/// <p>The maximum number of results to return.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results to return.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The maximum number of results to return.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
self.inner.get_max_results()
}
}