Class ServiceTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.aws.traits.ServiceTrait
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
,ToSmithyBuilder<ServiceTrait>
public final class ServiceTrait extends AbstractTrait implements ToSmithyBuilder<ServiceTrait>
Registers a service as an AWS service. This trait is required for all AWS services modeled in Smithy.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServiceTrait.Builder
Builder forServiceTrait
.static class
ServiceTrait.Provider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ServiceTrait.Builder
builder()
protected Node
createNode()
The result of toNode is used for hashCodes and equality.boolean
equals(java.lang.Object other)
java.util.Optional<java.lang.String>
getAbbreviation()
Deprecated.java.lang.String
getArnNamespace()
Get the AWS ARN service namespace of the service.java.lang.String
getCloudFormationName()
Get the AWS CloudFormation service name.java.lang.String
getCloudTrailEventSource()
Returns the CloudTrail event source name of the service.protected java.util.Optional<java.lang.String>
getDocId()
java.lang.String
getEndpointPrefix()
Returns the endpoint prefix for the service.java.lang.String
getSdkId()
Get the SDK service ID.int
hashCode()
java.lang.String
resolveDocId(ServiceShape serviceShape)
Resolves the doc id value for the service.ServiceTrait.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.traits.AbstractTrait
getSourceLocation, setNodeCache, toNode, toShapeId, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
-
-
-
Field Detail
-
ID
public static final ShapeId ID
-
-
Method Detail
-
builder
public static ServiceTrait.Builder builder()
- Returns:
- Creates a builder used to build a
ServiceTrait
.
-
getArnNamespace
public java.lang.String getArnNamespace()
Get the AWS ARN service namespace of the service.If not set, this value defaults to the name of the service shape converted to lowercase. This value is combined with resources contained within the service to form ARNs for resources. Only resources that explicitly define the 'aws.api#arnTemplate' trait are assigned ARNs, and their relative ARNs are combined with the service's arnNamespace to form an ARN.
- Returns:
- Returns the ARN service name (e.g., "route53").
-
getCloudFormationName
public java.lang.String getCloudFormationName()
Get the AWS CloudFormation service name.When not set, this value defaults to the name of the service shape.
- Returns:
- Returns the optionally present AWS CloudFormation type prefix.
-
getSdkId
public java.lang.String getSdkId()
Get the SDK service ID.This value is used to generate SDK class names.
- Returns:
- Returns the AWS SDK service ID value.
-
getCloudTrailEventSource
public java.lang.String getCloudTrailEventSource()
Returns the CloudTrail event source name of the service.- Returns:
- Returns the event source name.
-
resolveDocId
public java.lang.String resolveDocId(ServiceShape serviceShape)
Resolves the doc id value for the service.When value on trait is not set, this method defaults to the lower cased value of the sdkId followed by the service version, separated by dashes.
- Parameters:
serviceShape
- the shape which this trait targets- Returns:
- Returns the documentation identifier value for the service name.
- Throws:
ExpectationNotMetException
- if the shape is not the target of this trait.
-
getDocId
protected java.util.Optional<java.lang.String> getDocId()
-
getEndpointPrefix
public java.lang.String getEndpointPrefix()
Returns the endpoint prefix for the service. This value is not unique across services and it can change at any time. Therefore it MUST NOT be used to generate class names, namespaces, or for any other purpose that requires a static, unique identifier. The sdkId property should be used for those purposes.- Returns:
- Returns the aws sdk endpoint prefix.
-
getAbbreviation
@Deprecated public java.util.Optional<java.lang.String> getAbbreviation()
Deprecated.
-
toBuilder
public ServiceTrait.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<ServiceTrait>
- Returns:
- a builder for type T
-
createNode
protected Node createNode()
Description copied from class:AbstractTrait
The 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:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classAbstractTrait
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractTrait
-
-