attrmapper

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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). This intermediate step enables merging of attributes, overriding of specific properties, and converting into a provider code spec type to be marshalled to JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyComputedOptionalRequiredOverride

func ApplyComputedOptionalRequiredOverride(value string) (schema.ComputedOptionalRequired, error)

Types

type DataSourceAttribute

type DataSourceAttribute interface {
	GetName() string
	Merge(DataSourceAttribute) (DataSourceAttribute, error)
	ApplyOverride(explorer.Override) (DataSourceAttribute, error)
	ToSpec() datasource.Attribute
}

type DataSourceAttributes

type DataSourceAttributes []DataSourceAttribute

func (DataSourceAttributes) ApplyOverride

func (attributes DataSourceAttributes) ApplyOverride(path []string, override explorer.Override) (DataSourceAttributes, error)

func (DataSourceAttributes) ApplyOverrides

func (attributes DataSourceAttributes) ApplyOverrides(overrideMap map[string]explorer.Override) (DataSourceAttributes, error)

func (DataSourceAttributes) Merge

func (targetSlice DataSourceAttributes) Merge(mergeSlices ...DataSourceAttributes) (DataSourceAttributes, error)

func (DataSourceAttributes) ToSpec

func (attributes DataSourceAttributes) ToSpec() []datasource.Attribute

type DataSourceBoolAttribute

type DataSourceBoolAttribute struct {
	datasource.BoolAttribute

	Name string
}

func (*DataSourceBoolAttribute) ApplyOverride

func (a *DataSourceBoolAttribute) ApplyOverride(override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceBoolAttribute) GetName

func (a *DataSourceBoolAttribute) GetName() string

func (*DataSourceBoolAttribute) Merge

func (*DataSourceBoolAttribute) ToSpec

type DataSourceFloat64Attribute

type DataSourceFloat64Attribute struct {
	datasource.Float64Attribute

	Name string
}

func (*DataSourceFloat64Attribute) ApplyOverride

func (*DataSourceFloat64Attribute) GetName

func (a *DataSourceFloat64Attribute) GetName() string

func (*DataSourceFloat64Attribute) Merge

func (*DataSourceFloat64Attribute) ToSpec

type DataSourceInt64Attribute

type DataSourceInt64Attribute struct {
	datasource.Int64Attribute

	Name string
}

func (*DataSourceInt64Attribute) ApplyOverride

func (a *DataSourceInt64Attribute) ApplyOverride(override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceInt64Attribute) GetName

func (a *DataSourceInt64Attribute) GetName() string

func (*DataSourceInt64Attribute) Merge

func (*DataSourceInt64Attribute) ToSpec

type DataSourceListAttribute

type DataSourceListAttribute struct {
	datasource.ListAttribute

	Name string
}

func (*DataSourceListAttribute) ApplyOverride

func (a *DataSourceListAttribute) ApplyOverride(override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceListAttribute) GetName

func (a *DataSourceListAttribute) GetName() string

func (*DataSourceListAttribute) Merge

func (*DataSourceListAttribute) ToSpec

type DataSourceListNestedAttribute

type DataSourceListNestedAttribute struct {
	datasource.ListNestedAttribute

	Name         string
	NestedObject DataSourceNestedAttributeObject
}

func (*DataSourceListNestedAttribute) ApplyNestedOverride

func (a *DataSourceListNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceListNestedAttribute) ApplyOverride

func (*DataSourceListNestedAttribute) GetName

func (*DataSourceListNestedAttribute) Merge

func (*DataSourceListNestedAttribute) ToSpec

type DataSourceMapAttribute

type DataSourceMapAttribute struct {
	datasource.MapAttribute

	Name string
}

func (*DataSourceMapAttribute) ApplyOverride

func (a *DataSourceMapAttribute) ApplyOverride(override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceMapAttribute) GetName

func (a *DataSourceMapAttribute) GetName() string

func (*DataSourceMapAttribute) Merge

func (*DataSourceMapAttribute) ToSpec

type DataSourceMapNestedAttribute

type DataSourceMapNestedAttribute struct {
	datasource.MapNestedAttribute

	Name         string
	NestedObject DataSourceNestedAttributeObject
}

func (*DataSourceMapNestedAttribute) ApplyNestedOverride

func (a *DataSourceMapNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceMapNestedAttribute) ApplyOverride

func (*DataSourceMapNestedAttribute) GetName

func (a *DataSourceMapNestedAttribute) GetName() string

func (*DataSourceMapNestedAttribute) Merge

func (*DataSourceMapNestedAttribute) ToSpec

type DataSourceNestedAttribute

type DataSourceNestedAttribute interface {
	ApplyNestedOverride([]string, explorer.Override) (DataSourceAttribute, error)
}

type DataSourceNestedAttributeObject

type DataSourceNestedAttributeObject struct {
	Attributes DataSourceAttributes
}

type DataSourceNumberAttribute

type DataSourceNumberAttribute struct {
	datasource.NumberAttribute

	Name string
}

func (*DataSourceNumberAttribute) ApplyOverride

func (*DataSourceNumberAttribute) GetName

func (a *DataSourceNumberAttribute) GetName() string

func (*DataSourceNumberAttribute) Merge

func (*DataSourceNumberAttribute) ToSpec

type DataSourceSetAttribute

type DataSourceSetAttribute struct {
	datasource.SetAttribute

	Name string
}

func (*DataSourceSetAttribute) ApplyOverride

func (a *DataSourceSetAttribute) ApplyOverride(override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceSetAttribute) GetName

func (a *DataSourceSetAttribute) GetName() string

func (*DataSourceSetAttribute) Merge

func (*DataSourceSetAttribute) ToSpec

type DataSourceSetNestedAttribute

type DataSourceSetNestedAttribute struct {
	datasource.SetNestedAttribute

	Name         string
	NestedObject DataSourceNestedAttributeObject
}

func (*DataSourceSetNestedAttribute) ApplyNestedOverride

func (a *DataSourceSetNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceSetNestedAttribute) ApplyOverride

func (*DataSourceSetNestedAttribute) GetName

func (a *DataSourceSetNestedAttribute) GetName() string

func (*DataSourceSetNestedAttribute) Merge

func (*DataSourceSetNestedAttribute) ToSpec

type DataSourceSingleNestedAttribute

type DataSourceSingleNestedAttribute struct {
	datasource.SingleNestedAttribute

	Name       string
	Attributes DataSourceAttributes
}

func (*DataSourceSingleNestedAttribute) ApplyNestedOverride

func (a *DataSourceSingleNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (DataSourceAttribute, error)

func (*DataSourceSingleNestedAttribute) ApplyOverride

func (*DataSourceSingleNestedAttribute) GetName

func (*DataSourceSingleNestedAttribute) Merge

func (*DataSourceSingleNestedAttribute) ToSpec

type DataSourceStringAttribute

type DataSourceStringAttribute struct {
	datasource.StringAttribute

	Name string
}

func (*DataSourceStringAttribute) ApplyOverride

func (*DataSourceStringAttribute) GetName

func (a *DataSourceStringAttribute) GetName() string

func (*DataSourceStringAttribute) Merge

func (*DataSourceStringAttribute) ToSpec

type ProviderAttribute

type ProviderAttribute interface {
	ToSpec() provider.Attribute
}

type ProviderAttributes

type ProviderAttributes []ProviderAttribute

func (ProviderAttributes) ToSpec

func (attributes ProviderAttributes) ToSpec() []provider.Attribute

type ProviderBoolAttribute

type ProviderBoolAttribute struct {
	provider.BoolAttribute

	Name string
}

func (*ProviderBoolAttribute) ToSpec

type ProviderFloat64Attribute

type ProviderFloat64Attribute struct {
	provider.Float64Attribute

	Name string
}

func (*ProviderFloat64Attribute) ToSpec

type ProviderInt64Attribute

type ProviderInt64Attribute struct {
	provider.Int64Attribute

	Name string
}

func (*ProviderInt64Attribute) ToSpec

type ProviderListAttribute

type ProviderListAttribute struct {
	provider.ListAttribute

	Name string
}

func (*ProviderListAttribute) ToSpec

type ProviderListNestedAttribute

type ProviderListNestedAttribute struct {
	provider.ListNestedAttribute

	Name         string
	NestedObject ProviderNestedAttributeObject
}

func (*ProviderListNestedAttribute) ToSpec

type ProviderMapAttribute

type ProviderMapAttribute struct {
	provider.MapAttribute

	Name string
}

func (*ProviderMapAttribute) ToSpec

type ProviderMapNestedAttribute

type ProviderMapNestedAttribute struct {
	provider.MapNestedAttribute

	Name         string
	NestedObject ProviderNestedAttributeObject
}

func (*ProviderMapNestedAttribute) ToSpec

type ProviderNestedAttributeObject

type ProviderNestedAttributeObject struct {
	Attributes ProviderAttributes
}

type ProviderNumberAttribute

type ProviderNumberAttribute struct {
	provider.NumberAttribute

	Name string
}

func (*ProviderNumberAttribute) ToSpec

type ProviderSetAttribute

type ProviderSetAttribute struct {
	provider.SetAttribute

	Name string
}

func (*ProviderSetAttribute) ToSpec

type ProviderSetNestedAttribute

type ProviderSetNestedAttribute struct {
	provider.SetNestedAttribute

	Name         string
	NestedObject ProviderNestedAttributeObject
}

func (*ProviderSetNestedAttribute) ToSpec

type ProviderSingleNestedAttribute

type ProviderSingleNestedAttribute struct {
	provider.SingleNestedAttribute

	Name       string
	Attributes ProviderAttributes
}

func (*ProviderSingleNestedAttribute) ToSpec

type ProviderStringAttribute

type ProviderStringAttribute struct {
	provider.StringAttribute

	Name string
}

func (*ProviderStringAttribute) ToSpec

type ResourceAttribute

type ResourceAttribute interface {
	GetName() string
	Merge(ResourceAttribute) (ResourceAttribute, error)
	ApplyOverride(explorer.Override) (ResourceAttribute, error)
	ToSpec() resource.Attribute
}

type ResourceAttributes

type ResourceAttributes []ResourceAttribute

func (ResourceAttributes) ApplyOverride

func (attributes ResourceAttributes) ApplyOverride(path []string, override explorer.Override) (ResourceAttributes, error)

func (ResourceAttributes) ApplyOverrides

func (attributes ResourceAttributes) ApplyOverrides(overrideMap map[string]explorer.Override) (ResourceAttributes, error)

func (ResourceAttributes) Merge

func (targetSlice ResourceAttributes) Merge(mergeSlices ...ResourceAttributes) (ResourceAttributes, error)

func (ResourceAttributes) ToSpec

func (attributes ResourceAttributes) ToSpec() []resource.Attribute

type ResourceBoolAttribute

type ResourceBoolAttribute struct {
	resource.BoolAttribute

	Name string
}

func (*ResourceBoolAttribute) ApplyOverride

func (a *ResourceBoolAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceBoolAttribute) GetName

func (a *ResourceBoolAttribute) GetName() string

func (*ResourceBoolAttribute) Merge

func (a *ResourceBoolAttribute) Merge(mergeAttribute ResourceAttribute) (ResourceAttribute, error)

func (*ResourceBoolAttribute) ToSpec

type ResourceFloat64Attribute

type ResourceFloat64Attribute struct {
	resource.Float64Attribute

	Name string
}

func (*ResourceFloat64Attribute) ApplyOverride

func (a *ResourceFloat64Attribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceFloat64Attribute) GetName

func (a *ResourceFloat64Attribute) GetName() string

func (*ResourceFloat64Attribute) Merge

func (*ResourceFloat64Attribute) ToSpec

type ResourceInt64Attribute

type ResourceInt64Attribute struct {
	resource.Int64Attribute

	Name string
}

func (*ResourceInt64Attribute) ApplyOverride

func (a *ResourceInt64Attribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceInt64Attribute) GetName

func (a *ResourceInt64Attribute) GetName() string

func (*ResourceInt64Attribute) Merge

func (*ResourceInt64Attribute) ToSpec

type ResourceListAttribute

type ResourceListAttribute struct {
	resource.ListAttribute

	Name string
}

func (*ResourceListAttribute) ApplyOverride

func (a *ResourceListAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceListAttribute) GetName

func (a *ResourceListAttribute) GetName() string

func (*ResourceListAttribute) Merge

func (a *ResourceListAttribute) Merge(mergeAttribute ResourceAttribute) (ResourceAttribute, error)

func (*ResourceListAttribute) ToSpec

type ResourceListNestedAttribute

type ResourceListNestedAttribute struct {
	resource.ListNestedAttribute

	Name         string
	NestedObject ResourceNestedAttributeObject
}

func (*ResourceListNestedAttribute) ApplyNestedOverride

func (a *ResourceListNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (ResourceAttribute, error)

func (*ResourceListNestedAttribute) ApplyOverride

func (*ResourceListNestedAttribute) GetName

func (a *ResourceListNestedAttribute) GetName() string

func (*ResourceListNestedAttribute) Merge

func (*ResourceListNestedAttribute) ToSpec

type ResourceMapAttribute

type ResourceMapAttribute struct {
	resource.MapAttribute

	Name string
}

func (*ResourceMapAttribute) ApplyOverride

func (a *ResourceMapAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceMapAttribute) GetName

func (a *ResourceMapAttribute) GetName() string

func (*ResourceMapAttribute) Merge

func (a *ResourceMapAttribute) Merge(mergeAttribute ResourceAttribute) (ResourceAttribute, error)

func (*ResourceMapAttribute) ToSpec

type ResourceMapNestedAttribute

type ResourceMapNestedAttribute struct {
	resource.MapNestedAttribute

	Name         string
	NestedObject ResourceNestedAttributeObject
}

func (*ResourceMapNestedAttribute) ApplyNestedOverride

func (a *ResourceMapNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (ResourceAttribute, error)

func (*ResourceMapNestedAttribute) ApplyOverride

func (a *ResourceMapNestedAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceMapNestedAttribute) GetName

func (a *ResourceMapNestedAttribute) GetName() string

func (*ResourceMapNestedAttribute) Merge

func (*ResourceMapNestedAttribute) ToSpec

type ResourceNestedAttribute

type ResourceNestedAttribute interface {
	ApplyNestedOverride([]string, explorer.Override) (ResourceAttribute, error)
}

type ResourceNestedAttributeObject

type ResourceNestedAttributeObject struct {
	Attributes ResourceAttributes
}

type ResourceNumberAttribute

type ResourceNumberAttribute struct {
	resource.NumberAttribute

	Name string
}

func (*ResourceNumberAttribute) ApplyOverride

func (a *ResourceNumberAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceNumberAttribute) GetName

func (a *ResourceNumberAttribute) GetName() string

func (*ResourceNumberAttribute) Merge

func (*ResourceNumberAttribute) ToSpec

type ResourceSetAttribute

type ResourceSetAttribute struct {
	resource.SetAttribute

	Name string
}

func (*ResourceSetAttribute) ApplyOverride

func (a *ResourceSetAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceSetAttribute) GetName

func (a *ResourceSetAttribute) GetName() string

func (*ResourceSetAttribute) Merge

func (a *ResourceSetAttribute) Merge(mergeAttribute ResourceAttribute) (ResourceAttribute, error)

func (*ResourceSetAttribute) ToSpec

type ResourceSetNestedAttribute

type ResourceSetNestedAttribute struct {
	resource.SetNestedAttribute

	Name         string
	NestedObject ResourceNestedAttributeObject
}

func (*ResourceSetNestedAttribute) ApplyNestedOverride

func (a *ResourceSetNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (ResourceAttribute, error)

func (*ResourceSetNestedAttribute) ApplyOverride

func (a *ResourceSetNestedAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceSetNestedAttribute) GetName

func (a *ResourceSetNestedAttribute) GetName() string

func (*ResourceSetNestedAttribute) Merge

func (*ResourceSetNestedAttribute) ToSpec

type ResourceSingleNestedAttribute

type ResourceSingleNestedAttribute struct {
	resource.SingleNestedAttribute

	Name       string
	Attributes ResourceAttributes
}

func (*ResourceSingleNestedAttribute) ApplyNestedOverride

func (a *ResourceSingleNestedAttribute) ApplyNestedOverride(path []string, override explorer.Override) (ResourceAttribute, error)

func (*ResourceSingleNestedAttribute) ApplyOverride

func (*ResourceSingleNestedAttribute) GetName

func (*ResourceSingleNestedAttribute) Merge

func (*ResourceSingleNestedAttribute) ToSpec

type ResourceStringAttribute

type ResourceStringAttribute struct {
	resource.StringAttribute

	Name string
}

func (*ResourceStringAttribute) ApplyOverride

func (a *ResourceStringAttribute) ApplyOverride(override explorer.Override) (ResourceAttribute, error)

func (*ResourceStringAttribute) GetName

func (a *ResourceStringAttribute) GetName() string

func (*ResourceStringAttribute) Merge

func (*ResourceStringAttribute) ToSpec

Jump to

Keyboard shortcuts

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