aws-sdk-apiportal 1.1.0

AWS SDK for APIPortal
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_product_api_page::_create_product_api_page_input::CreateProductApiPageInputBuilder;

pub use crate::operation::create_product_api_page::_create_product_api_page_output::CreateProductApiPageOutputBuilder;

impl crate::operation::create_product_api_page::builders::CreateProductApiPageInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_product_api_page::CreateProductApiPageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_product_api_page::CreateProductApiPageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_product_api_page();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateProductApiPage`.
///
/// Creates an API page that documents a Managed API in a product. The page content is generated asynchronously. Use `status` to track it.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateProductApiPageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_product_api_page::builders::CreateProductApiPageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_product_api_page::CreateProductApiPageOutput,
        crate::operation::create_product_api_page::CreateProductApiPageError,
    > for CreateProductApiPageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_product_api_page::CreateProductApiPageOutput,
            crate::operation::create_product_api_page::CreateProductApiPageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateProductApiPageFluentBuilder {
    /// Creates a new `CreateProductApiPageFluentBuilder`.
    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 CreateProductApiPage as a reference.
    pub fn as_input(&self) -> &crate::operation::create_product_api_page::builders::CreateProductApiPageInputBuilder {
        &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::create_product_api_page::CreateProductApiPageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_product_api_page::CreateProductApiPageError,
            ::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::create_product_api_page::CreateProductApiPage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_product_api_page::CreateProductApiPage::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::create_product_api_page::CreateProductApiPageOutput,
        crate::operation::create_product_api_page::CreateProductApiPageError,
        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
    }
    /// The identifier of the product.
    pub fn product_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.product_id(input.into());
        self
    }
    /// The identifier of the product.
    pub fn set_product_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_product_id(input);
        self
    }
    /// The identifier of the product.
    pub fn get_product_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_product_id()
    }
    /// The Managed API this page documents. It must already be associated with the product, and the page's API identifier is taken from the Managed API rather than supplied by the caller.
    pub fn managed_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.managed_api_id(input.into());
        self
    }
    /// The Managed API this page documents. It must already be associated with the product, and the page's API identifier is taken from the Managed API rather than supplied by the caller.
    pub fn set_managed_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_managed_api_id(input);
        self
    }
    /// The Managed API this page documents. It must already be associated with the product, and the page's API identifier is taken from the Managed API rather than supplied by the caller.
    pub fn get_managed_api_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_managed_api_id()
    }
    /// Exactly one of the members is set: `none` to use default display content, or `overrides` to customize it. Modeled as a union so the "exactly one" choice is enforced by type.
    pub fn display_content(mut self, input: crate::types::ApiPageDisplayContent) -> Self {
        self.inner = self.inner.display_content(input);
        self
    }
    /// Exactly one of the members is set: `none` to use default display content, or `overrides` to customize it. Modeled as a union so the "exactly one" choice is enforced by type.
    pub fn set_display_content(mut self, input: ::std::option::Option<crate::types::ApiPageDisplayContent>) -> Self {
        self.inner = self.inner.set_display_content(input);
        self
    }
    /// Exactly one of the members is set: `none` to use default display content, or `overrides` to customize it. Modeled as a union so the "exactly one" choice is enforced by type.
    pub fn get_display_content(&self) -> &::std::option::Option<crate::types::ApiPageDisplayContent> {
        self.inner.get_display_content()
    }
    /// Whether readers can call the API from the page with Try-It. Defaults to `DISABLED`. To enable it, the page's API URL must use HTTPS on a domain that supports Try-It.
    pub fn try_it_state(mut self, input: crate::types::TryItState) -> Self {
        self.inner = self.inner.try_it_state(input);
        self
    }
    /// Whether readers can call the API from the page with Try-It. Defaults to `DISABLED`. To enable it, the page's API URL must use HTTPS on a domain that supports Try-It.
    pub fn set_try_it_state(mut self, input: ::std::option::Option<crate::types::TryItState>) -> Self {
        self.inner = self.inner.set_try_it_state(input);
        self
    }
    /// Whether readers can call the API from the page with Try-It. Defaults to `DISABLED`. To enable it, the page's API URL must use HTTPS on a domain that supports Try-It.
    pub fn get_try_it_state(&self) -> &::std::option::Option<crate::types::TryItState> {
        self.inner.get_try_it_state()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// Up to 50 tags per request, matching API Gateway's limit of 50 tags per resource.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// Up to 50 tags per request, matching API Gateway's limit of 50 tags per resource.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// Up to 50 tags per request, matching API Gateway's limit of 50 tags per resource.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}