providerclient

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgent    = "polytomic-terraform-provider"
	ErrorSummary = "Client Error"

	//PolytomicDeploymentKey is the environment variable name for the Polytomic deployment key
	PolytomicDeploymentKey = "POLYTOMIC_DEPLOYMENT_KEY"
	//PolytomicAPIKey is the environment variable name for the Polytomic API key
	PolytomicAPIKey = "POLYTOMIC_API_KEY"
	//PolytomicPartnerKey is the environment variable name for the Polytomic partner key
	PolytomicPartnerKey = "POLYTOMIC_PARTNER_KEY"
	//PolytomicDeploymentURL is the environment variable name for the Polytomic deployment URL
	PolytomicDeploymentURL = "POLYTOMIC_DEPLOYMENT_URL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	DeploymentKey string
	DeploymentURL string
	PartnerKey    string
	APIKey        string
}

func OptionsFromEnv

func OptionsFromEnv() Options

OptionsFromEnv returns the provider client Options configured using the environment.

func (Options) Validate

func (o Options) Validate() error

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is used to construct Polytomic clients based on the configured authentication mechanism.

func GetProvider

func GetProvider(data any, diags diag.Diagnostics) *Provider

GetClient returns a Polytomic client from the provider data for the specified organization.

func NewClientProvider

func NewClientProvider(opts Options) (*Provider, error)

func (*Provider) Client

func (p *Provider) Client(org string) (*ptclient.Client, error)

func (*Provider) ListOrganizations

func (ic *Provider) ListOrganizations(ctx context.Context) ([]*polytomic.Organization, error)

ListOrganizations returns all organizations accessible via the configured authentication method.

func (*Provider) PartnerClient

func (p *Provider) PartnerClient() (*ptclient.Client, error)

func (*Provider) Validate

func (p *Provider) Validate() error

Validate checks the provider configuration for required fields.

Jump to

Keyboard shortcuts

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