Documentation
¶
Index ¶
- func AWSRegionToMongoDBRegion(region string) string
- func AddJSONBodyErrorToDiagnostics(msgPrefix string, err error, diags *diag.Diagnostics)
- func AddLegacyDiags(diags *diag.Diagnostics, legacyDiags legacyDiag.Diagnostics)
- func CopyModel[T any](src any) *T
- func DataSourceSchemaFromResource(rs schema.Schema, req *DataSourceSchemaRequest) dsschema.Schema
- func DecodeStateID(stateID string) map[string]string
- func EncodeStateID(values map[string]string) string
- func ExpandStringList(list []any) (res []string)
- func ExpandStringListFromSetSchema(set *schema.Set) []string
- func ExpandTagsFromSetSchema(d *schema.ResourceData) *[]admin.ResourceTag
- func FlattenLinks(links []admin.Link) []map[string]string
- func FlattenTags(tags []admin.ResourceTag) []map[string]string
- func GetEncodedID(stateID, keyPosition string) string
- func HasElementsSliceOrMap(value any) bool
- func ImportSplit3(importRaw string) (ok bool, part1, part2, part3 string)
- func ImportStateProjectIDClusterName(ctx context.Context, req resource.ImportStateRequest, ...)
- func Int64PtrToIntPtr(i64 *int64) *int
- func IntPtr(v int) *int
- func IntPtrToInt64Ptr(i *int) *int64
- func IsStringPresent(strPtr *string) bool
- func MongoDBRegionToAWSRegion(region string) string
- func NewResourceTags(ctx context.Context, tags types.Map) *[]admin.ResourceTag
- func NewTFTags(tags []admin.ResourceTag) types.Map
- func NilForUnknown[T any](primitiveAttr TFPrimitiveType, value *T) *T
- func NilForUnknownOrEmptyString(primitiveAttr types.String) *string
- func PluralDataSourceSchemaFromResource(rs schema.Schema, req *PluralDataSourceSchemaRequest) dsschema.Schema
- func Pointer[T any](x T) *T
- func SafeString(s *string) string
- func SafeValue[T any](v *T) T
- func StringNullIfEmpty(v string) types.String
- func StringPtr(v string) *string
- func StringPtrNullIfEmpty(p *string) types.String
- func StringPtrToTimePtr(str *string) (*time.Time, bool)
- func StringToTime(str string) (time.Time, bool)
- func TimePtrToStringPtr(t *time.Time) *string
- func TimeToString(t time.Time) string
- func ToAnySlicePointer(value *[]map[string]any) *[]any
- func ToTFMapOfSlices(ctx context.Context, values map[string][]string) (basetypes.MapValue, diag.Diagnostics)
- func ToTFMapOfString(ctx context.Context, diags *diag.Diagnostics, values *map[string]string) basetypes.MapValue
- func TypesListToString(ctx context.Context, list types.List) []string
- func TypesSetToString(ctx context.Context, set types.Set) []string
- func UpdateAttr(attr any)
- func UpdateSchemaDescription[T schema.Schema | dsschema.Schema](s *T)
- func UseNilForEmpty(planTag, newTag types.Map) bool
- func ValRegion(reg any, opt ...string) (string, error)
- func ValidateClusterName(clusterName string) error
- func ValidateProjectID(projectID string) error
- type DataSourceSchemaRequest
- type ErrBody
- type PluralDataSourceSchemaRequest
- type TFPrimitiveType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSRegionToMongoDBRegion ¶ added in v1.19.0
AWSRegionToMongoDBRegion converts region in us-east-1-like format to US_EAST_1-like
func AddJSONBodyErrorToDiagnostics ¶ added in v1.21.0
func AddJSONBodyErrorToDiagnostics(msgPrefix string, err error, diags *diag.Diagnostics)
AddJSONBodyErrorToDiagnostics tries to get the JSON body from the error and add it to the diagnostics. For example, admin.GenericOpenAPIError has the Body() []byte method.
func AddLegacyDiags ¶ added in v1.23.0
func AddLegacyDiags(diags *diag.Diagnostics, legacyDiags legacyDiag.Diagnostics)
func CopyModel ¶ added in v1.23.0
CopyModel creates a new struct with the same values as the source struct. Fields in destination struct that are not in source are left with zero value. It panics if there are some structural problems so it should only happen during development.
func DataSourceSchemaFromResource ¶ added in v1.22.0
func DataSourceSchemaFromResource(rs schema.Schema, req *DataSourceSchemaRequest) dsschema.Schema
func DecodeStateID ¶
func EncodeStateID ¶
func ExpandStringList ¶
func ExpandStringListFromSetSchema ¶ added in v1.15.0
func ExpandTagsFromSetSchema ¶ added in v1.15.2
func ExpandTagsFromSetSchema(d *schema.ResourceData) *[]admin.ResourceTag
func FlattenTags ¶ added in v1.15.2
func FlattenTags(tags []admin.ResourceTag) []map[string]string
func GetEncodedID ¶
func HasElementsSliceOrMap ¶ added in v1.17.4
HasElementsSliceOrMap checks if param is a non-empty slice or map
func ImportSplit3 ¶ added in v1.25.0
func ImportStateProjectIDClusterName ¶ added in v1.20.0
func ImportStateProjectIDClusterName(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse, attrNameProjectID, attrNameClusterName string)
func Int64PtrToIntPtr ¶
func IntPtrToInt64Ptr ¶
func IsStringPresent ¶
IsStringPresent returns true if the string is non-empty.
func MongoDBRegionToAWSRegion ¶
MongoDBRegionToAWSRegion converts region in US_EAST_1-like format to us-east-1-like
func NewResourceTags ¶ added in v1.22.0
func NilForUnknown ¶ added in v1.22.0
func NilForUnknown[T any](primitiveAttr TFPrimitiveType, value *T) *T
func NilForUnknownOrEmptyString ¶ added in v1.23.0
func PluralDataSourceSchemaFromResource ¶ added in v1.23.0
func PluralDataSourceSchemaFromResource(rs schema.Schema, req *PluralDataSourceSchemaRequest) dsschema.Schema
func SafeString ¶
func StringNullIfEmpty ¶
StringNullIfEmpty converts a string value to a Framework String value. An empty string is converted to a null String. Useful for optional attributes.
func StringPtrNullIfEmpty ¶
StringPtrNullIfEmpty is similar to StringNullIfEmpty but can also handle nil string pointers.
func StringToTime ¶ added in v1.15.2
StringToTime is the opposite to TimeToString, returns ok if conversion is possible.
func TimePtrToStringPtr ¶
utility conversions that can potentially be defined in sdk
func TimeToString ¶
TimeToString returns a RFC3339 date time string format. The resulting format is identical to the format returned by Atlas API, documented as ISO 8601 timestamp format in UTC. It also returns decimals in seconds (up to nanoseconds) if available. Example formats: "2023-07-18T16:12:23Z", "2023-07-18T16:12:23.456Z"
func ToAnySlicePointer ¶ added in v1.17.4
ToAnySlicePointer converts to a slice pointer of any as needed in some Atlas SDK Go structs
func ToTFMapOfSlices ¶ added in v1.17.0
func ToTFMapOfString ¶ added in v1.22.0
func UpdateAttr ¶ added in v1.21.0
func UpdateAttr(attr any)
UpdateAttr is exported for testing purposes only and should not be used directly.
func UpdateSchemaDescription ¶ added in v1.21.0
func UseNilForEmpty ¶ added in v1.22.0
func ValidateClusterName ¶ added in v1.20.0
func ValidateProjectID ¶ added in v1.20.0
Types ¶
type DataSourceSchemaRequest ¶ added in v1.23.0
type PluralDataSourceSchemaRequest ¶ added in v1.23.0
type TFPrimitiveType ¶ added in v1.22.0
type TFPrimitiveType interface {
IsUnknown() bool
}