public final class OperationShape extends Shape implements software.amazon.smithy.utils.ToSmithyBuilder<OperationShape>
Modifier and Type | Class and Description |
---|---|
static class |
OperationShape.Builder
Builder used to create a
OperationShape . |
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(ShapeVisitor<R> visitor)
Dispatches the shape to the appropriate
ShapeVisitor method. |
java.util.Optional<OperationShape> |
asOperationShape() |
static OperationShape.Builder |
builder() |
boolean |
equals(java.lang.Object other) |
java.util.List<ShapeId> |
getErrors()
Gets a list of the error shape IDs bound directly to the operation
that can be encountered.
|
java.util.List<ShapeId> |
getErrors(ServiceShape service)
Gets a list of the error shape IDs the operation can encounter,
including any common errors of a service.
|
java.util.Optional<ShapeId> |
getInput()
Gets the optional shape ID of the input of the operation.
|
ShapeId |
getInputShape()
Gets the input of the operation.
|
java.util.List<ShapeId> |
getIntroducedErrors()
Gets the errors introduced by the shape and not inherited
from mixins.
|
java.util.Optional<ShapeId> |
getOutput()
Gets the optional shape ID of the output of the operation.
|
ShapeId |
getOutputShape()
Gets the output of the operation.
|
ShapeType |
getType()
Gets the type of the shape.
|
OperationShape.Builder |
toBuilder() |
asBigDecimalShape, asBigIntegerShape, asBlobShape, asBooleanShape, asByteShape, asDocumentShape, asDoubleShape, asEnumShape, asFloatShape, asIntegerShape, asIntEnumShape, asListShape, asLongShape, asMapShape, asMemberShape, asResourceShape, asServiceShape, asSetShape, asShortShape, asStringShape, asStructureShape, asTimestampShape, asUnionShape, compareTo, expectTrait, findMemberTrait, findTrait, findTrait, getAllMembers, getAllTraits, getId, getIntroducedTraits, getMember, getMemberNames, getMemberTrait, getMixins, getRequiredMixinMember, getSourceLocation, getTags, getTrait, hashCode, hasTrait, hasTrait, hasTrait, isBigDecimalShape, isBigIntegerShape, isBlobShape, isBooleanShape, isByteShape, isDocumentShape, isDoubleShape, isEnumShape, isFloatShape, isIntegerShape, isIntEnumShape, isListShape, isLongShape, isMapShape, isMemberShape, isOperationShape, isResourceShape, isServiceShape, isSetShape, isShortShape, isStringShape, isStructureShape, isTimestampShape, isUnionShape, members, shapeToBuilder, toShapeId, toString, validateMemberShapeIds, validateMixins
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compare
public static OperationShape.Builder builder()
public OperationShape.Builder toBuilder()
toBuilder
in interface software.amazon.smithy.utils.ToSmithyBuilder<OperationShape>
public <R> R accept(ShapeVisitor<R> visitor)
Shape
ShapeVisitor
method.public java.util.Optional<OperationShape> asOperationShape()
asOperationShape
in class Shape
OperationShape
.public java.util.Optional<ShapeId> getInput()
Gets the optional shape ID of the input of the operation.
For backward compatibility, if the input targets smithy.api#Unit
,
then an empty optional is returned.
public java.util.Optional<ShapeId> getOutput()
Gets the optional shape ID of the output of the operation.
For backward compatibility, if the output targets smithy.api#Unit
,
then an empty optional is returned.
public ShapeId getInputShape()
All operations have input, and they default to target
smithy.api#Unit
.
public ShapeId getOutputShape()
All operations have output, and they default to target
smithy.api#Unit
.
public java.util.List<ShapeId> getErrors()
Gets a list of the error shape IDs bound directly to the operation that can be encountered.
This DOES NOT include errors that are common to a service. Operations
can be bound to multiple services, so common service errors cannot be
returned by this method. Use getErrors(ServiceShape)
or
OperationIndex.getErrors(ToShapeId, ToShapeId)
to get all of the
errors an operation can encounter when used within a service.
Each returned ShapeId
must resolve to a
StructureShape
that is targeted by an error trait; however,
this is only guaranteed after a model is validated.
getErrors(ServiceShape)
,
OperationIndex.getErrors(ToShapeId, ToShapeId)
public java.util.List<ShapeId> getIntroducedErrors()
public java.util.List<ShapeId> getErrors(ServiceShape service)
Gets a list of the error shape IDs the operation can encounter, including any common errors of a service.
No validation is performed here to ensure that the operation is actually bound to the given service shape.
OperationIndex.getErrors(ToShapeId, ToShapeId)