rhetoric

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

rhetoric-go

A Go client for the Rhetoric e-filing API.

Install

go get github.com/rhetoriclabs/rhetoric-go

Usage

package main

import (
	"context"
	"errors"
	"fmt"
	"os"

	rhetoric "github.com/rhetoriclabs/rhetoric-go"
)

func main() {
	ctx := context.Background()

	client := rhetoric.New(
		"https://api.rhetoric.law",
		rhetoric.WithToken(os.Getenv("RHETORIC_API_KEY")),
	)

	created, err := client.CreateFiler(ctx, rhetoric.CreateFilerInput{})
	if err != nil {
		handle(err)
		return
	}

	session, err := client.CreateFilingSession(ctx, rhetoric.CreateFilingSessionInput{
		FilerID: created.Filer.ID,
	})
	if err != nil {
		handle(err)
		return
	}
	fmt.Println(session.SessionToken)

	list, err := client.ListFilingSessions(ctx, rhetoric.ListFilingSessionsInput{
		FilerID: rhetoric.Ptr(created.Filer.ID),
		Limit:   rhetoric.Ptr(uint8(20)),
	})
	if err != nil {
		handle(err)
		return
	}
	fmt.Println(list.Sessions)
}

func handle(err error) {
	var transportErr *rhetoric.OperationTransportError
	if errors.As(err, &transportErr) {
		fmt.Println("transport error:", transportErr.Err)
		return
	}

	// Operations with application errors return OperationAppError[E], where E is
	// the operation's error type, e.g. rhetoric.ListFilersError.
	var appErr *rhetoric.OperationAppError[rhetoric.ListFilersError]
	if errors.As(err, &appErr) {
		fmt.Println("application error:", appErr.Data)
	}
}

Documentation

Overview

Package rhetoric is a client for the Rhetoric service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v. It is a convenience for populating optional fields, which are pointers, from literals and other values that cannot be addressed directly:

UpdateTodoInput{ID: id, Done: Ptr(true)}

Types

type Action

type Action struct {
	// The ID of the action.
	ActionID string `json:"action_id"`
	// The human readable label.
	Label string `json:"label"`
	// Whether this is the step's primary action.
	Primary bool `json:"primary"`
}

An action the user can take.

func (*Action) UnmarshalJSON

func (v *Action) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ApplyFilingSessionEventError

type ApplyFilingSessionEventError interface {
	// contains filtered or unexported methods
}

ApplyFilingSessionEventError is one of ApplyFilingSessionEventErrorNotFound, ApplyFilingSessionEventErrorSessionBusy, ApplyFilingSessionEventErrorStaleState, ApplyFilingSessionEventErrorSessionExpired. Use a type switch to tell the variants apart.

type ApplyFilingSessionEventErrorNotFound

type ApplyFilingSessionEventErrorNotFound struct{}

No session exists for the given session id.

func (ApplyFilingSessionEventErrorNotFound) MarshalJSON

func (v ApplyFilingSessionEventErrorNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ApplyFilingSessionEventErrorSessionBusy

type ApplyFilingSessionEventErrorSessionBusy struct{}

A concurrent request for this session is already in progress.

func (ApplyFilingSessionEventErrorSessionBusy) MarshalJSON

func (v ApplyFilingSessionEventErrorSessionBusy) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ApplyFilingSessionEventErrorSessionExpired

type ApplyFilingSessionEventErrorSessionExpired struct{}

The session has expired.

func (ApplyFilingSessionEventErrorSessionExpired) MarshalJSON

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ApplyFilingSessionEventErrorStaleState

type ApplyFilingSessionEventErrorStaleState struct {
	// The current form.
	Form Form `json:"form"`
	// The current state version.
	StateVersion int64 `json:"state_version"`
}

The event was based on an outdated session state.

func (ApplyFilingSessionEventErrorStaleState) MarshalJSON

func (v ApplyFilingSessionEventErrorStaleState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*ApplyFilingSessionEventErrorStaleState) UnmarshalJSON

func (v *ApplyFilingSessionEventErrorStaleState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ApplyFilingSessionEventInput

type ApplyFilingSessionEventInput struct {
	// The state version of the session that this event applies to.
	StateVersion int64 `json:"state_version"`
	// The event to process.
	Event Event `json:"event"`
}

func (*ApplyFilingSessionEventInput) UnmarshalJSON

func (v *ApplyFilingSessionEventInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ApplyFilingSessionEventOutput

type ApplyFilingSessionEventOutput struct {
	// The form to render.
	Form Form `json:"form"`
	// The current state version of the session.
	//
	// Echo this back when sending events to the session to ensure proper
	// concurrency handling.
	StateVersion int64 `json:"state_version"`
}

func (*ApplyFilingSessionEventOutput) UnmarshalJSON

func (v *ApplyFilingSessionEventOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type AutocompleteAdditionalName

type AutocompleteAdditionalName struct{}

func (AutocompleteAdditionalName) MarshalJSON

func (v AutocompleteAdditionalName) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteAddressLine1

type AutocompleteAddressLine1 struct{}

func (AutocompleteAddressLine1) MarshalJSON

func (v AutocompleteAddressLine1) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteAddressLine2

type AutocompleteAddressLine2 struct{}

func (AutocompleteAddressLine2) MarshalJSON

func (v AutocompleteAddressLine2) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteBillingAddressLine1

type AutocompleteBillingAddressLine1 struct{}

func (AutocompleteBillingAddressLine1) MarshalJSON

func (v AutocompleteBillingAddressLine1) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteBillingAddressLine2

type AutocompleteBillingAddressLine2 struct{}

func (AutocompleteBillingAddressLine2) MarshalJSON

func (v AutocompleteBillingAddressLine2) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteBillingCity

type AutocompleteBillingCity struct{}

func (AutocompleteBillingCity) MarshalJSON

func (v AutocompleteBillingCity) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteBillingPostalCode

type AutocompleteBillingPostalCode struct{}

func (AutocompleteBillingPostalCode) MarshalJSON

func (v AutocompleteBillingPostalCode) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteBillingState

type AutocompleteBillingState struct{}

func (AutocompleteBillingState) MarshalJSON

func (v AutocompleteBillingState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCity

type AutocompleteCity struct{}

func (AutocompleteCity) MarshalJSON

func (v AutocompleteCity) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCreditCardExpirationMonth

type AutocompleteCreditCardExpirationMonth struct{}

func (AutocompleteCreditCardExpirationMonth) MarshalJSON

func (v AutocompleteCreditCardExpirationMonth) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCreditCardExpirationYear

type AutocompleteCreditCardExpirationYear struct{}

func (AutocompleteCreditCardExpirationYear) MarshalJSON

func (v AutocompleteCreditCardExpirationYear) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCreditCardName

type AutocompleteCreditCardName struct{}

func (AutocompleteCreditCardName) MarshalJSON

func (v AutocompleteCreditCardName) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCreditCardNumber

type AutocompleteCreditCardNumber struct{}

func (AutocompleteCreditCardNumber) MarshalJSON

func (v AutocompleteCreditCardNumber) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCreditCardSecurityCode

type AutocompleteCreditCardSecurityCode struct{}

func (AutocompleteCreditCardSecurityCode) MarshalJSON

func (v AutocompleteCreditCardSecurityCode) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteCurrentPassword

type AutocompleteCurrentPassword struct{}

func (AutocompleteCurrentPassword) MarshalJSON

func (v AutocompleteCurrentPassword) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteFamilyName

type AutocompleteFamilyName struct{}

func (AutocompleteFamilyName) MarshalJSON

func (v AutocompleteFamilyName) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteGivenName

type AutocompleteGivenName struct{}

func (AutocompleteGivenName) MarshalJSON

func (v AutocompleteGivenName) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteNewPassword

type AutocompleteNewPassword struct{}

func (AutocompleteNewPassword) MarshalJSON

func (v AutocompleteNewPassword) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompletePostalCode

type AutocompletePostalCode struct{}

func (AutocompletePostalCode) MarshalJSON

func (v AutocompletePostalCode) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteState

type AutocompleteState struct{}

func (AutocompleteState) MarshalJSON

func (v AutocompleteState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteTel

type AutocompleteTel struct{}

func (AutocompleteTel) MarshalJSON

func (v AutocompleteTel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type AutocompleteUsername

type AutocompleteUsername struct{}

func (AutocompleteUsername) MarshalJSON

func (v AutocompleteUsername) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type Block

type Block struct {
	// A stable identifier for the block.
	ID string `json:"id"`
	// A heading for the block.
	Title *string `json:"title,omitempty"`
	// The content of the block.
	Items []Item `json:"items"`
	// Actions scoped to this block.
	Actions []Action `json:"actions"`
}

A group of items that belong together.

A block says only that its items are related; it places no restriction on which kinds of item it holds, so input, information, and explanatory text can be mixed freely.

func (*Block) UnmarshalJSON

func (v *Block) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for the Rhetoric service.

func New

func New(url string, opts ...Option) *Client

New constructs a Client. url is the base URL for the service.

func (*Client) ApplyFilingSessionEvent

func (c *Client) ApplyFilingSessionEvent(ctx context.Context, input ApplyFilingSessionEventInput) (ApplyFilingSessionEventOutput, error)

Applies an event to a filing session and returns the resulting form.

Authenticated with the session token instead of an API key.

func (*Client) CreateFiler

func (c *Client) CreateFiler(ctx context.Context, input CreateFilerInput) (CreateFilerOutput, error)

Creates a new filer.

A filer represents an entity that files documents through Rhetoric, such as an individual or an organization.

func (*Client) CreateFilingSession

func (c *Client) CreateFilingSession(ctx context.Context, input CreateFilingSessionInput) (CreateFilingSessionOutput, error)

Creates a filing session.

func (*Client) GetFiler

func (c *Client) GetFiler(ctx context.Context, input GetFilerInput) (GetFilerOutput, error)

Gets a filer.

func (*Client) GetFilingSession

func (c *Client) GetFilingSession(ctx context.Context, input GetFilingSessionInput) (GetFilingSessionOutput, error)

Returns a filing session.

func (*Client) ListFilers

func (c *Client) ListFilers(ctx context.Context, input ListFilersInput) (ListFilersOutput, error)

Returns a list of filers.

The results are returned in reverse chronological order by creation date.

func (*Client) ListFilingSessions

func (c *Client) ListFilingSessions(ctx context.Context, input ListFilingSessionsInput) (ListFilingSessionsOutput, error)

Returns a list of filing sessions.

func (*Client) ResumeFilingSession

func (c *Client) ResumeFilingSession(ctx context.Context, input ResumeFilingSessionInput) (ResumeFilingSessionOutput, error)

Returns the current form of a filing session.

Authenticated with a session token instead of an API key.

type CreateFilerInput

type CreateFilerInput struct{}

The input for the create filer operation.

type CreateFilerOutput

type CreateFilerOutput struct {
	// The created filer.
	Filer Filer `json:"filer"`
}

The output for the create filer operation.

func (*CreateFilerOutput) UnmarshalJSON

func (v *CreateFilerOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type CreateFilingSessionInput

type CreateFilingSessionInput struct {
	// The ID of the filer operating the filing session.
	FilerID string `json:"filer_id"`
}

The input for the create filing session operation.

func (*CreateFilingSessionInput) UnmarshalJSON

func (v *CreateFilingSessionInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type CreateFilingSessionOutput

type CreateFilingSessionOutput struct {
	// The created session.
	Session FilingSession `json:"session"`
	// The bearer token used to authenticate session requests.
	//
	// The Element component embedded in the browser will use this to drive the
	// session. This token is only returned once and cannot be recovered; keep it
	// somewhere safe.
	SessionToken string `json:"session_token"`
}

The output for the create filing session operation.

func (*CreateFilingSessionOutput) UnmarshalJSON

func (v *CreateFilingSessionOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Data

type Data struct {
	// The human readable name for the data.
	Label string `json:"label"`
	// The value of the data, formatted for display, such as `$435.00`.
	Value string `json:"value"`
	// Secondary information about the value, such as the type and page count of a
	// document or the role of a party.
	Detail *string `json:"detail,omitempty"`
}

A labeled piece of data.

func (*Data) UnmarshalJSON

func (v *Data) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Event

type Event interface {
	// contains filtered or unexported methods
}

Event is one of EventSetField, EventAction, EventSearch. Use a type switch to tell the variants apart.

type EventAction

type EventAction struct {
	ActionID string `json:"action_id"`
}

func (EventAction) MarshalJSON

func (v EventAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*EventAction) UnmarshalJSON

func (v *EventAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type EventSearch

type EventSearch struct {
	// The key of the field to search.
	Field string `json:"field"`
	// The text to search for. If empty, the server returns a default selection of
	// results.
	Query string `json:"query"`
}

Searches the values of a field that supports search.

func (EventSearch) MarshalJSON

func (v EventSearch) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*EventSearch) UnmarshalJSON

func (v *EventSearch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type EventSetField

type EventSetField struct {
	Field string          `json:"field"`
	Value json.RawMessage `json:"value"`
}

func (EventSetField) MarshalJSON

func (v EventSetField) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*EventSetField) UnmarshalJSON

func (v *EventSetField) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Field

type Field struct {
	// The key identifying this field.
	Key string `json:"key"`
	// The human readable label.
	Label string `json:"label"`
	// Help text shown with the field.
	Description *string `json:"description,omitempty"`
	// Whether the field must be filled before the step can advance.
	Required bool `json:"required"`
	// Whether the field can currently be interacted with.
	Disabled bool `json:"disabled"`
	// Indicates that the value is a secret, such as a password or a payment
	// detail. Renderers should mask it, for example with a password input instead
	// of a plain text one.
	Sensitive bool `json:"sensitive"`
	// The browser autofill value represented by the field. This is an HTML hint
	// that other renderers may ignore.
	Autocomplete Autocomplete `json:"autocomplete,omitempty"`
	// The virtual keyboard a browser should prefer for a text field. A hint that
	// other renderers may ignore.
	InputMode TextInputMode `json:"input_mode,omitempty"`
	// The representation of the value.
	Ty ValueType `json:"ty"`
	// The fixed set of values the field may take.
	//
	// If present, the value must be one of the options (an empty list means there
	// is nothing to choose yet). If absent, any value of the field type is
	// permitted, subject to its validations.
	//
	// At most one of `options` and `search` is present.
	Options []FieldOption `json:"options,omitempty"`
	// A set of values the field may take that is too large to send whole, and is
	// queried instead.
	//
	// If present, the value must be one of the values the search can return. Use a
	// "search" event to change the query. If absent, see `options`.
	//
	// At most one of `options` and `search` is present.
	Search *Search `json:"search,omitempty"`
	// Rules the value must satisfy.
	Validations []Validation `json:"validations"`
	// The current value, if any.
	Value json.RawMessage `json:"value,omitempty"`
	// Problems with the current value reported by the server.
	Errors []string `json:"errors"`
}

An input field.

func (*Field) UnmarshalJSON

func (v *Field) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type FieldOption

type FieldOption struct {
	// The value of this option.
	//
	// It is guaranteed to match the type of the field.
	Value json.RawMessage `json:"value"`
	// The human readable label for the option.
	Label string `json:"label"`
}

An option for a field.

func (*FieldOption) UnmarshalJSON

func (v *FieldOption) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Filer

type Filer struct {
	// The filer ID.
	ID string `json:"id"`
	// The time the filer was created, as an ISO 8601 timestamp.
	CreatedAt string `json:"created_at"`
}

A filer.

func (*Filer) UnmarshalJSON

func (v *Filer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type FilingSession

type FilingSession struct {
	// The session ID.
	ID string `json:"id"`
	// The time the session was created, as an ISO 8601 timestamp.
	CreatedAt string `json:"created_at"`
	// The filer ID.
	FilerID string `json:"filer_id"`
	// The status of the session.
	Status FilingSessionStatus `json:"status"`
}

A filing session.

func (*FilingSession) UnmarshalJSON

func (v *FilingSession) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type FilingSessionStatus

type FilingSessionStatus interface {
	// contains filtered or unexported methods
}

The status of a session.

FilingSessionStatus is one of FilingSessionStatusActive, FilingSessionStatusSubmitted, FilingSessionStatusExpired. Use a type switch to tell the variants apart.

type FilingSessionStatusActive

type FilingSessionStatusActive struct{}

The session is active.

func (FilingSessionStatusActive) MarshalJSON

func (v FilingSessionStatusActive) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type FilingSessionStatusExpired

type FilingSessionStatusExpired struct{}

The session has expired.

func (FilingSessionStatusExpired) MarshalJSON

func (v FilingSessionStatusExpired) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type FilingSessionStatusSubmitted

type FilingSessionStatusSubmitted struct{}

The session has been submitted.

func (FilingSessionStatusSubmitted) MarshalJSON

func (v FilingSessionStatusSubmitted) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type Form

type Form struct {
	// The title of the form.
	Title string `json:"title"`
	// Blocks of form content.
	Blocks []Block `json:"blocks"`
	// The actions available.
	Actions []Action `json:"actions"`
	// Breadcrumb labels, one per frame on the step stack, from outermost to
	// innermost (the current step is last).
	Breadcrumbs []string `json:"breadcrumbs"`
	// Form-wide error messages that are not attributable to a single field.
	Errors []string `json:"errors"`
}

func (*Form) UnmarshalJSON

func (v *Form) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type GetFilerError

type GetFilerError interface {
	// contains filtered or unexported methods
}

An error returned by the get filer operation.

GetFilerError is one of GetFilerErrorNotFound. Use a type switch to tell the variants apart.

type GetFilerErrorNotFound

type GetFilerErrorNotFound struct{}

The filer was not found.

func (GetFilerErrorNotFound) MarshalJSON

func (v GetFilerErrorNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type GetFilerInput

type GetFilerInput struct {
	// The filer ID.
	ID string `json:"id"`
}

The input for the get filer operation.

func (*GetFilerInput) UnmarshalJSON

func (v *GetFilerInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type GetFilerOutput

type GetFilerOutput struct {
	// The identified filer.
	Filer Filer `json:"filer"`
}

The output for the get filer operation.

func (*GetFilerOutput) UnmarshalJSON

func (v *GetFilerOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type GetFilingSessionError

type GetFilingSessionError interface {
	// contains filtered or unexported methods
}

An error returned by the get filing session operation.

GetFilingSessionError is one of GetFilingSessionErrorNotFound. Use a type switch to tell the variants apart.

type GetFilingSessionErrorNotFound

type GetFilingSessionErrorNotFound struct{}

The session was not found.

func (GetFilingSessionErrorNotFound) MarshalJSON

func (v GetFilingSessionErrorNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type GetFilingSessionInput

type GetFilingSessionInput struct {
	// The ID of the session.
	SessionID string `json:"session_id"`
}

The input for the get filing session operation.

func (*GetFilingSessionInput) UnmarshalJSON

func (v *GetFilingSessionInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type GetFilingSessionOutput

type GetFilingSessionOutput struct {
	// The session.
	Session FilingSession `json:"session"`
}

The output for the get filing session operation.

func (*GetFilingSessionOutput) UnmarshalJSON

func (v *GetFilingSessionOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Item

type Item interface {
	// contains filtered or unexported methods
}

A piece of content in a Block.

Item is one of ItemField, ItemData, ItemText. Use a type switch to tell the variants apart.

type ItemData

type ItemData struct {
	// Value is the value of the variant.
	Value Data
}

A labeled piece of data.

func (ItemData) MarshalJSON

func (v ItemData) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ItemField

type ItemField struct {
	// Value is the value of the variant.
	Value Field
}

An input field.

func (ItemField) MarshalJSON

func (v ItemField) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ItemText

type ItemText struct {
	// Value is the value of the variant.
	Value Text
}

A passage of explanatory text.

func (ItemText) MarshalJSON

func (v ItemText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ListFilersError

type ListFilersError interface {
	// contains filtered or unexported methods
}

An error returned by the list filers operation.

ListFilersError is one of ListFilersErrorInvalidLimit. Use a type switch to tell the variants apart.

type ListFilersErrorInvalidLimit

type ListFilersErrorInvalidLimit struct {
	// The minimum limit.
	Min uint8 `json:"min"`
	// The maximum limit.
	Max uint8 `json:"max"`
}

The provided limit is out of bounds.

func (ListFilersErrorInvalidLimit) MarshalJSON

func (v ListFilersErrorInvalidLimit) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*ListFilersErrorInvalidLimit) UnmarshalJSON

func (v *ListFilersErrorInvalidLimit) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ListFilersInput

type ListFilersInput struct {
	// The number of results to return.
	//
	// The limit must be between 1 and 100 (default: 10).
	Limit *uint8 `json:"limit,omitempty"`
	// The token for the next page of results.
	//
	// If none, the operation returns the first page of results.
	NextToken *string `json:"next_token,omitempty"`
}

The input for the list filers operation.

func (*ListFilersInput) UnmarshalJSON

func (v *ListFilersInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ListFilersOutput

type ListFilersOutput struct {
	// The filers.
	Filers []Filer `json:"filers"`
	// The total available results.
	TotalCount uint64 `json:"total_count"`
	// The token for the next page of results.
	//
	// If none, there are no more results.
	NextToken *string `json:"next_token,omitempty"`
}

The output for the list filers operation.

func (*ListFilersOutput) UnmarshalJSON

func (v *ListFilersOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ListFilingSessionsError

type ListFilingSessionsError interface {
	// contains filtered or unexported methods
}

An error returned by the list filing sessions operation.

ListFilingSessionsError is one of ListFilingSessionsErrorInvalidLimit. Use a type switch to tell the variants apart.

type ListFilingSessionsErrorInvalidLimit

type ListFilingSessionsErrorInvalidLimit struct {
	// The minimum limit.
	Min uint8 `json:"min"`
	// The maximum limit.
	Max uint8 `json:"max"`
}

The provided limit is out of bounds.

func (ListFilingSessionsErrorInvalidLimit) MarshalJSON

func (v ListFilingSessionsErrorInvalidLimit) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*ListFilingSessionsErrorInvalidLimit) UnmarshalJSON

func (v *ListFilingSessionsErrorInvalidLimit) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ListFilingSessionsInput

type ListFilingSessionsInput struct {
	// Only return sessions associated with this filer.
	FilerID *string `json:"filer_id,omitempty"`
	// The number of results to return.
	//
	// The limit must be between 1 and 100 (default: 10).
	Limit *uint8 `json:"limit,omitempty"`
	// The token for the next page of results.
	//
	// If none, the operation returns the first page of results.
	NextToken *string `json:"next_token,omitempty"`
}

The input for the list filing sessions operation.

func (*ListFilingSessionsInput) UnmarshalJSON

func (v *ListFilingSessionsInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ListFilingSessionsOutput

type ListFilingSessionsOutput struct {
	// The filing sessions.
	Sessions []FilingSession `json:"sessions"`
	// The total available results.
	TotalCount uint64 `json:"total_count"`
	// The token for the next page of results.
	//
	// If none, there are no more results.
	NextToken *string `json:"next_token,omitempty"`
}

The output for the list filing sessions operation.

func (*ListFilingSessionsOutput) UnmarshalJSON

func (v *ListFilingSessionsOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type OperationAppError

type OperationAppError[E any] struct {
	// Data is the application error returned by the server.
	Data E
}

OperationAppError is returned when the server responds with a well-formed application error.

func (*OperationAppError[E]) Error

func (e *OperationAppError[E]) Error() string

type OperationTransportError

type OperationTransportError struct {
	// Err is the underlying cause.
	Err error
}

OperationTransportError is returned when an operation fails during transport (e.g. a network failure, an internal server error, invalid authentication, or a response that does not match the expected shape).

func (*OperationTransportError) Error

func (e *OperationTransportError) Error() string

func (*OperationTransportError) Unwrap

func (e *OperationTransportError) Unwrap() error

type Option

type Option func(*Client)

Option configures a Client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets the HTTP client used to send requests.

func WithToken

func WithToken(token string) Option

WithToken sets the auth token for the service.

type ResumeFilingSessionError

type ResumeFilingSessionError interface {
	// contains filtered or unexported methods
}

ResumeFilingSessionError is one of ResumeFilingSessionErrorSessionExpired. Use a type switch to tell the variants apart.

type ResumeFilingSessionErrorSessionExpired

type ResumeFilingSessionErrorSessionExpired struct{}

The session has expired.

func (ResumeFilingSessionErrorSessionExpired) MarshalJSON

func (v ResumeFilingSessionErrorSessionExpired) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ResumeFilingSessionInput

type ResumeFilingSessionInput struct{}

type ResumeFilingSessionOutput

type ResumeFilingSessionOutput struct {
	// The form to render.
	Form Form `json:"form"`
	// The current state version of the session.
	//
	// Echo this back when sending events to the session to ensure proper
	// concurrency handling.
	StateVersion int64 `json:"state_version"`
}

func (*ResumeFilingSessionOutput) UnmarshalJSON

func (v *ResumeFilingSessionOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Rule

type Rule interface {
	// contains filtered or unexported methods
}

A rule that a value must satisfy.

Rule is one of RulePattern, RuleExtension. Use a type switch to tell the variants apart.

type RuleExtension

type RuleExtension struct {
	// The accepted file extensions, lowercase and without a leading dot, such as
	// `pdf`.
	Extensions []string `json:"extensions"`
}

The value must be a file with one of these extensions.

func (RuleExtension) MarshalJSON

func (v RuleExtension) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*RuleExtension) UnmarshalJSON

func (v *RuleExtension) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type RulePattern

type RulePattern struct {
	// The pattern that the input must match.
	//
	// This must be a valid regular expression using the JavaScript regex syntax.
	Pattern string `json:"pattern"`
}

The value must match a pattern.

func (RulePattern) MarshalJSON

func (v RulePattern) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

func (*RulePattern) UnmarshalJSON

func (v *RulePattern) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Search struct {
	// The search query.
	Query *string `json:"query,omitempty"`
	// The values matching the query.
	Results []FieldOption `json:"results"`
	// The currently selected value, so that its label can be shown when it is not
	// among the `results`.
	Selected *FieldOption `json:"selected,omitempty"`
	// The total number of values matching the query. If it exceeds the number of
	// results count, it means the results were truncated. Absent if the server
	// cannot calculate the total.
	Total *int64 `json:"total,omitempty"`
}

A queryable set of values for a field.

func (*Search) UnmarshalJSON

func (v *Search) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type Text

type Text struct {
	// The text, as plain text with no formatting.
	Text string `json:"text"`
}

A paragraph of explanatory text, such as guidance or a note about what a step does. Use one item per paragraph.

func (*Text) UnmarshalJSON

func (v *Text) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type TextInputMode

type TextInputMode interface {
	// contains filtered or unexported methods
}

The virtual keyboard a browser should prefer for a text field.

TextInputMode is one of TextInputModeText, TextInputModeNumeric, TextInputModeDecimal, TextInputModeTel, TextInputModeEmail. Use a type switch to tell the variants apart.

type TextInputModeDecimal

type TextInputModeDecimal struct{}

func (TextInputModeDecimal) MarshalJSON

func (v TextInputModeDecimal) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type TextInputModeEmail

type TextInputModeEmail struct{}

func (TextInputModeEmail) MarshalJSON

func (v TextInputModeEmail) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type TextInputModeNumeric

type TextInputModeNumeric struct{}

func (TextInputModeNumeric) MarshalJSON

func (v TextInputModeNumeric) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type TextInputModeTel

type TextInputModeTel struct{}

func (TextInputModeTel) MarshalJSON

func (v TextInputModeTel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type TextInputModeText

type TextInputModeText struct{}

func (TextInputModeText) MarshalJSON

func (v TextInputModeText) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type Validation

type Validation struct {
	// The human readable error message shown when the rule is not satisfied.
	Label string `json:"label"`
	// The rule the value must satisfy.
	Rule Rule `json:"rule"`
}

A validation on an input value.

Validations run after an input value has been committed and do not modify the input.

func (*Validation) UnmarshalJSON

func (v *Validation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It rejects data that is missing a required field.

type ValueType

type ValueType interface {
	// contains filtered or unexported methods
}

The type of a field value.

ValueType is one of ValueTypeString, ValueTypeNumber, ValueTypeBool, ValueTypeFile. Use a type switch to tell the variants apart.

type ValueTypeBool

type ValueTypeBool struct{}

A boolean.

func (ValueTypeBool) MarshalJSON

func (v ValueTypeBool) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ValueTypeFile

type ValueTypeFile struct{}

A document.

It is represented as an object with the following fields:

- file_name (string): The original file name - content_type (string): The MIME type of the document - size_bytes (number): The size of the document, in bytes - content (string): The base64-encoded document content

The content field is required on write and omitted on read.

func (ValueTypeFile) MarshalJSON

func (v ValueTypeFile) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ValueTypeNumber

type ValueTypeNumber struct{}

A 64-bit floating point number.

func (ValueTypeNumber) MarshalJSON

func (v ValueTypeNumber) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

type ValueTypeString

type ValueTypeString struct{}

A UTF-8 string.

func (ValueTypeString) MarshalJSON

func (v ValueTypeString) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It writes the tag of the variant.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL