Class AuthorizersTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.aws.apigateway.traits.AuthorizersTrait
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
,ToSmithyBuilder<AuthorizersTrait>
public final class AuthorizersTrait extends AbstractTrait implements ToSmithyBuilder<AuthorizersTrait>
Defines a map of API Gatewayx-amazon-apigateway-authorizer
values that correspond to Smithy authorization definitions.The key in each key-value pair of the
aws.apigateway#authorizers
trait is an arbitrary name that's used to associate authorizer definitions to operations. Thescheme
property of an authorizer must correspond to the name of an authorization scheme of the service the trait is bound to. When used to generate and OpenAPI model, theaws.apigateway#authorizers
trait is used to add thex-amazon-apigateway-authorizer
OpenAPI extension to the generated security scheme.- See Also:
- API Gateway Authorizers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizersTrait.Builder
Builds anAuthorizersTrait
.static class
AuthorizersTrait.Provider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthorizersTrait.Builder
builder()
Creates a builder for the trait.protected Node
createNode()
The result of toNode is used for hashCodes and equality.java.util.Optional<AuthorizerDefinition>
getAuthorizer(java.lang.String name)
Gets a specific authorizer by name.java.util.Map<java.lang.String,AuthorizerDefinition>
getAuthorizers()
Gets an immutable map of authorizer names to their definitions.AuthorizersTrait.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
-
-
-
Field Detail
-
ID
public static final ShapeId ID
-
-
Method Detail
-
builder
public static AuthorizersTrait.Builder builder()
Creates a builder for the trait.- Returns:
- Returns the created builder.
-
getAuthorizer
public java.util.Optional<AuthorizerDefinition> getAuthorizer(java.lang.String name)
Gets a specific authorizer by name.- Parameters:
name
- Name of the authorizer to get.- Returns:
- Returns the optionally found authorizer.
-
getAuthorizers
public java.util.Map<java.lang.String,AuthorizerDefinition> getAuthorizers()
Gets an immutable map of authorizer names to their definitions.- Returns:
- Returns the authorizers.
-
toBuilder
public AuthorizersTrait.Builder toBuilder()
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<AuthorizersTrait>
- Returns:
- a builder for type T
-
createNode
protected Node createNode()
Description copied from class:AbstractTrait
The result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-
-