cfclient

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGraphQLResponseInto

func DecodeGraphQLResponseInto(body []byte, target interface{}) error

func DecodeResponseInto

func DecodeResponseInto(body []byte, target interface{}) error

DecodeResponseInto json Unmarshall

func EncodeToJSON

func EncodeToJSON(object interface{}) ([]byte, error)

EncodeToJSON json Marshal

func FindInSlice

func FindInSlice(slice []string, val string) bool

func GetAccountAdminsDiff

func GetAccountAdminsDiff(desiredAdmins []string, existingAdmins []string) (adminsToAdd []string, adminsToDelete []string)

func GetUsersDiff

func GetUsersDiff(desiredUsers []string, existingUsers []TeamUser) (usersToAdd []string, usersToDelete []string)

func ToQS

func ToQS(qs map[string]string) string

ToQS add extra parameters to path

func UriEncodeEvent

func UriEncodeEvent(event string) string

Types

type Account

type Account struct {
	Suspension                  *Suspension         `json:"suspension,omitempty"`
	Integrations                *Integration        `json:"integrations,omitempty"`
	Build                       *Build              `json:"build,omitempty"`
	PaymentPlan                 *PaymentPlan        `json:"paymentPlan,omitempty"`
	ImageViewConfig             *ImageViewConfig    `json:"imageViewConfig,omitempty"`
	BuildStepConfig             *BuildStepConfig    `json:"buildStepConfig,omitempty"`
	CFCRState                   *CFCRState          `json:"CFCRState,omitempty"`
	AllowedDomains              []interface{}       `json:"allowedDomains,omitempty"`
	Admins                      []string            `json:"admins,omitempty"`
	Environment                 int                 `json:"environment,omitempty"`
	DedicatedInfrastructure     bool                `json:"dedicatedInfrastructure,omitempty"`
	CanUsePrivateRepos          bool                `json:"canUsePrivateRepos,omitempty"`
	SupportPlan                 string              `json:"supportPlan,omitempty"`
	IncreasedAttention          bool                `json:"increasedAttention,omitempty"`
	LocalUserPasswordIDPEnabled bool                `json:"localUserPasswordIDPEnabled,omitempty"`
	CodefreshEnv                string              `json:"codefreshEnv,omitempty"`
	ID                          string              `json:"_id,omitempty"`
	BadgeToken                  string              `json:"badgeToken,omitempty"`
	CreatedAt                   string              `json:"createdAt,omitempty"`
	UpdatedAt                   string              `json:"updatedAt,omitempty"`
	Name                        string              `json:"name,omitempty"`
	RuntimeEnvironment          string              `json:"runtimeEnvironment,omitempty"`
	CfcrRepositoryPath          string              `json:"cfcrRepositoryPath,omitempty"`
	Notifications               []NotificationEvent `json:"notifications,omitempty"`
	RepoPermission              string              `json:"repoPermission,omitempty"`
	Limits                      *Limits             `json:"limits,omitempty"`
	Features                    map[string]bool     `json:"features,omitempty"`
}

func ToSlimAccount

func ToSlimAccount(account Account) Account

func ToSlimAccounts

func ToSlimAccounts(accounts []Account) []Account

func (*Account) GetID

func (account *Account) GetID() string

func (*Account) SetFeatures

func (account *Account) SetFeatures(m map[string]interface{})

Decodes a TypeMap of map[string]interface{} into map[string]bool for account features

type AccountDetails

type AccountDetails struct {
	AccountDetails Account `json:"accountDetails"`
}

type Active

type Active struct {
	Active bool `json:"active"`
}

type ApiKey

type ApiKey struct {
	Subject       ApiKeySubject       `json:"subject,omitempty"`
	ID            string              `json:"_id,omitempty"`
	Name          string              `json:"name"`
	Scopes        []string            `json:"scopes,omitempty"`
	TokenPrefix   string              `json:"tokenPrefix,omitempty"`
	ScopeSnapshot ApiKeyScopeSnapshot `json:"scopeSnapshot,omitempty"`
	Created       string              `json:"created,omitempty"`
}

type ApiKeyScopeSnapshot

type ApiKeyScopeSnapshot struct {
	Scopes []string `json:"scopes,omitempty"`
	ID     string   `json:"_id,omitempty"`
	Date   string   `json:"date,omitempty"`
	V      int      `json:"__v,omitempty"`
}

type ApiKeySubject

type ApiKeySubject struct {
	Type string `json:"type,omitempty"`
	Ref  string `json:"ref,omitempty"`
}

type Build

type Build struct {
	Strategy string        `json:"strategy,omitempty"`
	Nodes    int           `json:"nodes,omitempty"`
	Parallel int           `json:"parallel,omitempty"`
	Packs    []interface{} `json:"packs,omitempty"`
}

type BuildStepConfig

type BuildStepConfig struct {
	Version     string `json:"version"`
	DisablePush bool   `json:"disablePush"`
	AutoPush    bool   `json:"autoPush"`
}

type CFCRState

type CFCRState struct {
	Enabled             bool   `json:"enabled"`
	System              string `json:"system"`
	DisplayGlobalNotice bool   `json:"displayGlobalNotice"`
	AccountChoice       string `json:"accountChoice"`
}

type Client

type Client struct {
	Token       string
	TokenHeader string
	Host        string
	HostV2      string
	Client      *http.Client
}

Client token, host, htpp.Client

func NewClient

func NewClient(hostname string, hostnameV2 string, token string, tokenHeader string) *Client

NewClient returns a new client configured to communicate on a server with the given hostname and to send an Authorization Header with the value of token

func (*Client) ActivateUser

func (client *Client) ActivateUser(userId string) (*User, error)

func (*Client) AddAccountToIDP

func (client *Client) AddAccountToIDP(accountId, idpId string) error

add account to idp

func (*Client) AddNewUserToAccount

func (client *Client) AddNewUserToAccount(accountId, userName, userEmail string) (*User, error)

func (*Client) AddPendingUser

func (client *Client) AddPendingUser(user *NewUser) (*User, error)

func (*Client) AddUserToTeam

func (client *Client) AddUserToTeam(teamID, userID string) error

func (*Client) AddUserToTeamByAdmin

func (client *Client) AddUserToTeamByAdmin(userID string, accountID string, team string) error

AddUserToTeamByAdmin - adds user to team with swich account

func (*Client) CreateAbacRule

func (client *Client) CreateAbacRule(gitopsAbacRule *GitopsAbacRule) (*GitopsAbacRule, error)

func (*Client) CreateAccount

func (client *Client) CreateAccount(account *Account) (*Account, error)

func (*Client) CreateApiKey

func (client *Client) CreateApiKey(userID string, accountId string, apiKey *ApiKey) (string, error)

CreateApiKey - creates api key for account by switch to the user and call /api/auth/keys

func (*Client) CreateContext

func (client *Client) CreateContext(context *Context) (*Context, error)

func (*Client) CreateHermesTriggerByEventAndPipeline

func (client *Client) CreateHermesTriggerByEventAndPipeline(event string, pipeline string) error

func (*Client) CreateHermesTriggerEvent

func (client *Client) CreateHermesTriggerEvent(event *HermesTriggerEvent) (string, error)

func (*Client) CreatePermission

func (client *Client) CreatePermission(permission *Permission) (*Permission, error)

func (*Client) CreatePipeline

func (client *Client) CreatePipeline(pipeline *Pipeline) (*Pipeline, error)

func (*Client) CreateProject

func (client *Client) CreateProject(project *Project) (*Project, error)

CreateProject POST project

func (*Client) CreateRegistry

func (client *Client) CreateRegistry(registry *Registry) (*Registry, error)

func (*Client) CreateStepTypes

func (client *Client) CreateStepTypes(stepTypes *StepTypes) (*StepTypes, error)

func (*Client) CreateTeam

func (client *Client) CreateTeam(team *Team) (*NewTeam, error)

CreateTeam POST team

func (*Client) DeleteAPIKey

func (client *Client) DeleteAPIKey(keyID string) error

func (*Client) DeleteAbacRule

func (client *Client) DeleteAbacRule(id string) (*GitopsAbacRule, error)

func (*Client) DeleteAccount

func (client *Client) DeleteAccount(id string) error

func (*Client) DeleteContext

func (client *Client) DeleteContext(name string) error

func (*Client) DeleteHermesTriggerByEventAndPipeline

func (client *Client) DeleteHermesTriggerByEventAndPipeline(event string, pipeline string) error

func (*Client) DeletePermission

func (client *Client) DeletePermission(id string) error

func (*Client) DeletePipeline

func (client *Client) DeletePipeline(name string) error

func (*Client) DeleteProject

func (client *Client) DeleteProject(id string) error

DeleteProject DELETE

func (*Client) DeleteRegistry

func (client *Client) DeleteRegistry(name string) error

func (*Client) DeleteStepTypes

func (client *Client) DeleteStepTypes(name string) error

func (*Client) DeleteTeam

func (client *Client) DeleteTeam(id string) error

DeleteTeam

func (*Client) DeleteUser

func (client *Client) DeleteUser(userName string) error

func (*Client) DeleteUserAsAccountAdmin

func (client *Client) DeleteUserAsAccountAdmin(accountId, userId string) error

func (*Client) DeleteUserFromAccount

func (client *Client) DeleteUserFromAccount(accountId, userId string) error

func (*Client) DeleteUserFromTeam

func (client *Client) DeleteUserFromTeam(teamID, userID string) error

func (*Client) GenerateToken

func (client *Client) GenerateToken(xToken string, apiKey *ApiKey) (string, error)

func (*Client) GetAPIKey

func (client *Client) GetAPIKey(keyID string) (*ApiKey, error)

func (*Client) GetAbacRuleByID

func (client *Client) GetAbacRuleByID(id string) (*GitopsAbacRule, error)

GetAbacRuleByID -

func (*Client) GetAbacRulesList

func (client *Client) GetAbacRulesList(entityType string) ([]GitopsAbacRule, error)

func (*Client) GetAccountByID

func (client *Client) GetAccountByID(id string) (*Account, error)

func (*Client) GetAccountByName

func (client *Client) GetAccountByName(name string) (*Account, error)

GetAccountByName - returns account

func (*Client) GetAccountIDPs

func (client *Client) GetAccountIDPs() (*[]IDP, error)

get account idps

func (*Client) GetAccountsList

func (client *Client) GetAccountsList(accountsId []string) (*[]Account, error)

func (*Client) GetAllAccounts

func (client *Client) GetAllAccounts() (*[]Account, error)

func (*Client) GetAllUsers

func (client *Client) GetAllUsers() (*[]User, error)

func (*Client) GetApiKeysList

func (client *Client) GetApiKeysList() ([]ApiKey, error)

func (*Client) GetContext

func (client *Client) GetContext(name string) (*Context, error)

func (*Client) GetCurrentAccount

func (client *Client) GetCurrentAccount() (*CurrentAccount, error)

GetCurrentAccount -

func (*Client) GetHermesTriggerByEventAndPipeline

func (client *Client) GetHermesTriggerByEventAndPipeline(event string, pipeline string) (*HermesTrigger, error)

func (*Client) GetHermesTriggerEvent

func (client *Client) GetHermesTriggerEvent(event string) (*HermesTriggerEvent, error)

func (*Client) GetIDPs

func (client *Client) GetIDPs() (*[]IDP, error)

get all idps

func (*Client) GetIdpByID

func (client *Client) GetIdpByID(idpID string) (*IDP, error)

func (*Client) GetIdpByName

func (client *Client) GetIdpByName(idpName string) (*IDP, error)

get idp id by idp name

func (*Client) GetPermissionByID

func (client *Client) GetPermissionByID(id string) (*Permission, error)

GetPermissionByID -

func (*Client) GetPermissionList

func (client *Client) GetPermissionList(teamID, action, resource string) ([]Permission, error)

func (*Client) GetPipeline

func (client *Client) GetPipeline(name string) (*Pipeline, error)

func (*Client) GetPipelines

func (client *Client) GetPipelines() (*[]Pipeline, error)

func (*Client) GetProjectByID

func (client *Client) GetProjectByID(id string) (*Project, error)

GetProjectByID get project object by id

func (*Client) GetProjectByName

func (client *Client) GetProjectByName(name string) (*Project, error)

GetProjectByName get project object by name

func (*Client) GetRegistry

func (client *Client) GetRegistry(identifier string) (*Registry, error)

GetRegistry identifier is ObjectId or name

func (*Client) GetStepTypes

func (client *Client) GetStepTypes(identifier string) (*StepTypes, error)

func (*Client) GetStepTypesVersions

func (client *Client) GetStepTypesVersions(name string) ([]string, error)

func (*Client) GetTeamByID

func (client *Client) GetTeamByID(id string) (*Team, error)

func (*Client) GetTeamByName

func (client *Client) GetTeamByName(name string) (*Team, error)

func (*Client) GetTeamList

func (client *Client) GetTeamList() ([]Team, error)

func (*Client) GetUserByID

func (client *Client) GetUserByID(userId string) (*User, error)

func (*Client) GetXAccessToken

func (client *Client) GetXAccessToken(userID string, accountId string) (string, error)

GetXAccessToken

func (*Client) RenameTeam

func (client *Client) RenameTeam(teamID, name string) error

func (*Client) RequestAPI

func (client *Client) RequestAPI(opt *RequestOptions) ([]byte, error)

RequestAPI http request to Codefresh API

func (*Client) RequestApiXAccessToken

func (client *Client) RequestApiXAccessToken(opt *RequestOptions) ([]byte, error)

func (*Client) SendGqlRequest

func (client *Client) SendGqlRequest(request GraphQLRequest) ([]byte, error)

func (*Client) SetUserAsAccountAdmin

func (client *Client) SetUserAsAccountAdmin(accountId, userId string) error

func (*Client) SynchronizeClientWithGroup

func (client *Client) SynchronizeClientWithGroup(name, ssoType string, notifications bool) error

func (*Client) UpdateAPIKey

func (client *Client) UpdateAPIKey(key *ApiKey) error

func (*Client) UpdateAccount

func (client *Client) UpdateAccount(account *Account) (*Account, error)

func (*Client) UpdateContext

func (client *Client) UpdateContext(context *Context) (*Context, error)

func (*Client) UpdatePipeline

func (client *Client) UpdatePipeline(pipeline *Pipeline) (*Pipeline, error)

func (*Client) UpdateProject

func (client *Client) UpdateProject(project *Project) error

UpdateProject PATCH project

func (*Client) UpdateRegistry

func (client *Client) UpdateRegistry(registry *Registry) (*Registry, error)

func (*Client) UpdateStepTypes

func (client *Client) UpdateStepTypes(stepTypes *StepTypes) (*StepTypes, error)

func (*Client) UpdateUserAccounts

func (client *Client) UpdateUserAccounts(userId string, accounts []Account) error

func (*Client) UpdateUserDetails

func (client *Client) UpdateUserDetails(accountId, userId, userName, userEmail string) (*User, error)

type CodefreshObject

type CodefreshObject interface {
	GetID() string
}

CodefreshObject codefresh interface

type Collaborators

type Collaborators struct {
	Limit int `json:"limit"`
	Used  int `json:"used,omitempty"`
}

type Context

type Context struct {
	Metadata ContextMetadata `json:"metadata,omitempty"`
	Spec     ContextSpec     `json:"spec,omitempty"`
	Version  string          `json:"version,omitempty"`
}

func (*Context) GetID

func (context *Context) GetID() string

type ContextErrorResponse

type ContextErrorResponse struct {
	Status  int    `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

type ContextMetadata

type ContextMetadata struct {
	Name string `json:"name,omitempty"`
}

type ContextSpec

type ContextSpec struct {
	Type string                 `json:"type,omitempty"`
	Data map[string]interface{} `json:"data,omitempty"`
}

type Credentials

type Credentials struct {
	Permissions []string `json:"permissions,omitempty"`
}

type CronTrigger

type CronTrigger struct {
	Name               string              `json:"name,omitempty"`
	Type               string              `json:"type,omitempty"`
	Expression         string              `json:"expression,omitempty"`
	Message            string              `json:"message,omitempty"`
	GitTriggerId       string              `json:"gitTriggerId,omitempty"`
	Branch             string              `json:"branch,omitempty"`
	Disabled           bool                `json:"disabled,omitempty"`
	Options            *TriggerOptions     `json:"options,omitempty"`
	RuntimeEnvironment *RuntimeEnvironment `json:"runtimeEnvironment,omitempty"`
	Variables          []Variable          `json:"variables,omitempty"`
}

func (*CronTrigger) SetVariables

func (t *CronTrigger) SetVariables(variables map[string]interface{})

type CurrentAccount

type CurrentAccount struct {
	ID     string
	Name   string
	Users  []CurrentAccountUser
	Admins []CurrentAccountUser
}

CurrentAccount spec

type CurrentAccountUser

type CurrentAccountUser struct {
	ID       string `json:"id,omitempty"`
	UserName string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Status   string `json:"status,omitempty"`
}

CurrentAccountUser spec

type DataRetention

type DataRetention struct {
	Weeks int `json:"weeks"`
}

type DockerRegistry

type DockerRegistry struct {
	Kind                string `json:"kind"`
	BehindFirewall      bool   `json:"behindFirewall"`
	Primary             bool   `json:"primary"`
	Default             bool   `json:"default"`
	Internal            bool   `json:"internal"`
	DenyCompositeDomain bool   `json:"denyCompositeDomain"`
	ID                  string `json:"_id"`
	Name                string `json:"name"`
	Provider            string `json:"provider"`
	Username            string `json:"username"`
	Password            string `json:"password"`
	Domain              string `json:"domain"`
	RepositoryPrefix    string `json:"repositoryPrefix"`
}

type EntityAbacAttribute

type EntityAbacAttribute struct {
	Name  string `json:"name"`
	Key   string `json:"key,omitempty"`
	Value string `json:"value"`
}

type ErrorResponse

type ErrorResponse struct {
	Status  int    `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

type EventData

type EventData struct {
	Uri     string `json:"uri"`
	Type    string `json:"type"`
	Kind    string `json:"kind"`
	Account string `json:"account"`
	Secret  string `json:"secret"`
}

type Exist

type Exist struct {
	Exist bool `json:"exist"`
}

type GitopsAbacRule

type GitopsAbacRule struct {
	ID         string                `json:"id,omitempty"`
	AccountId  string                `json:"accountId,omitempty"`
	EntityType string                `json:"entityType"`
	Teams      []string              `json:"teams"`
	Tags       []string              `json:"tags,omitempty"`
	Actions    []string              `json:"actions"`
	Attributes []EntityAbacAttribute `json:"attributes"`
}

GitopsAbacRule spec

type GitopsAbacRuleResponse

type GitopsAbacRuleResponse struct {
	Data struct {
		AbacRule       GitopsAbacRule `json:"abacRule,omitempty"`
		CreateAbacRule GitopsAbacRule `json:"createAbacRule,omitempty"`
		RemoveAbacRule GitopsAbacRule `json:"removeAbacRule,omitempty"`
	} `json:"data"`
}

type GitopsAbacRulesListResponse

type GitopsAbacRulesListResponse struct {
	Data struct {
		AbacRules []GitopsAbacRule `json:"abacRules"`
	} `json:"data"`
}

type GraphQLRequest

type GraphQLRequest struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables,omitempty"`
}

GraphQLRequest GraphQL query

type HermesTrigger

type HermesTrigger struct {
	Event      string    `json:"event,omitempty"`
	PipelineID string    `json:"pipeline,omitempty"`
	EventData  EventData `json:"event-data,omitempty"`
}

type HermesTriggerEvent

type HermesTriggerEvent struct {
	Type   string            `json:"type,omitempty"`
	Kind   string            `json:"kind,omitempty"`
	Filter string            `json:"filter,omitempty"`
	Secret string            `json:"secret,omitempty"`
	Values map[string]string `json:"values,omitempty"`
}

type Hooks

type Hooks struct {
	Hooks string
}

func (Hooks) MarshalJSON

func (d Hooks) MarshalJSON() ([]byte, error)

func (*Hooks) UnmarshalJSON

func (d *Hooks) UnmarshalJSON(data []byte) error

type IDP

type IDP struct {
	Access_token    string   `json:"access_token,omitempty"`
	Accounts        []string `json:"accounts,omitempty"`
	ApiHost         string   `json:"apiHost,omitempty"`
	ApiPathPrefix   string   `json:"apiPathPrefix,omitempty"`
	ApiURL          string   `json:"apiURL,omitempty"`
	AppId           string   `json:"appId,omitempty"`
	AuthURL         string   `json:"authURL,omitempty"`
	ClientHost      string   `json:"clientHost,omitempty"`
	ClientId        string   `json:"clientId,omitempty"`
	ClientName      string   `json:"clientName,omitempty"`
	ClientSecret    string   `json:"clientSecret,omitempty"`
	ClientType      string   `json:"clientType,omitempty"`
	CookieIv        string   `json:"cookieIv,omitempty"`
	CookieKey       string   `json:"cookieKey,omitempty"`
	DisplayName     string   `json:"displayName,omitempty"`
	ID              string   `json:"_id,omitempty"`
	IDPLoginUrl     string   `json:"IDPLoginUrl,omitempty"`
	LoginUrl        string   `json:"loginUrl,omitempty"`
	RedirectUiUrl   string   `json:"redirectUiUrl,omitempty"`
	RedirectUrl     string   `json:"redirectUrl,omitempty"`
	RefreshTokenURL string   `json:"refreshTokenURL,omitempty"`
	Scopes          []string `json:"scopes,omitempty"`
	Tenant          string   `json:"tenant,omitempty"`
	TokenSecret     string   `json:"tokenSecret,omitempty"`
	TokenURL        string   `json:"tokenURL,omitempty"`
	UserProfileURL  string   `json:"userProfileURL,omitempty"`
}

type ImageViewConfig

type ImageViewConfig struct {
	Version string `json:"version"`
}

type Integration

type Integration struct {
	Stash        Active           `json:"stash,omitempty"`
	Github       Active           `json:"github,omitempty"`
	Gitlab       Active           `json:"gitlab,omitempty"`
	Aks          Exist            `json:"aks,omitempty"`
	Gcloud       Exist            `json:"gcloud,omitempty"`
	DigitalOcean Exist            `json:"digitalOcean,omitempty"`
	Registries   []DockerRegistry `json:"registries,omitempty"`
}

type Labels

type Labels struct {
	Tags []string `json:"tags,omitempty"`
}

type Limits

type Limits struct {
	Collaborators Collaborators `json:"collaborators,omitempty"`
	DataRetention DataRetention `json:"dataRetention,omitempty"`
}

type Login

type Login struct {
	Credentials Credentials `json:"credentials,omitempty"`
	PersonalGit bool        `json:"personalGit,omitempty"`
	Permissions []string    `json:"permissions,omitempty"`
	IDP         IDP         `json:"idp,omitempty"`
	Idp_ID      string      `json:"idp_id,omitempty"`
	Sso         bool        `json:"sso,omitempty"`
}

type Metadata

type Metadata struct {
	Name               string `json:"name,omitempty"`
	ID                 string `json:"id,omitempty"`
	IsPublic           bool   `json:"isPublic,omitempty"`
	Labels             Labels `json:"labels,omitempty"`
	OriginalYamlString string `json:"originalYamlString,omitempty"`
	Project            string `json:"project,omitempty"`
	ProjectId          string `json:"projectId,omitempty"`
	Revision           int    `json:"revision,omitempty"`
}

type NewPermission

type NewPermission struct {
	ID              string   `json:"_id,omitempty"`
	Team            string   `json:"team,omitempty"`
	Resource        string   `json:"resource,omitempty"`
	RelatedResource string   `json:"related_resource,omitempty"`
	Action          string   `json:"action,omitempty"`
	Account         string   `json:"account,omitempty"`
	Tags            []string `json:"tags,omitempty"`
}

NewPermission spec, diffs from Permission: `json:"_id,omitempty"`, `json:"team,omitempty"`, `json:"tags,omitempty"`

type NewTeam

type NewTeam struct {
	ID      string   `json:"_id,omitempty"`
	Name    string   `json:"name,omitempty"`
	Type    string   `json:"type,omitempty"`
	Account string   `json:"account,omitempty"`
	Tags    []string `json:"tags,omitempty"`
	Users   []string `json:"users,omitempty"`
}

NewTeam Codefresh API expects a list of users IDs to create a new team

func ConvertToNewTeam

func ConvertToNewTeam(team *Team) *NewTeam

type NewUser

type NewUser struct {
	ID       string    `json:"_id,omitempty"`
	UserName string    `json:"userName"`
	Email    string    `json:"email"`
	Logins   []Login   `json:"logins,omitempty"`
	Roles    []string  `json:"roles,omitempty"`
	Account  []string  `json:"account,omitempty"`
	Personal *Personal `json:"personal,omitempty"`
}

type NotificationEvent

type NotificationEvent struct {
	Events []string `json:"events"`
	Type   string   `json:"type"`
}

type PaymentPlan

type PaymentPlan struct {
	Trial struct {
		Trialing             bool   `json:"trialing"`
		TrialWillEndNotified bool   `json:"trialWillEndNotified"`
		TrialEndedNotified   bool   `json:"trialEndedNotified"`
		Type                 string `json:"type"`
		PreviousSegment      string `json:"previousSegment"`
	} `json:"trial,omitempty"`
	ID       string `json:"id,omitempty"`
	Provider string `json:"provider,omitempty"`
}

type Permission

type Permission struct {
	ID              string   `json:"id,omitempty"`
	Team            string   `json:"role,omitempty"`
	Resource        string   `json:"resource,omitempty"`
	RelatedResource string   `json:"related_resource,omitempty"`
	Action          string   `json:"action,omitempty"`
	Account         string   `json:"account,omitempty"`
	Tags            []string `json:"attributes,omitempty"`
}

Permission spec

type Personal

type Personal struct {
	FirstName   string `json:"firstName,omitempty"`
	LastName    string `json:"lastName,omitempty"`
	CompanyName string `json:"companyName,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
	Country     string `json:"country,omitempty"`
}

type Pipeline

type Pipeline struct {
	Metadata Metadata `json:"metadata,omitempty"`
	Spec     Spec     `json:"spec,omitempty"`
	Version  string   `json:"version,omitempty"`
}

func (*Pipeline) GetID

func (pipeline *Pipeline) GetID() string

func (*Pipeline) SetVariables

func (p *Pipeline) SetVariables(variables map[string]interface{})

type Pipelines

type Pipelines struct {
	Docs  []Pipeline `json:"docs,omitempty"`
	Count int        `json:"count,omitempty"`
}

type Project

type Project struct {
	ID          string     `json:"id,omitempty"`
	ProjectName string     `json:"projectName,omitempty"`
	Tags        []string   `json:"tags,omitempty"`
	Variables   []Variable `json:"variables,omitempty"`
}

Project spec

func (*Project) GetID

func (project *Project) GetID() string

GetID implement CodefreshObject interface

func (*Project) SetVariables

func (project *Project) SetVariables(variables map[string]interface{})

SetVariables project variables

type Registry

type Registry struct {
	// common
	Id               string `json:"_id,omitempty"`
	Name             string `json:"name,omitempty"`
	Kind             string `json:"kind,omitempty"`
	Default          bool   `json:"default,omitempty"`
	Primary          bool   `json:"primary,omitempty"`
	BehindFirewall   bool   `json:"behindFirewall,omitempty"`
	FallbackRegistry string `json:"fallbackRegistry,omitempty"`
	RepositoryPrefix string `json:"repositoryPrefix,omitempty"`
	Provider         string `json:"provider,omitempty"`

	// mostly all
	Domain   string `json:"domain,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`

	// bintray
	Token string `json:"token,omitempty"`

	// ecr
	AccessKeyId     string `json:"accessKeyId,omitempty"`
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	Region          string `json:"region,omitempty"`

	// gcr, gar
	Keyfile string `json:"keyfile,omitempty"`

	// acr
	ClientId     string `json:"clientId,omitempty"`
	ClientSecret string `json:"clientSecret,omitempty"`
}

func (*Registry) GetID

func (registry *Registry) GetID() string

type RequestOptions

type RequestOptions struct {
	Path         string
	Method       string
	Body         []byte
	QS           map[string]string
	XAccessToken string
}

RequestOptions path, method, etc

type RuntimeEnvironment

type RuntimeEnvironment struct {
	Name                     string `json:"name,omitempty"`
	Memory                   string `json:"memory,omitempty"`
	CPU                      string `json:"cpu,omitempty"`
	DindStorage              string `json:"dindStorage,omitempty"`
	RequiredAvailableStorage string `json:"requiredAvailableStorage,omitempty"`
}

type ShortProfile

type ShortProfile struct {
	UserName string `json:"userName,omitempty"`
}

type Spec

type Spec struct {
	Variables                []Variable               `json:"variables,omitempty"`
	SpecTemplate             *SpecTemplate            `json:"specTemplate,omitempty"`
	Triggers                 []Trigger                `json:"triggers,omitempty"`
	CronTriggers             []CronTrigger            `json:"cronTriggers,omitempty"`
	Priority                 int                      `json:"priority,omitempty"`
	Concurrency              int                      `json:"concurrency,omitempty"`
	BranchConcurrency        int                      `json:"branchConcurrency,omitempty"`
	TriggerConcurrency       int                      `json:"triggerConcurrency,omitempty"`
	Contexts                 []interface{}            `json:"contexts,omitempty"`
	Steps                    *Steps                   `json:"steps,omitempty"`
	Stages                   *Stages                  `json:"stages,omitempty"`
	Mode                     string                   `json:"mode,omitempty"`
	FailFast                 *bool                    `json:"fail_fast,omitempty"`
	RuntimeEnvironment       RuntimeEnvironment       `json:"runtimeEnvironment,omitempty"`
	TerminationPolicy        []map[string]interface{} `json:"terminationPolicy,omitempty"`
	PackId                   string                   `json:"packId,omitempty"`
	RequiredAvailableStorage string                   `json:"requiredAvailableStorage,omitempty"`
	Hooks                    *Hooks                   `json:"hooks,omitempty"`
	Options                  map[string]bool          `json:"options,omitempty"`
}

type SpecStepTypes

type SpecStepTypes struct {
	Arguments     string                 `json:"arguments,omitempty"`
	Delimiters    map[string]interface{} `json:"delimiters,omitempty"`
	Returns       string                 `json:"returns,omitempty"`
	Steps         *orderedmap.OrderedMap `json:"steps,omitempty"`
	StepsTemplate string                 `json:"stepsTemplate,omitempty"`
}

type SpecTemplate

type SpecTemplate struct {
	Location string `json:"location,omitempty"`
	Repo     string `json:"repo,omitempty"`
	Path     string `json:"path,omitempty"`
	Revision string `json:"revision,omitempty"`
	Context  string `json:"context,omitempty"`
}

type Stages

type Stages struct {
	Stages string
}

func (Stages) MarshalJSON

func (d Stages) MarshalJSON() ([]byte, error)

func (*Stages) UnmarshalJSON

func (d *Stages) UnmarshalJSON(data []byte) error

type StepTypes

type StepTypes struct {
	Version  string                 `json:"version,omitempty"`
	Kind     string                 `json:"kind,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Spec     SpecStepTypes          `json:"spec,omitempty"`
}

func (*StepTypes) GetID

func (stepTypes *StepTypes) GetID() string

type StepTypesVersion

type StepTypesVersion struct {
	VersionNumber string
	StepTypes     StepTypes
}

type StepTypesVersions

type StepTypesVersions struct {
	Name     string
	Versions []StepTypesVersion
}

type Steps

type Steps struct {
	Steps string
}

func (Steps) MarshalJSON

func (d Steps) MarshalJSON() ([]byte, error)

func (*Steps) UnmarshalJSON

func (d *Steps) UnmarshalJSON(data []byte) error

type Suspension

type Suspension struct {
	IsSuspended bool `json:"isSuspended"`
}

type Team

type Team struct {
	ID      string     `json:"_id,omitempty"`
	Name    string     `json:"name,omitempty"`
	Type    string     `json:"type,omitempty"`
	Account string     `json:"account,omitempty"`
	Tags    []string   `json:"tags,omitempty"`
	Users   []TeamUser `json:"users,omitempty"`
}

Team spec

func (*Team) GetID

func (team *Team) GetID() string

GetID implement CodefreshObject interface

type TeamUser

type TeamUser struct {
	ID       string `json:"_id,omitempty"`
	UserName string `json:"userName,omitempty"`
	Email    string `json:"email,omitempty"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"accessToken"`
	User        struct {
		UserName string `json:"userName,omitempty"`
		Email    string `json:"email,omitempty"`
	} `json:"user"`
}

type Trigger

type Trigger struct {
	Name                         string              `json:"name,omitempty"`
	Description                  string              `json:"description,omitempty"`
	Type                         string              `json:"type,omitempty"`
	Repo                         string              `json:"repo,omitempty"`
	Events                       []string            `json:"events,omitempty"`
	BranchRegex                  string              `json:"branchRegex,omitempty"`
	BranchRegexInput             string              `json:"branchRegexInput,omitempty"`
	PullRequestTargetBranchRegex string              `json:"pullRequestTargetBranchRegex,omitempty"`
	CommentRegex                 string              `json:"commentRegex,omitempty"`
	ModifiedFilesGlob            string              `json:"modifiedFilesGlob,omitempty"`
	Provider                     string              `json:"provider,omitempty"`
	Disabled                     bool                `json:"disabled,omitempty"`
	Options                      *TriggerOptions     `json:"options,omitempty"`
	PullRequestAllowForkEvents   bool                `json:"pullRequestAllowForkEvents,omitempty"`
	CommitStatusTitle            string              `json:"commitStatusTitle,omitempty"`
	Context                      string              `json:"context,omitempty"`
	Contexts                     []string            `json:"contexts,omitempty"`
	RuntimeEnvironment           *RuntimeEnvironment `json:"runtimeEnvironment,omitempty"`
	Variables                    []Variable          `json:"variables,omitempty"`
}

func (*Trigger) SetVariables

func (t *Trigger) SetVariables(variables map[string]interface{})

type TriggerOptions

type TriggerOptions struct {
	NoCache             bool `json:"noCache,omitempty"`
	NoCfCache           bool `json:"noCfCache,omitempty"`
	ResetVolume         bool `json:"resetVolume,omitempty"`
	EnableNotifications bool `json:"enableNotifications,omitempty"`
}

type User

type User struct {
	ID             string              `json:"_id,omitempty"`
	UserName       string              `json:"userName"`
	Email          string              `json:"email"`
	Personal       *Personal           `json:"personal,omitempty"`
	Roles          []string            `json:"roles,omitempty"`
	DefaultAccount int                 `json:"defaultAccount,omitempty"`
	Account        []Account           `json:"account,omitempty"`
	Status         string              `json:"status,omitempty"`
	RegisterDate   string              `json:"register_date,omitempty"`
	HasPassword    bool                `json:"hasPassword,omitempty"`
	Notifications  []NotificationEvent `json:"notifications,omitempty"`
	ShortProfile   ShortProfile        `json:"shortProfile,omitempty"`
	Logins         []Login             `json:"logins,omitempty"`
	InviteURL      string              `json:"inviteUrl,omitempty"`
}

type UserAccounts

type UserAccounts struct {
	UserName string    `json:"userName"`
	Account  []Account `json:"account"`
}

type Variable

type Variable struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Variable spec

Jump to

Keyboard shortcuts

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