dbt_cloud

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_ACTIVE           = 1
	STATE_DELETED          = 2
	ID_DELIMITER           = ":"
	NUM_THREADS_CREDENTIAL = 6
)

Variables

EnvironmentCategories is a list of all possible environment categories

View Source
var FabricDriver = "ODBC Driver 18 for SQL Server"
View Source
var (
	PermissionSets = []string{
		"owner",
		"member",
		"account_admin",
		"security_admin",
		"billing_admin",
		"admin",
		"database_admin",
		"git_admin",
		"team_admin",
		"job_admin",
		"job_runner",
		"job_viewer",
		"analyst",
		"developer",
		"stakeholder",
		"readonly",
		"project_creator",
		"account_viewer",
		"metadata_only",
		"semantic_layer_only",
		"webhooks_only",
	}
)
View Source
var SynapseDriver = FabricDriver

Right now Synapse and Fabric are the same If they diverge in the future, we can update the SynapseConfig struct

Functions

This section is empty.

Types

type APIError added in v0.2.1

type APIError struct {
	Data   interface{} `json:"data"`
	Status struct {
		Code             int    `json:"code"`
		DeveloperMessage string `json:"developer_message"`
		IsSuccess        bool   `json:"is_success"`
		UserMessage      string `json:"user_message"`
	} `json:"status"`
}

Parses the error we get to see if it is a 404 for a missing resource

type Adapter

type Adapter struct {
	ID                      *int            `json:"id,omitempty"`
	AccountID               int             `json:"account_id"`
	ProjectID               int             `json:"project_id"`
	CreatedByID             *int            `json:"created_by_id,omitempty"`
	CreatedByServiceTokenID *int            `json:"created_by_service_token_id,omitempty"`
	Metadata                AdapterMetadata `json:"metadata_json"`
	State                   int             `json:"state"`
	AdapterVersion          string          `json:"adapter_version"`
	CreatedAt               *string         `json:"created_at,omitempty"`
	UpdatedAt               *string         `json:"updated_at,omitempty"`
}

type AdapterCredentialDetails added in v0.2.17

type AdapterCredentialDetails struct {
	Fields      map[string]AdapterCredentialField `json:"fields"`
	Field_Order []string                          `json:"field_order"`
}

func GenerateDatabricksCredentialDetails added in v0.3.19

func GenerateDatabricksCredentialDetails(
	token string,
	schema string,
	targetName string,
	catalog string,

) (AdapterCredentialDetails, error)

func GenerateFabricCredentialDetails added in v0.2.17

func GenerateFabricCredentialDetails(
	user string,
	password string,
	tenantId string,
	clientId string,
	clientSecret string,
	schema string,
	schemaAuthorization string,
) (AdapterCredentialDetails, error)

func GetDatabricksConnectionDetails added in v0.2.2

func GetDatabricksConnectionDetails(
	hostName string,
	httpPath string,
	catalog string,
	clientID string,
	clientSecret string,
) *AdapterCredentialDetails

func GetFabricConnectionDetails added in v0.2.17

func GetFabricConnectionDetails(
	server string,
	port int,
	database string,
	retries int,
	loginTimeout int,
	queryTimeout int,
) *AdapterCredentialDetails

type AdapterCredentialField added in v0.2.17

type AdapterCredentialField struct {
	Metadata AdapterCredentialFieldMetadata `json:"metadata"`
	Value    interface{}                    `json:"value"`
}

Value can actually be a string or an int (for threads)

type AdapterCredentialFieldMetadata added in v0.2.17

type AdapterCredentialFieldMetadata struct {
	Label        string                                   `json:"label"`
	Description  string                                   `json:"description"`
	Field_Type   string                                   `json:"field_type"`
	Encrypt      bool                                     `json:"encrypt"`
	Overrideable bool                                     `json:"overrideable"`
	Options      []AdapterCredentialFieldMetadataOptions  `json:"options,omitempty"`
	Validation   AdapterCredentialFieldMetadataValidation `json:"validation"`
}

type AdapterCredentialFieldMetadataOptions added in v0.2.17

type AdapterCredentialFieldMetadataOptions struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type AdapterCredentialFieldMetadataValidation added in v0.2.17

type AdapterCredentialFieldMetadataValidation struct {
	Required bool `json:"required"`
}

type AdapterMetadata

type AdapterMetadata struct {
	Title     string `json:"title"`
	DocsLink  string `json:"docs_link"`
	ImageLink string `json:"image_link"`
}

type AdapterResponse

type AdapterResponse struct {
	Data   Adapter        `json:"data"`
	Status ResponseStatus `json:"status"`
}

type ApacheSparkConfig added in v0.3.13

type ApacheSparkConfig struct {
	Method         *string                   `json:"method,omitempty"`
	Host           *string                   `json:"host,omitempty"`
	Port           *int64                    `json:"port,omitempty"`
	Cluster        *string                   `json:"cluster,omitempty"`
	ConnectTimeout *int64                    `json:"connect_timeout,omitempty"`
	ConnectRetries *int64                    `json:"connect_retries,omitempty"`
	Organization   nullable.Nullable[string] `json:"organization,omitempty"`
	User           nullable.Nullable[string] `json:"user,omitempty"`
	Auth           nullable.Nullable[string] `json:"auth,omitempty"`
}

func (ApacheSparkConfig) AdapterVersion added in v0.3.13

func (ApacheSparkConfig) AdapterVersion() string

type AssignUserGroupsResponse added in v0.2.4

type AssignUserGroupsResponse struct {
	Data   []Group        `json:"data"`
	Status ResponseStatus `json:"status"`
}

type AthenaConfig added in v0.3.13

type AthenaConfig struct {
	RegionName        *string                   `json:"region_name,omitempty"`
	Database          *string                   `json:"database,omitempty"`
	S3StagingDir      *string                   `json:"s3_staging_dir,omitempty"`
	WorkGroup         nullable.Nullable[string] `json:"work_group,omitempty"`
	SparkWorkGroup    nullable.Nullable[string] `json:"spark_work_group,omitempty"`
	S3DataDir         nullable.Nullable[string] `json:"s3_data_dir,omitempty"`
	S3DataNaming      nullable.Nullable[string] `json:"s3_data_naming,omitempty"`
	S3TmpTableDir     nullable.Nullable[string] `json:"s3_tmp_table_dir,omitempty"`
	PollInterval      nullable.Nullable[int64]  `json:"poll_interval,omitempty"`
	NumRetries        nullable.Nullable[int64]  `json:"num_retries,omitempty"`
	NumBoto3Retries   nullable.Nullable[int64]  `json:"num_boto3_retries,omitempty"`
	NumIcebergRetries nullable.Nullable[int64]  `json:"num_iceberg_retries,omitempty"`
}

func (AthenaConfig) AdapterVersion added in v0.3.13

func (AthenaConfig) AdapterVersion() string

type AuthResponse

type AuthResponse struct {
	Status ResponseStatus     `json:"status"`
	Data   []AuthResponseData `json:"data"`
}

AuthResponse -

type AuthResponseData

type AuthResponseData struct {
	DocsJobId                      int    `json:"docs_job_id"`
	FreshnessJobId                 int    `json:"freshness_job_id"`
	LockReason                     string `json:"lock_reason"`
	UnlockIfSubscriptionRenewed    bool   `json:"unlock_if_subscription_renewed"`
	ReadOnlySeats                  int    `json:"read_only_seats"`
	Id                             int    `json:"id"`
	Name                           string `json:"name"`
	State                          int    `json:"state"`
	Plan                           string `json:"plan"`
	PendingCancel                  bool   `json:"pending_cancel"`
	RunSlots                       int    `json:"run_slots"`
	DeveloperSeats                 int    `json:"developer_seats"`
	QueueLimit                     int    `json:"queue_limit"`
	PodMemoryRequestMebibytes      int    `json:"pod_memory_request_mebibytes"`
	RunDurationLimitSeconds        int    `json:"run_duration_limit_seconds"`
	EnterpriseAuthenticationMethod string `json:"enterprise_authentication_method"`
	EnterpriseLoginSlug            string `json:"enterprise_login_slug"`
	EnterpriseUniqueIdentifier     string `json:"enterprise_unique_identifier"`
	BillingEmailAddress            string `json:"billing_email_address"`
	Locked                         bool   `json:"locked"`
	DevelopFileSystem              bool   `json:"develop_file_system"`
	UnlockedAt                     string `json:"unlocked_at"`
	CreatedAt                      string `json:"created_at"`
	UpdatedAt                      string `json:"updated_at"`
	StarterRepoUrl                 string `json:"starter_repo_url"`
	SsoReauth                      bool   `json:"sso_reauth"`
	GitAuthLevel                   string `json:"git_auth_level"`
	DocsJob                        string `json:"docs_job"`
	FreshnessJob                   string `json:"freshness_job"`
	EnterpriseLoginUrl             string `json:"enterprise_login_url"`
}

type AzureDevOpsProject added in v0.2.14

type AzureDevOpsProject struct {
	URL  string `json:"url"`
	Name string `json:"name"`
	ID   string `json:"id"`
}

type AzureDevOpsProjectsData added in v0.2.14

type AzureDevOpsProjectsData struct {
	Count int                  `json:"count"`
	Value []AzureDevOpsProject `json:"value"`
}

type AzureDevOpsProjectsResponse added in v0.2.14

type AzureDevOpsProjectsResponse struct {
	Data   AzureDevOpsProjectsData `json:"data"`
	Status ResponseStatus          `json:"status"`
}

type AzureDevOpsRepositoriesData added in v0.2.14

type AzureDevOpsRepositoriesData struct {
	Count int                     `json:"count"`
	Value []AzureDevOpsRepository `json:"value"`
}

type AzureDevOpsRepositoriesResponse added in v0.2.14

type AzureDevOpsRepositoriesResponse struct {
	Data   AzureDevOpsRepositoriesData `json:"data"`
	Status ResponseStatus              `json:"status"`
}

type AzureDevOpsRepository added in v0.2.14

type AzureDevOpsRepository struct {
	DetailsURL    string `json:"url"`
	RemoteURL     string `json:"remoteUrl"`
	WebURL        string `json:"webUrl"`
	Name          string `json:"name"`
	ID            string `json:"id"`
	DefaultBranch string `json:"defaultBranch"`
}

type BaseConnection added in v0.2.17

type BaseConnection struct {
	ID                      *int    `json:"id,omitempty"`
	AccountID               int     `json:"account_id"`
	ProjectID               int     `json:"project_id"`
	Name                    string  `json:"name"`
	Type                    string  `json:"type"`
	CreatedByID             *int    `json:"created_by_id,omitempty"`
	CreatedByServiceTokenID *int    `json:"created_by_service_token_id,omitempty"`
	State                   int     `json:"state"`
	PrivateLinkEndpointID   string  `json:"private_link_endpoint_id,omitempty"`
	Created_At              *string `json:"created_at,omitempty"`
	Updated_At              *string `json:"updated_at,omitempty"`
}

use this BaseConnection for all connections that are defined in their own resources

type BigQueryConfig added in v0.3.11

type BigQueryConfig struct {
	ProjectID                 *string                   `json:"project_id,omitempty"`
	TimeoutSeconds            *int64                    `json:"timeout_seconds,omitempty"`
	PrivateKeyID              *string                   `json:"private_key_id,omitempty"`
	PrivateKey                *string                   `json:"private_key,omitempty"`
	ClientEmail               *string                   `json:"client_email,omitempty"`
	ClientID                  *string                   `json:"client_id,omitempty"`
	AuthURI                   *string                   `json:"auth_uri,omitempty"`
	TokenURI                  *string                   `json:"token_uri,omitempty"`
	AuthProviderX509CertURL   *string                   `json:"auth_provider_x509_cert_url,omitempty"`
	ClientX509CertURL         *string                   `json:"client_x509_cert_url,omitempty"`
	Priority                  nullable.Nullable[string] `json:"priority,omitempty"`
	Retries                   *int64                    `json:"retries,omitempty"` //not nullable because there is a default in the UI
	Location                  nullable.Nullable[string] `json:"location,omitempty"`
	MaximumBytesBilled        nullable.Nullable[int64]  `json:"maximum_bytes_billed,omitempty"`
	ExecutionProject          nullable.Nullable[string] `json:"execution_project,omitempty"`
	ImpersonateServiceAccount nullable.Nullable[string] `json:"impersonate_service_account,omitempty"`
	JobRetryDeadlineSeconds   nullable.Nullable[int64]  `json:"job_retry_deadline_seconds,omitempty"`
	JobCreationTimeoutSeconds nullable.Nullable[int64]  `json:"job_creation_timeout_seconds,omitempty"`
	ApplicationID             nullable.Nullable[string] `json:"application_id,omitempty"`
	ApplicationSecret         nullable.Nullable[string] `json:"application_secret,omitempty"`
	GcsBucket                 nullable.Nullable[string] `json:"gcs_bucket,omitempty"`
	DataprocRegion            nullable.Nullable[string] `json:"dataproc_region,omitempty"`
	DataprocClusterName       nullable.Nullable[string] `json:"dataproc_cluster_name,omitempty"`
	Scopes                    []string                  `json:"scopes,omitempty"` //not nullable because there is a default in the UI
}

func (BigQueryConfig) AdapterVersion added in v0.3.11

func (BigQueryConfig) AdapterVersion() string

type BigQueryConnection

type BigQueryConnection struct {
	BaseConnection
	Details BigQueryConnectionDetails `json:"details"`
}

maybe try interface here

type BigQueryConnectionDetails

type BigQueryConnectionDetails struct {
	GcpProjectId            string  `json:"project_id"`
	TimeoutSeconds          int     `json:"timeout_seconds"`
	PrivateKeyId            string  `json:"private_key_id"`
	PrivateKey              string  `json:"private_key,omitempty"`
	ClientEmail             string  `json:"client_email"`
	ClientId                string  `json:"client_id"`
	AuthUri                 string  `json:"auth_uri"`
	TokenUri                string  `json:"token_uri"`
	AuthProviderX509CertUrl string  `json:"auth_provider_x509_cert_url"`
	ClientX509CertUrl       string  `json:"client_x509_cert_url"`
	Retries                 *int    `json:"retries,omitempty"`
	Location                *string `json:"location,omitempty"`
	MaximumBytesBilled      *int    `json:"maximum_bytes_billed,omitempty"`
	ExecutionProject        *string `json:"execution_project,omitempty"`
	Priority                *string `json:"priority,omitempty"`
	GcsBucket               *string `json:"gcs_bucket,omitempty"`
	DataprocRegion          *string `json:"dataproc_region,omitempty"`
	DataprocClusterName     *string `json:"dataproc_cluster_name,omitempty"`
	ApplicationSecret       string  `json:"application_secret,omitempty"`
	ApplicationId           string  `json:"application_id,omitempty"`
	IsConfiguredOAuth       bool    `json:"is_configured_for_oauth,omitempty"`
}

type BigQueryConnectionResponse

type BigQueryConnectionResponse struct {
	Data   BigQueryConnection `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type BigQueryCredential

type BigQueryCredential struct {
	ID         *int   `json:"id"`
	Account_Id int    `json:"account_id"`
	Project_Id int    `json:"project_id"`
	Type       string `json:"type"`
	State      int    `json:"state"`
	Threads    int    `json:"threads"`
	Dataset    string `json:"schema"`
}

type BigQueryCredentialResponse

type BigQueryCredentialResponse struct {
	Data   BigQueryCredential `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type Client

type Client struct {
	HostURL    string
	HTTPClient *http.Client
	Token      string
	AccountURL string
	AccountID  int
}

func NewClient

func NewClient(account_id *int, token *string, host_url *string) (*Client, error)

NewClient -

func (*Client) AssignUserGroups added in v0.2.4

func (c *Client) AssignUserGroups(userId int, groupIDs []int) (*AssignUserGroupsResponse, error)

func (*Client) CreateBigQueryConnection

func (c *Client) CreateBigQueryConnection(
	projectID int,
	name string,
	connectionType string,
	isActive bool,
	gcpProjectId string,
	timeoutSeconds int,
	privateKeyId string,
	privateKey string,
	clientEmail string,
	clientId string,
	authUri string,
	tokenUri string,
	authProviderX509CertUrl string,
	clientX509CertUrl string,
	retries *int,
	location *string,
	maximumBytesBilled *int,
	executionProject *string,
	priority *string,
	gcsBucket *string,
	dataprocRegion *string,
	dataprocClusterName *string,
	applicationSecret string,
	applicationId string) (*BigQueryConnection, error)

func (*Client) CreateBigQueryCredential

func (c *Client) CreateBigQueryCredential(
	projectId int,
	type_ string,
	isActive bool,
	dataset string,
	numThreads int,
) (*BigQueryCredential, error)

func (*Client) CreateConnection

func (c *Client) CreateConnection(
	projectID int,
	name string,
	connectionType string,
	privatelinkEndpointID string,
	isActive bool,
	account string,
	database string,
	warehouse string,
	role string,
	allowSSO *bool,
	clientSessionKeepAlive *bool,
	oAuthClientID string,
	oAuthClientSecret string,
	hostName string,
	port int,
	tunnelEnabled *bool,
	httpPath string,
	catalog string,
) (*Connection, error)

func (*Client) CreateDatabricksCredential

func (c *Client) CreateDatabricksCredential(
	projectId int,
	token string,
	schema string,
	targetName string,
	catalog string,

) (*DatabricksCredential, error)

func (*Client) CreateDatabricksCredentialLegacy added in v0.3.19

func (c *Client) CreateDatabricksCredentialLegacy(
	projectId int,
	type_ string,
	targetName string,
	adapterId int,
	token string,
	catalog string,
	schema string,
	adapterType string,
) (*DatabricksCredential, error)

func (*Client) CreateEnvironment

func (c *Client) CreateEnvironment(
	isActive bool,
	projectId int,
	name string,
	dbtVersion string,
	type_ string,
	useCustomBranch bool,
	customBranch string,
	credentialId int,
	deploymentType string,
	extendedAttributesID int,
	connectionID int,
	enableModelQueryHistory bool,
) (*Environment, error)

func (*Client) CreateEnvironmentVariable

func (c *Client) CreateEnvironmentVariable(
	projectID int,
	name string,
	environmentValues map[string]string,
) (*EnvironmentVariable, error)

func (*Client) CreateEnvironmentVariableJobOverride added in v0.2.16

func (c *Client) CreateEnvironmentVariableJobOverride(
	projectID int,
	name string,
	rawValue string,
	jobDefinitionID int,
) (*EnvironmentVariableJobOverride, error)

func (*Client) CreateExtendedAttributes added in v0.2.9

func (c *Client) CreateExtendedAttributes(
	state int,
	projectId int,
	extendedAttributes json.RawMessage,
) (*ExtendedAttributes, error)

func (*Client) CreateFabricConnection added in v0.2.17

func (c *Client) CreateFabricConnection(
	projectID int,
	name string,
	server string,
	port int,
	database string,
	retries int,
	login_timeout int,
	query_timeout int,
) (*FabricConnection, error)

func (*Client) CreateFabricCredential added in v0.2.17

func (c *Client) CreateFabricCredential(
	projectId int,
	adapterId int,
	user string,
	password string,
	tenantId string,
	clientId string,
	clientSecret string,
	schema string,
	schemaAuthorization string,
) (*FabricCredential, error)

func (*Client) CreateGroup

func (c *Client) CreateGroup(
	name string,
	assignByDefault bool,
	ssoMappingGroups []string,
) (*Group, error)

func (*Client) CreateJob

func (c *Client) CreateJob(
	projectId int,
	environmentId int,
	name string,
	description string,
	executeSteps []string,
	dbtVersion string,
	isActive bool,
	triggers map[string]any,
	numThreads int,
	targetName string,
	generateDocs bool,
	runGenerateSources bool,
	scheduleType string,
	scheduleInterval int,
	scheduleHours []int,
	scheduleDays []int,
	scheduleCron string,
	deferringJobId int,
	deferringEnvironmentID int,
	selfDeferring bool,
	timeoutSeconds int,
	triggersOnDraftPR bool,
	jobCompletionTriggerCondition map[string]any,
	runCompareChanges bool,
) (*Job, error)

func (*Client) CreateLicenseMap added in v0.2.6

func (c *Client) CreateLicenseMap(licenseType string, ssoLicenseMappingGroups []string) (*LicenseMap, error)

func (*Client) CreateLineageIntegration added in v0.3.20

func (c *Client) CreateLineageIntegration(
	projectID int64,
	name string,
	host string,
	siteID string,
	tokenName string,
	token string,
) (*LineageIntegration, error)

func (*Client) CreateNotification added in v0.2.3

func (c *Client) CreateNotification(
	userId int,
	onCancel []int,
	onFailure []int,
	onWarning []int,
	onSuccess []int,
	state int,
	notificationType int,
	externalEmail *string,
	slackChannelID *string,
	slackChannelName *string) (*Notification, error)

func (*Client) CreatePostgresCredential

func (c *Client) CreatePostgresCredential(
	projectId int,
	isActive bool,
	type_ string,
	defaultSchema string,
	targetName string,
	username string,
	password string,
	numThreads int,
) (*PostgresCredential, error)

CreatePostgresCredential creates a new Postgres credential

func (*Client) CreateProject

func (c *Client) CreateProject(
	name string,
	description string,
	dbtProjectSubdirectory string,
) (*Project, error)

func (*Client) CreateRepository

func (c *Client) CreateRepository(
	projectID int,
	remoteUrl string,
	isActive bool,
	gitCloneStrategy string,
	gitlabProjectID int,
	githubInstallationID int,
	azureActiveDirectoryProjectID string,
	azureActiveDirectoryRepositoryID string,
	azureBypassWebhookRegistrationFailure bool,
	pullRequestURLTemplate string,
) (*Repository, error)

func (*Client) CreateServiceToken

func (c *Client) CreateServiceToken(
	name string,
	state int,
) (*ServiceToken, error)

func (*Client) CreateSnowflakeCredential

func (c *Client) CreateSnowflakeCredential(
	projectId int,
	type_ string,
	isActive bool,
	database string,
	role string,
	warehouse string,
	schema string,
	user string,
	password string,
	privateKey string,
	privateKeyPassphrase string,
	authType string,
	numThreads int,
) (*SnowflakeCredential, error)

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(
	webhookId string,
	name string,
	description string,
	clientUrl string,
	eventTypes []string,
	jobIds []int,
	active bool,
) (*WebhookRead, error)

func (*Client) DeleteConnection

func (c *Client) DeleteConnection(connectionID, projectID string) (string, error)

func (*Client) DeleteCredential added in v0.2.17

func (c *Client) DeleteCredential(credentialId, projectId string) (string, error)

func (*Client) DeleteEnvironment

func (c *Client) DeleteEnvironment(projectId, environmentId int) (string, error)

func (*Client) DeleteEnvironmentVariable

func (c *Client) DeleteEnvironmentVariable(
	environmentVariableName string,
	projectID int,
) (string, error)

func (*Client) DeleteEnvironmentVariableJobOverride added in v0.2.16

func (c *Client) DeleteEnvironmentVariableJobOverride(
	projectID int,
	environmentVariableJobOverrideID int,
) (string, error)

func (*Client) DeleteExtendedAttributes added in v0.2.9

func (c *Client) DeleteExtendedAttributes(projectId, extendedAttributesID int) (string, error)

func (*Client) DeleteGlobalConnection added in v0.3.11

func (c *Client) DeleteGlobalConnection(connectionID int64) (string, error)

func (*Client) DeleteLineageIntegration added in v0.3.20

func (c *Client) DeleteLineageIntegration(projectID int64, lineageIntegrationID int64) error

func (*Client) DeletePostgresCredential

func (c *Client) DeletePostgresCredential(credentialId, projectId string) (string, error)

DeletePostgresCredential deletes a Postgres credential by its ID

func (*Client) DeleteRepository

func (c *Client) DeleteRepository(repositoryID, projectID string) (string, error)

func (*Client) DeleteServiceToken

func (c *Client) DeleteServiceToken(serviceTokenID int) (string, error)

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(webhookId string) (string, error)

func (*Client) DestroyLicenseMap added in v0.2.6

func (c *Client) DestroyLicenseMap(licenseMapID int) error

func (*Client) GetAllConnections added in v0.3.15

func (c *Client) GetAllConnections() ([]GlobalConnectionSummary, error)

func (*Client) GetAllEnvironments added in v0.3.4

func (c *Client) GetAllEnvironments(projectID int) ([]Environment, error)

func (*Client) GetAllGroupIDsByName added in v0.3.3

func (c *Client) GetAllGroupIDsByName(groupName string) []int

func (*Client) GetAllJobs added in v0.3.10

func (c *Client) GetAllJobs(projectID int, environmentID int) ([]JobWithEnvironment, error)

func (*Client) GetAllLicenseMaps added in v0.3.6

func (c *Client) GetAllLicenseMaps() ([]LicenseMap, error)

func (*Client) GetAllNotifications added in v0.3.5

func (c *Client) GetAllNotifications() ([]Notification, error)

func (*Client) GetAllProjects added in v0.3.15

func (c *Client) GetAllProjects(nameContains string) ([]ProjectConnectionRepository, error)

func (*Client) GetAllServiceTokens added in v0.3.5

func (c *Client) GetAllServiceTokens() ([]ServiceToken, error)

func (*Client) GetAzureDevOpsProject added in v0.2.14

func (c *Client) GetAzureDevOpsProject(
	projectName string,
) (*AzureDevOpsProject, error)

func (*Client) GetAzureDevOpsProjects added in v0.2.14

func (c *Client) GetAzureDevOpsProjects() ([]AzureDevOpsProject, error)

func (*Client) GetAzureDevOpsRepositories added in v0.2.14

func (c *Client) GetAzureDevOpsRepositories(
	azureDevOpsProjectID string,
) ([]AzureDevOpsRepository, error)

func (*Client) GetAzureDevOpsRepository added in v0.2.14

func (c *Client) GetAzureDevOpsRepository(
	repositoryName string,
	azureDevOpsProjectID string,
) (*AzureDevOpsRepository, error)

func (*Client) GetBigQueryConnection

func (c *Client) GetBigQueryConnection(
	connectionID, projectID string,
) (*BigQueryConnection, error)

func (*Client) GetBigQueryCredential

func (c *Client) GetBigQueryCredential(
	projectId int,
	credentialId int,
) (*BigQueryCredential, error)

func (*Client) GetConnectedUser

func (c *Client) GetConnectedUser() (*User, error)

func (*Client) GetConnection

func (c *Client) GetConnection(connectionID, projectID string) (*Connection, error)

func (*Client) GetConstants added in v0.2.22

func (c *Client) GetConstants() (*Constants, error)

func (*Client) GetData added in v0.3.3

func (c *Client) GetData(url string) []any

func (*Client) GetDatabricksCredential

func (c *Client) GetDatabricksCredential(
	projectId int,
	credentialId int,
) (*DatabricksCredential, error)

func (*Client) GetEndpoint added in v0.3.3

func (c *Client) GetEndpoint(url string) ([]byte, error)

func (*Client) GetEnvironment

func (c *Client) GetEnvironment(projectId int, environmentId int) (*Environment, error)

func (*Client) GetEnvironmentVariable

func (c *Client) GetEnvironmentVariable(
	projectID int,
	environmentVariableName string,
) (*EnvironmentVariable, error)

func (*Client) GetEnvironmentVariableJobOverride added in v0.2.16

func (c *Client) GetEnvironmentVariableJobOverride(
	projectID int,
	jobDefinitionID int,
	environmentVariableOverrideID int,
) (*EnvironmentVariableJobOverride, error)

func (*Client) GetExtendedAttributes added in v0.2.9

func (c *Client) GetExtendedAttributes(projectId int, extendedAttributesID int) (*ExtendedAttributes, error)

func (*Client) GetFabricConnection added in v0.2.17

func (c *Client) GetFabricConnection(connectionID, projectID string) (*FabricConnection, error)

func (*Client) GetFabricCredential added in v0.2.17

func (c *Client) GetFabricCredential(
	projectId int,
	credentialId int,
) (*FabricCredential, error)

func (*Client) GetGlobalConnectionAdapter added in v0.3.12

func (c *Client) GetGlobalConnectionAdapter(connectionID int64) (*GlobalConnectionAdapter, error)

func (*Client) GetGroup

func (c *Client) GetGroup(groupID int) (*Group, error)

func (*Client) GetJob

func (c *Client) GetJob(jobID string) (*Job, error)

func (*Client) GetLicenseMap added in v0.2.6

func (c *Client) GetLicenseMap(licenseMapId int) (*LicenseMap, error)

func (*Client) GetLineageIntegration added in v0.3.20

func (c *Client) GetLineageIntegration(
	projectID int64,
	lineageIntegrationID int64,
) (*LineageIntegration, error)

func (*Client) GetNotification added in v0.2.3

func (c *Client) GetNotification(notificationID string) (*Notification, error)

func (*Client) GetPermissionIDs added in v0.2.22

func (c *Client) GetPermissionIDs() ([]string, error)

func (*Client) GetPostgresCredential

func (c *Client) GetPostgresCredential(
	projectId int,
	credentialId int,
) (*PostgresCredential, error)

GetPostgresCredential retrieves a specific Postgres credential by its ID

func (*Client) GetPrivatelinkEndpoint

func (c *Client) GetPrivatelinkEndpoint(endpointName string, privatelinkEndpointURL string) (*PrivatelinkEndpoint, error)

func (*Client) GetProject

func (c *Client) GetProject(projectID string) (*Project, error)

func (*Client) GetProjectByName added in v0.2.10

func (c *Client) GetProjectByName(projectName string) (*Project, error)

func (*Client) GetRepository

func (c *Client) GetRepository(
	repositoryID, projectID string,
) (*Repository, error)

func (*Client) GetServiceToken

func (c *Client) GetServiceToken(serviceTokenID int) (*ServiceToken, error)

func (*Client) GetServiceTokenPermissions

func (c *Client) GetServiceTokenPermissions(serviceTokenID int) (*[]ServiceTokenPermission, error)

func (*Client) GetSnowflakeCredential

func (c *Client) GetSnowflakeCredential(
	projectId int,
	credentialId int,
) (*SnowflakeCredential, error)

func (*Client) GetUser

func (c *Client) GetUser(email string) (*User, error)

func (*Client) GetUserGroups added in v0.2.4

func (c *Client) GetUserGroups(userId int) (*UserGroupsCurrentAccount, error)

func (*Client) GetUsers added in v0.2.13

func (c *Client) GetUsers() ([]User, error)

func (*Client) GetWebhook

func (c *Client) GetWebhook(webhookID string) (*WebhookRead, error)

func (*Client) UpdateBigQueryConnection

func (c *Client) UpdateBigQueryConnection(
	connectionID, projectID string,
	connection BigQueryConnection,
) (*BigQueryConnection, error)

func (*Client) UpdateBigQueryCredential

func (c *Client) UpdateBigQueryCredential(
	projectId int,
	credentialId int,
	BigQueryCredential BigQueryCredential,
) (*BigQueryCredential, error)

func (*Client) UpdateConnection

func (c *Client) UpdateConnection(
	connectionID, projectID string,
	connection Connection,
) (*Connection, error)

func (*Client) UpdateDatabricksCredentialGlobConn added in v0.3.19

func (c *Client) UpdateDatabricksCredentialGlobConn(
	projectId int,
	credentialId int,
	databricksCredential DatabricksCredentialGLobConnPatch,
) (*DatabricksCredential, error)

func (*Client) UpdateDatabricksCredentialLegacy added in v0.3.19

func (c *Client) UpdateDatabricksCredentialLegacy(
	projectId int,
	credentialId int,
	databricksCredential DatabricksCredential,
) (*DatabricksCredential, error)

func (*Client) UpdateEnvironment

func (c *Client) UpdateEnvironment(
	projectId int,
	environmentId int,
	environment Environment,
) (*Environment, error)

func (*Client) UpdateEnvironmentVariable

func (c *Client) UpdateEnvironmentVariable(
	projectID int,
	environmentVariable EnvironmentVariable,
) (*EnvironmentVariable, error)

func (*Client) UpdateEnvironmentVariableJobOverride added in v0.2.16

func (c *Client) UpdateEnvironmentVariableJobOverride(
	projectID int,
	environmentVariableJobOverrideID int,
	environmentVariableJobOverride EnvironmentVariableJobOverride,
) (*EnvironmentVariableJobOverride, error)

func (*Client) UpdateExtendedAttributes added in v0.2.9

func (c *Client) UpdateExtendedAttributes(projectId int, extendedAttributesID int, extendedAttributes ExtendedAttributes) (*ExtendedAttributes, error)

func (*Client) UpdateFabricConnection added in v0.2.17

func (c *Client) UpdateFabricConnection(
	connectionID, projectID string,
	connection FabricConnection,
) (*FabricConnection, error)

func (*Client) UpdateFabricCredential added in v0.2.17

func (c *Client) UpdateFabricCredential(
	projectId int,
	credentialId int,
	fabricCredential FabricCredential,
) (*FabricCredential, error)

func (*Client) UpdateGroup

func (c *Client) UpdateGroup(groupID int, group Group) (*Group, error)

func (*Client) UpdateGroupPermissions

func (c *Client) UpdateGroupPermissions(
	groupID int,
	groupPermissions []GroupPermission,
) (*[]GroupPermission, error)

func (*Client) UpdateJob

func (c *Client) UpdateJob(jobId string, job Job) (*Job, error)

func (*Client) UpdateLicenseMap added in v0.2.6

func (c *Client) UpdateLicenseMap(licenseMapID int, licenseMap LicenseMap) (*LicenseMap, error)

func (*Client) UpdateLineageIntegration added in v0.3.20

func (c *Client) UpdateLineageIntegration(
	projectID int64,
	lineageIntegrationID int64,
	lineageIntegration LineageIntegration,
) (*LineageIntegration, error)

func (*Client) UpdateNotification added in v0.2.3

func (c *Client) UpdateNotification(
	notificationId string,
	notification Notification,
) (*Notification, error)

func (*Client) UpdatePostgresCredential

func (c *Client) UpdatePostgresCredential(
	projectId int,
	credentialId int,
	postgresCredential PostgresCredential,
) (*PostgresCredential, error)

UpdatePostgresCredential updates an existing Postgres credential

func (*Client) UpdateProject

func (c *Client) UpdateProject(projectID string, project Project) (*Project, error)

func (*Client) UpdateRepository

func (c *Client) UpdateRepository(
	repositoryID, projectID string,
	repository Repository,
) (*Repository, error)

func (*Client) UpdateServiceToken

func (c *Client) UpdateServiceToken(serviceTokenID int, serviceToken ServiceToken) (*ServiceToken, error)

func (*Client) UpdateServiceTokenPermissions

func (c *Client) UpdateServiceTokenPermissions(serviceTokenID int, serviceTokenPermissions []ServiceTokenPermission) (*[]ServiceTokenPermission, error)

func (*Client) UpdateSnowflakeCredential

func (c *Client) UpdateSnowflakeCredential(
	projectId int,
	credentialId int,
	snowflakeCredential SnowflakeCredential,
) (*SnowflakeCredential, error)

func (*Client) UpdateWebhook

func (c *Client) UpdateWebhook(webhookId string, webhook WebhookWrite) (*WebhookRead, error)

type Connection

type Connection struct {
	BaseConnection
	Details ConnectionDetails `json:"details"`
}

type ConnectionDetails

type ConnectionDetails struct {
	Account                string                    `json:"account,omitempty"`
	Database               string                    `json:"database,omitempty"`
	DBName                 string                    `json:"dbname,omitempty"`
	Warehouse              string                    `json:"warehouse,omitempty"`
	AllowSSO               *bool                     `json:"allow_sso,omitempty"`
	ClientSessionKeepAlive *bool                     `json:"client_session_keep_alive,omitempty"`
	Role                   string                    `json:"role,omitempty"`
	OAuthClientID          string                    `json:"oauth_client_id,omitempty"`
	OAuthClientSecret      string                    `json:"oauth_client_secret,omitempty"`
	Host                   string                    `json:"hostname,omitempty"`
	Port                   int                       `json:"port,omitempty"`
	TunnelEnabled          *bool                     `json:"tunnel_enabled,omitempty"`
	AdapterId              *int                      `json:"adapter_id,omitempty"`
	AdapterDetails         *AdapterCredentialDetails `json:"connection_details,omitempty"`
}

type ConnectionListResponse

type ConnectionListResponse struct {
	Data   []Connection   `json:"data"`
	Status ResponseStatus `json:"status"`
}

type ConnectionResponse

type ConnectionResponse struct {
	Data   Connection     `json:"data"`
	Status ResponseStatus `json:"status"`
}

type Constants added in v0.2.22

type Constants struct {
	PermissionSets map[string]string `json:"permissions_sets"`
}

type ConstantsResponse added in v0.2.22

type ConstantsResponse struct {
	Data   Constants      `json:"data"`
	Status ResponseStatus `json:"status"`
}

This is not used now but allows us to find the list of permission sets allowed Terraform doesn't allow to run it in the offline validation mode though as we don't have access to the configuration context

type CreateEnvironmentVariableResponse

type CreateEnvironmentVariableResponse struct {
	Data   CreateEnvironmentVariableResponseMessage `json:"data"`
	Status ResponseStatus                           `json:"status"`
}

type CreateEnvironmentVariableResponseMessage

type CreateEnvironmentVariableResponseMessage struct {
	Message        string `json:"message"`
	NewVariableIDs []int  `json:"new_var_ids"`
}

type CurrentUser

type CurrentUser struct {
	User User `json:"user"`
}

type CurrentUserResponse

type CurrentUserResponse struct {
	Data   CurrentUser    `json:"data"`
	Status ResponseStatus `json:"status"`
}

type DatabricksConfig added in v0.3.12

type DatabricksConfig struct {
	Host         *string                   `json:"host,omitempty"`
	HTTPPath     *string                   `json:"http_path,omitempty"`
	Catalog      nullable.Nullable[string] `json:"catalog,omitempty"`
	ClientID     nullable.Nullable[string] `json:"client_id,omitempty"`
	ClientSecret nullable.Nullable[string] `json:"client_secret,omitempty"`
}

func (DatabricksConfig) AdapterVersion added in v0.3.12

func (DatabricksConfig) AdapterVersion() string

type DatabricksCredential

type DatabricksCredential struct {
	ID                           *int                                   `json:"id"`
	Account_Id                   int                                    `json:"account_id"`
	Project_Id                   int                                    `json:"project_id"`
	Type                         string                                 `json:"type"`
	State                        int                                    `json:"state"`
	Threads                      int                                    `json:"threads"`
	Target_Name                  string                                 `json:"target_name"`
	Adapter_Id                   int                                    `json:"adapter_id"`
	AdapterVersion               string                                 `json:"adapter_version,omitempty"`
	Credential_Details           AdapterCredentialDetails               `json:"credential_details"`
	UnencryptedCredentialDetails DatabricksUnencryptedCredentialDetails `json:"unencrypted_credential_details"`
}

type DatabricksCredentialGLobConnPatch added in v0.3.19

type DatabricksCredentialGLobConnPatch struct {
	ID                int                      `json:"id"`
	CredentialDetails AdapterCredentialDetails `json:"credential_details"`
}

type DatabricksCredentialGlobConn added in v0.3.19

type DatabricksCredentialGlobConn struct {
	ID                *int                     `json:"id"`
	AccountID         int                      `json:"account_id"`
	ProjectID         int                      `json:"project_id"`
	Type              string                   `json:"type"`
	State             int                      `json:"state"`
	Threads           int                      `json:"threads"`
	AdapterVersion    string                   `json:"adapter_version"`
	CredentialDetails AdapterCredentialDetails `json:"credential_details"`
}

type DatabricksCredentialListResponse

type DatabricksCredentialListResponse struct {
	Data   []DatabricksCredential `json:"data"`
	Status ResponseStatus         `json:"status"`
}

type DatabricksCredentialResponse

type DatabricksCredentialResponse struct {
	Data   DatabricksCredential `json:"data"`
	Status ResponseStatus       `json:"status"`
}

type DatabricksUnencryptedCredentialDetails

type DatabricksUnencryptedCredentialDetails struct {
	Catalog    string `json:"catalog"`
	Schema     string `json:"schema"`
	TargetName string `json:"target_name"`
	Threads    int    `json:"threads"`
	Token      string `json:"token,omitempty"`
}

type DeployKey

type DeployKey struct {
	ID        int    `json:"id"`
	AccountID int    `json:"account_id"`
	State     int    `json:"state"`
	PublicKey string `json:"public_key"`
}

type EmptyConfig added in v0.3.15

type EmptyConfig struct {
}

func (EmptyConfig) AdapterVersion added in v0.3.15

func (EmptyConfig) AdapterVersion() string

type Environment

type Environment struct {
	ID                           *int                 `json:"id,omitempty"`
	State                        int                  `json:"state,omitempty"`
	Account_Id                   int                  `json:"account_id"`
	Project_Id                   int                  `json:"project_id"`
	Credential_Id                *int                 `json:"credentials_id,omitempty"`
	Name                         string               `json:"name"`
	Dbt_Version                  string               `json:"dbt_version"`
	Type                         string               `json:"type"`
	Use_Custom_Branch            bool                 `json:"use_custom_branch"`
	Custom_Branch                *string              `json:"custom_branch"`
	Environment_Id               *int                 `json:"-"` //TODO: check why this is here
	Support_Docs                 bool                 `json:"supports_docs"`
	Created_At                   *string              `json:"created_at"`
	Updated_At                   *string              `json:"updated_at"`
	Project                      Project              `json:"project"`
	Jobs                         *string              `json:"jobs"`
	Credentials                  *SnowflakeCredential `json:"credentials"`
	Custom_Environment_Variables *string              `json:"custom_environment_variables"`
	DeploymentType               *string              `json:"deployment_type,omitempty"`
	ExtendedAttributesID         *int                 `json:"extended_attributes_id,omitempty"`
	ConnectionID                 *int                 `json:"connection_id,omitempty"`
	EnableModelQueryHistory      bool                 `json:"enable_model_query_history,omitempty"`
}

type EnvironmentCategory added in v0.3.10

type EnvironmentCategory = string

EnvironmentCategory is a type for the different environment categories

const (
	// All is the category for all environments
	EnvironmentCategory_All EnvironmentCategory = "all"
	// Development is the category for development environments
	EnvironmentCategory_Development EnvironmentCategory = "development"
	// Staging is the category for staging environments
	EnvironmentCategory_Staging EnvironmentCategory = "staging"
	// Production is the category for production environments
	EnvironmentCategory_Production EnvironmentCategory = "production"
	// Other is the category for other environments
	EnvironmentCategory_Other EnvironmentCategory = "other"
)

type EnvironmentResponse

type EnvironmentResponse struct {
	Data   Environment    `json:"data"`
	Status ResponseStatus `json:"status"`
}

type EnvironmentVariable

type EnvironmentVariable struct {
	Name                  string
	ProjectID             int
	EnvironmentNameValues map[string]string
}

type EnvironmentVariableJobOverride added in v0.2.16

type EnvironmentVariableJobOverride struct {
	ID              *int   `json:"id"`
	AccountID       int    `json:"account_id"`
	JobDefinitionID int    `json:"job_definition_id"`
	Name            string `json:"name"`
	ProjectID       int    `json:"project_id"`
	RawValue        string `json:"raw_value"`
	Type            string `json:"type"`
}

type EnvironmentVariableJobOverrideAllResponse added in v0.2.16

type EnvironmentVariableJobOverrideAllResponse struct {
	Data   any            `json:"data"`
	Status ResponseStatus `json:"status"`
}

type EnvironmentVariableJobOverrideResponse added in v0.2.16

type EnvironmentVariableJobOverrideResponse struct {
	Data   EnvironmentVariableJobOverride `json:"data"`
	Status ResponseStatus                 `json:"status"`
}

type EnvironmentVariableNameValue

type EnvironmentVariableNameValue struct {
	ID    int    `json:"id,omitempty"`
	Value string `json:"value"`
}

type EnvironmentVariablesGet

type EnvironmentVariablesGet struct {
	Environment []string                                           `json:"environments"`
	Variables   map[string]map[string]EnvironmentVariableNameValue `json:"variables"`
}

type ExtendedAttributes added in v0.2.9

type ExtendedAttributes struct {
	ID                 *int            `json:"id,omitempty"`
	State              int             `json:"state,omitempty"`
	AccountID          int             `json:"account_id"`
	ProjectID          int             `json:"project_id"`
	ExtendedAttributes json.RawMessage `json:"extended_attributes"`
}

type ExtendedAttributesResponse added in v0.2.9

type ExtendedAttributesResponse struct {
	Data   ExtendedAttributes `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type Extra added in v0.3.3

type Extra struct {
	Pagination Pagination `json:"pagination"`
}

type FabricConfig added in v0.3.13

type FabricConfig struct {
	Driver       *string `json:"driver,omitempty"`
	Server       *string `json:"server,omitempty"`
	Port         *int64  `json:"port,omitempty"`
	Database     *string `json:"database,omitempty"`
	Retries      *int64  `json:"retries,omitempty"`
	LoginTimeout *int64  `json:"login_timeout,omitempty"`
	QueryTimeout *int64  `json:"query_timeout,omitempty"`
}

func (FabricConfig) AdapterVersion added in v0.3.13

func (FabricConfig) AdapterVersion() string

type FabricConnection added in v0.2.17

type FabricConnection struct {
	BaseConnection
	Details FabricConnectionDetails `json:"details"`
}

type FabricConnectionDetails added in v0.2.17

type FabricConnectionDetails struct {
	AdapterId      int                      `json:"adapter_id,omitempty"`
	AdapterDetails AdapterCredentialDetails `json:"connection_details,omitempty"`
}

type FabricConnectionListResponse added in v0.2.17

type FabricConnectionListResponse struct {
	Data   []FabricConnection `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type FabricConnectionResponse added in v0.2.17

type FabricConnectionResponse struct {
	Data   FabricConnection `json:"data"`
	Status ResponseStatus   `json:"status"`
}

type FabricCredential added in v0.2.17

type FabricCredential struct {
	ID                           *int                               `json:"id"`
	Account_Id                   int                                `json:"account_id"`
	Project_Id                   int                                `json:"project_id"`
	Type                         string                             `json:"type"`
	State                        int                                `json:"state"`
	Threads                      int                                `json:"threads"`
	Adapter_Id                   int                                `json:"adapter_id"`
	CredentialDetails            AdapterCredentialDetails           `json:"credential_details"`
	UnencryptedCredentialDetails FabricUnencryptedCredentialDetails `json:"unencrypted_credential_details"`
}

type FabricCredentialListResponse added in v0.2.17

type FabricCredentialListResponse struct {
	Data   []FabricCredential `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type FabricCredentialResponse added in v0.2.17

type FabricCredentialResponse struct {
	Data   FabricCredential `json:"data"`
	Status ResponseStatus   `json:"status"`
}

type FabricUnencryptedCredentialDetails added in v0.2.17

type FabricUnencryptedCredentialDetails struct {
	Authentication      string `json:"authentication"`
	User                string `json:"user"`
	ClientId            string `json:"client_id"`
	Schema              string `json:"schema"`
	SchemaAuthorization string `json:"schema_authorization"`
	TenantId            string `json:"tenant_id"`
}

type GetEnvironmentVariableResponse

type GetEnvironmentVariableResponse struct {
	Data   EnvironmentVariablesGet `json:"data"`
	Status ResponseStatus          `json:"status"`
}

type GlobalConnectionAdapter added in v0.3.12

type GlobalConnectionAdapter struct {
	Data struct {
		ID             int64  `json:"id"`
		AdapterVersion string `json:"adapter_version"`
	} `json:"data"`
}

TODO: Could be improved in the future, maybe creating a client with empty Config For now, I couldn't use it as the AdapterVersion is not returned in the GET response To be revisited when we handle different versions for the same adapter

type GlobalConnectionClient added in v0.3.11

type GlobalConnectionClient[T GlobalConnectionConfig] struct{ *Client }

func NewGlobalConnectionClient added in v0.3.11

func NewGlobalConnectionClient[T GlobalConnectionConfig](c *Client) GlobalConnectionClient[T]

func (*GlobalConnectionClient[T]) Create added in v0.3.11

func (c *GlobalConnectionClient[T]) Create(
	common GlobalConnectionCommon,
	config T,
) (*GlobalConnectionCommon, *T, error)

func (*GlobalConnectionClient[T]) CreateUpdateEncryption added in v0.3.13

func (c *GlobalConnectionClient[T]) CreateUpdateEncryption(
	encryptionPayload GlobalConnectionEncryptionPayload,
) (*GlobalConnectionEncryptionPayload, error)

func (*GlobalConnectionClient[T]) Get added in v0.3.11

func (c *GlobalConnectionClient[T]) Get(connectionID int64) (*GlobalConnectionCommon, *T, error)

func (*GlobalConnectionClient[T]) GetEncryptionsForConnection added in v0.3.13

func (c *GlobalConnectionClient[T]) GetEncryptionsForConnection(
	connectionID int64,
) (*[]GlobalConnectionEncryptionPayload, error)

func (*GlobalConnectionClient[T]) Update added in v0.3.11

func (c *GlobalConnectionClient[T]) Update(
	connectionID int64,
	common GlobalConnectionCommon,
	config T,
) (*GlobalConnectionCommon, *T, error)

type GlobalConnectionCommon added in v0.3.11

type GlobalConnectionCommon struct {
	ID                    *int64                    `json:"id,omitempty"`
	Name                  *string                   `json:"name,omitempty"`
	IsSshTunnelEnabled    *bool                     `json:"is_ssh_tunnel_enabled,omitempty"`
	PrivateLinkEndpointId nullable.Nullable[string] `json:"private_link_endpoint_id,omitempty"`
	OauthConfigurationId  *int64                    `json:"oauth_configuration_id,omitempty"`
}

type GlobalConnectionConfig added in v0.3.11

type GlobalConnectionConfig interface {
	AdapterVersion() string
}

type GlobalConnectionEncryptionPayload added in v0.3.13

type GlobalConnectionEncryptionPayload struct {
	ID           *int64 `json:"id"`
	AccountID    int64  `json:"account_id"`
	ConnectionID int64  `json:"connection_id"`
	Username     string `json:"username,omitempty"`
	Port         int64  `json:"port,omitempty"`
	HostName     string `json:"hostname,omitempty"`
	PublicKey    string `json:"public_key,omitempty"`
	State        int64  `json:"state,omitempty"`
}

type GlobalConnectionSummary added in v0.3.15

type GlobalConnectionSummary struct {
	ID                    int64   `json:"id"`
	CreatedAt             string  `json:"created_at"`
	UpdatedAt             string  `json:"updated_at"`
	AccountID             int64   `json:"account_id"`
	Name                  string  `json:"name"`
	AdapterVersion        string  `json:"adapter_version"`
	PrivateLinkEndpointID *string `json:"private_link_endpoint_id"`
	IsSSHTunnelEnabled    bool    `json:"is_ssh_tunnel_enabled"`
	OauthConfigurationID  *int64  `json:"oauth_configuration_id"`
	EnvironmentCount      int64   `json:"environment__count"`
}

type Group

type Group struct {
	ID               *int              `json:"id"`
	Name             string            `json:"name"`
	AccountID        int               `json:"account_id"`
	State            int               `json:"state"`
	AssignByDefault  bool              `json:"assign_by_default"`
	SSOMappingGroups []string          `json:"sso_mapping_groups"`
	Permissions      []GroupPermission `json:"group_permissions,omitempty"`
}

type GroupPermission

type GroupPermission struct {
	ID                            *int     `json:"id,omitempty"`
	AccountID                     int      `json:"account_id"`
	GroupID                       int      `json:"group_id"`
	ProjectID                     int      `json:"project_id,omitempty"`
	AllProjects                   bool     `json:"all_projects"`
	State                         int      `json:"state,omitempty"`
	Set                           string   `json:"permission_set,omitempty"`
	Level                         string   `json:"permission_level,omitempty"`
	WritableEnvironmentCategories []string `json:"writable_environment_categories,omitempty"` // TODO(cwalden): use environment_category.go#EnvironmentCategory ?
}

type GroupPermissionListResponse

type GroupPermissionListResponse struct {
	Data   []GroupPermission `json:"data"`
	Status ResponseStatus    `json:"status"`
}

type GroupResponse

type GroupResponse struct {
	Data   Group          `json:"data"`
	Status ResponseStatus `json:"status"`
}

type Job

type Job struct {
	ID                     *int                  `json:"id"`
	Account_Id             int                   `json:"account_id"`
	Project_Id             int                   `json:"project_id"`
	Environment_Id         int                   `json:"environment_id"`
	Name                   string                `json:"name"`
	Description            string                `json:"description"`
	Execute_Steps          []string              `json:"execute_steps"`
	Dbt_Version            *string               `json:"dbt_version"`
	JobType                string                `json:"job_type,omitempty"`
	Triggers               JobTrigger            `json:"triggers"`
	Settings               JobSettings           `json:"settings"`
	State                  int                   `json:"state"`
	Generate_Docs          bool                  `json:"generate_docs"`
	Schedule               JobSchedule           `json:"schedule"`
	Run_Generate_Sources   bool                  `json:"run_generate_sources"`
	Deferring_Job_Id       *int                  `json:"deferring_job_definition_id"`
	DeferringEnvironmentId *int                  `json:"deferring_environment_id"`
	Execution              JobExecution          `json:"execution"`
	TriggersOnDraftPR      bool                  `json:"triggers_on_draft_pr"`
	JobCompletionTrigger   *JobCompletionTrigger `json:"job_completion_trigger_condition"`
	RunCompareChanges      bool                  `json:"run_compare_changes"`
}

type JobCompletionTrigger added in v0.2.20

type JobCompletionTrigger struct {
	Condition JobCompletionTriggerCondition `json:"condition"`
}

type JobCompletionTriggerCondition added in v0.2.20

type JobCompletionTriggerCondition struct {
	JobID     int   `json:"job_id"`
	ProjectID int   `json:"project_id"`
	Statuses  []int `json:"statuses"`
}

type JobExecution

type JobExecution struct {
	Timeout_Seconds int `json:"timeout_seconds"`
}

type JobResponse

type JobResponse struct {
	Data   Job            `json:"data"`
	Status ResponseStatus `json:"status"`
}

type JobSchedule

type JobSchedule struct {
	Cron string       `json:"cron"`
	Date scheduleDate `json:"date"`
	Time scheduleTime `json:"time"`
}

type JobSettings

type JobSettings struct {
	Threads     int    `json:"threads"`
	Target_Name string `json:"target_name"`
}

type JobTrigger

type JobTrigger struct {
	Github_Webhook     bool `json:"github_webhook"`
	Schedule           bool `json:"schedule"`
	GitProviderWebhook bool `json:"git_provider_webhook"`
	OnMerge            bool `json:"on_merge"`
}

type JobWithEnvironment added in v0.3.10

type JobWithEnvironment struct {
	Job
	Environment Environment `json:"environment"`
}

type LicenseMap added in v0.2.6

type LicenseMap struct {
	ID                      *int     `json:"id"`
	LicenseType             string   `json:"license_type"`
	AccountID               int      `json:"account_id"`
	State                   int      `json:"state"`
	SSOLicenseMappingGroups []string `json:"sso_license_mapping_groups"`
}

type LicenseMapResponse added in v0.2.6

type LicenseMapResponse struct {
	Data   LicenseMap     `json:"data"`
	Status ResponseStatus `json:"status"`
}

type LineageIntegration added in v0.3.20

type LineageIntegration struct {
	ID        *int64                   `json:"id,omitempty"`
	AccountID int64                    `json:"account_id,omitempty"`
	ProjectID int64                    `json:"project_id,omitempty"`
	Name      string                   `json:"name,omitempty"`
	Config    LineageIntegrationConfig `json:"config"`
}

type LineageIntegrationConfig added in v0.3.20

type LineageIntegrationConfig struct {
	Host      string `json:"host,omitempty"`
	SiteID    string `json:"site_id,omitempty"`
	TokenName string `json:"token_name,omitempty"`
	Token     string `json:"token,omitempty"`
}

type LineageIntegrationResponse added in v0.3.20

type LineageIntegrationResponse struct {
	Data   LineageIntegration `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type Notification added in v0.2.3

type Notification struct {
	Id               *int    `json:"id,omitempty"`
	AccountId        int     `json:"account_id"`
	UserId           int     `json:"user_id"`
	OnCancel         []int   `json:"on_cancel"`
	OnFailure        []int   `json:"on_failure"`
	OnWarning        []int   `json:"on_warning"`
	OnSuccess        []int   `json:"on_success"`
	State            int     `json:"state"`
	NotificationType int     `json:"type"`
	ExternalEmail    *string `json:"external_email"`
	SlackChannelID   *string `json:"slack_channel_id"`
	SlackChannelName *string `json:"slack_channel_name"`
}

type NotificationResponse added in v0.2.3

type NotificationResponse struct {
	Data   Notification   `json:"data"`
	Status ResponseStatus `json:"status"`
}

type Pagination added in v0.3.3

type Pagination struct {
	Count      int `json:"count"`
	TotalCount int `json:"total_count"`
}

type Permission added in v0.2.4

type Permission struct {
	AccountID int     `json:"account_id"`
	Groups    []Group `json:"groups"`
}

type PostgresConfig added in v0.3.13

type PostgresConfig struct {
	HostName *string                   `json:"hostname,omitempty"`
	Port     *int64                    `json:"port,omitempty"`
	DBName   nullable.Nullable[string] `json:"dbname,omitempty"`
}

func (PostgresConfig) AdapterVersion added in v0.3.13

func (PostgresConfig) AdapterVersion() string

type PostgresCredential

type PostgresCredential struct {
	ID             *int   `json:"id"`
	Account_Id     int    `json:"account_id"`
	Project_Id     int    `json:"project_id"`
	Type           string `json:"type"`
	State          int    `json:"state"`
	Threads        int    `json:"threads"`
	Username       string `json:"username"`
	Default_Schema string `json:"default_schema"`
	Target_Name    string `json:"target_name"`
	Password       string `json:"password,omitempty"`
}

type PostgresCredentialResponse

type PostgresCredentialResponse struct {
	Data   PostgresCredential `json:"data"`
	Status ResponseStatus     `json:"status"`
}

type PrivatelinkEndpoint

type PrivatelinkEndpoint struct {
	Account_Id             int    `json:"account_id"`
	Name                   string `json:"name"`
	Type                   string `json:"type"`
	PrivatelinkEndpointURL string `json:"private_link_endpoint"`
	CIDRRange              string `json:"cidr_range"`
	State                  int    `json:"state"`
	ID                     string `json:"id"`
}

type PrivatelinkEndpointListResponse

type PrivatelinkEndpointListResponse struct {
	Data   []PrivatelinkEndpoint `json:"data"`
	Status ResponseStatus        `json:"status"`
}

type PrivatelinkEndpointResponse

type PrivatelinkEndpointResponse struct {
	Data   PrivatelinkEndpoint `json:"data"`
	Status ResponseStatus      `json:"status"`
}

type Project

type Project struct {
	ID                     *int    `json:"id,omitempty"`
	Name                   string  `json:"name"`
	Description            string  `json:"description"`
	DbtProjectSubdirectory *string `json:"dbt_project_subdirectory,omitempty"`
	ConnectionID           *int    `json:"connection_id,omitempty"`
	RepositoryID           *int    `json:"repository_id,omitempty"`
	State                  int     `json:"state"`
	AccountID              int     `json:"account_id"`
	FreshnessJobId         *int    `json:"freshness_job_id"`
	DocsJobId              *int    `json:"docs_job_id,"`
}

type ProjectConnectionRepository added in v0.3.15

type ProjectConnectionRepository struct {
	Name                   string                                `json:"name,omitempty"`
	AccountID              int64                                 `json:"account_id,omitempty"`
	Description            string                                `json:"description,omitempty"`
	ConnectionID           int64                                 `json:"connection_id,omitempty"`
	RepositoryID           int64                                 `json:"repository_id,omitempty"`
	SemanticLayerConfigID  *int64                                `json:"semantic_layer_config_id,omitempty"`
	SkippedSetup           bool                                  `json:"skipped_setup,omitempty"`
	State                  int64                                 `json:"state,omitempty"`
	DbtProjectSubdirectory string                                `json:"dbt_project_subdirectory,omitempty"`
	DocsJobID              *int64                                `json:"docs_job_id,omitempty"`
	FreshnessJobID         *int64                                `json:"freshness_job_id,omitempty"`
	ID                     int64                                 `json:"id,omitempty"`
	CreatedAt              string                                `json:"created_at,omitempty"`
	UpdatedAt              string                                `json:"updated_at,omitempty"`
	Connection             *globalConnectionPayload[EmptyConfig] `json:"connection,omitempty"`
	Environments           any                                   `json:"environments,omitempty"`
	Repository             *Repository                           `json:"repository,omitempty"`
	GroupPermissions       any                                   `json:"group_permissions,omitempty"`
	DocsJob                any                                   `json:"docs_job,omitempty"`
	FreshnessJob           any                                   `json:"freshness_job,omitempty"`
}

type ProjectListResponse

type ProjectListResponse struct {
	Data   []Project      `json:"data"`
	Status ResponseStatus `json:"status"`
	Extra  ResponseExtra  `json:"extra"`
}

type ProjectResponse

type ProjectResponse struct {
	Data   Project        `json:"data"`
	Status ResponseStatus `json:"status"`
}

type RedshiftConfig added in v0.3.13

type RedshiftConfig struct {
	HostName *string                   `json:"hostname,omitempty"`
	Port     *int64                    `json:"port,omitempty"`
	DBName   nullable.Nullable[string] `json:"dbname,omitempty"`
}

Redshift and Postgres are the same today but they might diverge in the future to support more authentication methods

func (RedshiftConfig) AdapterVersion added in v0.3.13

func (RedshiftConfig) AdapterVersion() string

type Repository

type Repository struct {
	ID                                    *int       `json:"id,omitempty"`
	AccountID                             int        `json:"account_id"`
	ProjectID                             int        `json:"project_id"`
	RemoteUrl                             string     `json:"remote_url"`
	State                                 int        `json:"state"`
	AzureActiveDirectoryProjectID         *string    `json:"azure_active_directory_project_id,omitempty"`
	AzureActiveDirectoryRepositoryID      *string    `json:"azure_active_directory_repository_id,omitempty"`
	AzureBypassWebhookRegistrationFailure *bool      `json:"azure_bypass_webhook_registration_failure,omitempty"`
	GitCloneStrategy                      string     `json:"git_clone_strategy"`
	RepositoryCredentialsID               *int       `json:"repository_credentials_id,omitempty"`
	GitlabProjectID                       *int       `json:"gitlab_project_id,omitempty"`
	GithubInstallationID                  *int       `json:"github_installation_id,omitempty"`
	DeployKey                             *DeployKey `json:"deploy_key,omitempty"`
	DeployKeyID                           *int       `json:"deploy_key_id,omitempty"`
	PullRequestURLTemplate                string     `json:"pull_request_url_template,omitempty"`
}

type RepositoryListResponse

type RepositoryListResponse struct {
	Data   []Repository   `json:"data"`
	Status ResponseStatus `json:"status"`
}

type RepositoryResponse

type RepositoryResponse struct {
	Data   Repository     `json:"data"`
	Status ResponseStatus `json:"status"`
}

type Response added in v0.3.3

type Response struct {
	Data  []any `json:"data"`
	Extra Extra `json:"extra"`
}

type ResponseExtra added in v0.2.10

type ResponseExtra struct {
	Pagination ResponseExtraPagination `json:"pagination"`
	Filters    ResponseExtraFilters    `json:"filters"`
}

type ResponseExtraFilters added in v0.2.10

type ResponseExtraFilters struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type ResponseExtraPagination added in v0.2.10

type ResponseExtraPagination struct {
	Count      int `json:"count"`
	TotalCount int `json:"total_count"`
}

type ResponseStatus

type ResponseStatus struct {
	Code              int    `json:"code"`
	Is_Success        bool   `json:"is_success"`
	User_Message      string `json:"user_message"`
	Developer_Message string `json:"developer_message"`
}

type ServiceToken

type ServiceToken struct {
	ID          *int                     `json:"id"`
	AccountID   int                      `json:"account_id"`
	UID         string                   `json:"uid"`
	Name        string                   `json:"name"`
	TokenString *string                  `json:"token_string,omitempty"`
	State       int                      `json:"state"`
	Permissions []ServiceTokenPermission `json:"service_token_permissions,omitempty"`
}

type ServiceTokenListResponse

type ServiceTokenListResponse struct {
	Data   []ServiceToken `json:"data"`
	Status ResponseStatus `json:"status"`
}

type ServiceTokenPermission

type ServiceTokenPermission struct {
	ID             *int                  `json:"id,omitempty"`
	AccountID      int                   `json:"account_id"`
	ServiceTokenID int                   `json:"service_token_id"`
	ProjectID      int                   `json:"project_id,omitempty"`
	AllProjects    bool                  `json:"all_projects"`
	State          int                   `json:"state,omitempty"`
	Set            string                `json:"permission_set,omitempty"`
	WritableEnvs   []EnvironmentCategory `json:"writable_environment_categories,omitempty"`
}

type ServiceTokenPermissionListResponse

type ServiceTokenPermissionListResponse struct {
	Data   []ServiceTokenPermission `json:"data"`
	Status ResponseStatus           `json:"status"`
}

type ServiceTokenResponse

type ServiceTokenResponse struct {
	Data   ServiceToken   `json:"data"`
	Status ResponseStatus `json:"status"`
}

type SnowflakeConfig added in v0.3.11

type SnowflakeConfig struct {
	Account                *string                   `json:"account,omitempty"`
	Database               *string                   `json:"database,omitempty"`
	Warehouse              *string                   `json:"warehouse,omitempty"`
	ClientSessionKeepAlive *bool                     `json:"client_session_keep_alive,omitempty"`
	Role                   nullable.Nullable[string] `json:"role,omitempty"`
	AllowSso               *bool                     `json:"allow_sso,omitempty"`
	OauthClientID          *string                   `json:"oauth_client_id,omitempty"`
	OauthClientSecret      *string                   `json:"oauth_client_secret,omitempty"`
}

func (SnowflakeConfig) AdapterVersion added in v0.3.11

func (SnowflakeConfig) AdapterVersion() string

type SnowflakeCredential

type SnowflakeCredential struct {
	ID                   *int   `json:"id"`
	Account_Id           int    `json:"account_id"`
	Project_Id           int    `json:"project_id"`
	Type                 string `json:"type"`
	State                int    `json:"state"`
	Threads              int    `json:"threads"`
	User                 string `json:"user"`
	Password             string `json:"password,omitempty"`
	Auth_Type            string `json:"auth_type"`
	Database             string `json:"database"`
	Role                 string `json:"role"`
	Warehouse            string `json:"warehouse"`
	Schema               string `json:"schema"`
	PrivateKey           string `json:"private_key,omitempty"`
	PrivateKeyPassphrase string `json:"private_key_passphrase,omitempty"`
}

type SnowflakeCredentialResponse

type SnowflakeCredentialResponse struct {
	Data   SnowflakeCredential `json:"data"`
	Status ResponseStatus      `json:"status"`
}

type StarburstConfig added in v0.3.13

type StarburstConfig struct {
	Method *string `json:"method,omitempty"`
	Host   *string `json:"host,omitempty"`
	Port   *int64  `json:"port,omitempty"`
}

func (StarburstConfig) AdapterVersion added in v0.3.13

func (StarburstConfig) AdapterVersion() string

type SynapseConfig added in v0.3.13

type SynapseConfig struct {
	Driver       *string `json:"driver,omitempty"`
	Host         *string `json:"host,omitempty"`
	Port         *int64  `json:"port,omitempty"`
	Database     *string `json:"database,omitempty"`
	Retries      *int64  `json:"retries,omitempty"`
	LoginTimeout *int64  `json:"login_timeout,omitempty"`
	QueryTimeout *int64  `json:"query_timeout,omitempty"`
}

func (SynapseConfig) AdapterVersion added in v0.3.13

func (SynapseConfig) AdapterVersion() string

type User

type User struct {
	ID    int    `json:"id"`
	Email string `json:"email"`
	// only the first permission is filled id, it is a list with  1 element
	Permissions []struct {
		Groups []struct {
			ID int `json:"id"`
		} `json:"groups"`
	} `json:"permissions"`
}

type UserGroups added in v0.2.4

type UserGroups struct {
	Permissions []Permission `json:"permissions"`
}

type UserGroupsBody added in v0.2.4

type UserGroupsBody struct {
	UserID   int   `json:"user_id"`
	GroupIDs []int `json:"desired_group_ids"`
}

type UserGroupsCurrentAccount added in v0.2.4

type UserGroupsCurrentAccount struct {
	Groups []Group
}

type UserGroupsResponse added in v0.2.4

type UserGroupsResponse struct {
	Data   UserGroups     `json:"data"`
	Status ResponseStatus `json:"status"`
}

type UserListResponse

type UserListResponse struct {
	Data   []User         `json:"data"`
	Status ResponseStatus `json:"status"`
	Extra  ResponseExtra  `json:"extra"`
}

type WebhookRead

type WebhookRead struct {
	WebhookId         string   `json:"id"`
	Name              string   `json:"name"`
	Description       string   `json:"description,omitempty"`
	ClientUrl         string   `json:"client_url"`
	EventTypes        []string `json:"event_types,omitempty"`
	JobIds            []string `json:"job_ids"`
	Active            bool     `json:"active,omitempty"`
	HmacSecret        *string  `json:"hmac_secret,omitempty"`
	HttpStatusCode    *string  `json:"http_status_code,omitempty"`
	AccountIdentifier *string  `json:"account_identifier,omitempty"`
}

type WebhookResponse

type WebhookResponse struct {
	Data   WebhookRead    `json:"data"`
	Status ResponseStatus `json:"status"`
}

type WebhookWrite

type WebhookWrite struct {
	WebhookId   string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	ClientUrl   string   `json:"client_url"`
	EventTypes  []string `json:"event_types,omitempty"`
	JobIds      []int    `json:"job_ids"`
	Active      bool     `json:"active,omitempty"`
}

Jump to

Keyboard shortcuts

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