Class ServiceShape.Builder
- java.lang.Object
-
- software.amazon.smithy.model.shapes.AbstractShapeBuilder<B,S>
-
- software.amazon.smithy.model.shapes.EntityShape.Builder<ServiceShape.Builder,ServiceShape>
-
- software.amazon.smithy.model.shapes.ServiceShape.Builder
-
- All Implemented Interfaces:
FromSourceLocation,SmithyBuilder<ServiceShape>
- Enclosing class:
- ServiceShape
public static final class ServiceShape.Builder extends EntityShape.Builder<ServiceShape.Builder,ServiceShape>
Builder used to create aServiceShape.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceShape.BuilderaddError(java.lang.String errorShapeId)Adds an error to the service that is implicitly bound to every operation within the closure of the service.ServiceShape.BuilderaddError(ToShapeId errorShapeId)Adds an error to the service that is implicitly bound to every operation within the closure of the service.ServiceShape.BuilderaddErrors(java.util.List<ShapeId> errorShapeIds)Adds errors to the service that are implicitly bound to every operation within the closure of the service.ServiceShapebuild()Creates an immutable object that is created from the properties that have been set on the builder.ServiceShape.BuilderclearErrors()Removes all errors.ServiceShape.BuilderclearRename()ServiceShape.Buildererrors(java.util.Collection<ShapeId> errorShapeIds)Sets and replaces the errors of the service.ServiceShape.BuilderflattenMixins()Removes mixins from a shape and flattens them into the shape.ShapeTypegetShapeType()Gets the type of shape being built.ServiceShape.BuilderputRename(ShapeId from, java.lang.String to)ServiceShape.BuilderremoveError(ToShapeId errorShapeId)Removes an error by Shape ID.ServiceShape.BuilderremoveRename(ToShapeId from)ServiceShape.Builderrename(java.util.Map<ShapeId,java.lang.String> rename)ServiceShape.Builderversion(java.lang.String version)-
Methods inherited from class software.amazon.smithy.model.shapes.EntityShape.Builder
addOperation, addOperation, addResource, addResource, clearOperations, clearResources, operations, removeOperation, removeResource, resources
-
Methods inherited from class software.amazon.smithy.model.shapes.AbstractShapeBuilder
addMember, addMixin, addTrait, addTraits, clearMembers, clearMixins, clearTraits, getAllTraits, getId, getMember, getSourceLocation, id, id, mixins, removeMixin, removeTrait, removeTrait, source, source, traits
-
-
-
-
Method Detail
-
build
public ServiceShape build()
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Returns:
- an instance of T
-
getShapeType
public ShapeType getShapeType()
Description copied from class:AbstractShapeBuilderGets the type of shape being built.- Specified by:
getShapeTypein classAbstractShapeBuilder<ServiceShape.Builder,ServiceShape>- Returns:
- Returns the shape type.
-
version
public ServiceShape.Builder version(java.lang.String version)
-
clearRename
public ServiceShape.Builder clearRename()
-
rename
public ServiceShape.Builder rename(java.util.Map<ShapeId,java.lang.String> rename)
-
putRename
public ServiceShape.Builder putRename(ShapeId from, java.lang.String to)
-
removeRename
public ServiceShape.Builder removeRename(ToShapeId from)
-
errors
public ServiceShape.Builder errors(java.util.Collection<ShapeId> errorShapeIds)
Sets and replaces the errors of the service. Each error is implicitly bound to every operation within the closure of the service.- Parameters:
errorShapeIds- Error shape IDs to set.- Returns:
- Returns the builder.
-
addError
public ServiceShape.Builder addError(ToShapeId errorShapeId)
Adds an error to the service that is implicitly bound to every operation within the closure of the service.- Parameters:
errorShapeId- Error shape ID to add.- Returns:
- Returns the builder.
-
addError
public ServiceShape.Builder addError(java.lang.String errorShapeId)
Adds an error to the service that is implicitly bound to every operation within the closure of the service.- Parameters:
errorShapeId- Error shape ID to add.- Returns:
- Returns the builder.
- Throws:
ShapeIdSyntaxException- if the shape ID is invalid.
-
addErrors
public ServiceShape.Builder addErrors(java.util.List<ShapeId> errorShapeIds)
Adds errors to the service that are implicitly bound to every operation within the closure of the service.- Parameters:
errorShapeIds- Error shape IDs to add.- Returns:
- Returns the builder.
-
removeError
public ServiceShape.Builder removeError(ToShapeId errorShapeId)
Removes an error by Shape ID.- Parameters:
errorShapeId- Error shape ID to remove.- Returns:
- Returns the builder.
-
clearErrors
public ServiceShape.Builder clearErrors()
Removes all errors.- Returns:
- Returns the builder.
-
flattenMixins
public ServiceShape.Builder flattenMixins()
Description copied from class:AbstractShapeBuilderRemoves mixins from a shape and flattens them into the shape.Flattening a mixin into a shape copies the traits and members of a mixin onto the shape, effectively resulting in the same shape but with no trace of the mixin relationship.
- Overrides:
flattenMixinsin classEntityShape.Builder<ServiceShape.Builder,ServiceShape>- Returns:
- Returns the updated builder.
-
-