mapper

package
v0.4.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package mapper includes the types and methods for mapping provider, resource, and data source types (explorer package) from an OpenAPI specification into Provider Code Specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSourceMapper

type DataSourceMapper interface {
	MapToIR(*slog.Logger) ([]DataSourceWithRefreshObjectName, error)
}

func NewDataSourceMapper

func NewDataSourceMapper(dataSources map[string]explorer.DataSource, cfg config.Config) DataSourceMapper

type DataSourceWithRefreshObjectName

type DataSourceWithRefreshObjectName struct {
	datasource.DataSource
	RefreshObjectName   string `json:"refresh_object_name"`
	ImportStateOverride string `json:"import_state_override"`
	Id                  string `json:"id"`
}

type ProviderMapper

type ProviderMapper interface {
	MapToIR(*slog.Logger) (*ProviderWithEndpoint, error)
}

func NewProviderMapper

func NewProviderMapper(exploredProvider explorer.Provider, cfg config.Config) ProviderMapper

type ProviderWithEndpoint added in v0.5.0

type ProviderWithEndpoint struct {
	provider.Provider
	Endpoint string `json:"endpoint"`
}

type RequestMapper

type RequestMapper interface {
	MapToIR(*slog.Logger) ([]RequestWithName, error)
}

func NewRequestMapper

func NewRequestMapper(resources map[string]explorer.Resource, cfg config.Config) RequestMapper

type RequestTypeWithMethodAndPath

type RequestTypeWithMethodAndPath struct {
	spec.RequestType
	Method string `json:"method"`
	Path   string `json:"path"`
}

type RequestWithMethodAndPath

type RequestWithMethodAndPath struct {
	Create RequestTypeWithMethodAndPath    `json:"create,omitempty"`
	Read   RequestTypeWithMethodAndPath    `json:"read"`
	Update []*RequestTypeWithMethodAndPath `json:"update"`
	Delete RequestTypeWithMethodAndPath    `json:"delete"`
}

type RequestWithName

type RequestWithName struct {
	RequestWithMethodAndPath
	Name string `json:"name"`
}

type ResourceMapper

type ResourceMapper interface {
	MapToIR(*slog.Logger) ([]ResourceWithRefreshObjectName, error)
}

func NewResourceMapper

func NewResourceMapper(resources map[string]explorer.Resource, cfg config.Config) ResourceMapper

type ResourceWithRefreshObjectName

type ResourceWithRefreshObjectName struct {
	resource.Resource
	RefreshObjectName   string `json:"refresh_object_name"`
	ImportStateOverride string `json:"import_state_override"`
	Id                  string `json:"id"`
}

Directories

Path Synopsis
Package attrmapper contains types and methods that provide an intermediate step between the OpenAPI schema types (libopenapi) and the Provider Code Specification types (terraform-plugin-codegen-spec).
Package attrmapper contains types and methods that provide an intermediate step between the OpenAPI schema types (libopenapi) and the Provider Code Specification types (terraform-plugin-codegen-spec).
Package frameworkvalidators contains functionality for mapping validations onto specification that uses terraform-plugin-framework-validators.
Package frameworkvalidators contains functionality for mapping validations onto specification that uses terraform-plugin-framework-validators.
Package oas contains the logic that determines how to map OpenAPI schemas to the intermediate attrmapper types.
Package oas contains the logic that determines how to map OpenAPI schemas to the intermediate attrmapper types.

Jump to

Keyboard shortcuts

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