approvals

package
v2.113.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

Get returns a paginated collection of server-task approvals matching the query.

Types

type Approval

type Approval struct {
	Id                   string         `json:"Id,omitempty"`
	SpaceId              string         `json:"SpaceId,omitempty"`
	Name                 string         `json:"Name,omitempty"`
	ServerTaskApprovalId string         `json:"ServerTaskApprovalId"`
	UserId               string         `json:"UserId,omitempty"`
	Status               ApprovalStatus `json:"Status"`
	Notes                string         `json:"Notes"`
}

Approval is a single person's decision recorded against a ServerTaskApproval.

func AddApproval

func AddApproval(client newclient.Client, spaceID string, serverTaskApprovalID string, approval *Approval) (*Approval, error)

AddApproval records a new decision (approve/reject) against a server-task approval.

func GetApprovalByID

func GetApprovalByID(client newclient.Client, spaceID string, serverTaskApprovalID string, ID string) (*Approval, error)

GetApprovalByID returns a single decision by ID.

func ListApprovals

func ListApprovals(client newclient.Client, spaceID string, serverTaskApprovalID string) ([]*Approval, error)

ListApprovals returns the individual decisions recorded against a server-task approval. The server returns a bare array (not a paginated collection).

func UpdateApproval

func UpdateApproval(client newclient.Client, spaceID string, serverTaskApprovalID string, approval *Approval) (*Approval, error)

UpdateApproval modifies an existing decision.

type ApprovalStatus

type ApprovalStatus string

ApprovalStatus is an individual approver's decision.

const (
	ApprovalStatusApproved ApprovalStatus = "Approved"
	ApprovalStatusRejected ApprovalStatus = "Rejected"
)

type ChangeRequest

type ChangeRequest struct {
	Id                         string                     `json:"Id"`
	Number                     string                     `json:"Number,omitempty"`
	Description                string                     `json:"Description"`
	Active                     bool                       `json:"Active"`
	Type                       string                     `json:"Type,omitempty"`
	ChangeRequestApprovalState ChangeRequestApprovalState `json:"ChangeRequestApprovalState"`
	Self                       string                     `json:"Self,omitempty"`
}

ChangeRequest is the (optionally ITSM-backed) change associated with a server-task approval.

type ChangeRequestApprovalState

type ChangeRequestApprovalState string

ChangeRequestApprovalState is the state of the change carried by a server-task approval.

const (
	ChangeRequestApprovalStatePreApproval  ChangeRequestApprovalState = "PreApproval"
	ChangeRequestApprovalStateApproved     ChangeRequestApprovalState = "Approved"
	ChangeRequestApprovalStatePostApproval ChangeRequestApprovalState = "PostApproval"
)

type NamedReferenceItem

type NamedReferenceItem struct {
	Id               string `json:"Id"`
	DisplayName      string `json:"DisplayName"`
	DisplayIdAndName bool   `json:"DisplayIdAndName"`
}

NamedReferenceItem is a lightweight id/display-name reference used for approving users/teams.

type ServerTaskApproval

type ServerTaskApproval struct {
	Id                 string        `json:"Id"`
	ServerTaskId       string        `json:"ServerTaskId"`
	SpaceId            string        `json:"SpaceId"`
	ApprovalProviderId string        `json:"ApprovalProviderId"`
	Name               string        `json:"Name"`
	ChangeRequest      ChangeRequest `json:"ChangeRequest"`
}

ServerTaskApproval is the approval requirement attached to a server task (list / get-by-id representation).

func GetAll

func GetAll(client newclient.Client, spaceID string) ([]*ServerTaskApproval, error)

GetAll returns all server-task approvals in the space, following pagination links.

func GetByID

func GetByID(client newclient.Client, spaceID string, ID string) (*ServerTaskApproval, error)

GetByID returns the server-task approval that matches the input ID. It returns (nil, nil) if the response contains no server-task approval.

type ServerTaskApprovalDetail

type ServerTaskApprovalDetail struct {
	Id                       string               `json:"Id"`
	SpaceId                  string               `json:"SpaceId"`
	Approvals                []Approval           `json:"Approvals"`
	ApprovalState            string               `json:"ApprovalState"`
	ApprovingUsers           []NamedReferenceItem `json:"ApprovingUsers,omitempty"`
	ApprovingTeams           []NamedReferenceItem `json:"ApprovingTeams,omitempty"`
	ApprovalsCount           int                  `json:"ApprovalsCount"`
	MinimumApproversRequired int                  `json:"MinimumApproversRequired"`
}

ServerTaskApprovalDetail is the richer representation returned by the by-task-id endpoint.

func GetByTaskID

func GetByTaskID(client newclient.Client, spaceID string, serverTaskID string) (*ServerTaskApprovalDetail, error)

GetByTaskID returns the approval detail for a server task. Returns (nil, nil) when the task has no approval requirement (feature off, not a deployment/runbook, or no policy applies).

type ServerTaskApprovalsQuery

type ServerTaskApprovalsQuery struct {
	ProviderId string `uri:"providerId,omitempty" url:"providerId,omitempty"`
	State      string `uri:"state,omitempty" url:"state,omitempty"`
	Skip       int    `uri:"skip" url:"skip"`
	Take       int    `uri:"take,omitempty" url:"take,omitempty"`
}

ServerTaskApprovalsQuery is the query for the paginated server-task approvals list endpoint.

Jump to

Keyboard shortcuts

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