Documentation ¶
Overview ¶
Package toproto6 contains functions to convert from framework types to protocol version 6 (tfprotov6) types.
Index ¶
- func ApplyResourceChangeResponse(ctx context.Context, fw *fwserver.ApplyResourceChangeResponse) *tfprotov6.ApplyResourceChangeResponse
- func Block(ctx context.Context, name string, path *tftypes.AttributePath, ...) (*tfprotov6.SchemaNestedBlock, error)
- func Config(ctx context.Context, fw *tfsdk.Config) (*tfprotov6.DynamicValue, diag.Diagnostics)
- func ConfigureProviderResponse(ctx context.Context, fw *provider.ConfigureResponse) *tfprotov6.ConfigureProviderResponse
- func DiagnosticSeverity(s diag.Severity) tfprotov6.DiagnosticSeverity
- func Diagnostics(ctx context.Context, diagnostics diag.Diagnostics) []*tfprotov6.Diagnostic
- func DynamicValue(ctx context.Context, data *fwschemadata.Data) (*tfprotov6.DynamicValue, diag.Diagnostics)
- func GetProviderSchemaResponse(ctx context.Context, fw *fwserver.GetProviderSchemaResponse) *tfprotov6.GetProviderSchemaResponse
- func ImportResourceStateResponse(ctx context.Context, fw *fwserver.ImportResourceStateResponse) *tfprotov6.ImportResourceStateResponse
- func ImportedResource(ctx context.Context, fw *fwserver.ImportedResource) (*tfprotov6.ImportedResource, diag.Diagnostics)
- func PlanResourceChangeResponse(ctx context.Context, fw *fwserver.PlanResourceChangeResponse) *tfprotov6.PlanResourceChangeResponse
- func ReadDataSourceResponse(ctx context.Context, fw *fwserver.ReadDataSourceResponse) *tfprotov6.ReadDataSourceResponse
- func ReadResourceResponse(ctx context.Context, fw *fwserver.ReadResourceResponse) *tfprotov6.ReadResourceResponse
- func Schema(ctx context.Context, s fwschema.Schema) (*tfprotov6.Schema, error)
- func SchemaAttribute(ctx context.Context, name string, path *tftypes.AttributePath, ...) (*tfprotov6.SchemaAttribute, error)
- func ServerCapabilities(ctx context.Context, fw *fwserver.ServerCapabilities) *tfprotov6.ServerCapabilities
- func State(ctx context.Context, fw *tfsdk.State) (*tfprotov6.DynamicValue, diag.Diagnostics)
- func UpgradeResourceStateResponse(ctx context.Context, fw *fwserver.UpgradeResourceStateResponse) *tfprotov6.UpgradeResourceStateResponse
- func ValidateDataSourceConfigResponse(ctx context.Context, fw *fwserver.ValidateDataSourceConfigResponse) *tfprotov6.ValidateDataResourceConfigResponse
- func ValidateProviderConfigResponse(ctx context.Context, fw *fwserver.ValidateProviderConfigResponse) *tfprotov6.ValidateProviderConfigResponse
- func ValidateResourceConfigResponse(ctx context.Context, fw *fwserver.ValidateResourceConfigResponse) *tfprotov6.ValidateResourceConfigResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyResourceChangeResponse ¶ added in v0.9.0
func ApplyResourceChangeResponse(ctx context.Context, fw *fwserver.ApplyResourceChangeResponse) *tfprotov6.ApplyResourceChangeResponse
ApplyResourceChangeResponse returns the *tfprotov6.ApplyResourceChangeResponse equivalent of a *fwserver.ApplyResourceChangeResponse.
func Block ¶
func Block(ctx context.Context, name string, path *tftypes.AttributePath, b fwschema.Block) (*tfprotov6.SchemaNestedBlock, error)
Block returns the *tfprotov6.SchemaNestedBlock equivalent of a Block. Errors will be tftypes.AttributePathErrors based on `path`. `name` is the name of the attribute.
func Config ¶ added in v0.9.0
func Config(ctx context.Context, fw *tfsdk.Config) (*tfprotov6.DynamicValue, diag.Diagnostics)
Config returns the *tfprotov6.DynamicValue for a *tfsdk.Config.
func ConfigureProviderResponse ¶ added in v0.9.0
func ConfigureProviderResponse(ctx context.Context, fw *provider.ConfigureResponse) *tfprotov6.ConfigureProviderResponse
ConfigureProviderResponse returns the *tfprotov6.ConfigureProviderResponse equivalent of a *fwserver.ConfigureProviderResponse.
func DiagnosticSeverity ¶ added in v0.9.0
func DiagnosticSeverity(s diag.Severity) tfprotov6.DiagnosticSeverity
DiagnosticSeverity converts diag.Severity into tfprotov6.DiagnosticSeverity.
func Diagnostics ¶
func Diagnostics(ctx context.Context, diagnostics diag.Diagnostics) []*tfprotov6.Diagnostic
Diagnostics converts the diagnostics into the tfprotov6 collection type.
func DynamicValue ¶ added in v1.1.0
func DynamicValue(ctx context.Context, data *fwschemadata.Data) (*tfprotov6.DynamicValue, diag.Diagnostics)
DynamicValue returns the *tfprotov6.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 GetProviderSchemaResponse ¶
func GetProviderSchemaResponse(ctx context.Context, fw *fwserver.GetProviderSchemaResponse) *tfprotov6.GetProviderSchemaResponse
GetProviderSchemaResponse returns the *tfprotov6.GetProviderSchemaResponse equivalent of a *fwserver.GetProviderSchemaResponse.
func ImportResourceStateResponse ¶ added in v0.9.0
func ImportResourceStateResponse(ctx context.Context, fw *fwserver.ImportResourceStateResponse) *tfprotov6.ImportResourceStateResponse
ImportResourceStateResponse returns the *tfprotov6.ImportResourceStateResponse equivalent of a *fwserver.ImportResourceStateResponse.
func ImportedResource ¶ added in v0.9.0
func ImportedResource(ctx context.Context, fw *fwserver.ImportedResource) (*tfprotov6.ImportedResource, diag.Diagnostics)
ImportedResource returns the *tfprotov6.ImportedResource equivalent of a *fwserver.ImportedResource.
func PlanResourceChangeResponse ¶ added in v0.9.0
func PlanResourceChangeResponse(ctx context.Context, fw *fwserver.PlanResourceChangeResponse) *tfprotov6.PlanResourceChangeResponse
PlanResourceChangeResponse returns the *tfprotov6.PlanResourceChangeResponse equivalent of a *fwserver.PlanResourceChangeResponse.
func ReadDataSourceResponse ¶ added in v0.9.0
func ReadDataSourceResponse(ctx context.Context, fw *fwserver.ReadDataSourceResponse) *tfprotov6.ReadDataSourceResponse
ReadDataSourceResponse returns the *tfprotov6.ReadDataSourceResponse equivalent of a *fwserver.ReadDataSourceResponse.
func ReadResourceResponse ¶ added in v0.9.0
func ReadResourceResponse(ctx context.Context, fw *fwserver.ReadResourceResponse) *tfprotov6.ReadResourceResponse
ReadResourceResponse returns the *tfprotov6.ReadResourceResponse equivalent of a *fwserver.ReadResourceResponse.
func SchemaAttribute ¶
func SchemaAttribute(ctx context.Context, name string, path *tftypes.AttributePath, a fwschema.Attribute) (*tfprotov6.SchemaAttribute, error)
SchemaAttribute returns the *tfprotov6.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) *tfprotov6.ServerCapabilities
ServerCapabilities returns the *tfprotov6.ServerCapabilities for a *fwserver.ServerCapabilities.
func State ¶ added in v0.9.0
func State(ctx context.Context, fw *tfsdk.State) (*tfprotov6.DynamicValue, diag.Diagnostics)
State returns the *tfprotov6.DynamicValue for a *tfsdk.State.
func UpgradeResourceStateResponse ¶ added in v0.9.0
func UpgradeResourceStateResponse(ctx context.Context, fw *fwserver.UpgradeResourceStateResponse) *tfprotov6.UpgradeResourceStateResponse
UpgradeResourceStateResponse returns the *tfprotov6.UpgradeResourceStateResponse equivalent of a *fwserver.UpgradeResourceStateResponse.
func ValidateDataSourceConfigResponse ¶ added in v0.9.0
func ValidateDataSourceConfigResponse(ctx context.Context, fw *fwserver.ValidateDataSourceConfigResponse) *tfprotov6.ValidateDataResourceConfigResponse
ValidateDataSourceConfigResponse returns the *tfprotov6.ValidateDataSourceConfigResponse equivalent of a *fwserver.ValidateDataSourceConfigResponse.
func ValidateProviderConfigResponse ¶ added in v0.9.0
func ValidateProviderConfigResponse(ctx context.Context, fw *fwserver.ValidateProviderConfigResponse) *tfprotov6.ValidateProviderConfigResponse
ValidateProviderConfigResponse returns the *tfprotov6.ValidateProviderConfigResponse equivalent of a *fwserver.ValidateProviderConfigResponse.
func ValidateResourceConfigResponse ¶ added in v0.9.0
func ValidateResourceConfigResponse(ctx context.Context, fw *fwserver.ValidateResourceConfigResponse) *tfprotov6.ValidateResourceConfigResponse
ValidateResourceConfigResponse returns the *tfprotov6.ValidateResourceConfigResponse equivalent of a *fwserver.ValidateResourceConfigResponse.
Types ¶
This section is empty.
Source Files ¶
- applyresourcechange.go
- block.go
- config.go
- configureprovider.go
- diagnostics.go
- doc.go
- dynamic_value.go
- getproviderschema.go
- importedresource.go
- importresourcestate.go
- planresourcechange.go
- readdatasource.go
- readresource.go
- schema.go
- schema_attribute.go
- server_capabilities.go
- state.go
- upgraderesourcestate.go
- validatedatasourceconfig.go
- validateproviderconfig.go
- validateresourceconfig.go