Documentation ¶
Overview ¶
Package toproto5 contains functions to convert from framework types to protocol version 5 (tfprotov5) types.
Index ¶
- func ApplyResourceChangeResponse(ctx context.Context, fw *fwserver.ApplyResourceChangeResponse) *tfprotov5.ApplyResourceChangeResponse
- func Block(ctx context.Context, name string, path *tftypes.AttributePath, ...) (*tfprotov5.SchemaNestedBlock, error)
- func CallFunctionResponse(ctx context.Context, fw *fwserver.CallFunctionResponse) *tfprotov5.CallFunctionResponse
- func CloseEphemeralResourceResponse(ctx context.Context, fw *fwserver.CloseEphemeralResourceResponse) *tfprotov5.CloseEphemeralResourceResponse
- func Config(ctx context.Context, fw *tfsdk.Config) (*tfprotov5.DynamicValue, diag.Diagnostics)
- func ConfigureProviderResponse(ctx context.Context, fw *provider.ConfigureResponse) *tfprotov5.ConfigureProviderResponse
- func DataSourceDeferred(fw *datasource.Deferred) *tfprotov5.Deferred
- func DataSourceMetadata(ctx context.Context, fw fwserver.DataSourceMetadata) tfprotov5.DataSourceMetadata
- func DiagnosticSeverity(s diag.Severity) tfprotov5.DiagnosticSeverity
- func Diagnostics(ctx context.Context, diagnostics diag.Diagnostics) []*tfprotov5.Diagnostic
- func DynamicValue(ctx context.Context, data *fwschemadata.Data) (*tfprotov5.DynamicValue, diag.Diagnostics)
- func EphemeralResourceDeferred(fw *ephemeral.Deferred) *tfprotov5.Deferred
- func EphemeralResourceMetadata(ctx context.Context, fw fwserver.EphemeralResourceMetadata) tfprotov5.EphemeralResourceMetadata
- func EphemeralResultData(ctx context.Context, fw *tfsdk.EphemeralResultData) (*tfprotov5.DynamicValue, diag.Diagnostics)
- func Function(ctx context.Context, fw function.Definition) *tfprotov5.Function
- func FunctionError(ctx context.Context, funcErr *function.FuncError) *tfprotov5.FunctionError
- func FunctionMetadata(ctx context.Context, fw fwserver.FunctionMetadata) tfprotov5.FunctionMetadata
- func FunctionParameter(ctx context.Context, fw function.Parameter) *tfprotov5.FunctionParameter
- func FunctionResultData(ctx context.Context, data function.ResultData) (*tfprotov5.DynamicValue, *function.FuncError)
- func FunctionReturn(ctx context.Context, fw function.Return) *tfprotov5.FunctionReturn
- func GetFunctionsResponse(ctx context.Context, fw *fwserver.GetFunctionsResponse) *tfprotov5.GetFunctionsResponse
- func GetMetadataResponse(ctx context.Context, fw *fwserver.GetMetadataResponse) *tfprotov5.GetMetadataResponse
- func GetProviderSchemaResponse(ctx context.Context, fw *fwserver.GetProviderSchemaResponse) *tfprotov5.GetProviderSchemaResponse
- func ImportResourceStateResponse(ctx context.Context, fw *fwserver.ImportResourceStateResponse) *tfprotov5.ImportResourceStateResponse
- func ImportedResource(ctx context.Context, fw *fwserver.ImportedResource) (*tfprotov5.ImportedResource, diag.Diagnostics)
- func MoveResourceStateResponse(ctx context.Context, fw *fwserver.MoveResourceStateResponse) *tfprotov5.MoveResourceStateResponse
- func OpenEphemeralResourceResponse(ctx context.Context, fw *fwserver.OpenEphemeralResourceResponse) *tfprotov5.OpenEphemeralResourceResponse
- func PlanResourceChangeResponse(ctx context.Context, fw *fwserver.PlanResourceChangeResponse) *tfprotov5.PlanResourceChangeResponse
- func PrepareProviderConfigResponse(ctx context.Context, fw *fwserver.ValidateProviderConfigResponse) *tfprotov5.PrepareProviderConfigResponse
- func ReadDataSourceResponse(ctx context.Context, fw *fwserver.ReadDataSourceResponse) *tfprotov5.ReadDataSourceResponse
- func ReadResourceResponse(ctx context.Context, fw *fwserver.ReadResourceResponse) *tfprotov5.ReadResourceResponse
- func RenewEphemeralResourceResponse(ctx context.Context, fw *fwserver.RenewEphemeralResourceResponse) *tfprotov5.RenewEphemeralResourceResponse
- func ResourceDeferred(fw *resource.Deferred) *tfprotov5.Deferred
- func ResourceMetadata(ctx context.Context, fw fwserver.ResourceMetadata) tfprotov5.ResourceMetadata
- func Schema(ctx context.Context, s fwschema.Schema) (*tfprotov5.Schema, error)
- func SchemaAttribute(ctx context.Context, name string, path *tftypes.AttributePath, ...) (*tfprotov5.SchemaAttribute, error)
- func ServerCapabilities(ctx context.Context, fw *fwserver.ServerCapabilities) *tfprotov5.ServerCapabilities
- func State(ctx context.Context, fw *tfsdk.State) (*tfprotov5.DynamicValue, diag.Diagnostics)
- func UpgradeResourceStateResponse(ctx context.Context, fw *fwserver.UpgradeResourceStateResponse) *tfprotov5.UpgradeResourceStateResponse
- func ValidateDataSourceConfigResponse(ctx context.Context, fw *fwserver.ValidateDataSourceConfigResponse) *tfprotov5.ValidateDataSourceConfigResponse
- func ValidateEphemeralResourceConfigResponse(ctx context.Context, fw *fwserver.ValidateEphemeralResourceConfigResponse) *tfprotov5.ValidateEphemeralResourceConfigResponse
- func ValidateResourceTypeConfigResponse(ctx context.Context, fw *fwserver.ValidateResourceConfigResponse) *tfprotov5.ValidateResourceTypeConfigResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyResourceChangeResponse ¶
func ApplyResourceChangeResponse(ctx context.Context, fw *fwserver.ApplyResourceChangeResponse) *tfprotov5.ApplyResourceChangeResponse
ApplyResourceChangeResponse returns the *tfprotov5.ApplyResourceChangeResponse equivalent of a *fwserver.ApplyResourceChangeResponse.
func Block ¶
func Block(ctx context.Context, name string, path *tftypes.AttributePath, b fwschema.Block) (*tfprotov5.SchemaNestedBlock, error)
Block returns the *tfprotov5.SchemaNestedBlock equivalent of a Block. Errors will be tftypes.AttributePathErrors based on `path`. `name` is the name of the attribute.
func CallFunctionResponse ¶ added in v1.5.0
func CallFunctionResponse(ctx context.Context, fw *fwserver.CallFunctionResponse) *tfprotov5.CallFunctionResponse
CallFunctionResponse returns the *tfprotov5.CallFunctionResponse equivalent of a *fwserver.CallFunctionResponse.
func CloseEphemeralResourceResponse ¶ added in v1.13.0
func CloseEphemeralResourceResponse(ctx context.Context, fw *fwserver.CloseEphemeralResourceResponse) *tfprotov5.CloseEphemeralResourceResponse
CloseEphemeralResourceResponse returns the *tfprotov5.CloseEphemeralResourceResponse equivalent of a *fwserver.CloseEphemeralResourceResponse.
func Config ¶
func Config(ctx context.Context, fw *tfsdk.Config) (*tfprotov5.DynamicValue, diag.Diagnostics)
Config returns the *tfprotov5.DynamicValue for a *tfsdk.Config.
func ConfigureProviderResponse ¶
func ConfigureProviderResponse(ctx context.Context, fw *provider.ConfigureResponse) *tfprotov5.ConfigureProviderResponse
ConfigureProviderResponse returns the *tfprotov5.ConfigureProviderResponse equivalent of a *fwserver.ConfigureProviderResponse.
func DataSourceDeferred ¶ added in v1.9.0
func DataSourceDeferred(fw *datasource.Deferred) *tfprotov5.Deferred
func DataSourceMetadata ¶ added in v1.4.0
func DataSourceMetadata(ctx context.Context, fw fwserver.DataSourceMetadata) tfprotov5.DataSourceMetadata
DataSourceMetadata returns the tfprotov5.DataSourceMetadata for a fwserver.DataSourceMetadata.
func DiagnosticSeverity ¶
func DiagnosticSeverity(s diag.Severity) tfprotov5.DiagnosticSeverity
DiagnosticSeverity converts diag.Severity into tfprotov5.DiagnosticSeverity.
func Diagnostics ¶
func Diagnostics(ctx context.Context, diagnostics diag.Diagnostics) []*tfprotov5.Diagnostic
Diagnostics converts the diagnostics into the tfprotov5 collection type.
func DynamicValue ¶ added in v1.1.0
func DynamicValue(ctx context.Context, data *fwschemadata.Data) (*tfprotov5.DynamicValue, diag.Diagnostics)
DynamicValue returns the *tfprotov5.DynamicValue for a given fwschemadata.Data.
If necessary, the underlying data is modified to convert list and set block values from a null collection to an empty collection. This is to prevent developers from needing to understand Terraform's differences between block and attribute values where blocks are technically never null, but from a developer perspective this distinction introduces unnecessary complexity.
func EphemeralResourceDeferred ¶ added in v1.13.0
func EphemeralResourceMetadata ¶ added in v1.13.0
func EphemeralResourceMetadata(ctx context.Context, fw fwserver.EphemeralResourceMetadata) tfprotov5.EphemeralResourceMetadata
EphemeralResourceMetadata returns the tfprotov5.EphemeralResourceMetadata for a fwserver.EphemeralResourceMetadata.
func EphemeralResultData ¶ added in v1.13.0
func EphemeralResultData(ctx context.Context, fw *tfsdk.EphemeralResultData) (*tfprotov5.DynamicValue, diag.Diagnostics)
EphemeralResultData returns the *tfprotov5.DynamicValue for a *tfsdk.EphemeralResultData.
func FunctionError ¶ added in v1.6.0
FunctionError converts the function error into the tfprotov5 function error.
func FunctionMetadata ¶ added in v1.5.0
func FunctionMetadata(ctx context.Context, fw fwserver.FunctionMetadata) tfprotov5.FunctionMetadata
FunctionMetadata returns the tfprotov5.FunctionMetadata for a fwserver.FunctionMetadata.
func FunctionParameter ¶ added in v1.5.0
FunctionParameter returns the *tfprotov5.FunctionParameter for a function.Parameter.
func FunctionResultData ¶ added in v1.5.0
func FunctionResultData(ctx context.Context, data function.ResultData) (*tfprotov5.DynamicValue, *function.FuncError)
FunctionResultData returns the *tfprotov5.DynamicValue for a given function.ResultData.
func FunctionReturn ¶ added in v1.5.0
FunctionReturn returns the *tfprotov5.FunctionReturn for a function.Return.
func GetFunctionsResponse ¶ added in v1.5.0
func GetFunctionsResponse(ctx context.Context, fw *fwserver.GetFunctionsResponse) *tfprotov5.GetFunctionsResponse
GetFunctionsResponse returns the *tfprotov5.GetFunctionsResponse equivalent of a *fwserver.GetFunctionsResponse.
func GetMetadataResponse ¶ added in v1.4.0
func GetMetadataResponse(ctx context.Context, fw *fwserver.GetMetadataResponse) *tfprotov5.GetMetadataResponse
GetMetadataResponse returns the *tfprotov5.GetMetadataResponse equivalent of a *fwserver.GetMetadataResponse.
func GetProviderSchemaResponse ¶
func GetProviderSchemaResponse(ctx context.Context, fw *fwserver.GetProviderSchemaResponse) *tfprotov5.GetProviderSchemaResponse
GetProviderSchemaResponse returns the *tfprotov5.GetProviderSchemaResponse equivalent of a *fwserver.GetProviderSchemaResponse.
func ImportResourceStateResponse ¶
func ImportResourceStateResponse(ctx context.Context, fw *fwserver.ImportResourceStateResponse) *tfprotov5.ImportResourceStateResponse
ImportResourceStateResponse returns the *tfprotov5.ImportResourceStateResponse equivalent of a *fwserver.ImportResourceStateResponse.
func ImportedResource ¶
func ImportedResource(ctx context.Context, fw *fwserver.ImportedResource) (*tfprotov5.ImportedResource, diag.Diagnostics)
ImportedResource returns the *tfprotov5.ImportedResource equivalent of a *fwserver.ImportedResource.
func MoveResourceStateResponse ¶ added in v1.6.0
func MoveResourceStateResponse(ctx context.Context, fw *fwserver.MoveResourceStateResponse) *tfprotov5.MoveResourceStateResponse
MoveResourceStateResponse returns the *tfprotov5.MoveResourceStateResponse equivalent of a *fwserver.MoveResourceStateResponse.
func OpenEphemeralResourceResponse ¶ added in v1.13.0
func OpenEphemeralResourceResponse(ctx context.Context, fw *fwserver.OpenEphemeralResourceResponse) *tfprotov5.OpenEphemeralResourceResponse
OpenEphemeralResourceResponse returns the *tfprotov5.OpenEphemeralResourceResponse equivalent of a *fwserver.OpenEphemeralResourceResponse.
func PlanResourceChangeResponse ¶
func PlanResourceChangeResponse(ctx context.Context, fw *fwserver.PlanResourceChangeResponse) *tfprotov5.PlanResourceChangeResponse
PlanResourceChangeResponse returns the *tfprotov5.PlanResourceChangeResponse equivalent of a *fwserver.PlanResourceChangeResponse.
func PrepareProviderConfigResponse ¶
func PrepareProviderConfigResponse(ctx context.Context, fw *fwserver.ValidateProviderConfigResponse) *tfprotov5.PrepareProviderConfigResponse
PrepareProviderConfigResponse returns the *tfprotov5.PrepareProviderConfigResponse equivalent of a *fwserver.ValidateProviderConfigResponse.
func ReadDataSourceResponse ¶
func ReadDataSourceResponse(ctx context.Context, fw *fwserver.ReadDataSourceResponse) *tfprotov5.ReadDataSourceResponse
ReadDataSourceResponse returns the *tfprotov5.ReadDataSourceResponse equivalent of a *fwserver.ReadDataSourceResponse.
func ReadResourceResponse ¶
func ReadResourceResponse(ctx context.Context, fw *fwserver.ReadResourceResponse) *tfprotov5.ReadResourceResponse
ReadResourceResponse returns the *tfprotov5.ReadResourceResponse equivalent of a *fwserver.ReadResourceResponse.
func RenewEphemeralResourceResponse ¶ added in v1.13.0
func RenewEphemeralResourceResponse(ctx context.Context, fw *fwserver.RenewEphemeralResourceResponse) *tfprotov5.RenewEphemeralResourceResponse
RenewEphemeralResourceResponse returns the *tfprotov5.RenewEphemeralResourceResponse equivalent of a *fwserver.RenewEphemeralResourceResponse.
func ResourceDeferred ¶ added in v1.9.0
func ResourceMetadata ¶ added in v1.4.0
func ResourceMetadata(ctx context.Context, fw fwserver.ResourceMetadata) tfprotov5.ResourceMetadata
ResourceMetadata returns the tfprotov5.ResourceMetadata for a fwserver.ResourceMetadata.
func SchemaAttribute ¶
func SchemaAttribute(ctx context.Context, name string, path *tftypes.AttributePath, a fwschema.Attribute) (*tfprotov5.SchemaAttribute, error)
SchemaAttribute returns the *tfprotov5.SchemaAttribute equivalent of an Attribute. Errors will be tftypes.AttributePathErrors based on `path`. `name` is the name of the attribute.
func ServerCapabilities ¶ added in v0.10.0
func ServerCapabilities(ctx context.Context, fw *fwserver.ServerCapabilities) *tfprotov5.ServerCapabilities
ServerCapabilities returns the *tfprotov5.ServerCapabilities for a *fwserver.ServerCapabilities.
func State ¶
func State(ctx context.Context, fw *tfsdk.State) (*tfprotov5.DynamicValue, diag.Diagnostics)
State returns the *tfprotov5.DynamicValue for a *tfsdk.State.
func UpgradeResourceStateResponse ¶
func UpgradeResourceStateResponse(ctx context.Context, fw *fwserver.UpgradeResourceStateResponse) *tfprotov5.UpgradeResourceStateResponse
UpgradeResourceStateResponse returns the *tfprotov5.UpgradeResourceStateResponse equivalent of a *fwserver.UpgradeResourceStateResponse.
func ValidateDataSourceConfigResponse ¶
func ValidateDataSourceConfigResponse(ctx context.Context, fw *fwserver.ValidateDataSourceConfigResponse) *tfprotov5.ValidateDataSourceConfigResponse
ValidateDataSourceConfigResponse returns the *tfprotov5.ValidateDataSourceConfigResponse equivalent of a *fwserver.ValidateDataSourceConfigResponse.
func ValidateEphemeralResourceConfigResponse ¶ added in v1.13.0
func ValidateEphemeralResourceConfigResponse(ctx context.Context, fw *fwserver.ValidateEphemeralResourceConfigResponse) *tfprotov5.ValidateEphemeralResourceConfigResponse
ValidateEphemeralResourceConfigResponse returns the *tfprotov5.ValidateEphemeralResourceConfigResponse equivalent of a *fwserver.ValidateEphemeralResourceConfigResponse.
func ValidateResourceTypeConfigResponse ¶
func ValidateResourceTypeConfigResponse(ctx context.Context, fw *fwserver.ValidateResourceConfigResponse) *tfprotov5.ValidateResourceTypeConfigResponse
ValidateResourceTypeConfigResponse returns the *tfprotov5.ValidateResourceTypeConfigResponse equivalent of a *fwserver.ValidateResourceConfigResponse.
Types ¶
This section is empty.
Source Files ¶
- applyresourcechange.go
- block.go
- callfunction.go
- closeephemeralresource.go
- config.go
- configureprovider.go
- datasourcemetadata.go
- deferred.go
- diagnostics.go
- doc.go
- dynamic_value.go
- ephemeral_result_data.go
- ephemeralresourcemetadata.go
- function.go
- function_errors.go
- getfunctions.go
- getmetadata.go
- getproviderschema.go
- importedresource.go
- importresourcestate.go
- moveresourcestate.go
- openephemeralresource.go
- planresourcechange.go
- prepareproviderconfig.go
- readdatasource.go
- readresource.go
- renewephemeralresource.go
- resourcemetadata.go
- schema.go
- schema_attribute.go
- server_capabilities.go
- state.go
- upgraderesourcestate.go
- validatedatasourceconfig.go
- validateephemeralresourceconfig.go
- validateresourcetypeconfig.go