Class ServiceShape
- java.lang.Object
-
- software.amazon.smithy.model.shapes.Shape
-
- software.amazon.smithy.model.shapes.EntityShape
-
- software.amazon.smithy.model.shapes.ServiceShape
-
- All Implemented Interfaces:
java.lang.Comparable<Shape>
,FromSourceLocation
,ToShapeId
,Tagged
,ToSmithyBuilder<ServiceShape>
public final class ServiceShape extends EntityShape implements ToSmithyBuilder<ServiceShape>
Represents aservice
shape.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServiceShape.Builder
Builder used to create aServiceShape
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
accept(ShapeVisitor<R> visitor)
Dispatches the shape to the appropriateShapeVisitor
method.java.util.Optional<ServiceShape>
asServiceShape()
static ServiceShape.Builder
builder()
boolean
equals(java.lang.Object other)
java.lang.String
getContextualName(ToShapeId shape)
Gets the contextual name of a shape within the closure.java.util.List<ShapeId>
getErrors()
Gets a list of the common errors that can be encountered by every operation in the service.java.util.List<ShapeId>
getIntroducedErrors()
Gets the list of common errors introduced by the shape and not inherited from mixins.java.util.Map<ShapeId,java.lang.String>
getIntroducedRename()
Gets the rename map introduced by the shape and not inherited from mixins.java.lang.String
getIntroducedVersion()
Gets the version of the service introduced by the shape and not inherited from mixins.java.util.Map<ShapeId,java.lang.String>
getRename()
ShapeType
getType()
Gets the type of the shape.java.lang.String
getVersion()
Get the version of the service.ServiceShape.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.shapes.EntityShape
getAllOperations, getIntroducedOperations, getIntroducedResources, getOperations, getResources
-
Methods inherited from class software.amazon.smithy.model.shapes.Shape
asBigDecimalShape, asBigIntegerShape, asBlobShape, asBooleanShape, asByteShape, asDocumentShape, asDoubleShape, asEnumShape, asFloatShape, asIntegerShape, asIntEnumShape, asListShape, asLongShape, asMapShape, asMemberShape, asOperationShape, asResourceShape, asSetShape, asShortShape, asStringShape, asStructureShape, asTimestampShape, asUnionShape, compareTo, expectTrait, findMemberTrait, findTrait, findTrait, getAllMembers, getAllTraits, getId, getIntroducedTraits, getMember, getMemberNames, getMemberTrait, getMixins, getRequiredMembers, 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
-
-
-
-
Method Detail
-
builder
public static ServiceShape.Builder builder()
-
toBuilder
public ServiceShape.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<ServiceShape>
- Returns:
- a builder for type T
-
accept
public <R> R accept(ShapeVisitor<R> visitor)
Description copied from class:Shape
Dispatches the shape to the appropriateShapeVisitor
method.
-
asServiceShape
public java.util.Optional<ServiceShape> asServiceShape()
- Overrides:
asServiceShape
in classShape
- Returns:
- Optionally returns the shape as a
ServiceShape
.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classEntityShape
-
getVersion
public java.lang.String getVersion()
Get the version of the service. An empty string is returned if the version is undefined.- Returns:
- The version of the service.
-
getIntroducedVersion
public java.lang.String getIntroducedVersion()
Gets the version of the service introduced by the shape and not inherited from mixins. An empty string is returned if the version is undefined.- Returns:
- The introduced version of the service.
-
getRename
public java.util.Map<ShapeId,java.lang.String> getRename()
- Returns:
- The rename map of the service.
-
getIntroducedRename
public java.util.Map<ShapeId,java.lang.String> getIntroducedRename()
Gets the rename map introduced by the shape and not inherited from mixins.- Returns:
- The introduced rename map of the service.
-
getErrors
public java.util.List<ShapeId> getErrors()
Gets a list of the common errors that can be encountered by every operation in the service.
Each returned
ShapeId
must resolve to aStructureShape
that is targeted by an error trait; however, this is only guaranteed after a model is validated.- Returns:
- Returns the errors.
-
getIntroducedErrors
public java.util.List<ShapeId> getIntroducedErrors()
Gets the list of common errors introduced by the shape and not inherited from mixins. These errors can be encountered by every operation in the service. Each returnedShapeId
must resolve to aStructureShape
that is targeted by an error trait; however, this is only guaranteed after a model is validated.- Returns:
- Returns the introduced service errors.
-
getContextualName
public java.lang.String getContextualName(ToShapeId shape)
Gets the contextual name of a shape within the closure.If there is a rename property entry for the given shape ID, then the renamed shape name is returned. Otherwise, the name part of the given shape ID is returned, regardless of if the shape exists in the closure of the service.
This is a mirror of
ShapeId.getName(ServiceShape)
that serves to make this functionality more discoverable.- Parameters:
shape
- Shape to get the contextual name of.- Returns:
- Returns the contextual name of the shape within the service.
-
-