Documentation
¶
Index ¶
- func APIToDynamicJSON(ctx context.Context, attributePath tfpath.Path, source any, ...) (types.Dynamic, diag.Diagnostics)
- func APIToDynamicSiblingDiscriminator(ctx context.Context, attributePath path.Path, source any, selector string, ...) (types.Dynamic, diag.Diagnostics)
- func AlignMembersByEmail(ctx context.Context, source any, prior attr.Value) any
- func AtLeastOneOfAttributes(names ...string) validator.Object
- func AttributeToInterface(ctx context.Context, path path.Path, source attr.Value) (dest interface{}, diags diag.Diagnostics)
- func CaptureResponseBody(body *[]byte) files_sdk.RequestResponseOption
- func CurrentFormFields(formFieldSet files_sdk.FormFieldSet, fields any) any
- func DeprecatedJSONEncoding(rule, example, deadline string, valueTypes map[string]string, ...) validator.Dynamic
- func DeprecatedSiblingDiscriminatorValue(rule, selector string, variants []JSONSchemaVariant, warning string) validator.Dynamic
- func DynamicSiblingDiscriminatorToAPI(ctx context.Context, attributePath path.Path, source types.Dynamic, ...) (any, diag.Diagnostics)
- func DynamicSiblingDiscriminatorUpdateToAPI(ctx context.Context, attributePath path.Path, source types.Dynamic, ...) (any, diag.Diagnostics)
- func DynamicToInterface(ctx context.Context, path path.Path, source types.Dynamic) (interface{}, diag.Diagnostics)
- func DynamicToStringMap(ctx context.Context, path path.Path, source types.Dynamic) (map[string]interface{}, diag.Diagnostics)
- func DynamicToStringMapSlice(ctx context.Context, path path.Path, source types.Dynamic) ([]map[string]interface{}, diag.Diagnostics)
- func ElementsToInterfaces(ctx context.Context, path path.Path, elements []attr.Value) (dest []interface{}, diags diag.Diagnostics)
- func ElementsToStringMap(ctx context.Context, path path.Path, attrs map[string]attr.Value) (dest map[string]interface{}, diags diag.Diagnostics)
- func ExactlyOneOfAttributes(names ...string) validator.Object
- func FixedRecordIDs(key string, serverFilled []string) fixedRecordIDs
- func GroupStructuralUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, ...) (any, diag.Diagnostics)
- func JSONToStringMapSlice(attributePath tfpath.Path, value any) ([]map[string]any, diag.Diagnostics)
- func JSONValueHas(value any, valuePath string) bool
- func JSONValueToAPI(ctx context.Context, attributePath tfpath.Path, source attr.Value) (any, diag.Diagnostics)
- func KnownKeys(detail string, names ...string) validator.Dynamic
- func ListToStringMapSlice(ctx context.Context, path path.Path, elements []attr.Value) (dest []map[string]interface{}, diags diag.Diagnostics)
- func ListValueToString(ctx context.Context, path path.Path, list types.List, delim string) (string, diag.Diagnostics)
- func NullRemovedSiblingFields(ctx context.Context, attributePath path.Path, value any, prior attr.Value, ...) (any, diag.Diagnostics)
- func ParseDecimalAttribute(text string) (exact *string, legacy float64, err error)
- func ReadLegacyTruthyAtPath(_ context.Context, attributePath path.Path, source any, names []string) (any, diag.Diagnostics)
- func RejectEmptyList(detail string) rejectEmptyListValidator
- func RejectJSONNull(detail string) validator.Dynamic
- func ResponseProperty(attributePath path.Path, body []byte, name string) (any, diag.Diagnostics)
- func SchemaAttributeToInterface(ctx context.Context, path path.Path, source attr.Value) (dest interface{}, diags diag.Diagnostics)
- func SettleUnchangedPlan(config tfsdk.Config, state tfsdk.State, plan *tfsdk.Plan) error
- func SiblingDiscriminatorMatches(discriminator string) validator.Object
- func TimeToStringType(ctx context.Context, path path.Path, source *time.Time, dest *types.String) error
- func ToDynamic(ctx context.Context, path path.Path, source any, plan attr.Value) (dest types.Dynamic, diags diag.Diagnostics)
- func ToList(ctx context.Context, path path.Path, source any, plan types.List) (types.List, diag.Diagnostics)
- func ToMap(ctx context.Context, path path.Path, source any, plan types.Map) (types.Map, diag.Diagnostics)
- func ToObject(ctx context.Context, path path.Path, source any, plan types.Object) (types.Object, diag.Diagnostics)
- func UngroupStructuralUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, ...) (any, diag.Diagnostics)
- func UnwrapDiscriminatedUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, ...) (any, diag.Diagnostics)
- func UnwrapSiblingDiscriminator(_ context.Context, attributePath path.Path, source any, discriminator string, ...) (any, diag.Diagnostics)
- func ValidJSONEncoding() validator.Dynamic
- func WrapDiscriminatedUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, ...) (any, diag.Diagnostics)
- func WrapDiscriminatedUnionLikeConfigAtPath(ctx context.Context, attributePath path.Path, source any, ...) (any, diag.Diagnostics)
- func WrapLegacySingleItemAtPath(_ context.Context, attributePath path.Path, source any, names []string) (any, diag.Diagnostics)
- func WrapSiblingDiscriminator(_ context.Context, attributePath path.Path, source any, discriminator string, ...) (any, diag.Diagnostics)
- type JSONSchemaVariant
- type Logger
- type SortedElementString
- type SortedElementStringType
- func (t SortedElementStringType) Equal(o attr.Type) bool
- func (t SortedElementStringType) String() string
- func (t SortedElementStringType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t SortedElementStringType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t SortedElementStringType) ValueType(ctx context.Context) attr.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIToDynamicJSON ¶ added in v0.1.1009
func APIToDynamicSiblingDiscriminator ¶ added in v0.1.936
func AlignMembersByEmail ¶ added in v0.1.1362
AlignMembersByEmail puts Share Group members in the order and email spelling of prior, the configured or prior state value. Rails matches members by email ignoring letter case, keeps the stored spelling and returns them in its own order. Unmatched members follow in API order. source is the members value of the response body.
func AtLeastOneOfAttributes ¶ added in v0.1.867
func AttributeToInterface ¶
func CaptureResponseBody ¶ added in v0.1.1362
func CaptureResponseBody(body *[]byte) files_sdk.RequestResponseOption
CaptureResponseBody keeps a copy of the response body in body and gives the SDK an identical reader to decode. The Go SDK decodes some fields into strings with omitempty, which cannot tell an empty string from null.
func CurrentFormFields ¶ added in v0.1.1362
func CurrentFormFields(formFieldSet files_sdk.FormFieldSet, fields any) any
CurrentFormFields returns the fields listed in form_layout, in that order. Authenticated Form Field Set responses also contain historical definitions that existing registration answers use. fields is the form_fields value of the response body, as ResponseProperty returns it.
func DeprecatedJSONEncoding ¶ added in v0.1.1009
func DeprecatedJSONEncoding(rule, example, deadline string, valueTypes map[string]string, requiredPaths []string, nestedPaths ...string) validator.Dynamic
DeprecatedJSONEncoding warns about JSON-encoded values. valueTypes maps fields of the typed schema to "integer", "boolean" or "list", with "[]" for list items and "*" for map values, for example {"user_ids[]": "integer"}. A configured value of another type gets guidance for its field, in the same warning when the value is also encoded. requiredPaths name fields, in the same form, that the typed schema requires although the API also accepts null for them. A configured null there gets guidance, because Terraform treats it as missing. An unknown value does not. nestedPaths name the discriminator of list union items that the typed schema moves under their variant name, for example "folder_behaviors[].behavior". An item that still has it uses the old nesting and gets example as guidance.
func DeprecatedSiblingDiscriminatorValue ¶ added in v0.1.936
func DeprecatedSiblingDiscriminatorValue(rule, selector string, variants []JSONSchemaVariant, warning string) validator.Dynamic
func DynamicSiblingDiscriminatorToAPI ¶ added in v0.1.936
func DynamicSiblingDiscriminatorUpdateToAPI ¶ added in v0.1.936
func DynamicToInterface ¶ added in v0.1.391
func DynamicToStringMap ¶
func DynamicToStringMapSlice ¶
func ElementsToInterfaces ¶ added in v0.1.867
func ElementsToStringMap ¶
func ExactlyOneOfAttributes ¶ added in v0.1.867
func FixedRecordIDs ¶ added in v0.1.1362
FixedRecordIDs plans records that the API keeps under an ID, such as form fields. Rails keeps a record whose request names a current ID: it keeps every stored value that the request leaves out, and it stores a changed value under a new ID. key is the ID field. serverFilled fields get an API value for a new record too, such as a default.
For a typed list, a record that names a stored ID plans each left-out value as the stored value, and a new record plans each left-out value as null, except serverFilled fields. A configured value that differs from the stored record is an error, because the API would replace the ID. An unknown value is checked when Terraform plans again with the final values, before apply. A Dynamic value holds only the configured keys, so it is only checked.
func GroupStructuralUnionAtPath ¶ added in v0.1.867
func GroupStructuralUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
func JSONToStringMapSlice ¶ added in v0.1.1009
func JSONValueHas ¶ added in v0.1.1362
JSONValueHas reports whether value has a value other than null at valuePath, with "[]" for list items and "*" for map values, for example "folder_behaviors[].behavior".
func JSONValueToAPI ¶ added in v0.1.1009
func KnownKeys ¶ added in v0.1.1362
KnownKeys rejects a value that is not an object, and top-level keys outside names, for a Dynamic object whose unknown keys the API removes when it saves, so the value read back never matches the configuration.
func ListToStringMapSlice ¶
func ListValueToString ¶
func NullRemovedSiblingFields ¶ added in v0.1.1362
func NullRemovedSiblingFields(ctx context.Context, attributePath path.Path, value any, prior attr.Value, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
NullRemovedSiblingFields sends null for each writable field that prior, the typed value in state, sets and value, the unwrapped request value, no longer sets. Rails merges a Behavior value on update and removes only fields sent as null.
func ParseDecimalAttribute ¶ added in v0.1.1114
ParseDecimalAttribute reads a string attribute that earlier provider versions parsed with strconv.ParseFloat before sending it as a number. Decimal text such as "1.5" or "2e-3" comes back unchanged as exact, so the API receives it without float rounding. Other spellings ParseFloat accepts, such as hexadecimal floats or digits separated by underscores, keep their former float64 value and rounding, with a nil exact. NaN, infinities and values ParseFloat rejects are errors.
func ReadLegacyTruthyAtPath ¶ added in v0.1.1362
func ReadLegacyTruthyAtPath(_ context.Context, attributePath path.Path, source any, names []string) (any, diag.Diagnostics)
Read marked boolean fields using Ruby truthiness, rather than parsing strings such as "false".
func RejectEmptyList ¶ added in v0.1.1362
func RejectEmptyList(detail string) rejectEmptyListValidator
RejectEmptyList rejects an empty list for a property whose empty list the API ignores, so the value read back never matches it. It validates a typed list and a Dynamic value, native or JSON-encoded.
func RejectJSONNull ¶ added in v0.1.1362
RejectJSONNull rejects a JSON-encoded null, such as jsonencode(null), for a property whose null the API ignores, so the value read back never matches it. Native null and an omitted value are not affected.
func ResponseProperty ¶ added in v0.1.1362
ResponseProperty returns the named top-level property of the JSON object in body exactly as the API sent it. A missing property is nil, like a null one. A body that is not a JSON object is an error.
func SchemaAttributeToInterface ¶ added in v0.1.867
func SettleUnchangedPlan ¶ added in v0.1.1362
SettleUnchangedPlan keeps prior state when the plan differs from it only in computed attributes that have no configuration and are unknown. Terraform proposes null for an omitted Optional and Computed typed object whose prior value has fields that are not Computed. The framework then marks every computed attribute without configuration unknown, although the object's UseStateForUnknown plan modifier keeps its prior value. Without this, every plan would show an update that changes nothing.
func SiblingDiscriminatorMatches ¶ added in v0.1.1362
SiblingDiscriminatorMatches requires a typed value to set the attribute named by its sibling discriminator, such as files_behavior.value under the name in behavior. Without it, a mismatch fails only at apply, when the request is built.
func TimeToStringType ¶
func UngroupStructuralUnionAtPath ¶ added in v0.1.867
func UngroupStructuralUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
func UnwrapDiscriminatedUnionAtPath ¶ added in v0.1.867
func UnwrapDiscriminatedUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
UnwrapDiscriminatedUnionAtPath turns typed list union items, such as {"file_expiration": {"value": ...}}, into API items, such as {"behavior": "file_expiration", "value": ...}. Items that already have the discriminator are API items and stay as they are, so a Dynamic value can use either nesting.
func UnwrapSiblingDiscriminator ¶ added in v0.1.936
func UnwrapSiblingDiscriminator(_ context.Context, attributePath path.Path, source any, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
func ValidJSONEncoding ¶ added in v0.1.1362
ValidJSONEncoding rejects a JSON-encoded string that does not decode, at plan time, for a property that stays Dynamic in every release. Native values and valid JSON strings pass without a warning.
func WrapDiscriminatedUnionAtPath ¶ added in v0.1.867
func WrapDiscriminatedUnionAtPath(ctx context.Context, attributePath path.Path, source any, names []string, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
WrapDiscriminatedUnionAtPath turns API list union items into typed items under their variant name. Items that are already typed, as in state that a Dynamic value stored with the typed nesting, stay as they are.
func WrapDiscriminatedUnionLikeConfigAtPath ¶ added in v0.1.1362
func WrapDiscriminatedUnionLikeConfigAtPath(ctx context.Context, attributePath path.Path, source any, configured attr.Value, names []string, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
WrapDiscriminatedUnionLikeConfigAtPath wraps an API list union item only where the configured item at the same position uses the typed nesting. A Dynamic value read back then keeps the nesting of each configured item.
func WrapLegacySingleItemAtPath ¶ added in v0.1.1362
func WrapLegacySingleItemAtPath(_ context.Context, attributePath path.Path, source any, names []string) (any, diag.Diagnostics)
WrapLegacySingleItemAtPath reads one stored item at a list marked x-files-legacy-single-item as a one-item list, so 5 becomes [5]. Lists and null stay as they are. The item conversion that follows still turns "5" into 5 and rejects values that are not valid items.
func WrapSiblingDiscriminator ¶ added in v0.1.936
func WrapSiblingDiscriminator(_ context.Context, attributePath path.Path, source any, discriminator string, variants []JSONSchemaVariant) (any, diag.Diagnostics)
Types ¶
type JSONSchemaVariant ¶ added in v0.1.867
type SortedElementString ¶ added in v0.1.184
type SortedElementString struct {
basetypes.StringValue
}
func SortedElementStringValue ¶ added in v0.1.184
func SortedElementStringValue(value string) SortedElementString
func (SortedElementString) StringSemanticEquals ¶ added in v0.1.184
func (v SortedElementString) StringSemanticEquals(ctx context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
type SortedElementStringType ¶ added in v0.1.184
type SortedElementStringType struct {
basetypes.StringType
}
func (SortedElementStringType) Equal ¶ added in v0.1.184
func (t SortedElementStringType) Equal(o attr.Type) bool
func (SortedElementStringType) String ¶ added in v0.1.184
func (t SortedElementStringType) String() string
func (SortedElementStringType) ValueFromString ¶ added in v0.1.184
func (t SortedElementStringType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)