fromproto5

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package fromproto5 contains functions to convert from protocol version 5 (tfprotov5) types to framework types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyResourceChangeRequest

func ApplyResourceChangeRequest(ctx context.Context, proto5 *tfprotov5.ApplyResourceChangeRequest, resource resource.Resource, resourceSchema fwschema.Schema, providerMetaSchema fwschema.Schema) (*fwserver.ApplyResourceChangeRequest, diag.Diagnostics)

ApplyResourceChangeRequest returns the *fwserver.ApplyResourceChangeRequest equivalent of a *tfprotov5.ApplyResourceChangeRequest.

func ArgumentsData added in v1.5.0

func ArgumentsData(ctx context.Context, arguments []*tfprotov5.DynamicValue, definition function.Definition) (function.ArgumentsData, diag.Diagnostics)

ArgumentsData returns the ArgumentsData for a given []*tfprotov5.DynamicValue and function.Definition.

func CallFunctionRequest added in v1.5.0

func CallFunctionRequest(ctx context.Context, proto *tfprotov5.CallFunctionRequest, function function.Function, functionDefinition function.Definition) (*fwserver.CallFunctionRequest, diag.Diagnostics)

CallFunctionRequest returns the *fwserver.CallFunctionRequest equivalent of a *tfprotov5.CallFunctionRequest.

func Config

func Config(ctx context.Context, proto5DynamicValue *tfprotov5.DynamicValue, schema fwschema.Schema) (*tfsdk.Config, diag.Diagnostics)

Config returns the *tfsdk.Config for a *tfprotov5.DynamicValue and fwschema.Schema.

func ConfigureProviderRequest

func ConfigureProviderRequest(ctx context.Context, proto5 *tfprotov5.ConfigureProviderRequest, providerSchema fwschema.Schema) (*provider.ConfigureRequest, diag.Diagnostics)

ConfigureProviderRequest returns the *fwserver.ConfigureProviderRequest equivalent of a *tfprotov5.ConfigureProviderRequest.

func DynamicValue added in v1.1.0

DynamicValue returns the fwschemadata.Data for a given *tfprotov5.DynamicValue.

If necessary, the underlying data is modified to convert list and set block values from an empty collection to a null 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 GetFunctionsRequest added in v1.5.0

func GetFunctionsRequest(ctx context.Context, proto *tfprotov5.GetFunctionsRequest) *fwserver.GetFunctionsRequest

GetFunctionsRequest returns the *fwserver.GetFunctionsRequest equivalent of a *tfprotov5.GetFunctionsRequest.

func GetMetadataRequest added in v1.4.0

func GetMetadataRequest(ctx context.Context, proto5 *tfprotov5.GetMetadataRequest) *fwserver.GetMetadataRequest

GetMetadataRequest returns the *fwserver.GetMetadataRequest equivalent of a *tfprotov5.GetMetadataRequest.

func GetProviderSchemaRequest

GetProviderSchemaRequest returns the *fwserver.GetProviderSchemaRequest equivalent of a *tfprotov5.GetProviderSchemaRequest.

func ImportResourceStateRequest

func ImportResourceStateRequest(ctx context.Context, proto5 *tfprotov5.ImportResourceStateRequest, resource resource.Resource, resourceSchema fwschema.Schema) (*fwserver.ImportResourceStateRequest, diag.Diagnostics)

ImportResourceStateRequest returns the *fwserver.ImportResourceStateRequest equivalent of a *tfprotov5.ImportResourceStateRequest.

func MoveResourceStateRequest added in v1.6.0

func MoveResourceStateRequest(ctx context.Context, proto5 *tfprotov5.MoveResourceStateRequest, resource resource.Resource, resourceSchema fwschema.Schema) (*fwserver.MoveResourceStateRequest, diag.Diagnostics)

MoveResourceStateRequest returns the *fwserver.MoveResourceStateRequest equivalent of a *tfprotov5.MoveResourceStateRequest.

func Plan

func Plan(ctx context.Context, proto5DynamicValue *tfprotov5.DynamicValue, schema fwschema.Schema) (*tfsdk.Plan, diag.Diagnostics)

Plan returns the *tfsdk.Plan for a *tfprotov5.DynamicValue and fwschema.Schema.

func PlanResourceChangeRequest

func PlanResourceChangeRequest(ctx context.Context, proto5 *tfprotov5.PlanResourceChangeRequest, resource resource.Resource, resourceSchema fwschema.Schema, providerMetaSchema fwschema.Schema) (*fwserver.PlanResourceChangeRequest, diag.Diagnostics)

PlanResourceChangeRequest returns the *fwserver.PlanResourceChangeRequest equivalent of a *tfprotov5.PlanResourceChangeRequest.

func PrepareProviderConfigRequest

func PrepareProviderConfigRequest(ctx context.Context, proto5 *tfprotov5.PrepareProviderConfigRequest, providerSchema fwschema.Schema) (*fwserver.ValidateProviderConfigRequest, diag.Diagnostics)

PrepareProviderConfigRequest returns the *fwserver.ValidateProviderConfigRequest equivalent of a *tfprotov5.PrepareProviderConfigRequest.

func ProviderMeta

func ProviderMeta(ctx context.Context, proto5DynamicValue *tfprotov5.DynamicValue, schema fwschema.Schema) (*tfsdk.Config, diag.Diagnostics)

ProviderMeta returns the *tfsdk.Config for a *tfprotov5.DynamicValue and fwschema.Schema. This data handling is different than Config to simplify implementors, in that:

  • Missing Schema will return nil, rather than an error
  • Missing DynamicValue will return nil typed Value, rather than an error

func ReadDataSourceRequest

func ReadDataSourceRequest(ctx context.Context, proto5 *tfprotov5.ReadDataSourceRequest, dataSource datasource.DataSource, dataSourceSchema fwschema.Schema, providerMetaSchema fwschema.Schema) (*fwserver.ReadDataSourceRequest, diag.Diagnostics)

ReadDataSourceRequest returns the *fwserver.ReadDataSourceRequest equivalent of a *tfprotov5.ReadDataSourceRequest.

func ReadResourceRequest

func ReadResourceRequest(ctx context.Context, proto5 *tfprotov5.ReadResourceRequest, resource resource.Resource, resourceSchema fwschema.Schema, providerMetaSchema fwschema.Schema) (*fwserver.ReadResourceRequest, diag.Diagnostics)

ReadResourceRequest returns the *fwserver.ReadResourceRequest equivalent of a *tfprotov5.ReadResourceRequest.

func State

func State(ctx context.Context, proto5DynamicValue *tfprotov5.DynamicValue, schema fwschema.Schema) (*tfsdk.State, diag.Diagnostics)

State returns the *tfsdk.State for a *tfprotov5.DynamicValue and fwschema.Schema.

func UpgradeResourceStateRequest

func UpgradeResourceStateRequest(ctx context.Context, proto5 *tfprotov5.UpgradeResourceStateRequest, resource resource.Resource, resourceSchema fwschema.Schema) (*fwserver.UpgradeResourceStateRequest, diag.Diagnostics)

UpgradeResourceStateRequest returns the *fwserver.UpgradeResourceStateRequest equivalent of a *tfprotov5.UpgradeResourceStateRequest.

func ValidateDataSourceConfigRequest

func ValidateDataSourceConfigRequest(ctx context.Context, proto5 *tfprotov5.ValidateDataSourceConfigRequest, dataSource datasource.DataSource, dataSourceSchema fwschema.Schema) (*fwserver.ValidateDataSourceConfigRequest, diag.Diagnostics)

ValidateDataSourceConfigRequest returns the *fwserver.ValidateDataSourceConfigRequest equivalent of a *tfprotov5.ValidateDataSourceConfigRequest.

func ValidateResourceTypeConfigRequest

func ValidateResourceTypeConfigRequest(ctx context.Context, proto5 *tfprotov5.ValidateResourceTypeConfigRequest, resource resource.Resource, resourceSchema fwschema.Schema) (*fwserver.ValidateResourceConfigRequest, diag.Diagnostics)

ValidateResourceTypeConfigRequest returns the *fwserver.ValidateResourceConfigRequest equivalent of a *tfprotov5.ValidateResourceTypeConfigRequest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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