SmithyModel

zio.blocks.smithy.SmithyModel
See theSmithyModel companion object
final case class SmithyModel(version: String, namespace: String, useStatements: List[ShapeId], metadata: Map[String, NodeValue], shapes: List[ShapeDefinition], applyStatements: List[ApplyStatement] = ...)

Represents a top-level Smithy model.

A SmithyModel contains all the shapes, metadata, and configuration for a Smithy API definition. It includes the model version, target namespace, use statements, metadata key-value pairs, a list of shape definitions, and apply statements that attach traits to shapes.

Value parameters

applyStatements

list of apply statements that attach traits to shapes

metadata

map of metadata key-value pairs for the model

namespace

the namespace for all shapes in this model (e.g., "com.example.api")

shapes

list of shape definitions in the model

useStatements

list of ShapeIds imported via use statements

version

the Smithy specification version (e.g., "2.0")

Attributes

Companion
object
Source
SmithyModel.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def allShapeIds: List[ShapeId]

Returns the list of all ShapeIds in this model.

Returns the list of all ShapeIds in this model.

Each ShapeId is constructed from the model's namespace and the shape's name. The order matches the order of shapes in the shapes list.

Attributes

Returns

list of ShapeIds for all shapes in this model

Source
SmithyModel.scala
def findShape(name: String): Option[ShapeDefinition]

Finds a shape by name within this model.

Finds a shape by name within this model.

Returns the first ShapeDefinition with the given name, or None if not found.

Value parameters

name

the shape name to search for

Attributes

Returns

Some(ShapeDefinition) if found, None otherwise

Source
SmithyModel.scala
def prettyPrint: String

Serializes this model as Smithy IDL text with default 4-space indentation.

Serializes this model as Smithy IDL text with default 4-space indentation.

Attributes

Returns

a String containing valid Smithy IDL text

Source
SmithyModel.scala
def prettyPrint(indent: Int): String

Serializes this model as Smithy IDL text with configurable indentation.

Serializes this model as Smithy IDL text with configurable indentation.

Value parameters

indent

the number of spaces to use for indentation within shapes

Attributes

Returns

a String containing valid Smithy IDL text

Source
SmithyModel.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala