extensions

package
v2.932.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const Base64InputModeFile = "file"

Base64InputModeFile is the only currently-supported value for the x-speakeasy-base64-input-mode extension.

View Source
const (
	ErrUnmarshal = errors.Error("failed to unmarshal extension")
)

Variables

View Source
var ValidEntityOperationV1ConfigOperationTypes = []string{
	"close",
	"create",
	"delete",
	"invoke",
	"open",
	"read",
	"update",
}

Collection of valid entity operations types across targets and entity types. This currently includes Terraform data, ephemeral, and managed resource operation types.

Functions

func ComputePaginationDotNotation

func ComputePaginationDotNotation(config *Pagination)

Types

type BackoffStrategy

type BackoffStrategy struct {
	InitialInterval *int     `json:"initialInterval" yaml:"initialInterval,omitempty"`
	MaxInterval     *int     `json:"maxInterval" yaml:"maxInterval,omitempty"`
	Exponent        *float32 `json:"exponent" yaml:"exponent,omitempty"`
	MaxElapsedTime  *int     `json:"maxElapsedTime" yaml:"maxElapsedTime,omitempty"`
}

type Comment

type Comment struct {
	Summary     string `yaml:"summary" json:"summary"`
	Description string `yaml:"description" json:"description"`
}

type Comments

type Comments map[string]*Comment

type CoreCustomSecurityConfig

type CoreCustomSecurityConfig struct {
	marshaller.CoreModel `model:"customSecurityConfig"`

	UsesScopes marshaller.Node[*bool]           `key:"usesScopes"`
	Schema     marshaller.Node[core.JSONSchema] `key:"schema" required:"true"`
}

type CoreGlobals

type CoreGlobals struct {
	marshaller.CoreModel `model:"globals"`

	Parameters marshaller.Node[[]marshaller.Node[*core.Reference[*core.Parameter]]] `key:"parameters"`
}

type CustomSecurityConfig

type CustomSecurityConfig struct {
	marshaller.Model[CoreCustomSecurityConfig]

	UsesScopes *bool
	Schema     *oas3.JSONSchema[oas3.Referenceable]
}

type Entity

type Entity struct {
	// All entity names described by the x-speakeasy-entity extension configuration.
	Names []string `json:"names" yaml:"names"`
}

Describes the parsed x-speakeasy-entity extension configuration.

func NewEntity

func NewEntity() *Entity

Returns a new Entity.

func (*Entity) AddNames

func (e *Entity) AddNames(names ...string)

Adds entity names to the names, if they do not already exist.

func (*Entity) Clone

func (e *Entity) Clone() *Entity

Clone creates a deep copy of the Entity

func (*Entity) Merge

func (e *Entity) Merge(other *Entity)

Merges the given Entity into this Entity. The algorithm adds data from the given Entity to this Entity where it is undefined. It does not remove any data from this Entity.

type EntityDescription

type EntityDescription struct {
	// Entity description for Terraform action.
	TerraformAction string `json:"terraform_action" yaml:"terraform_action"`

	// Entity description for Terraform data resource.
	TerraformDataResource string `json:"terraform_data_resource" yaml:"terraform_data_resource"`

	// Entity description for Terraform ephemeral resource.
	TerraformEphemeralResource string `json:"terraform_ephemeral_resource" yaml:"terraform_ephemeral_resource"`

	// Entity description for Terraform managed resource.
	TerraformManagedResource string `json:"terraform_managed_resource" yaml:"terraform_managed_resource"`
}

Describes the parsed x-speakeasy-entity-description extension configuration. The data is normalized into values for target-specific entities.

func (*EntityDescription) Clone

Clone creates a deep copy of the EntityDescription

func (*EntityDescription) Merge

func (e *EntityDescription) Merge(other *EntityDescription)

Merges the given EntityDescription into this EntityDescription. The algorithm adds data from the given EntityDescription to this EntityDescription where it is undefined. Where there is conflicting data, this EntityDescription's data is preserved or otherwise delegated to data-specific merge functionality. It does not remove any data from this EntityDescription.

type EntityMissingCodes

type EntityMissingCodes []int

EntityMissingCodes describes HTTP status codes that indicate an entity is missing/deleted in the API. Used by Terraform target to call RemoveResource() during Read operations.

type EntityOperationV1

type EntityOperationV1 struct {
	TerraformActions            []EntityOperationV1Config `json:"terraform_actions" yaml:"terraform_actions"`
	TerraformDataResources      []EntityOperationV1Config `json:"terraform_data_resources" yaml:"terraform_data_resources"`
	TerraformEphemeralResources []EntityOperationV1Config `json:"terraform_ephemeral_resources" yaml:"terraform_ephemeral_resources"`
	TerraformManagedResources   []EntityOperationV1Config `json:"terraform_managed_resources" yaml:"terraform_managed_resources"`
}

Describes the parsed x-speakeasy-entity-operation extension configuration. The data is normalized into collections of target-specific entity operations.

type EntityOperationV1Config

type EntityOperationV1Config struct {
	// Name of the entity for this operation.
	Entity string `json:"entity" yaml:"entity"`

	// Types of the entity operation.
	OperationTypes []string `json:"operation_types" yaml:"operation_types"`

	// Optional ordering of the operation compared to other definitions of the
	// same entity and operation type.
	Order *int `json:"order,omitempty" yaml:"order,omitempty"`

	// Optional SDK options for this entity operation.
	Options *EntityOperationV1Options `json:"options,omitempty" yaml:"options,omitempty"`
}

Describes an individual entity operation parsed from Entity#OperationType[,OperationType...][#Order] string.

func ParseEntityOperationV1ConfigString

func ParseEntityOperationV1ConfigString(input string) (*EntityOperationV1Config, error)

Parses given Entity#OperationType[,OperationType...][#Order] string into an EntityOperationV1Config.

func (EntityOperationV1Config) String

func (c EntityOperationV1Config) String() string

Returns a string representation of the EntityOperationV1Config in the Entity#OperationType[,OperationType...][#Order] format.

type EntityOperationV1Options

type EntityOperationV1Options struct {
	// Polling configuration for this entity operation.
	Polling *EntityOperationV1Polling `json:"polling,omitempty" yaml:"polling,omitempty"`

	// Patch configuration for update operations.
	Patch *EntityOperationV1Patch `json:"patch,omitempty" yaml:"patch,omitempty"`
}

Describes SDK options for entity operations.

type EntityOperationV1Patch

type EntityOperationV1Patch struct {
	// Style of patch semantics to use for updates.
	// Valid values: "only-send-changed-attributes"
	Style string `json:"style" yaml:"style"`
}

Describes patch configuration for update operations.

type EntityOperationV1Polling

type EntityOperationV1Polling struct {
	// Overrides the number of seconds before the first request.
	DelaySeconds *int `json:"delaySeconds,omitempty" yaml:"delaySeconds,omitempty"`

	// Overrides the number of seconds between requests.
	IntervalSeconds *int `json:"intervalSeconds,omitempty" yaml:"intervalSeconds,omitempty"`

	// Overrides the number of requests to limit polling.
	LimitCount *int `json:"limitCount,omitempty" yaml:"limitCount,omitempty"`

	// Name of the polling option to use.
	Name string `json:"name" yaml:"name"`
}

Describes polling configuration for entity operations.

type EntityVersion

type EntityVersion struct {
	// Entity version for Terraform managed resource.
	TerraformManagedResource int64 `json:"terraform_managed_resource" yaml:"terraform_managed_resource"`
}

Describes the parsed x-speakeasy-entity-version extension configuration. The data is normalized into values for target-specific entities.

func (*EntityVersion) Clone

func (e *EntityVersion) Clone() *EntityVersion

Clone creates a deep copy of the EntityVersion

func (*EntityVersion) Merge

func (e *EntityVersion) Merge(other *EntityVersion)

Merges the given EntityVersion into this EntityVersion. The algorithm adds data from the given EntityVersion to this EntityVersion where it is undefined. Where there is conflicting data, this EntityVersion's data is preserved or otherwise delegated to data-specific merge functionality. It does not remove any data from this EntityVersion.

type Errors

type Errors struct {
	StatusCodes []string `yaml:"statusCodes"`
	Override    bool     `yaml:"override"`
}

func MergeErrors

func MergeErrors(a, b *Errors) *Errors

func (*Errors) IsErrorStatusCode

func (e *Errors) IsErrorStatusCode(statusCode string) bool

type Extension

type Extension int
const (
	ExtUsageExample Extension = iota
	ExtRetries
	ExtServerID
	ExtNameOverride
	ExtInclude
	ExtIgnore
	ExtGlobals
	ExtGlobalsHidden
	ExtExample
	ExtGroup
	ExtEnums
	ExtEnumDescriptions
	ExtEnumFormat
	ExtDeprecationReplacement
	ExtDeprecationMessage
	ExtPagination
	ExtTypeOverride
	ExtErrors
	ExtErrorMessage
	ExtExtensionRewrite
	ExtDocs
	ExtTest
	ExtTestInternalDirectives
	ExtTestID
	ExtTestIgnore
	ExtTestServer
	ExtDocsRateLimits
	ExtMaxMethodParams
	ExtExampleUnset
	ExtUnknownValues
	ExtFlattenRequest
	ExtTimeout
	ExtSSESentinel
	ExtTransformFromAPI
	ExtTransformToAPI
	ExtCustomSecurityScheme
	ExtParamEncodingOverride
	ExtWebhooks
	ExtReactHook
	ExtMCP
	ExtTokenEndpointAuth
	ExtEntity
	ExtEntityDescription
	ExtEntityOperation
	ExtEntityOperations
	ExtEntityVersion
	ExtMatch
	ExtTerraformAliasTo
	ExtTerraformCustomDefault
	ExtTerraformIgnore
	ExtTerraformWriteOnly
	ExtResponseFilter
	ExtTokenEndpointAdditionalPropertiess
	ExtWrappedAttribute
	ExtSSEOverload
	ExtOverridableOAuth2Scopes
	ExtPolling
	ExtEntityMissingCodes
	ExtAllowEmptyValue
	ExtModelNamespace
	ExtDiscriminator
	ExtBase64InputMode
	ExtPublicExports
	ExtGoOptionalMethodArguments
)

func (Extension) Name

func (e Extension) Name() string

type ExtensionScope

type ExtensionScope int
const (
	Global ExtensionScope = iota
	Operation
	Parameter
)

type Extensions

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

func New

func New(target types.Target) *Extensions

func (*Extensions) Base64InputMode

func (e *Extensions) Base64InputMode(schema *oas3.Schema) (string, error)

Base64InputMode returns the value of the x-speakeasy-base64-input-mode extension on a schema. Any value other than "file" is treated as unset (returns "").

func (*Extensions) DoesParamAllowReserved

func (e *Extensions) DoesParamAllowReserved(param *openapi.Parameter) bool

func (*Extensions) GetCustomDocs

func (e *Extensions) GetCustomDocs(extensions OAExtensions) (Comments, error)

func (*Extensions) GetDeprecationMessage

func (e *Extensions) GetDeprecationMessage(extensions OAExtensions) (string, error)

func (*Extensions) GetDeprecationReplacement

func (e *Extensions) GetDeprecationReplacement(extensions OAExtensions) (string, error)

func (*Extensions) GetDiscriminatorNameOverrides

func (e *Extensions) GetDiscriminatorNameOverrides(schema *oas3.Schema) (map[string]string, error)

func (*Extensions) GetEnumDescriptions

func (e *Extensions) GetEnumDescriptions(schema *oas3.Schema) ([]string, map[any]string, error)

func (*Extensions) GetEnumFormat

func (e *Extensions) GetEnumFormat(schema *oas3.Schema) (string, error)

func (*Extensions) GetEnumNames

func (e *Extensions) GetEnumNames(schema *oas3.Schema) ([]string, map[any]string, error)

func (*Extensions) GetFlattenRequest

func (e *Extensions) GetFlattenRequest(extensions OAExtensions) (*bool, error)

func (*Extensions) GetGoOptionalMethodArguments

func (e *Extensions) GetGoOptionalMethodArguments(extensions OAExtensions) (*GoOptionalMethodArguments, error)

func (*Extensions) GetGroups

func (e *Extensions) GetGroups(operation *openapi.Operation) ([]string, error)

func (*Extensions) GetGroupsWithNode

func (e *Extensions) GetGroupsWithNode(operation *openapi.Operation) ([]string, *yaml.Node, error)

GetGroupsWithNode returns the groups for an operation along with the yaml node for error reporting

func (*Extensions) GetMaxMethodParams

func (e *Extensions) GetMaxMethodParams(extensions OAExtensions) (*int, error)

func (*Extensions) GetModelNamespace

func (e *Extensions) GetModelNamespace(extensions OAExtensions) (string, error)

GetModelNamespace returns the namespace for a schema, used to organize component schemas into namespace folders. This enables multiple components with the same name to exist in different namespaces without conflict.

The namespace value must contain only alphanumeric characters, underscores, hyphens, and dots. Nested namespaces (containing forward slashes) are not currently supported.

func (*Extensions) GetOverridableOAuth2Scopes

func (e *Extensions) GetOverridableOAuth2Scopes(flow *openapi.OAuthFlow) (bool, error)

func (*Extensions) GetPropertyName

func (e *Extensions) GetPropertyName(s *oas3.JSONSchema[oas3.Referenceable], resolvedSchema *oas3.JSONSchema[oas3.Concrete], originalName string, ignoreResolvedNameOverride bool) (string, error)

func (*Extensions) GetResolvedName

func (e *Extensions) GetResolvedName(ext Extension) string

func (*Extensions) GetResolvedSchemaName

func (e *Extensions) GetResolvedSchemaName(extensions OAExtensions, originalName string) (string, error)

func (*Extensions) GetSSEOverload

func (e *Extensions) GetSSEOverload(extensions OAExtensions) (bool, error)

func (*Extensions) GetSecuritySchemeExample

func (e *Extensions) GetSecuritySchemeExample(scheme *openapi.SecurityScheme) *yaml.Node

func (*Extensions) GetServerID

func (e *Extensions) GetServerID(server *openapi.Server) (string, error)

func (*Extensions) GetTestDirectives

func (e *Extensions) GetTestDirectives(extensions OAExtensions) ([]string, error)

func (*Extensions) GetTestID

func (e *Extensions) GetTestID(operation *openapi.Operation) (string, error)

func (*Extensions) GetTokenServerAuthentication

func (e *Extensions) GetTokenServerAuthentication(securityScheme *openapi.OAuthFlow) (string, error)

func (*Extensions) GetUsageConfig

func (e *Extensions) GetUsageConfig(extensions OAExtensions) (*UsageExampleConfig, error)

func (*Extensions) HandleAllowEmptyQueryParameterValueExtension

func (e *Extensions) HandleAllowEmptyQueryParameterValueExtension(param *openapi.Parameter) (bool, error)

func (*Extensions) HandleClassNameExtension

func (e *Extensions) HandleClassNameExtension(extensions OAExtensions) (*NameOverride, error)

func (*Extensions) HandleCustomSecurityConfig

func (e *Extensions) HandleCustomSecurityConfig(ctx context.Context, exts OAExtensions) (*CustomSecurityConfig, error)

func (*Extensions) HandleDocsRateLimitExtension

func (e *Extensions) HandleDocsRateLimitExtension(operation *openapi.Operation) ([]RateLimit, error)

func (*Extensions) HandleEntityDescriptionExtension

func (e *Extensions) HandleEntityDescriptionExtension(extensions OAExtensions) (*EntityDescription, error)

Handles parsing of the x-speakeasy-entity-description extension from the given OpenAPI extensions map.

func (*Extensions) HandleEntityExtension

func (e *Extensions) HandleEntityExtension(extensions OAExtensions) (*Entity, error)

Handles parsing of the x-speakeasy-entity extension from the given OpenAPI extensions map.

func (*Extensions) HandleEntityMissingCodesExtension

func (e *Extensions) HandleEntityMissingCodesExtension(extensions OAExtensions) (EntityMissingCodes, error)

HandleEntityMissingCodesExtension handles parsing of the x-speakeasy-entity-missing-codes extension from the given OpenAPI extensions map.

func (*Extensions) HandleEntityOperationExtension

func (e *Extensions) HandleEntityOperationExtension(operation *openapi.Operation) (*EntityOperationV1, error)

Handles parsing of the x-speakeasy-entity-operation extension from the given OpenAPI operation.

func (*Extensions) HandleEntityVersionExtension

func (e *Extensions) HandleEntityVersionExtension(extensions OAExtensions) (*EntityVersion, error)

Handles parsing of the x-speakeasy-entity-version extension from the given OpenAPI extensions map.

func (*Extensions) HandleErrors

func (e *Extensions) HandleErrors(extensions OAExtensions) (*Errors, error)

func (*Extensions) HandleExampleUnsetExtension

func (e *Extensions) HandleExampleUnsetExtension(extensions OAExtensions) (*bool, error)

Handles parsing of the x-speakeasy-example-unset extension from the given OpenAPI extensions map.

func (*Extensions) HandleGlobalNameOverrideExtensions

func (e *Extensions) HandleGlobalNameOverrideExtensions(doc *openapi.OpenAPI) ([]*NameOverride, error)

func (*Extensions) HandleGlobalRetryExtension

func (e *Extensions) HandleGlobalRetryExtension(doc *openapi.OpenAPI, defaultEnabledRetries bool) (*Retries, error)

func (*Extensions) HandleGlobalTimeoutExtension

func (e *Extensions) HandleGlobalTimeoutExtension(doc *openapi.OpenAPI) (*int64, error)

func (*Extensions) HandleGlobalsExtension

func (e *Extensions) HandleGlobalsExtension(ctx context.Context, doc *openapi.OpenAPI) (*Globals, error)

func (*Extensions) HandleIgnoreExtension

func (e *Extensions) HandleIgnoreExtension(extensions OAExtensions) (*bool, error)

Handles parsing of the x-speakeasy-ignore extension from the given OpenAPI extensions map.

func (*Extensions) HandleMCPExtension

func (e *Extensions) HandleMCPExtension(operation *openapi.Operation) (*MCP, error)

func (*Extensions) HandleMatchExtension

func (e *Extensions) HandleMatchExtension(extensions OAExtensions) (*MatchConfig, error)

Handles parsing of the x-speakeasy-match extension from the given OpenAPI extensions map.

func (*Extensions) HandleOperationMethodNameExtension

func (e *Extensions) HandleOperationMethodNameExtension(operation *openapi.Operation) (*NameOverride, bool, error)

func (*Extensions) HandleOperationPaginationExtension

func (e *Extensions) HandleOperationPaginationExtension(ctx context.Context, operation *openapi.Operation, docInfo *document.DocumentInfo) (*Pagination, error)

func (*Extensions) HandleOperationParameterNameExtension

func (e *Extensions) HandleOperationParameterNameExtension(param *openapi.Parameter) (*NameOverride, bool, error)

func (*Extensions) HandleOperationRetryExtension

func (e *Extensions) HandleOperationRetryExtension(operation *openapi.Operation) (*Retries, bool, error)

func (*Extensions) HandleOperationTimeoutExtension

func (e *Extensions) HandleOperationTimeoutExtension(operation *openapi.Operation) (*int64, bool, error)

func (*Extensions) HandlePollingExtension

func (e *Extensions) HandlePollingExtension(extensions OAExtensions) (*Polling, error)

Handles parsing of the x-speakeasy-polling extension from the given OpenAPI extensions map.

func (*Extensions) HandlePublicExportsExtension

func (e *Extensions) HandlePublicExportsExtension(extensions OAExtensions) ([]PublicExport, error)

func (*Extensions) HandleReactHookExtension

func (e *Extensions) HandleReactHookExtension(operation *openapi.Operation) (*ReactHook, error)

func (*Extensions) HandleResponseFilterExtension

func (e *Extensions) HandleResponseFilterExtension(extensions OAExtensions) (*bool, error)

Handles parsing of the x-speakeasy-response-filter extension from the given OpenAPI extensions map.

func (*Extensions) HandleRewriteExtension

func (e *Extensions) HandleRewriteExtension(opts ...HandleRewriteExtensionOption) error

func (*Extensions) HandleSSESentinelExtension

func (e *Extensions) HandleSSESentinelExtension(extensions OAExtensions) (*SSESentinel, error)

func (*Extensions) HandleSSESentinelExtensionString

func (e *Extensions) HandleSSESentinelExtensionString(extensions OAExtensions) string

func (*Extensions) HandleTerraformAliasToExtension

func (e *Extensions) HandleTerraformAliasToExtension(extensions OAExtensions) (*string, error)

Handles parsing of the x-speakeasy-terraform-alias-to extension from the given OpenAPI extensions map.

func (*Extensions) HandleTerraformCustomDefaultExtension

func (e *Extensions) HandleTerraformCustomDefaultExtension(extensions OAExtensions) (*TerraformCustomDefault, error)

Handles parsing of the x-speakeasy-terraform-custom-default extension from the given OpenAPI extensions map.

func (*Extensions) HandleTerraformIgnoreExtension

func (e *Extensions) HandleTerraformIgnoreExtension(extensions OAExtensions) (*TerraformIgnore, error)

Handles parsing of the x-speakeasy-terraform-ignore extension from the given OpenAPI extensions map.

func (*Extensions) HandleTerraformWriteOnlyExtension

func (e *Extensions) HandleTerraformWriteOnlyExtension(extensions OAExtensions) (*bool, error)

Handles parsing of the x-speakeasy-terraform-write-only extension from the given OpenAPI extensions map.

func (*Extensions) HandleTransformExtension

func (e *Extensions) HandleTransformExtension(ext OAExtensions, transformExt Extension) (*TransformerConfig, error)

func (*Extensions) HandleWebhooksExtension

func (e *Extensions) HandleWebhooksExtension(extensions OAExtensions) (*Webhooks, error)

func (*Extensions) HandleWrappedAttributeExtension

func (e *Extensions) HandleWrappedAttributeExtension(extensions OAExtensions) (*string, error)

Handles parsing of the x-speakeasy-wrapped-attribute extension from the given OpenAPI extensions map.

func (*Extensions) Ignore

func (e *Extensions) Ignore(extensions OAExtensions) (bool, error)

func (*Extensions) IncludeSchema

func (e *Extensions) IncludeSchema(schema *oas3.JSONSchema[oas3.Concrete]) (bool, error)

func (*Extensions) IsErrorMessage

func (e *Extensions) IsErrorMessage(extensions OAExtensions) (bool, error)

func (*Extensions) IsExtensionIdentifying

func (e *Extensions) IsExtensionIdentifying(extName string) bool

IsExtensionIdentifying returns true if the extension affects schema identity and should prevent a schema from being considered "empty" during allOf processing. This is different from IsExtensionMergable - some extensions like x-speakeasy-name-override should not be merged into child schemas during oneOf processing, but DO affect identity when building unique references for allOf schemas.

func (*Extensions) IsExtensionMergable

func (e *Extensions) IsExtensionMergable(extName string) bool

func (*Extensions) IsGlobalHidden

func (e *Extensions) IsGlobalHidden(ctx context.Context, parameter *openapi.Parameter) bool

func (*Extensions) IsOpenEnum

func (e *Extensions) IsOpenEnum(schema *oas3.Schema) (bool, error)

func (*Extensions) IsTestIgnored

func (e *Extensions) IsTestIgnored(extensions OAExtensions) (bool, error)

func (*Extensions) IsTestingEnabled

func (e *Extensions) IsTestingEnabled(extensions OAExtensions) (*bool, error)

func (*Extensions) IsUsageExample

func (e *Extensions) IsUsageExample(extensions OAExtensions) (bool, error)

func (*Extensions) OperationCanHaveSSEOverload

func (e *Extensions) OperationCanHaveSSEOverload(ctx context.Context, op *openapi.Operation, docInfo *document.DocumentInfo) (*SSEOverloadConfig, error)

OperationCanHaveSSEOverload validates that an operation is compatible with the x-speakeasy-sse-overload extension. The operation must have a boolean `stream` discriminator either in the request body or as a query parameter, and exactly two successful response content types: 1 text/event-stream and 1 application/json. Returns the resolved stream-field ref on success.

func (*Extensions) OperationCanInferSSEOverload

func (e *Extensions) OperationCanInferSSEOverload(ctx context.Context, op *openapi.Operation, docInfo *document.DocumentInfo) (*SSEOverloadConfig, error)

OperationCanInferSSEOverload validates body-stream eligibility for generation.inferSSEOverload. Inference intentionally remains body-only; query-stream operations must opt in explicitly. Returns (nil, nil) when the operation is simply not a candidate (no body, no stream field, etc.). Fatal failures (e.g. broken $ref) are surfaced as errors.

func (*Extensions) ParseGlobalNameOverrideExtension

func (e *Extensions) ParseGlobalNameOverrideExtension(nameOverrideExtension *yaml.Node) ([]*NameOverride, error)

func (*Extensions) TypeOverride

func (e *Extensions) TypeOverride(extensions OAExtensions) (string, error)

type Globals

type Globals struct {
	marshaller.Model[CoreGlobals]
	Parameters []*openapi.ReferencedParameter
}

type GoOptionalMethodArguments

type GoOptionalMethodArguments string
const (
	GoOptionalMethodArgumentsPointers      GoOptionalMethodArguments = "pointers"
	GoOptionalMethodArgumentsSharedOptions GoOptionalMethodArguments = "shared-options"
	GoOptionalMethodArgumentsMethodOptions GoOptionalMethodArguments = "method-options"
)

type HandleRewriteExtensionOption

type HandleRewriteExtensionOption func(*HandleRewriteExtensionOptions)

func WithDocumentExtensions

func WithDocumentExtensions(extensions OAExtensions) HandleRewriteExtensionOption

func WithRewritesExtensionNode

func WithRewritesExtensionNode(node *yaml.Node) HandleRewriteExtensionOption

type HandleRewriteExtensionOptions

type HandleRewriteExtensionOptions struct {
	Extensions OAExtensions
	Node       *yaml.Node
}

type MCP

type MCP struct {
	Disabled        bool     `json:"disabled" yaml:"disabled"`
	Name            string   `json:"name" yaml:"name"`
	Scopes          []string `json:"scopes" yaml:"scopes"`
	Description     string   `json:"description" yaml:"description"`
	Title           string   `json:"title" yaml:"title"`
	DestructiveHint bool     `json:"destructiveHint" yaml:"destructiveHint"`
	IdempotentHint  bool     `json:"idempotentHint" yaml:"idempotentHint"`
	OpenWorldHint   bool     `json:"openWorldHint" yaml:"openWorldHint"`
	ReadOnlyHint    bool     `json:"readOnlyHint" yaml:"readOnlyHint"`
}

type MatchConfig

type MatchConfig struct {
	// Path to match in the entity (e.g., "id", "object.id")
	// When specified as a scalar string, this field is populated.
	Path *string `json:"path,omitempty" yaml:"path,omitempty"`

	// Whether to use the prior state value for this parameter in update operations.
	UsePriorState bool `json:"usePriorState,omitempty" yaml:"usePriorState,omitempty"`
}

MatchConfig describes the x-speakeasy-match extension configuration. It can be used to alias/map parameters to entity fields or to specify that prior state values should be used for parameters in update operations.

type NameOverride

type NameOverride struct {
	OperationId                 string `json:"operationId" yaml:"operationId"`
	GlobalMethodNameOverride    string `json:"methodNameOverride" yaml:"methodNameOverride"`
	ParameterName               string `json:"parameterName" yaml:"parameterName"`
	GlobalParameterNameOverride string `json:"parameterNameOverride" yaml:"parameterNameOverride"`
	Name                        string
	Node                        *yaml.Node // The yaml node where this extension is defined (for error reporting)
}

type OAExtensions

type OAExtensions = *extensions.Extensions

type Pagination

type Pagination struct {
	Type    PaginationType     `json:"type" yaml:"type"`
	Inputs  []PaginationInputs `json:"inputs" yaml:"inputs"`
	Outputs PaginationOutputs  `json:"outputs" yaml:"outputs"`
}

func (*Pagination) Clone

func (p *Pagination) Clone() *Pagination

Clone creates a deep copy of the Pagination

type PaginationInputInType

type PaginationInputInType string
const (
	PaginationInputInTypeParameters  PaginationInputInType = "parameters"
	PaginationInputInTypeRequestBody PaginationInputInType = "requestBody"
)

type PaginationInputType

type PaginationInputType string
const (
	PaginationInputTypeLimit  PaginationInputType = "limit"
	PaginationInputTypeOffset PaginationInputType = "offset"
	PaginationInputTypePage   PaginationInputType = "page"
	PaginationInputTypeCursor PaginationInputType = "cursor"
)

type PaginationInputs

type PaginationInputs struct {
	Name     string                `json:"name" yaml:"name"`
	In       PaginationInputInType `json:"in" yaml:"in"`
	Type     PaginationInputType   `json:"type" yaml:"type"`
	Optional bool
}

func (PaginationInputs) Clone

Clone creates a deep copy of the PaginationInputs

type PaginationOutputs

type PaginationOutputs struct {
	// CanUseDotNotation indicates that the JSONPath expressions in this
	// pagination config are simple enough and it is possible to use a
	// lightweight and more performant object-drilling library instead of a
	// JSONPath library.
	CanUseDotNotation bool `json:"-" yaml:"-"`

	Results    string `json:"results" yaml:"results"`
	ResultsDot string `json:"-" yaml:"-"`

	NumPages    string `json:"numPages" yaml:"numPages"`
	NumPagesDot string `json:"-" yaml:"-"`

	NextCursor    string `json:"nextCursor" yaml:"nextCursor"`
	NextCursorDot string `json:"-" yaml:"-"`

	NextURL    string `json:"nextUrl" yaml:"nextUrl"`
	NextURLDot string `json:"-" yaml:"-"`
}

func (PaginationOutputs) Clone

Clone creates a deep copy of the PaginationOutputs

type PaginationType

type PaginationType string
const (
	PaginationTypeOffsetLimit PaginationType = "offsetLimit"
	PaginationTypeCursor      PaginationType = "cursor"
	PaginationTypeURL         PaginationType = "url"
)

type Polling

type Polling struct {
	// Collection of polling options.
	Options PollingOptions `json:"options" yaml:"options"`
}

Describes parsed and normalized x-speakeasy-polling extension configuration.

func (*Polling) Clone

func (p *Polling) Clone() *Polling

Clone creates a deep copy of the Polling

type PollingCriteria

type PollingCriteria []*PollingCriterion

Collection of polling criterion.

func (PollingCriteria) Clone

func (c PollingCriteria) Clone() PollingCriteria

Clone creates a deep copy of the PollingCriteria.

type PollingCriterion

type PollingCriterion struct {
	// Condition for the polling criterion. For simple type criterion, this is
	// typically a full expression such as `$statusCode == 200`. For regex type
	// criterion, this is the regular expression pattern.
	Condition *criterion.Condition `json:"condition,omitempty" yaml:"condition,omitempty"`

	// Context is the expression to the value to be evaluated. Required for
	// regex type criterion.
	Context *expression.Expression `json:"context,omitempty" yaml:"context,omitempty"`

	// Type is the type of criterion. Defaults to CriterionTypeSimple.
	Type criterion.CriterionType `json:"type,omitempty" yaml:"type,omitempty"`
}

Describes a single polling criterion, such as a target condition.

func (*PollingCriterion) Clone

func (c *PollingCriterion) Clone() *PollingCriterion

Clone creates a deep copy of the PollingCriterion.

func (*PollingCriterion) UnmarshalYAML

func (c *PollingCriterion) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface for PollingCriterion.

type PollingOption

type PollingOption struct {
	// Delay in seconds before polling calls begin. Defaults to 1.
	DelaySeconds *int64 `json:"delaySeconds,omitempty" yaml:"delaySeconds,omitempty"`

	// Descibes immediate failure criteria for the polling option. When all
	// matching criteria are met (AND boolean), the operation will immediately
	// return an error.
	FailureCriteria PollingCriteria `json:"failureCriteria,omitempty" yaml:"failureCriteria,omitempty"`

	// Interval between polling calls in seconds. Defaults to 1.
	IntervalSeconds *int64 `json:"intervalSeconds,omitempty" yaml:"intervalSeconds,omitempty"`

	// Name of the polling option.
	Name string `json:"name" yaml:"name"`

	// Number of polling calls not matching the FailureCriteria or
	// SuccessCriteria before returning a timeout error. Defaults to 60.
	LimitCount *int64 `json:"limitCount,omitempty" yaml:"limitCount,omitempty"`

	// Descibes success criteria for the polling option. When all matching
	// criteria are met (AND boolean), the operation will return successfully.
	SuccessCriteria PollingCriteria `json:"successCriteria,omitempty" yaml:"successCriteria,omitempty"`
}

Describes a single polling option.

func (*PollingOption) Clone

func (o *PollingOption) Clone() *PollingOption

Clone creates a deep copy of the PollingOption.

func (*PollingOption) UnmarshalYAML

func (o *PollingOption) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface for PollingOption.

type PollingOptions

type PollingOptions []*PollingOption

Collection of PollingOption.

func (PollingOptions) Clone

func (o PollingOptions) Clone() PollingOptions

Clone creates a deep copy of the PollingOptions.

type PublicExport

type PublicExport struct {
	Group string `json:"group" yaml:"group"`
	Name  string `json:"name" yaml:"name"`
	// Representation selects the rendering the alias refers to: "model"
	// (default) or "input". See PublicExportRepresentation.
	Representation PublicExportRepresentation `json:"representation,omitempty" yaml:"representation,omitempty"`
}

func (PublicExport) Input

func (p PublicExport) Input() bool

Input reports whether the export aliases the request-input rendering.

func (PublicExport) IsZero

func (p PublicExport) IsZero() bool

func (PublicExport) Key

func (p PublicExport) Key() string

func (PublicExport) Normalize

func (p PublicExport) Normalize() PublicExport

type PublicExportRepresentation

type PublicExportRepresentation string

PublicExportRepresentation selects which rendering of the target type an export alias refers to in languages that generate more than one.

const (
	// PublicExportRepresentationModel aliases the type's primary rendering
	// (e.g. the Pydantic model class in Python). This is the default.
	PublicExportRepresentationModel PublicExportRepresentation = "model"
	// PublicExportRepresentationInput aliases the type's request-input
	// rendering where the language generates a separate one — e.g. the
	// TypedDict companion in Python, used when callers pass plain dicts.
	// Languages without a separate input rendering, and targets without an
	// input companion (enums, errors), fall back to the model rendering.
	PublicExportRepresentationInput PublicExportRepresentation = "input"
)

type RateLimit

type RateLimit struct {
	Strategy      string          `json:"strategy" yaml:"strategy"`
	SlidingWindow *WindowStrategy `json:"sliding_window" yaml:"sliding_window"`
	Identifier    string          `json:"identifier" yaml:"identifier"`
	Description   string          `json:"description" yaml:"description"`
}

type ReactHook

type ReactHook struct {
	Disabled bool               `json:"disabled" yaml:"disabled"`
	Name     string             `json:"name" yaml:"name"`
	Type     string             `json:"type" yaml:"type"`
	QueryKey *ReactHookQueryKey `json:"queryKey" yaml:"queryKey"`
}

type ReactHookQueryKey

type ReactHookQueryKey struct {
	IncludeRequestBody bool `json:"includeRequestBody" yaml:"includeRequestBody"`
}

type Retries

type Retries struct {
	Strategy              string           `json:"strategy" yaml:"strategy,omitempty"`
	DefaultApplied        bool             `json:"defaultApplied,omitempty" yaml:"defaultApplied,omitempty"`
	Disabled              *bool            `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	Backoff               *BackoffStrategy `json:"backoff" yaml:"backoff,omitempty"`
	StatusCodes           []string         `json:"statusCodes" yaml:"statusCodes,omitempty"`
	RetryConnectionErrors *bool            `json:"retryConnectionErrors" yaml:"retryConnectionErrors,omitempty"`
	MaxRetries            *int             `json:"maxRetries" yaml:"maxRetries,omitempty"`
}

type SSEOverloadConfig

type SSEOverloadConfig struct {
	In   string // "body" | "query"
	Name string // resolved field name
}

SSEOverloadConfig identifies the boolean field that toggles SSE overload for an operation. Name is not user-configurable today: always falls back to defaultSSEOverloadSelectorName.

type SSESentinel

type SSESentinel struct {
	DataValue string
}

type TerraformCustomDefault

type TerraformCustomDefault struct {
	// Go package imports required for the custom default.
	Imports []string `json:"imports" yaml:"imports"`

	// Code rendered into the schema to instantiate the custom default
	// implementation.
	SchemaDefinition string `json:"schemaDefinition" yaml:"schemaDefinition"`
}

Describes the parsed x-speakeasy-terraform-custom-default extension configuration.

func (*TerraformCustomDefault) Clone

Clone creates a deep copy of the TerraformCustomDefault

type TerraformIgnore

type TerraformIgnore struct {
	// When enabled, the field will be ignored in Terraform data models.
	// Enabled when the ignore extension is set to true.
	DataModel bool `json:"dataModel" yaml:"dataModel"`

	// When enabled, the field will be ignored in Terraform schema definitions.
	// Enabled when the ignore extension is set to true.
	Schema bool `json:"schema" yaml:"schema"`
}

Describes the parsed x-speakeasy-terraform-ignore extension configuration.

When the extension is set to true, all values will be ignored.

func (*TerraformIgnore) Clone

func (t *TerraformIgnore) Clone() *TerraformIgnore

Clone creates a deep copy of the TerraformIgnore

type TransformerConfig

type TransformerConfig struct {
	Type   TransformerType
	Config string
}

type TransformerType

type TransformerType string

TransformerType is a string enum that can right now only be "jq"

const (
	Jq TransformerType = "jq"
)

type UsageExampleConfig

type UsageExampleConfig struct {
	Title       string   `json:"title" yaml:"title,omitempty"`
	Description string   `json:"description" yaml:"description,omitempty"`
	Position    int      `json:"position" yaml:"position,omitempty"`
	Tags        []string `json:"tags" yaml:"tags,omitempty"`
}

type WebhookSecurity

type WebhookSecurity struct {
	// Valid values for this field are:
	//
	// * "signature" a configurable signature which respects header name, text encoding and algorithm
	//
	// * "custom" a custom signature down to the API producer to complete the implementation
	//
	// * "signatureStandardWebhooks" a preset which conforms to "Standard Webhooks" naming / guidance
	//
	// * "apiKey" an API key - no signing is performed
	Type string `json:"type" yaml:"type"`
	// Applicable when Type is "signature"
	HeaderName string `json:"headerName" yaml:"headerName,omitempty"`
	// Applicable when Type is "signature"
	SignatureTextEncoding string `json:"signatureTextEncoding" yaml:"signatureTextEncoding,omitempty"`
	// Applicable when Type is "signature"
	SignatureAlgorithm string `json:"algorithm" yaml:"algorithm,omitempty"`
	// ConsumerShouldProvideSecret is true if the webhook consumer should provide the secret - allows for "custom" type to override the default behavior
	ConsumerShouldProvideSecret *bool `json:"consumerShouldProvideSecret" yaml:"consumerShouldProvideSecret,omitempty"`
}

type Webhooks

type Webhooks struct {
	// A WebhookSecurity object is used to configure the security for a webhook.
	Security *WebhookSecurity `json:"security" yaml:"security,omitempty"`
}

A Webhooks extension is used to configure webhooks for an API.

type WindowStrategy

type WindowStrategy struct {
	Rate   int    `json:"rate" yaml:"rate"`
	Period string `json:"period" yaml:"period"`
}

Jump to

Keyboard shortcuts

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