This repository contains the custom types for the Terraform Plugin Framework.
Why supertypes?
The supertypes are custom types that are used to extend the functionality of the Terraform Plugin Framework. They are used to define the custom types that are used in the Terraform Plugin Framework.
Custom types available in the supertypes:
- Simple types
StringType- A custom type that is used to define the string type.Int32Type- A custom type that is used to define the integer type.Int64Type- A custom type that is used to define the integer type.NumberType- A custom type that is used to define the number type.BoolType- A custom type that is used to define the boolean type.Float32Type- A custom type that is used to define the float type.Float64Type- A custom type that is used to define the float type.
- Array types
MapType- A custom type that is used to define the map type.ListType- A custom type that is used to define the list type.SetType- A custom type that is used to define the set type.MapTypeOf- A custom type that is used to define the map type. This type use golang generics to construct automatically the map.ListTypeOf- A custom type that is used to define the list type. This type use golang generics to construct automatically the list.SetTypeOf- A custom type that is used to define the set type. This type use golang generics to construct automatically the set.
- Object types
SingleNestedObjectTypeOf- A custom type that is used to define the nested object value of the single type. This type use golang generics to construct automatically the nested object.
- Object array types
MapNestedType- A custom type that is used to define the nested map type.ListNestedType- A custom type that is used to define the nested list type.SetNestedType- A custom type that is used to define the nested set type.MapNestedObjectTypeOf- A custom type that is used to define the nested object value of the map type. This type use golang generics to construct automatically the nested object.ListNestedObjectTypeOf- A custom type that is used to define the nested object value of the list type. This type use golang generics to construct automatically the nested object.SetNestedObjectTypeOf- A custom type that is used to define the nested object value of the set type. This type use golang generics to construct automatically the nested object.
Principal methods available for each custom type:
Get()- A function that is used to get the value.GetPtr()- A function that is used to get the value as a pointer.Set()- A function that is used to set the value.SetPtr()- A function that is used to set the value as a pointer.SetNull()- A function that is used to set the value to null.SetUnknown()- A function that is used to set the value to unknown.IsKnown()- A function that is used to check if the value is known.
Special methods available for the Int32Type and Int64Type:
SetInt()- A function that is used to setintinto the type (int32orint64).SetInt8()- A function that is used to setint8into the type (int32orint64).SetInt16()- A function that is used to setint16into the type (int32orint64).SetInt32()- A function that is used to setint32into the type (int32orint64).SetInt64()- A function that is used to setint64into the type (int32orint64).SetIntPtr()- A function that is used to setintpointer into the type (int32orint64).SetInt8Ptr()- A function that is used to setint8pointer into the type (int32orint64).SetInt16Ptr()- A function that is used to setint16pointer into the type (int32orint64).SetInt32Ptr()- A function that is used to setint32pointer into the type (int32orint64).SetInt64Ptr()- A function that is used to setint64pointer into the type (int32orint64).GetInt()- A function that is used to get the value as anint.GetInt8()- A function that is used to get the value as anint8.GetInt16()- A function that is used to get the value as anint16.GetInt32()- A function that is used to get the value as anint32.GetInt64()- A function that is used to get the value as anint64.GetIntPtr()- A function that is used to get the value as anintpointer.GetInt8Ptr()- A function that is used to get the value as anint8pointer.GetInt16Ptr()- A function that is used to get the value as anint16pointer.GetInt32Ptr()- A function that is used to get the value as anint32pointer.GetInt64Ptr()- A function that is used to get the value as anint64pointer.
Special methods available for the all *TypeOf types:
MustGet(context.Context)- A function that is used to get the value. If the value get return an error, the function panic.DiagsGet(context.Context, diag.Diagnostics)- A function that is used to get the value. If the value get return an error, the function add the error to the diagnostics.MustSet(context.Context, T)- A function that is used to set the value. If the value set return an error, the function panic.DiagsSet(context.Context, diag.Diagnostics, T)- A function that is used to set the value. If the value set return an error, the function add the error to the diagnostics.
For installing the supertypes, you can use the go get command:
go get github.com/orange-cloudavenue/terraform-plugin-framework-supertypes@latestdocumentation is in progress.