azuredevops

package
v0.0.0-...-305df0d Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrganizationFromURL

func GetOrganizationFromURL(urlStr *string) *string

GetOrganizationFromURL grabs the Azure Devops URL Ex: https://dev.azure.com/Org/Project/more/path/entries returns Org

func GetProjectFromURL

func GetProjectFromURL(urlStr *string) *string

GetProjectFromURL grabs the Azure Devops URL Ex: https://dev.azure.com/Org/Project/more/path/entries returns Project

Types

type Approval

type Approval struct {
	ID                 int                           `json:"id"`
	Revision           int                           `json:"revision"`
	Approver           User                          `json:"approver"`
	ApprovedBy         User                          `json:"approvedBy"`
	ApprovalType       ApprovalType                  `json:"approvalType"`
	CreatedOn          time.Time                     `json:"createdOn"`
	ModifiedOn         time.Time                     `json:"modifiedOn"`
	Status             ApprovalStatus                `json:"status"`
	Comments           string                        `json:"comments"`
	IsAutomated        bool                          `json:"isAutomated"`
	IsNotificationOn   bool                          `json:"isNotificationOn"`
	TrialNumber        int                           `json:"trialNmber"`
	Attempt            int                           `json:"attempt"`
	Rank               int                           `json:"rank"`
	Release            IntDefinition                 `json:"release"`
	ReleaseDefinition  ServiceHookResourceDefinition `json:"releaseDefinition"`
	ReleaseEnvironment IntDefinition                 `json:"releaseEnvironment"`
}

Approval is the defintion of release definitions

type ApprovalStatus

type ApprovalStatus string

ApprovalStatus holds all of the different approval statuses

const (
	// ApprovalStatusApproved is for resources that have been approved
	ApprovalStatusApproved ApprovalStatus = "approved"
	// ApprovalStatusRejected is for resources that have been rejected
	ApprovalStatusRejected ApprovalStatus = "rejected"
	// ApprovalStatusPending is for resources that are currently pending
	ApprovalStatusPending ApprovalStatus = "pending"
)

type ApprovalType

type ApprovalType string

ApprovalType are the types of approvals

const (
	// ApprovalTypePreDeploy are approvals before an approval
	ApprovalTypePreDeploy ApprovalType = "preDeploy"
	// ApprovalTypePostDeploy are approvals after an approval
	ApprovalTypePostDeploy ApprovalType = "postDeploy"
)

type Client

type Client interface {
}

Client is used to call Azure Devops

type ClientAsync

type ClientAsync interface {
}

ClientAsync is an async version of Client

func MakeClient

func MakeClient(baseURL string, token string) ClientAsync

MakeClient creates a new Azure Devops client

type ClientAsyncImpl

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

ClientAsyncImpl is the async interface implementation that calls Azure Devops

type ClientImpl

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

ClientImpl is the interface implementation that calls Azure Devops

type Environment

type Environment struct {
	IntDefinition
	ReleaseID               int                           `json:"releaseId"`
	Status                  string                        `json:"status"`
	Variables               map[string]string             `json:"variables"`
	PreDeployApprovals      []User                        `json:"preDeployApprovals"`
	PostDeployApprovals     []User                        `json:"postDeployApprovals"`
	PreApprovalsSnapshot    []EnvironmentApprovalSnapshot `json:"preApprovalsSnapshot"`
	PostApprovalsSnapshot   []EnvironmentApprovalSnapshot `json:"postApprovalsSnapshot"`
	DeploySteps             []interface{}                 `json:"deploySteps"`
	Rank                    int                           `json:"rank"`
	DefinitionEnvironmentID int                           `json:"definitionEnvironmentId"`
	QueueID                 int                           `json:"queueId"`
	EnvironmentOptions      map[string]string             `json:"environmentOptions"`
	Demands                 []interface{}                 `json:"demands"`
	Conditions              []interface{}                 `json:"conditions"`
	ModifiedOn              time.Time                     `json:"modifiedOn"`
	WorkflowTasks           []EnvironmentWorkflowTasks    `json:"workflowTasks"`
	DeployPhasesSnapshot    []interface{}                 `json:"deployPhasesSnapshot"`
	Owner                   User                          `json:"owner"`
	ScheduledDeploymentTime time.Time                     `json:"scheduledDeploymentTime"`
	Schedules               []interface{}                 `json:"schedules"`
	Release                 ServiceHookResourceDefinition `json:"release"`
}

Environment holds the environment of a Release

type EnvironmentApprovalSnapshot

type EnvironmentApprovalSnapshot struct {
	Approvals       []User            `json:"approvals"`
	ApprovalOptions map[string]string `json:"approvalOptions"`
}

EnvironmentApprovalSnapshot holds the approval snapshot of a Release Environment

type EnvironmentWorkflowTasks

type EnvironmentWorkflowTasks struct {
	TaskID           string            `json:"taskId"`
	Version          string            `json:"version"`
	Name             string            `json:"name"`
	Enabled          bool              `json:"enabled"`
	AlwaysRun        bool              `json:"alwaysRun"`
	ContinueOnError  bool              `json:"continueOnError"`
	TimeoutInMinutes int               `json:"timeoutInMinutes"`
	DefinitionType   *string           `json:"definitionType"`
	Inputs           map[string]string `json:"inputs"`
}

EnvironmentWorkflowTasks holds the definition of pipeline environment tasks

type Error

type Error struct {
	//ID             string `json:"$id"`
	//InnerException Error  `json:"innerException"`
	Message   string `json:"message"`
	TypeName  string `json:"typeName"`
	TypeKey   string `json:"typeKey"`
	ErrorCode int    `json:"errorCode"`
	EventID   int    `json:"eventId"`
}

Error is returned when an error occurs in the API, such as an invalid ID being used.

type GitCommit

type GitCommit struct {
	CommitID string  `json:"commitId"`
	Author   GitUser `json:"author"`
	Comitter GitUser `json:"committer"`
	Comment  string  `json:"comment"`
	URL      string  `json:"url"`
}

GitCommit represents a single Git commit

type GitMergeCommit

type GitMergeCommit struct {
	CommitID string  `json:"commitId"`
	URL      *string `json:"url"`
}

GitMergeCommit holds info about a merge commit

type GitProject

type GitProject struct {
	StrDefinition
	URL   string `json:"url"`
	State string `json:"string"`
}

GitProject holds info about the Azure Devops project of a repository

type GitRefUpdate

type GitRefUpdate struct {
	Name        string `json:"name"`
	OldObjectID string `json:"oldObjectId"`
	NewObjectID string `json:"newObjectId"`
}

GitRefUpdate holds the old and new Git commit hashes

type GitRepository

type GitRepository struct {
	StrDefinition
	URL           string     `json:"url"`
	Project       GitProject `json:"project"`
	DefaultBranch string     `json:"defaultBranch"`
	RemoteURL     string     `json:"removeURL"`
}

GitRepository holds information about a Git repository

type GitReviewer

type GitReviewer struct {
	User
	ReviewerURL *string `json:"reviewerUrl"`
	Vote        int     `json:"vote"`
	IsContainer bool    `json:"isContainer"`
}

GitReviewer holds info about a Pull Request reviewer

type GitUser

type GitUser struct {
	Name  string    `json:"name"`
	Email string    `json:"email"`
	Date  time.Time `json:"date"`
}

GitUser represents a user in Git

type HTTPError

type HTTPError struct {
	StatusCode int

	Endpoint string

	RetryAfter *time.Duration
}

HTTPError is returned when an HTTP response does not return 200

func NewHTTPError

func NewHTTPError(response *http.Response) *HTTPError

NewHTTPError returns an HTTPError

func (HTTPError) Error

func (err HTTPError) Error() string

type IntDefinition

type IntDefinition struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

IntDefinition is the base type for Azure Devops responses

type Reason

type Reason string

Reason are the common Azure Devops reasons

const (
	// ReasonManual is for manually triggered reasources
	ReasonManual Reason = "manual"
	// ReasonContinuousIntegration is for automatically triggered reasources in a CI process
	ReasonContinuousIntegration Reason = "continuousIntegration"
)

type Release

type Release struct {
	IntDefinition
	ReleaseID                  int                           `json:"releaseId"`
	Status                     string                        `json:"status"`
	CreatedOn                  time.Time                     `json:"createdOn"`
	ModifiedOn                 time.Time                     `json:"modifiedOn"`
	ModifiedBy                 User                          `json:"modifiedBy"`
	CreatedBy                  User                          `json:"createdBy"`
	Environments               []Environment                 `json:"environments"`
	Variables                  map[string]string             `json:"variables"`
	Artifacts                  []ReleaseArtifact             `json:"artifacts"`
	ReleaseDefinition          ServiceHookResourceDefinition `json:"releaseDefinition"`
	Description                string                        `json:"description"`
	Reason                     string                        `json:"reason"`
	ReleaseNameFormat          string                        `json:"releaseNameFormat"`
	KeepForever                bool                          `json:"keepForever"`
	DefinitionSnapshotRevision int                           `json:"definitionSnapshotRevision"`
	Comment                    string                        `json:"comment"`
	LogsContainerURL           *string                       `json:"logsContainerUrl"`
}

Release holds a Release definition

type ReleaseArtifact

type ReleaseArtifact struct {
	SourceID            string                   `json:"sourceId"`
	Type                string                   `json:"type"`
	Alias               string                   `json:"alias"`
	DefinitionReference map[string]StrDefinition `json:"definitionReference"`
	IsPrimary           bool                     `json:"isPrimary"`
}

ReleaseArtifact holds an artifact of a Release

type ReleaseArtifactType

type ReleaseArtifactType string

ReleaseArtifactType are the artifact types https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/artifacts-overview?view=azure-devops

const (
	// ReleaseArtifactTypeBuild is for Build pipeline artifacts
	ReleaseArtifactTypeBuild ReleaseArtifactType = "Build"
	// ReleaseArtifactTypePipeline is for Pipeline pipeline artifacts
	ReleaseArtifactTypePipeline ReleaseArtifactType = "Pipeline"
	// ReleaseArtifactTypeMaven is for Maven pipeline artifacts
	ReleaseArtifactTypeMaven ReleaseArtifactType = "Maven"
	// ReleaseArtifactTypeNPM is for NPM pipeline artifacts
	ReleaseArtifactTypeNPM ReleaseArtifactType = "npm"
	// ReleaseArtifactTypeNuGet is for NuGet pipeline artifacts
	ReleaseArtifactTypeNuGet ReleaseArtifactType = "NuGet"
	// ReleaseArtifactTypePyPI is for PyPI pipeline artifacts
	ReleaseArtifactTypePyPI ReleaseArtifactType = "PyPI"
	// ReleaseArtifactTypeSymbols is for Symbols pipeline artifacts
	ReleaseArtifactTypeSymbols ReleaseArtifactType = "Symbols"
	// ReleaseArtifactTypeUniversal is for Universal pipeline artifacts
	ReleaseArtifactTypeUniversal ReleaseArtifactType = "Universal"
)

type ServiceHook

type ServiceHook struct {
	ID                 string                        `json:"id"`
	EventType          string                        `json:"eventType"`
	PublisherID        string                        `json:"publisherId"`
	Scope              string                        `json:"scope"`
	Message            ServiceHookMessage            `json:"message"`
	DetailedMessage    ServiceHookMessage            `json:"detailedMessage"`
	Resource           ServiceHookResource           `json:"resource"`
	ResourceVersion    string                        `json:"resourceVersion"`
	ResourceContainers ServiceHookResourceContainers `json:"resourceContainers"`
	CreatedDate        time.Time                     `json:"createdDate"`
}

ServiceHook defines the JSON body of service hooks https://docs.microsoft.com/en-us/azure/devops/service-hooks/events?toc=%2Fazure%2Fdevops%2Fintegrate%2Ftoc.json&bc=%2Fazure%2Fdevops%2Fintegrate%2Fbreadcrumb%2Ftoc.json&view=azure-devops

func (ServiceHook) Describe

func (sh ServiceHook) Describe() string

Describe returns a user-friendly descriptor for this Service Hook

func (ServiceHook) GetEnvironments

func (sh ServiceHook) GetEnvironments() []string

GetEnvironments returns all of the environment names attached to this ServiceHook

func (ServiceHook) GetProjectName

func (sh ServiceHook) GetProjectName() *string

GetProjectName returns the name of the project from the Service Hook

func (ServiceHook) GetReason

func (sh ServiceHook) GetReason() *string

GetReason returns the reason of the project from the Service Hook

func (ServiceHook) GetStatus

func (sh ServiceHook) GetStatus() *string

GetStatus returns the status of the project from the Service Hook

type ServiceHookEventType

type ServiceHookEventType string

ServiceHookEventType represents all possible Event Type values for a Service Hook configuration

const (
	// ServiceHookEventTypeBuildComplete represents the Build Completed event
	ServiceHookEventTypeBuildComplete ServiceHookEventType = "build.complete"

	// ServiceHookEventTypeReleaseAbandoned represents the Release Abandoned event
	ServiceHookEventTypeReleaseAbandoned ServiceHookEventType = "ms.vss-release.release-abandoned-event"
	// ServiceHookEventTypeReleaseCreated represents the Release Created event
	ServiceHookEventTypeReleaseCreated ServiceHookEventType = "ms.vss-release.release-created-event"

	// ServiceHookEventTypeReleaseDeploymentApprovalCompleted represents the Release Deployment Approval Completed event
	ServiceHookEventTypeReleaseDeploymentApprovalCompleted ServiceHookEventType = "ms.vss-release.deployment-approval-completed-event"
	// ServiceHookEventTypeReleaseDeploymestringntApprovalPending represents the Release Deployment Approval Pending event
	ServiceHookEventTypeReleaseDeploymentApprovalPending ServiceHookEventType = "ms.vss-release.deployment-approval-pending-event"

	// ServiceHookEventTypeReleaseDeploymentCompleted represents the Release Deployment Completed event
	ServiceHookEventTypeReleaseDeploymentCompleted ServiceHookEventType = "ms.vss-release.deployment-completed-event"
	// ServiceHookEventTypeReleaseDeploymentStarted represents the Release Deployment Started event
	ServiceHookEventTypeReleaseDeploymentStarted ServiceHookEventType = "ms.vss-release.deployment-started-event"

	// ServiceHookEventTypeCodeCheckedIn represents the Code Checked In event
	ServiceHookEventTypeCodeCheckedIn ServiceHookEventType = "tfvc.checkin"
	// ServiceHookEventTypeCodePushed represents the Code Pushed event
	ServiceHookEventTypeCodePushed ServiceHookEventType = "git.push"

	// ServiceHookEventTypePullRequestCreated represents the Pull Request Created event
	ServiceHookEventTypePullRequestCreated ServiceHookEventType = "git.pullrequest.created"
	// ServiceHookEventTypePullRequestMerged represents the Pull Request Merged event
	ServiceHookEventTypePullRequestMerged ServiceHookEventType = "git.pullrequest.merged"
	// ServiceHookEventTypePullRequestUpdated represents the Pull Request Updated event
	ServiceHookEventTypePullRequestUpdated ServiceHookEventType = "git.pullrequest.updated"

	// ServiceHookEventTypeWorkItemCreated represents the Work Item Created event
	ServiceHookEventTypeWorkItemCreated ServiceHookEventType = "workitem.created"
	// ServiceHookEventTypeWorkItemDeleted represents the Work Item Deleted event
	ServiceHookEventTypeWorkItemDeleted ServiceHookEventType = "workitem.deleted"
	// ServiceHookEventTypeWorkItemRestored represents the Work Item Restored event
	ServiceHookEventTypeWorkItemRestored ServiceHookEventType = "workitem.restored"
	// ServiceHookEventTypeWorkItemUpdated represents the Work Item Updated event
	ServiceHookEventTypeWorkItemUpdated ServiceHookEventType = "workitem.updated"
	// ServiceHookEventTypeWorkItemCommented represents the Work Item Commented event
	ServiceHookEventTypeWorkItemCommented ServiceHookEventType = "workitem.commented"
)

type ServiceHookMessage

type ServiceHookMessage struct {
	Text     string `json:"text"`
	HTML     string `json:"html"`
	Markdown string `json:"markdown"`
}

ServiceHookMessage is used to hold the message and defaultMessage fields in service hooks

type ServiceHookResource

type ServiceHookResource struct {
	IntDefinition // Event Types: build.complete (ID), Work Items
	ServiceHookResourceBuildComplete
	ServiceHookResourceCodeCheckedIn
	ServiceHookResourceCodePushed
	ServiceHookResourcePullRequest
	ServiceHookResourceWorkItems
	ServiceHookResourceWorkItemsUpdated

	URL    *string `json:"url"`    // Event types: build.complete, Code, Pull Requests, Work Items
	Reason *string `json:"reason"` // Event types: build.complete, Releases, Release Deployment Approvals
	Status *string `json:"status"` // Event types: build.complete, Pull Requests

	Approval    *Approval      `json:"approval"`    // Event types: Approvals
	Release     *Release       `json:"release"`     // Event types: Releases, Release Deployment Approvals
	Environment *Environment   `json:"environment"` // Event types: Release Deployments
	Project     *StrDefinition `json:"project"`     // Event types: Releases, Release Deployment Approvals, Release Deployments
	Repository  *GitRepository `json:"repository"`  // Event types: git.push, Pull Requests
	Commits     []GitCommit    `json:"commits"`     // Event types: git.push, Pull Requests
}

ServiceHookResource holds fields related to the Service Hook resource Release event types: - ms.vss-release.release-abandoned-event - ms.vss-release.release-created-event Release Deployment Approval event types: - ms.vss-release.deployment-approval-completed-event - ms.vss-release.deployment-approval-pending-event Release Deployment event types: - ms.vss-release.deployment-completed-event - ms.vss-release.deployment-started-event Code event types: - tfvc.checkin - git.push Pull Request types: - git.pullrequest.created - git.pullrequest.merged - git.pullrequest.updated Work Item types: - workitem.created - workitem.deleted - workitem.restored - workitem.updated - workitem.commented

type ServiceHookResourceBuildComplete

type ServiceHookResourceBuildComplete struct {
	URI                *string                             `json:"uri"`
	BuildNumber        *string                             `json:"buildNumber"`
	StartTime          *time.Time                          `json:"startTime"`
	FinishTime         *time.Time                          `json:"finishTime"`
	DropLocation       *string                             `json:"dropLocation"`
	Drop               *ServiceHookResourceBuildDrop       `json:"drop"`
	Log                *ServiceHookResourceBuildLog        `json:"log"`
	SourceGetVersion   *string                             `json:"sourceGetVersion"`
	LastChangedBy      *User                               `json:"lastChangedBy"`
	RetainIndefinitely *bool                               `json:"retainIndefinitely"`
	HasDiagnostics     *bool                               `json:"hasDiagnostics"`
	Definition         *ServiceHookResourceBuildDefinition `json:"definition"`
	Queue              *ServiceHookResourceBuildQueue      `json:"queue"`
	Requests           []ServiceHookResourceBuildRequests  `json:"requests"`
}

ServiceHookResourceBuildComplete holds fields related to the Service Hook resource for build.complete events

type ServiceHookResourceBuildDefinition

type ServiceHookResourceBuildDefinition struct {
	ServiceHookResourceDefinition
	BatchSize      int    `json:"batchSize"`
	TriggerType    string `json:"triggerType"`
	DefinitionType string `json:"definitionType"`
}

ServiceHookResourceBuildDefinition holds the definition of the Service Hook resource

type ServiceHookResourceBuildDefinitionTriggerType

type ServiceHookResourceBuildDefinitionTriggerType string

ServiceHookResourceBuildDefinitionTriggerType are the Service Hook Resource Definition trigger types

const (
	// ServiceHookResourceBuildDefinitionTriggerTypeNone is the Service Hook Resource Definition trigger type of none
	ServiceHookResourceBuildDefinitionTriggerTypeNone ServiceHookResourceBuildDefinitionTriggerType = "none"
)

type ServiceHookResourceBuildDefinitionType

type ServiceHookResourceBuildDefinitionType string

ServiceHookResourceBuildDefinitionType are the Service Hook Resource Definition types

const (
	// ServiceHookResourceBuildDefinitionTypeXAML is the Service Hook Resource Definition type of xaml
	ServiceHookResourceBuildDefinitionTypeXAML ServiceHookResourceBuildDefinitionType = "xaml"
)

type ServiceHookResourceBuildDrop

type ServiceHookResourceBuildDrop struct {
	Location    string `json:"location"`
	Type        string `json:"type"`
	URL         string `json:"url"`
	DownloadURL string `json:"downloadUrl"`
}

ServiceHookResourceBuildDrop holds the drop field of a Resource

type ServiceHookResourceBuildLog

type ServiceHookResourceBuildLog struct {
	Type        string `json:"type"`
	URL         string `json:"url"`
	DownloadURL string `json:"downloadUrl"`
}

ServiceHookResourceBuildLog holds the log field of a Resource

type ServiceHookResourceBuildQueue

type ServiceHookResourceBuildQueue struct {
	ServiceHookResourceDefinition
	QueueType string `json:"queueType"`
}

ServiceHookResourceBuildQueue holds the Queue definition of pipeline Service Hooks

type ServiceHookResourceBuildQueueType

type ServiceHookResourceBuildQueueType string

ServiceHookResourceBuildQueueType are the Service Hook Resource Queue types

const (
	// ServiceHookResourceBuildQueueTypeBuildController is the Service Hook Resource Queue type of buildController
	ServiceHookResourceBuildQueueTypeBuildController ServiceHookResourceBuildQueueType = "buildController"
)

type ServiceHookResourceBuildRequests

type ServiceHookResourceBuildRequests struct {
	ID           int    `json:"id"`
	URL          string `json:"url"`
	RequestedFor User   `json:"requestedFor"`
}

ServiceHookResourceBuildRequests holds the Requests definition of pipeline Service Hooks

type ServiceHookResourceCodeCheckedIn

type ServiceHookResourceCodeCheckedIn struct {
	ChangesetID *int       `json:"changesetID"`
	Author      *User      `json:"author"`
	CheckedInBy *User      `json:"checkedInBy"`
	CreatedDate *time.Time `json:"createdDate"`
	Comment     *string    `json:"comment"`
}

ServiceHookResourceCodeCheckedIn holds fields related to the Service Hook resource for the tfvc.checkin event

type ServiceHookResourceCodePushed

type ServiceHookResourceCodePushed struct {
	RefUpdates []GitRefUpdate `json:"refUpdates"`
	PushedBy   *User          `json:"pushedBy"`
	PushID     *int           `json:"pushId"`
	Date       *time.Time     `json:"time"`
}

ServiceHookResourceCodePushed holds fields related to the Service Hook resource for the git.push event

type ServiceHookResourceContainer

type ServiceHookResourceContainer struct {
	ID string `json:"id"`
}

ServiceHookResourceContainer contains a Resouce Container defintiion

type ServiceHookResourceContainers

type ServiceHookResourceContainers struct {
	Collection ServiceHookResourceContainer `json:"collection"`
	Account    ServiceHookResourceContainer `json:"account"`
	Project    ServiceHookResourceContainer `json:"project"`
}

ServiceHookResourceContainers contains the value of the resourceContainers field

type ServiceHookResourceDefinition

type ServiceHookResourceDefinition struct {
	IntDefinition
	URL string `json:"url"`
}

ServiceHookResourceDefinition holds a basic resource definition for Service Hooks

type ServiceHookResourcePullRequest

type ServiceHookResourcePullRequest struct {
	PullRequestID         *int            `json:"pullRequestId"`
	CreatedBy             *User           `json:"createdBy"`
	CreationDate          *time.Time      `json:"creationDate"`
	ClosedDate            *time.Time      `json:"closedDate"` // Event types: git.pullrequest.merged, git.pullrequest.updated
	Title                 *string         `json:"title"`
	Description           *string         `json:"description"`
	SourceRefName         *string         `json:"sourceRefName"`
	TargetRefName         *string         `json:"targetRefName"`
	MergeStatus           *string         `json:"mergeStatus"`
	MergeID               *string         `json:"mergeId"`
	LastMergeSourceCommit *GitMergeCommit `json:"lastMergeSourceCommit"`
	LastMergeTargetCommit *GitMergeCommit `json:"lastMergeTargetCommit"`
	LastMergeCommit       *GitMergeCommit `json:"lastMergeCommit"`
	Reviewers             []GitReviewer   `json:"reviewers"`
}

ServiceHookResourcePullRequest holds fields related to the Service Hook resource for Pull Request events

type ServiceHookResourceWorkItems

type ServiceHookResourceWorkItems struct {
	Rev *int `json:"rev"`
	// workitem.updated is a map[string]struct{oldValue string, newValue string}
	// Every other work item is a map[string]string
	//Fields map[string]string `json:"fields"`
	Fields map[string]interface{} `json:"fields"`
}

ServiceHookResourceWorkItems holds fields related to the Service Hook resource for Work Item events

type ServiceHookResourceWorkItemsUpdated

type ServiceHookResourceWorkItemsUpdated struct {
	WorkItemID  *int                                         `json:"workItemId"`
	RevisedBy   *User                                        `json:"revisedBy"`
	RevisedDate *time.Time                                   `json:"revisedDate"`
	Revision    *ServiceHookResourceWorkItemsUpdatedRevision `json:"revision"`
}

ServiceHookResourceWorkItemsUpdated holds fields related to the Service Hook resource for the workitem.updated

type ServiceHookResourceWorkItemsUpdatedRevision

type ServiceHookResourceWorkItemsUpdatedRevision struct {
	//ServiceHookResourceWorkItems
	Rev    *int              `json:"rev"`
	Fields map[string]string `json:"fields"`
	ID     int               `json:"id"`
	URL    string            `json:"url"`
}

ServiceHookResourceWorkItemsUpdatedRevision holds revision info for a Work Item

type Status

type Status string

Status are the common Azure Devops statuses

const (
	// StatusSucceeded is for resources that have completed successfuly
	StatusSucceeded Status = "succeeded"
	// StatusAbandoned is for resources that have been abandoned
	StatusAbandoned Status = "abandoned"
	// StatusActive is for resources that are active
	StatusActive Status = "active"
	// StatusCompleted is for resources that are completed without a substatus
	StatusCompleted Status = "completed"
	// StatusQueued is for resources that are waiting to run
	StatusQueued Status = "queued"
	// StatusNotSet is for resources that don't have a real status yet
	StatusNotSet Status = "notSet"
)
const (
	// PullRequestStatusCompleted is for completed
	PullRequestStatusCompleted Status = "completed"
	// PullRequestStatusAbandoned is for abandoned PRs
	PullRequestStatusAbandoned Status = "abandoned"
	// PullRequestStatusActive is for PRs that are currently open
	PullRequestStatusActive Status = "active"
	// PullRequestStatusNotSet is the default status of PRs
	PullRequestStatusNotSet Status = "notSet"
)

type StrDefinition

type StrDefinition struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

StrDefinition is the base type for Azure Devops responses

type User

type User struct {
	DisplayName string  `json:"displayName"`
	URL         *string `json:"url"`
	ID          string  `json:"id"`
	UniqueName  string  `json:"uniqueName"`
	ImageURL    *string `json:"imageUrl"`
	Descriptor  string  `json:"descriptor"`
}

User fields in the Azure Devops API

Jump to

Keyboard shortcuts

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