aws_sdk_wafv2/client/
create_api_key.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CreateAPIKey`](crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`scope(Scope)`](crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder::scope) / [`set_scope(Option<Scope>)`](crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder::set_scope):<br>required: **true**<br><p>Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner service, or an Amazon Web Services Verified Access instance.</p> <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p> <ul>  <li>   <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>  <li>   <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li> </ul><br>
    ///   - [`token_domains(impl Into<String>)`](crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder::token_domains) / [`set_token_domains(Option<Vec::<String>>)`](crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder::set_token_domains):<br>required: **true**<br><p>The client application domains that you want to use this API key for.</p> <p>Example JSON: <code>"TokenDomains": \["abc.com", "store.abc.com"\]</code></p> <p>Public suffixes aren't allowed. For example, you can't use <code>gov.au</code> or <code>co.uk</code> as token domains.</p><br>
    /// - On success, responds with [`CreateApiKeyOutput`](crate::operation::create_api_key::CreateApiKeyOutput) with field(s):
    ///   - [`api_key(Option<String>)`](crate::operation::create_api_key::CreateApiKeyOutput::api_key): <p>The generated, encrypted API key. You can copy this for use in your JavaScript CAPTCHA integration.</p>
    /// - On failure, responds with [`SdkError<CreateAPIKeyError>`](crate::operation::create_api_key::CreateAPIKeyError)
    pub fn create_api_key(&self) -> crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder {
        crate::operation::create_api_key::builders::CreateAPIKeyFluentBuilder::new(self.handle.clone())
    }
}