codegen

package
v1.24.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter struct {
	CfResource   *cfschema.Resource
	IsDataSource bool
	Ui           cli.Ui
	Writer       io.Writer
}

func (Emitter) EmitRootPropertiesSchema

func (e Emitter) EmitRootPropertiesSchema(tfType string, attributeNameMap map[string]string) (Features, error)

EmitRootPropertiesSchema generates the Terraform Plugin SDK code for a CloudFormation root schema and emits the generated code to the emitter's Writer. Code features are returned. The root schema is the map of root property names to Attributes.

type Features

type Features struct {
	HasRequiredRootProperty       bool // At least one root property is required.
	HasUpdatableProperty          bool // At least one property can be updated.
	HasValidator                  bool // At least one validator.
	UsesFrameworkTypes            bool // Uses a type from the terraform-plugin-framework/types package.
	UsesFrameworkJSONTypes        bool // Uses a type from the terraform-plugin-framework-jsontypes/jsontypes package.
	UsesFrameworkTimeTypes        bool // Uses a type from the terraform-plugin-framework-timetypes/timetypes package.
	UsesInternalDefaultsPackage   bool // Uses a function from the internal/defaults package.
	UsesInternalValidatorsPackage bool // Uses a function from the internal/validators package.
	UsesRegexpInValidation        bool // Uses a type from the Go standard regexp package for attribute validation.

	FrameworkDefaultsPackages     []string // Package names for any terraform-plugin-framework/resource/schema default values. May contain duplicates.
	FrameworkPlanModifierPackages []string // Package names for any terraform-plugin-framework plan modifiers. May contain duplicates.
	FrameworkValidatorsPackages   []string // Package names for any terraform-plugin-framework-validators validators. May contain duplicates.
}

Features of the emitted code.

func (Features) LogicalOr added in v0.44.0

func (f Features) LogicalOr(features Features) Features

Jump to

Keyboard shortcuts

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