resources

package
v2.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ControlTypeSingleLineText     = ControlType("SingleLineText")
	ControlTypeMultiLineText      = ControlType("MultiLineText")
	ControlTypeSelect             = ControlType("Select")
	ControlTypeCheckbox           = ControlType("Checkbox")
	ControlTypeSensitive          = ControlType("Sensitive")
	ControlTypeStepName           = ControlType("StepName")
	ControlTypeCertificate        = ControlType("Certificate")
	ControlTypeWorkerPool         = ControlType("WorkerPool")
	ControlTypeAzureAccount       = ControlType("AzureAccount")
	ControlTypeGoogleCloudAccount = ControlType("GoogleCloudAccount")
	ControlTypeAwsAccount         = ControlType("AmazonWebServicesAccount")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlType added in v2.37.0

type ControlType string

type DisplaySettings added in v2.37.0

type DisplaySettings struct {
	ControlType   ControlType     `json:"Octopus.ControlType"`
	SelectOptions []*SelectOption `json:"Octopus.SelectOptions,omitempty"`
}

func NewDisplaySettings added in v2.37.0

func NewDisplaySettings(controlType ControlType, selectOptions []*SelectOption) *DisplaySettings

func (*DisplaySettings) MarshalJSON added in v2.37.0

func (d *DisplaySettings) MarshalJSON() ([]byte, error)

MarshalJSON returns display settings as its JSON encoding.

func (*DisplaySettings) UnmarshalJSON added in v2.37.0

func (d *DisplaySettings) UnmarshalJSON(b []byte) error

UnmarshalJSON sets display settings from its representation in JSON.

type IHasName

type IHasName interface {
	GetName() string
	SetName(string)
}

type IHasSpace

type IHasSpace interface {
	GetSpaceID() string
	SetSpaceID(string)
}

type IResource

type IResource interface {
	GetID() string
	GetModifiedBy() string
	GetModifiedOn() *time.Time
	GetLinks() map[string]string
	SetID(string)
	SetLinks(map[string]string)
	SetModifiedBy(string)
	SetModifiedOn(*time.Time)
	Validate() error
}

IResource defines the interface for resources.

type IResources added in v2.3.0

type IResources[T any] interface {
	GetNextPage(client *sling.Sling) (*Resources[T], error)
	GetAllPages(client *sling.Sling) ([]T, error)
}
type Links struct {
	Self        string `json:"Self"`
	Template    string `json:"Template"`
	PageAll     string `json:"Page.All"`
	PageCurrent string `json:"Page.Current"`
	PageLast    string `json:"Page.Last"`
	PageNext    string `json:"Page.Next"`
}

type PagedResults

type PagedResults struct {
	ItemsPerPage   int    `json:"ItemsPerPage"`
	ItemType       string `json:"ItemType"`
	LastPageNumber int    `json:"LastPageNumber"`
	Links          Links  `json:"Links"`
	NumberOfPages  int    `json:"NumberOfPages"`
	TotalResults   int    `json:"TotalResults"`
}

type ProcessReferenceDataItem

type ProcessReferenceDataItem struct {
	ID          string `json:"Id,omitempty"`
	Name        string `json:"Name,omitempty"`
	ProcessType string `json:"ProcessType,omitempty"`
}

type ReferenceDataItem

type ReferenceDataItem struct {
	ID   string `json:"Id,omitempty"`
	Name string `json:"Name,omitempty"`
}

type Resource

type Resource struct {
	ID         string            `json:"Id,omitempty"`
	ModifiedBy string            `json:"LastModifiedBy,omitempty"`
	ModifiedOn *time.Time        `json:"LastModifiedOn,omitempty"`
	Links      map[string]string `json:"Links,omitempty"`
}

func NewResource

func NewResource() *Resource

func (*Resource) GetID

func (r *Resource) GetID() string

GetID returns the ID value of the resource.

func (r *Resource) GetLinks() map[string]string

GetLinks returns the associated links with the value of this resource.

func (*Resource) GetModifiedBy

func (r *Resource) GetModifiedBy() string

GetModifiedBy returns the name of the account that modified the value of this resource.

func (*Resource) GetModifiedOn

func (r *Resource) GetModifiedOn() *time.Time

GetModifiedOn returns the time when the value of this resource was changed.

func (*Resource) SetID

func (r *Resource) SetID(id string)

SetID sets the ID value of the resource.

func (r *Resource) SetLinks(links map[string]string)

SetLinks sets the associated links with the value of this resource.

func (*Resource) SetModifiedBy

func (r *Resource) SetModifiedBy(modifiedBy string)

SetModifiedBy set the name of the account that modified the value of this resource.

func (*Resource) SetModifiedOn

func (r *Resource) SetModifiedOn(modifiedOn *time.Time)

SetModifiedOn set the time when the value of this resource was changed.

func (*Resource) Validate

func (r *Resource) Validate() error

Validate checks the state of the resource and returns an error if invalid.

type Resources

type Resources[T any] struct {
	Items []T `json:"Items"`
	PagedResults
}

func (*Resources[T]) GetAllPages added in v2.3.0

func (r *Resources[T]) GetAllPages(client *sling.Sling) ([]T, error)

GetAllPages will retrive all remaining next pages in the link collection and return the result as list of concatenated Items; Including the items from the base Resource.

func (*Resources[T]) GetNextPage added in v2.3.0

func (r *Resources[T]) GetNextPage(client *sling.Sling) (*Resources[T], error)

GetNextPage retrives the next page from the links collection. If no next page exists it will return nill

type SelectOption added in v2.37.0

type SelectOption struct {
	Value       string
	DisplayName string
}

Jump to

Keyboard shortcuts

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