repos

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitProviderFromUrl

func GetGitProviderFromUrl(uri string) string

func ResourceGitCredential

func ResourceGitCredential() *schema.Resource

func ResourceRepo

func ResourceRepo() *schema.Resource

Types

type GitCredentialList

type GitCredentialList struct {
	Credentials []GitCredentialResponse `json:"credentials,omitempty"`
}

type GitCredentialRequest

type GitCredentialRequest struct {
	PAT      string `json:"personal_access_token" tf:"sensitive"`
	Provider string `json:"git_provider" tf:"suppress_diff"`
	UserName string `json:"git_username"`
}

type GitCredentialResponse

type GitCredentialResponse struct {
	ID       int64  `json:"credential_id"`
	UserName string `json:"git_username"`
	Provider string `json:"git_provider"`
}

func (GitCredentialResponse) GitCredentialID

func (r GitCredentialResponse) GitCredentialID() string

ID returns job id as string

type GitCredentialsAPI

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

GitCredentialsAPI exposes the Git Credentials API

func NewGitCredentialsAPI

func NewGitCredentialsAPI(ctx context.Context, m any) GitCredentialsAPI

GitCredentialsAPI creates GitCredentialsAPI instance from provider meta

func (GitCredentialsAPI) Create

func (GitCredentialsAPI) Delete

func (a GitCredentialsAPI) Delete(id string) error

func (GitCredentialsAPI) List

func (GitCredentialsAPI) Read

func (a GitCredentialsAPI) Read(id string) (resp GitCredentialResponse, err error)

func (GitCredentialsAPI) Update

type ReposAPI

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

ReposAPI exposes the Repos API

func NewReposAPI

func NewReposAPI(ctx context.Context, m any) ReposAPI

NewReposAPI creates ReposAPI instance from provider meta

func (ReposAPI) Create

func (a ReposAPI) Create(r reposCreateRequest) (ReposInformation, error)

func (ReposAPI) Delete

func (a ReposAPI) Delete(id string) error

func (ReposAPI) List

func (a ReposAPI) List(prefix string) ([]ReposInformation, error)

func (ReposAPI) ListAll

func (a ReposAPI) ListAll() ([]ReposInformation, error)

func (ReposAPI) Read

func (a ReposAPI) Read(id string) (ReposInformation, error)

func (ReposAPI) Update

func (a ReposAPI) Update(id string, r map[string]string) error

type ReposInformation

type ReposInformation struct {
	ID           int64  `json:"id"`
	Url          string `json:"url" tf:"force_new"`
	Provider     string `json:"provider,omitempty" tf:"computed,alias:git_provider,force_new"`
	Path         string `json:"path,omitempty" tf:"computed,force_new"` // TODO: remove force_new after the Update API will support changing the path
	Branch       string `json:"branch,omitempty" tf:"computed"`
	HeadCommitID string `json:"head_commit_id,omitempty" tf:"computed,alias:commit_hash"`
}

ReposInformation provides information about given repository

func (ReposInformation) RepoID

func (r ReposInformation) RepoID() string

RepoID returns job id as string

type ReposListResponse

type ReposListResponse struct {
	NextPageToken string             `json:"next_page_token,omitempty"`
	Repos         []ReposInformation `json:"repos"`
}

Jump to

Keyboard shortcuts

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