common

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(err error) string

FormatError returns a detailed error string including status code and response body.

func GetColumnRaw added in v1.2.0

func GetColumnRaw(c client.Client, databaseID, tableID, key string) (map[string]interface{}, error)

GetColumnRaw fetches a column using a raw API call, bypassing the SDK's type-matching logic which doesn't handle all column types (e.g. text, longtext, mediumtext, varchar, point, line, polygon).

func ImportColumnState

func ImportColumnState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)

ImportColumnState parses a "database_id/table_id/key" import ID into state.

func IsColumnNotAvailableError

func IsColumnNotAvailableError(err error) bool

IsColumnNotAvailableError checks if the error is due to a column still being processed.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks if an Appwrite SDK error is a 404.

func ProjectIDAttribute added in v1.0.0

func ProjectIDAttribute() schema.StringAttribute

ProjectIDAttribute returns the shared schema attribute for project_id on resources.

func ResolveProjectID added in v1.0.0

func ResolveProjectID(clients *AppwriteClients, resourceProjectID types.String) (string, error)

ResolveProjectID returns the resource-level project_id if set, otherwise the provider default. Returns an error if neither is set.

func UseStateForUnknownUnlessUpdating added in v1.5.0

func UseStateForUnknownUnlessUpdating() planmodifier.String

UseStateForUnknownUnlessUpdating copies the prior-state value into the plan when the planned value is unknown, EXCEPT when this is an update where something else in the resource is actually changing — in which case the value must be left unknown so the API's new timestamp doesn't violate the plan→apply contract.

func WaitForColumnAvailable added in v1.0.2

func WaitForColumnAvailable(ctx context.Context, getColumn func() (interface{}, error), key string) error

WaitForColumnAvailable polls a column until its status becomes "available", with a maximum wait of 5 minutes.

func WaitForDeploymentReady added in v1.1.0

func WaitForDeploymentReady(ctx context.Context, getDeployment func() (string, error), deploymentID string) error

WaitForDeploymentReady polls a deployment until its status becomes "ready", "failed", or "canceled". Returns nil on "ready", error otherwise.

func WithUserAgent added in v1.3.0

func WithUserAgent(version string) client.ClientOption

WithUserAgent returns a ClientOption that sets the User-Agent header to identify Terraform provider traffic. This is required for HashiCorp partner providers.

Types

type AppwriteClients

type AppwriteClients struct {
	// BaseOptions contains the client options without a project (endpoint + key + self_signed).
	BaseOptions []client.ClientOption
	// ProjectID is the provider-level default project ID.
	ProjectID string
}

AppwriteClients holds the base configuration for creating SDK clients.

func (*AppwriteClients) ClientForProject added in v1.0.0

func (ac *AppwriteClients) ClientForProject(projectID string) client.Client

ClientForProject creates a new SDK client targeting a specific project.

type AttrCheck added in v1.0.2

type AttrCheck struct {
	Summary  string
	Detail   string
	Mismatch bool
}

AttrCheck holds the result of an attribute mismatch check.

func CheckBoolNotIgnored added in v1.0.2

func CheckBoolNotIgnored(planned types.Bool, actual bool, attrName string, resourceDesc string) AttrCheck

CheckBoolNotIgnored returns an error diagnostic if the planned bool value differs from the API response, indicating the server doesn't support this attribute.

func CheckStringNotIgnored added in v1.0.2

func CheckStringNotIgnored(planned types.String, actual string, attrName string, resourceDesc string) AttrCheck

CheckStringNotIgnored returns an error diagnostic if the planned string value differs from the API response, indicating the server doesn't support this attribute.

Jump to

Keyboard shortcuts

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