Skip to content
Matt Muller edited this page Apr 7, 2024 · 34 revisions

Welcome to the smithy-ruby wiki!

This wiki covers the component design of a generated Ruby SDK and how Smithy traits influence generated code.

Protocols

  • Rails JSON - Implements a JSON protocol that communicates with Rails APIs.

Public Components

Generated SDKs from smithy-ruby supports the following public features:

  • Client - The Client class is the public interface used for interacting with the service. The Client will have methods for each operation defined by the API. Clients are 1:1 with a Smithy service shape and its public methods are 1:1 with Smithy operation shapes.

  • Config - The Config class is an immutable struct that contains the options that will be used by the Client. It can resolve default value chains and validates provided values against expected types. Config classes are 1:1 with a Smithy service shape.

  • Types - Types are light-weight classes that contain shape data. Types are built from params on input and populated by service responses on output. Types have a 1:1 mapping to Smithy structure shapes.

  • Errors and Error Parsers - Errors are a collection of classes that represent generic service errors and modeled Smithy error shapes. Modeled errors have a 1:1 mapping to Smithy structure shapes decorated with the @error trait.

  • Paginators - Paginators are classes that provide an abstraction for paginated operations. These classes provide enumerators that will automatically iterate the paginated responses. Paginators have a 1:1 mapping to paginated Smithy operations.

  • Waiters - Waiters are classes that provide an abstraction for polling resources until desired states are reached. Waiters have a 1:1 mapping to each waiter definition on the waiter traits across all operations.

  • Endpoints - Endpoints and EndpointProviders provide mechanisms for configuring and resolving Endpoints. Generated SDKs have a 1:1 mapping of EndpointProvider with Smithy service shapes.

Private Components

These are listed just for reference.

  • Params - Params are modules that convert user provided input into rigid shapes used by middleware. Params have a 1:1 mapping to Smithy shapes.

  • Validators - Validators are classes that provide a method for validating Ruby input types against the Smithy model. Validators will have a 1:1 mapping to Smithy input structure shapes.

  • Builders and Parsers - Builders and parsers are protocol specific classes that build a request using operation input and parse a response into an output object. Builders and parsers have a 1:1 mapping to Smithy complex shapes (Structure, List, Map, Operation).

  • Stubs - Stubs are classes that build a response object from provided values instead of performing a real network call. They are used in tests to control output. Stubs will have a 1:1 mapping to Smithy structure shapes.

Smithy Trait Designs