apitypes

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIType

type APIType interface {
	// TFModelType returns the name of the corresponding type in the
	// terraform-provider-userclouds/types package, used for in-memory storage
	TFModelType() string
	// TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this
	// object in the Terraform schema.
	TFSchemaAttributeType() string
	// TFSchemaAttributeText generates the declaration for an attribute storing
	// this type in a Terraform schema
	TFSchemaAttributeText(extraFields map[string]string) string
	// JSONClientModelType returns the name of the type for use with
	// userclouds/jsonclient (most likely simple Go native types)
	JSONClientModelType() string
	// TFModelToJSONClientFunc should return the text of a function with
	// signature "func (val *TFModelType) (*JSONClientModelType, error)"
	TFModelToJSONClientFunc() string
	// TFModelToJSONClientFunc should return the text of a function with
	// signature "func (val *JSONClientModelType) (TFModelType, error)"
	JSONClientModelToTFFunc() string
	// GetTFPlanModifierType returns the name of the
	// terraform-plugin-framework/resource/schema/planmodifier type for this API
	// type (e.g. String, Int64, etc.)
	GetTFPlanModifierType() string
	// GetTFPlanModifierPackageName returns the name of the package
	// (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the
	// plan modifiers for this type
	GetTFPlanModifierPackageName() string
}

APIType represents a type for use with the UserClouds API. It contains methods to simplify mapping between various Terraform types and Go types.

type Array

type Array struct {
	Schema    *openapi3.Schema
	ChildType APIType
}

Array represents an array of a single type.

func (*Array) GetTFPlanModifierPackageName added in v0.1.4

func (t *Array) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Array) GetTFPlanModifierType added in v0.1.4

func (t *Array) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Array) JSONClientModelToTFFunc

func (t *Array) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Array) JSONClientModelType

func (t *Array) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Array) TFModelToJSONClientFunc

func (t *Array) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Array) TFModelType

func (t *Array) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Array) TFSchemaAttributeText

func (t *Array) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Array) TFSchemaAttributeType

func (t *Array) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type Bool

type Bool struct {
	Schema *openapi3.Schema
}

Bool represents a boolean value.

func (*Bool) GetTFPlanModifierPackageName added in v0.1.4

func (t *Bool) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Bool) GetTFPlanModifierType added in v0.1.4

func (t *Bool) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Bool) JSONClientModelToTFFunc

func (t *Bool) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Bool) JSONClientModelType

func (t *Bool) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Bool) TFModelToJSONClientFunc

func (t *Bool) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Bool) TFModelType

func (t *Bool) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Bool) TFSchemaAttributeText

func (t *Bool) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Bool) TFSchemaAttributeType

func (t *Bool) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type Float

type Float struct {
	Schema *openapi3.Schema
}

Float represents a float value.

func (*Float) GetTFPlanModifierPackageName added in v0.1.4

func (t *Float) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Float) GetTFPlanModifierType added in v0.1.4

func (t *Float) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Float) JSONClientModelToTFFunc

func (t *Float) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Float) JSONClientModelType

func (t *Float) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Float) TFModelToJSONClientFunc

func (t *Float) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Float) TFModelType

func (t *Float) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Float) TFSchemaAttributeText

func (t *Float) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Float) TFSchemaAttributeType

func (t *Float) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type Int

type Int struct {
	Schema *openapi3.Schema
}

Int represents an integer value.

func (*Int) GetTFPlanModifierPackageName added in v0.1.4

func (t *Int) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Int) GetTFPlanModifierType added in v0.1.4

func (t *Int) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Int) JSONClientModelToTFFunc

func (t *Int) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Int) JSONClientModelType

func (t *Int) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Int) TFModelToJSONClientFunc

func (t *Int) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Int) TFModelType

func (t *Int) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Int) TFSchemaAttributeText

func (t *Int) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Int) TFSchemaAttributeType

func (t *Int) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type Map

type Map struct {
	Schema    *openapi3.Schema
	ValueType APIType
}

Map represents a map from string to ValueType.

func (*Map) GetTFPlanModifierPackageName added in v0.1.4

func (t *Map) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Map) GetTFPlanModifierType added in v0.1.4

func (t *Map) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Map) JSONClientModelToTFFunc

func (t *Map) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Map) JSONClientModelType

func (t *Map) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Map) TFModelToJSONClientFunc

func (t *Map) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Map) TFModelType

func (t *Map) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Map) TFSchemaAttributeText

func (t *Map) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Map) TFSchemaAttributeType

func (t *Map) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type Object

type Object struct {
	Schema *openapi3.Schema
	// We store the object properties in structs generated by schemas.go. We
	// need to reference those structs in the code generated here
	TFModelStructName         string
	TFSchemaAttrTypeMapName   string
	TFSchemaAttributesMapName string
	JSONClientModelStructName string
	// We also generate functions in schemas.go that iterate over the object
	// properties in order to convert between model types
	TFModelToJSONClientFuncName string
	JSONClientModelToTFFuncName string
}

Object represents an object with known property types.

func (*Object) GetTFPlanModifierPackageName added in v0.1.4

func (t *Object) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*Object) GetTFPlanModifierType added in v0.1.4

func (t *Object) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*Object) JSONClientModelToTFFunc

func (t *Object) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*Object) JSONClientModelType

func (t *Object) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*Object) TFModelToJSONClientFunc

func (t *Object) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*Object) TFModelType

func (t *Object) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*Object) TFSchemaAttributeText

func (t *Object) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*Object) TFSchemaAttributeType

func (t *Object) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type String

type String struct {
	Schema *openapi3.Schema
}

String represents a string value.

func (*String) GetTFPlanModifierPackageName added in v0.1.4

func (t *String) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*String) GetTFPlanModifierType added in v0.1.4

func (t *String) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*String) JSONClientModelToTFFunc

func (t *String) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*String) JSONClientModelType

func (t *String) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*String) TFModelToJSONClientFunc

func (t *String) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*String) TFModelType

func (t *String) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*String) TFSchemaAttributeText

func (t *String) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*String) TFSchemaAttributeType

func (t *String) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type StringEnum

type StringEnum struct {
	Schema *openapi3.Schema
	Values []string
}

StringEnum represents an enum of strings.

func (*StringEnum) GetTFPlanModifierPackageName added in v0.1.4

func (t *StringEnum) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*StringEnum) GetTFPlanModifierType added in v0.1.4

func (t *StringEnum) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*StringEnum) JSONClientModelToTFFunc

func (t *StringEnum) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*StringEnum) JSONClientModelType

func (t *StringEnum) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*StringEnum) TFModelToJSONClientFunc

func (t *StringEnum) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*StringEnum) TFModelType

func (t *StringEnum) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*StringEnum) TFSchemaAttributeText

func (t *StringEnum) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*StringEnum) TFSchemaAttributeType

func (t *StringEnum) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type UUID

type UUID struct {
	Schema *openapi3.Schema
}

UUID represents a UUID string.

func (*UUID) GetTFPlanModifierPackageName added in v0.1.4

func (t *UUID) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*UUID) GetTFPlanModifierType added in v0.1.4

func (t *UUID) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*UUID) JSONClientModelToTFFunc

func (t *UUID) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*UUID) JSONClientModelType

func (t *UUID) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*UUID) TFModelToJSONClientFunc

func (t *UUID) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*UUID) TFModelType

func (t *UUID) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*UUID) TFSchemaAttributeText

func (t *UUID) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*UUID) TFSchemaAttributeType

func (t *UUID) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

type UserstoreResourceID

type UserstoreResourceID struct {
	Schema *openapi3.Schema
	// JSONClientModelStructName is the name of the codegen'ed struct that stores a
	// userstore.ResourceID value for use in sending/receiving API requests/responses
	JSONClientModelStructName string
}

UserstoreResourceID represents a "userstore.ResourceID" struct. This struct has an ID field and a Name field, where only one field is required, so that customers making API requests can use either the UUID or the Name to refer to a resource. However, in Terraform, we want to drop the Name field, since the Name field is not guaranteed to be stable. If we include Name in Terraform state, then e.g. if someone were to change a column name, they would get diffs everywhere that references that column, even though those other resources did not change.

func (*UserstoreResourceID) GetTFPlanModifierPackageName added in v0.1.4

func (t *UserstoreResourceID) GetTFPlanModifierPackageName() string

GetTFPlanModifierPackageName returns the name of the package (terraform-plugin-framework/resource/schema/RETURNVALUE) containing the plan modifiers for this type

func (*UserstoreResourceID) GetTFPlanModifierType added in v0.1.4

func (t *UserstoreResourceID) GetTFPlanModifierType() string

GetTFPlanModifierType returns the name of the terraform-plugin-framework/resource/schema/planmodifier type for this API type (e.g. String, Int64, etc.)

func (*UserstoreResourceID) JSONClientModelToTFFunc

func (t *UserstoreResourceID) JSONClientModelToTFFunc() string

JSONClientModelToTFFunc returns the text of a function for converting a jsonclient model struct to a Terraform model struct.

func (*UserstoreResourceID) JSONClientModelType

func (t *UserstoreResourceID) JSONClientModelType() string

JSONClientModelType returns the type that should be used to represent this type in a jsonclient request/response struct.

func (*UserstoreResourceID) TFModelToJSONClientFunc

func (t *UserstoreResourceID) TFModelToJSONClientFunc() string

TFModelToJSONClientFunc returns the text of a function for converting a Terraform model struct to a jsonclient model struct.

func (*UserstoreResourceID) TFModelType

func (t *UserstoreResourceID) TFModelType() string

TFModelType returns the type that should be used to represent this type in a Terraform model.

func (*UserstoreResourceID) TFSchemaAttributeText

func (t *UserstoreResourceID) TFSchemaAttributeText(extraFields map[string]string) string

TFSchemaAttributeText returns the text of the code for instantiating this type as a Terraform schema attribute.

func (*UserstoreResourceID) TFSchemaAttributeType

func (t *UserstoreResourceID) TFSchemaAttributeType() string

TFSchemaAttributeType returns an attr.Type, which is a struct representing the type of this object in the Terraform schema.

Jump to

Keyboard shortcuts

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