gitcredentials

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Registers personal access token for Databricks to do operations on behalf of the user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCredentials

type CreateCredentials struct {
	// Git provider. This field is case-insensitive. The available Git providers
	// are awsCodeCommit, azureDevOpsServices,
	GitProvider string `json:"git_provider"`
	// Git username.
	GitUsername string `json:"git_username,omitempty"`
	// The personal access token used to authenticate to the corresponding Git
	// provider.
	PersonalAccessToken string `json:"personal_access_token,omitempty"`
}

type CreateCredentialsResponse

type CreateCredentialsResponse struct {
	// ID of the credential object in the workspace.
	CredentialId int64 `json:"credential_id,omitempty"`
	// Git provider. This field is case-insensitive. The available Git providers
	// are awsCodeCommit, azureDevOpsServices,
	GitProvider string `json:"git_provider,omitempty"`
	// Git username.
	GitUsername string `json:"git_username,omitempty"`
}

type CredentialInfo

type CredentialInfo struct {
	// ID of the credential object in the workspace.
	CredentialId int64 `json:"credential_id,omitempty"`
	// Git provider. This field is case-insensitive. The available Git providers
	// are awsCodeCommit, azureDevOpsServices,
	GitProvider string `json:"git_provider,omitempty"`
	// Git username.
	GitUsername string `json:"git_username,omitempty"`
}

type Delete

type Delete struct {
	// The ID for the corresponding credential to access.
	CredentialId int64 `json:"-" url:"-"`
}

Delete a credential

type Get

type Get struct {
	// The ID for the corresponding credential to access.
	CredentialId int64 `json:"-" url:"-"`
}

Get a credential entry

type GetCredentialsResponse

type GetCredentialsResponse struct {
	Credentials []CredentialInfo `json:"credentials,omitempty"`
}

type GitCredentialsAPI

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

Registers personal access token for Databricks to do operations on behalf of the user.

See more info.

func NewGitCredentials

func NewGitCredentials(client *client.DatabricksClient) *GitCredentialsAPI

func (*GitCredentialsAPI) Create

Create a credential entry.

Creates a Git credential entry for the user. Only one Git credential per user is supported, so any attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials.

func (*GitCredentialsAPI) CredentialInfoGitProviderToCredentialIdMap

func (a *GitCredentialsAPI) CredentialInfoGitProviderToCredentialIdMap(ctx context.Context) (map[string]int64, error)

CredentialInfoGitProviderToCredentialIdMap calls GitCredentialsAPI.ListAll and creates a map of results with CredentialInfo.GitProvider as key and CredentialInfo.CredentialId as value.

Returns an error if there's more than one CredentialInfo with the same .GitProvider.

Note: All CredentialInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*GitCredentialsAPI) Delete

func (a *GitCredentialsAPI) Delete(ctx context.Context, request Delete) error

Delete a credential.

Deletes the specified Git credential.

func (*GitCredentialsAPI) DeleteByCredentialId

func (a *GitCredentialsAPI) DeleteByCredentialId(ctx context.Context, credentialId int64) error

Delete a credential.

Deletes the specified Git credential.

func (*GitCredentialsAPI) Get

func (a *GitCredentialsAPI) Get(ctx context.Context, request Get) (*CredentialInfo, error)

Get a credential entry.

Gets the Git credential with the specified credential ID.

func (*GitCredentialsAPI) GetByCredentialId

func (a *GitCredentialsAPI) GetByCredentialId(ctx context.Context, credentialId int64) (*CredentialInfo, error)

Get a credential entry.

Gets the Git credential with the specified credential ID.

func (*GitCredentialsAPI) GetByGitProvider

func (a *GitCredentialsAPI) GetByGitProvider(ctx context.Context, name string) (*CredentialInfo, error)

GetByGitProvider calls GitCredentialsAPI.CredentialInfoGitProviderToCredentialIdMap and returns a single CredentialInfo.

Returns an error if there's more than one CredentialInfo with the same .GitProvider.

Note: All CredentialInfo instances are loaded into memory before returning matching by name.

This method is generated by Databricks SDK Code Generator.

func (*GitCredentialsAPI) Impl

Impl returns low-level GitCredentials API implementation

func (*GitCredentialsAPI) ListAll

func (a *GitCredentialsAPI) ListAll(ctx context.Context) ([]CredentialInfo, error)

Get Git credentials.

Lists the calling user's Git credentials. One credential per user is supported.

This method is generated by Databricks SDK Code Generator.

func (*GitCredentialsAPI) Update

func (a *GitCredentialsAPI) Update(ctx context.Context, request UpdateCredentials) error

Update a credential.

Updates the specified Git credential.

func (*GitCredentialsAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.

type GitCredentialsService

type GitCredentialsService interface {

	// Create a credential entry.
	//
	// Creates a Git credential entry for the user. Only one Git credential per
	// user is supported, so any attempts to create credentials if an entry
	// already exists will fail. Use the PATCH endpoint to update existing
	// credentials, or the DELETE endpoint to delete existing credentials.
	Create(ctx context.Context, request CreateCredentials) (*CreateCredentialsResponse, error)

	// Delete a credential.
	//
	// Deletes the specified Git credential.
	Delete(ctx context.Context, request Delete) error

	// Get a credential entry.
	//
	// Gets the Git credential with the specified credential ID.
	Get(ctx context.Context, request Get) (*CredentialInfo, error)

	// Get Git credentials.
	//
	// Lists the calling user's Git credentials. One credential per user is
	// supported.
	//
	// Use ListAll() to get all CredentialInfo instances
	List(ctx context.Context) (*GetCredentialsResponse, error)

	// Update a credential.
	//
	// Updates the specified Git credential.
	Update(ctx context.Context, request UpdateCredentials) error
}

Registers personal access token for Databricks to do operations on behalf of the user.

See more info.

type UpdateCredentials

type UpdateCredentials struct {
	// The ID for the corresponding credential to access.
	CredentialId int64 `json:"-" url:"-"`
	// Git provider. This field is case-insensitive. The available Git providers
	// are awsCodeCommit, azureDevOpsServices,
	GitProvider string `json:"git_provider,omitempty"`
	// Git username.
	GitUsername string `json:"git_username,omitempty"`
	// The personal access token used to authenticate to the corresponding Git
	// provider.
	PersonalAccessToken string `json:"personal_access_token,omitempty"`
}

Jump to

Keyboard shortcuts

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