Class OperationShape
- java.lang.Object
-
- software.amazon.smithy.model.shapes.Shape
-
- software.amazon.smithy.model.shapes.OperationShape
-
- All Implemented Interfaces:
java.lang.Comparable<Shape>,FromSourceLocation,ToShapeId,Tagged,ToSmithyBuilder<OperationShape>
public final class OperationShape extends Shape implements ToSmithyBuilder<OperationShape>
Represents an API operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOperationShape.BuilderBuilder used to create aOperationShape.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(ShapeVisitor<R> cases)Dispatches the shape to the appropriateShapeVisitormethod.java.util.Optional<OperationShape>asOperationShape()static OperationShape.Builderbuilder()booleanequals(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.java.util.Optional<ShapeId>getOutput()Gets the optional shape ID of the output of the operation.OperationShape.BuildertoBuilder()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.shapes.Shape
asBigDecimalShape, asBigIntegerShape, asBlobShape, asBooleanShape, asByteShape, asDocumentShape, asDoubleShape, asFloatShape, asIntegerShape, asListShape, asLongShape, asMapShape, asMemberShape, asResourceShape, asServiceShape, asSetShape, asShortShape, asStringShape, asStructureShape, asTimestampShape, asUnionShape, compareTo, expectTrait, findMemberTrait, findTrait, findTrait, getAllTraits, getId, getMemberTrait, getSourceLocation, getTags, getTrait, getType, hashCode, hasTrait, hasTrait, hasTrait, isBigDecimalShape, isBigIntegerShape, isBlobShape, isBooleanShape, isByteShape, isDocumentShape, isDoubleShape, isFloatShape, isIntegerShape, isListShape, isLongShape, isMapShape, isMemberShape, isOperationShape, isResourceShape, isServiceShape, isSetShape, isShortShape, isStringShape, isStructureShape, isTimestampShape, isUnionShape, members, shapeToBuilder, toShapeId, toString
-
-
-
-
Method Detail
-
builder
public static OperationShape.Builder builder()
-
toBuilder
public OperationShape.Builder 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<OperationShape>- Returns:
- a builder for type T
-
accept
public <R> R accept(ShapeVisitor<R> cases)
Description copied from class:ShapeDispatches the shape to the appropriateShapeVisitormethod.
-
asOperationShape
public java.util.Optional<OperationShape> asOperationShape()
- Overrides:
asOperationShapein classShape- Returns:
- Optionally returns the shape as an
OperationShape.
-
getInput
public java.util.Optional<ShapeId> getInput()
Gets the optional shape ID of the input of the operation.
- Returns:
- Returns the optional shape ID.
-
getOutput
public java.util.Optional<ShapeId> getOutput()
Gets the optional shape ID of the output of the operation.
- Returns:
- Returns the optional shape ID.
-
getErrors
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)orOperationIndex.getErrors(ToShapeId, ToShapeId)to get all of the errors an operation can encounter when used within a service.Each returned
ShapeIdmust resolve to aStructureShapethat is targeted by an error trait; however, this is only guaranteed after a model is validated.- Returns:
- Returns the errors.
- See Also:
getErrors(ServiceShape),OperationIndex.getErrors(ToShapeId, ToShapeId)
-
getErrors
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.
- Returns:
- Returns the errors.
- See Also:
OperationIndex.getErrors(ToShapeId, ToShapeId)
-
-