Class IdempotentTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.IdempotentTrait
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToShapeId,Trait,ToSmithyBuilder<IdempotentTrait>
public final class IdempotentTrait
extends AbstractTrait
implements ToSmithyBuilder<IdempotentTrait>
Indicates that an operation is idempotent.
Optionally describes the errors returned when encountering unexpected resource states (already exists for creates, not found for deletes).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forIdempotentTrait.static final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IdempotentTrait.Builderbuilder()protected NodeThe result of toNode is used for hashCodes and equality.static IdempotentTraitCreates aIdempotentTraitfrom aNode.Gets the errors returned when the resource already exists.Gets the errors returned when the resource already exists, ornullif not defined.Gets the errors returned when the resource does not exist.Gets the errors returned when the resource does not exist, ornullif not defined.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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
Field Details
-
ID
-
-
Constructor Details
-
IdempotentTrait
-
IdempotentTrait
public IdempotentTrait()
-
-
Method Details
-
getExists
Gets the errors returned when the resource already exists.When present, an empty list indicates the operation returns a successful response. When absent, the behavior is unspecified.
- Returns:
- The exists errors list, if present.
-
getExistsOrNull
Gets the errors returned when the resource already exists, ornullif not defined.- Returns:
- The exists errors list, or
nullif not defined.
-
getNotFound
Gets the errors returned when the resource does not exist.When present, an empty list indicates the operation returns a successful response. When absent, the behavior is unspecified.
- Returns:
- The notFound errors list, if present.
-
getNotFoundOrNull
Gets the errors returned when the resource does not exist, ornullif not defined.- Returns:
- The notFound errors list, or
nullif not defined.
-
createNode
Description copied from class:AbstractTraitThe 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:
createNodein classAbstractTrait- Returns:
- Returns the trait as a node.
-
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<IdempotentTrait>- Returns:
- a builder for type T
-
fromNode
Creates aIdempotentTraitfrom aNode.- Parameters:
node- Node to create the IdempotentTrait from.- Returns:
- Returns the created IdempotentTrait.
- Throws:
ExpectationNotMetException- if the given Node is invalid.
-
builder
-