Smithy Qt 0.1.0-pre
Smithy code generator for Qt
Loading...
Searching...
No Matches
Shape Class Reference

The Shape class provides a Qt representation of a Smithy semantic shape. More...

Classes

struct  Member
 
struct  ShapeReference
 

Public Types

enum class  Error { NoError = 0 , UndefinedShapeType = 1 , MissingRequiredProperty = 2 , InvalidPropertyValue = 3 }
 
enum class  Type {
  Undefined = 0x000 , Blob = 0x101 , Boolean = 0x102 , String = 0x103 ,
  Enum = 0x104 , Byte = 0x105 , Short = 0x106 , Integer = 0x107 ,
  IntEnum = 0x108 , Long = 0x109 , Float = 0x10A , Double = 0x10B ,
  BigInteger = 0x10C , BigDecimal = 0x10D , Timestamp = 0x10E , Document = 0x10F ,
  List = 0x201 , Set = 0x201 , Map = 0x202 , Structure = 0x203 ,
  Union = 0x204 , Service = 0x301 , Operation = 0x302 , Resource = 0x303 ,
  Apply = 0x401
}
 
typedef QHash< ShapeId, QJsonValue > TraitsMap
 
typedef QHash< QString, ShapeReferenceStringShapeRefMap
 
typedef QSet< ShapeReferenceShapeReferences
 
typedef QHash< QString, MemberStringMemberMap
 

Public Member Functions

 Shape ()
 Constructs a new, empty Smithy shape.
 
 Shape (const QJsonObject &ast, const ShapeId &id=ShapeId{})
 
 Shape (Shape &&other)
 
 Shape (const Shape &other)
 
Shapeoperator= (const Shape &shape)
 
Shapeoperator= (const Shape &&shape)
 
 ~Shape ()
 Destroys this Shape object.
 
Error error () const
 
bool isValid () const
 
ShapeId id () const
 
Type type () const
 
TraitsMap traits () const
 
Member member () const
 
Member key () const
 
Member value () const
 
StringMemberMap members () const
 
QString version () const
 
ShapeReferences operations () const
 
ShapeReferences resources () const
 
ShapeReferences errors () const
 
ShapeIdStringMap rename () const
 
StringShapeRefMap identifiers () const
 
StringShapeRefMap properties () const
 
ShapeReference create () const
 
ShapeReference put () const
 
ShapeReference read () const
 
ShapeReference update () const
 
ShapeReference Delete () const
 
ShapeReference list () const
 
ShapeReferences collectionOperations () const
 
ShapeReference input () const
 
ShapeReference output () const
 
ShapeReferences mixins () const
 
QJsonObject rawAst () const
 

Detailed Description

The Shape class provides a Qt representation of a Smithy semantic shape.

That is, essentially a tagged union or variant class, with some specialised conversions for native Qt types.

See also
https://awslabs.github.io/smithy/2.0/spec/shape.html#semantic-shape

Member Enumeration Documentation

◆ Type

enum class Shape::Type
strong
Enumerator
Undefined 0x000 

The shape is undefined, usually the result of an error condition.

Blob 0x101 

Uninterpreted binary data.

Boolean 0x102 

Boolean value type.

String 0x103 

UTF-8 encoded string.

Enum 0x104 

A string with a fixed set of values.

Byte 0x105 

8-bit signed integer ranging from -128 to 127 (inclusive).

Short 0x106 

16-bit signed integer ranging from -32,768 to 32,767 (inclusive).

Integer 0x107 

32-bit signed integer ranging from -2^31 to (2^31)-1 (inclusive).

IntEnum 0x108 

An integer with a fixed set of values.

Long 0x109 

64-bit signed integer ranging from -2^63 to (2^63)-1 (inclusive).

Float 0x10A 

Single precision IEEE-754 floating point number.

Double 0x10B 

Double precision IEEE-754 floating point number.

BigInteger 0x10C 

Arbitrarily large signed integer.

BigDecimal 0x10D 

Arbitrary precision signed decimal number.

Timestamp 0x10E 

An instant in time with no UTC offset or timezone.

Document 0x10F 

Open content that functions as a kind of "any" type.

List 0x201 

Ordered collection of homogeneous values.

Set 0x201 

Deprecated; use a list with the uniqueItems trait instead.

Map 0x202 

Map data structure that maps string keys to homogeneous values.

Structure 0x203 

Fixed set of named heterogeneous members.

Union 0x204 

Tagged union data structure that can take on one of several different, but fixed, types

Service 0x301 

Entry point of an API that aggregates resources and operations together.

Operation 0x302 

Represents the input, output, and errors of an API operation.

Resource 0x303 

Entity with an identity that has a set of operations.

Apply 0x401 

Traits to be applied to shapes outside of their definition.


The documentation for this class was generated from the following files: