From d135dd5b97e97ce040ef9cc6a1e28924252af397 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:24:53 +0000 Subject: [PATCH 1/8] chore: add azure devops taskagent v7 vendor files Add generated client and models for github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent. --- .../azuredevops/v7/taskagent/client.go | 2272 +++++++++++ .../azuredevops/v7/taskagent/models.go | 3324 +++++++++++++++++ vendor/modules.txt | 1 + 3 files changed, 5597 insertions(+) create mode 100644 vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/client.go create mode 100644 vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/models.go diff --git a/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/client.go b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/client.go new file mode 100644 index 00000000..0b49b055 --- /dev/null +++ b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/client.go @@ -0,0 +1,2272 @@ +// -------------------------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// -------------------------------------------------------------------------------------------- +// Generated file, DO NOT EDIT +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// -------------------------------------------------------------------------------------------- + +package taskagent + +import ( + "bytes" + "context" + "encoding/json" + "github.com/google/uuid" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7" + "net/http" + "net/url" + "strconv" + "strings" +) + +var ResourceAreaId, _ = uuid.Parse("a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd") + +type Client interface { + // [Preview API] Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. + AddAgent(context.Context, AddAgentArgs) (*TaskAgent, error) + // [Preview API] + AddAgentCloud(context.Context, AddAgentCloudArgs) (*TaskAgentCloud, error) + // [Preview API] Create an agent pool. + AddAgentPool(context.Context, AddAgentPoolArgs) (*TaskAgentPool, error) + // [Preview API] Create a new agent queue to connect a project to an agent pool. + AddAgentQueue(context.Context, AddAgentQueueArgs) (*TaskAgentQueue, error) + // [Preview API] Create a deployment group. + AddDeploymentGroup(context.Context, AddDeploymentGroupArgs) (*DeploymentGroup, error) + // [Preview API] Create an environment. + AddEnvironment(context.Context, AddEnvironmentArgs) (*EnvironmentInstance, error) + // [Preview API] Add new kubernetes resource + AddKubernetesResourceNewEndpoint(ctx context.Context, args AddKubernetesResourceArgsNewEndpoint) (*KubernetesResource, error) + // [Preview API] Add existing kubernetes resource + AddKubernetesResourcExistingEndpoint(ctx context.Context, args AddKubernetesResourceArgsExistingEndpoint) (*KubernetesResource, error) + // [Preview API] Create a task group. + AddTaskGroup(context.Context, AddTaskGroupArgs) (*TaskGroup, error) + // [Preview API] Add a variable group. + AddVariableGroup(context.Context, AddVariableGroupArgs) (*VariableGroup, error) + // [Preview API] Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization. + DeleteAgent(context.Context, DeleteAgentArgs) error + // [Preview API] + DeleteAgentCloud(context.Context, DeleteAgentCloudArgs) (*TaskAgentCloud, error) + // [Preview API] Delete an agent pool. + DeleteAgentPool(context.Context, DeleteAgentPoolArgs) error + // [Preview API] Removes an agent queue from a project. + DeleteAgentQueue(context.Context, DeleteAgentQueueArgs) error + // [Preview API] Delete a deployment group. + DeleteDeploymentGroup(context.Context, DeleteDeploymentGroupArgs) error + // [Preview API] Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. + DeleteDeploymentTarget(context.Context, DeleteDeploymentTargetArgs) error + // [Preview API] Delete the specified environment. + DeleteEnvironment(context.Context, DeleteEnvironmentArgs) error + // [Preview API] + DeleteKubernetesResource(context.Context, DeleteKubernetesResourceArgs) error + // [Preview API] Delete a task group. + DeleteTaskGroup(context.Context, DeleteTaskGroupArgs) error + // [Preview API] Delete a variable group + DeleteVariableGroup(context.Context, DeleteVariableGroupArgs) error + // [Preview API] Get information about an agent. + GetAgent(context.Context, GetAgentArgs) (*TaskAgent, error) + // [Preview API] + GetAgentCloud(context.Context, GetAgentCloudArgs) (*TaskAgentCloud, error) + // [Preview API] + GetAgentCloudRequests(context.Context, GetAgentCloudRequestsArgs) (*[]TaskAgentCloudRequest, error) + // [Preview API] + GetAgentClouds(context.Context, GetAgentCloudsArgs) (*[]TaskAgentCloud, error) + // [Preview API] Get agent cloud types. + GetAgentCloudTypes(context.Context, GetAgentCloudTypesArgs) (*[]TaskAgentCloudType, error) + // [Preview API] Get information about an agent pool. + GetAgentPool(context.Context, GetAgentPoolArgs) (*TaskAgentPool, error) + // [Preview API] Get a list of agent pools. + GetAgentPools(context.Context, GetAgentPoolsArgs) (*[]TaskAgentPool, error) + // [Preview API] Get a list of agent pools. + GetAgentPoolsByIds(context.Context, GetAgentPoolsByIdsArgs) (*[]TaskAgentPool, error) + // [Preview API] Get information about an agent queue. + GetAgentQueue(context.Context, GetAgentQueueArgs) (*TaskAgentQueue, error) + // [Preview API] Get a list of agent queues. + GetAgentQueues(context.Context, GetAgentQueuesArgs) (*[]TaskAgentQueue, error) + // [Preview API] Get a list of agent queues by their IDs + GetAgentQueuesByIds(context.Context, GetAgentQueuesByIdsArgs) (*[]TaskAgentQueue, error) + // [Preview API] Get a list of agent queues by their names + GetAgentQueuesByNames(context.Context, GetAgentQueuesByNamesArgs) (*[]TaskAgentQueue, error) + // [Preview API] Get a list of agent queues by pool ids + GetAgentQueuesForPools(context.Context, GetAgentQueuesForPoolsArgs) (*[]TaskAgentQueue, error) + // [Preview API] Get a list of agents. + GetAgents(context.Context, GetAgentsArgs) (*[]TaskAgent, error) + // [Preview API] Get a deployment group by its ID. + GetDeploymentGroup(context.Context, GetDeploymentGroupArgs) (*DeploymentGroup, error) + // [Preview API] Get a list of deployment groups by name or IDs. + GetDeploymentGroups(context.Context, GetDeploymentGroupsArgs) (*GetDeploymentGroupsResponseValue, error) + // [Preview API] Get a deployment target by its ID in a deployment group + GetDeploymentTarget(context.Context, GetDeploymentTargetArgs) (*DeploymentMachine, error) + // [Preview API] Get a list of deployment targets in a deployment group. + GetDeploymentTargets(context.Context, GetDeploymentTargetsArgs) (*GetDeploymentTargetsResponseValue, error) + // [Preview API] Get an environment by its ID. + GetEnvironmentById(context.Context, GetEnvironmentByIdArgs) (*EnvironmentInstance, error) + // [Preview API] Get environment deployment execution history + GetEnvironmentDeploymentExecutionRecords(context.Context, GetEnvironmentDeploymentExecutionRecordsArgs) (*GetEnvironmentDeploymentExecutionRecordsResponseValue, error) + // [Preview API] Get all environments. + GetEnvironments(context.Context, GetEnvironmentsArgs) (*GetEnvironmentsResponseValue, error) + // [Preview API] + GetKubernetesResource(context.Context, GetKubernetesResourceArgs) (*KubernetesResource, error) + // [Preview API] List task groups. + GetTaskGroups(context.Context, GetTaskGroupsArgs) (*[]TaskGroup, error) + // [Preview API] Get a variable group. + GetVariableGroup(context.Context, GetVariableGroupArgs) (*VariableGroup, error) + // [Preview API] Get variable groups. + GetVariableGroups(context.Context, GetVariableGroupsArgs) (*[]VariableGroup, error) + // [Preview API] Get variable groups by ids. + GetVariableGroupsById(context.Context, GetVariableGroupsByIdArgs) (*[]VariableGroup, error) + // [Preview API] GET the Yaml schema used for Yaml file validation. + GetYamlSchema(context.Context, GetYamlSchemaArgs) (interface{}, error) + // [Preview API] Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. + ReplaceAgent(context.Context, ReplaceAgentArgs) (*TaskAgent, error) + // [Preview API] Add a variable group. + ShareVariableGroup(context.Context, ShareVariableGroupArgs) error + // [Preview API] Update agent details. + UpdateAgent(context.Context, UpdateAgentArgs) (*TaskAgent, error) + // [Preview API] + UpdateAgentCloud(context.Context, UpdateAgentCloudArgs) (*TaskAgentCloud, error) + // [Preview API] Update properties on an agent pool + UpdateAgentPool(context.Context, UpdateAgentPoolArgs) (*TaskAgentPool, error) + // [Preview API] Update a deployment group. + UpdateDeploymentGroup(context.Context, UpdateDeploymentGroupArgs) (*DeploymentGroup, error) + // [Preview API] Update tags of a list of deployment targets in a deployment group. + UpdateDeploymentTargets(context.Context, UpdateDeploymentTargetsArgs) (*[]DeploymentMachine, error) + // [Preview API] Update the specified environment. + UpdateEnvironment(context.Context, UpdateEnvironmentArgs) (*EnvironmentInstance, error) + // [Preview API] Update a task group. + UpdateTaskGroup(context.Context, UpdateTaskGroupArgs) (*TaskGroup, error) + // [Preview API] Update a variable group. + UpdateVariableGroup(context.Context, UpdateVariableGroupArgs) (*VariableGroup, error) +} + +type ClientImpl struct { + Client azuredevops.Client +} + +func NewClient(ctx context.Context, connection *azuredevops.Connection) (Client, error) { + client, err := connection.GetClientByResourceAreaId(ctx, ResourceAreaId) + if err != nil { + return nil, err + } + return &ClientImpl{ + Client: *client, + }, nil +} + +// [Preview API] Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. +func (client *ClientImpl) AddAgent(ctx context.Context, args AddAgentArgs) (*TaskAgent, error) { + if args.Agent == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Agent"} + } + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + + body, marshalErr := json.Marshal(*args.Agent) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgent + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddAgent function +type AddAgentArgs struct { + // (required) Details about the agent being added + Agent *TaskAgent + // (required) The agent pool in which to add the agent + PoolId *int +} + +// [Preview API] +func (client *ClientImpl) AddAgentCloud(ctx context.Context, args AddAgentCloudArgs) (*TaskAgentCloud, error) { + if args.AgentCloud == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentCloud"} + } + body, marshalErr := json.Marshal(*args.AgentCloud) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("bfa72b3d-0fc6-43fb-932b-a7f6559f93b9") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentCloud + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddAgentCloud function +type AddAgentCloudArgs struct { + // (required) + AgentCloud *TaskAgentCloud +} + +// [Preview API] Create an agent pool. +func (client *ClientImpl) AddAgentPool(ctx context.Context, args AddAgentPoolArgs) (*TaskAgentPool, error) { + if args.Pool == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Pool"} + } + body, marshalErr := json.Marshal(*args.Pool) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentPool + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddAgentPool function +type AddAgentPoolArgs struct { + // (required) Details about the new agent pool + Pool *TaskAgentPool +} + +// [Preview API] Create a new agent queue to connect a project to an agent pool. +func (client *ClientImpl) AddAgentQueue(ctx context.Context, args AddAgentQueueArgs) (*TaskAgentQueue, error) { + if args.Queue == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Queue"} + } + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + queryParams := url.Values{} + if args.AuthorizePipelines != nil { + queryParams.Add("authorizePipelines", strconv.FormatBool(*args.AuthorizePipelines)) + } + body, marshalErr := json.Marshal(*args.Queue) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, queryParams, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentQueue + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddAgentQueue function +type AddAgentQueueArgs struct { + // (required) Details about the queue to create + Queue *TaskAgentQueue + // (optional) Project ID or project name + Project *string + // (optional) Automatically authorize this queue when using YAML + AuthorizePipelines *bool +} + +// [Preview API] Create a deployment group. +func (client *ClientImpl) AddDeploymentGroup(ctx context.Context, args AddDeploymentGroupArgs) (*DeploymentGroup, error) { + if args.DeploymentGroup == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroup"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + body, marshalErr := json.Marshal(*args.DeploymentGroup) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("083c4d89-ab35-45af-aa11-7cf66895c53e") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue DeploymentGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddDeploymentGroup function +type AddDeploymentGroupArgs struct { + // (required) Deployment group to create. + DeploymentGroup *DeploymentGroupCreateParameter + // (required) Project ID or project name + Project *string +} + +// [Preview API] Create an environment. +func (client *ClientImpl) AddEnvironment(ctx context.Context, args AddEnvironmentArgs) (*EnvironmentInstance, error) { + if args.EnvironmentCreateParameter == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentCreateParameter"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + body, marshalErr := json.Marshal(*args.EnvironmentCreateParameter) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("8572b1fc-2482-47fa-8f74-7e3ed53ee54b") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue EnvironmentInstance + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddEnvironment function +type AddEnvironmentArgs struct { + // (required) Environment to create. + EnvironmentCreateParameter *EnvironmentCreateParameter + // (required) Project ID or project name + Project *string +} + +// [Preview API] +func (client *ClientImpl) AddKubernetesResourceNewEndpoint(ctx context.Context, args AddKubernetesResourceArgsNewEndpoint) (*KubernetesResource, error) { + if args.CreateParameters == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.CreateParameters"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + body, marshalErr := json.Marshal(*args.CreateParameters) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("73fba52f-15ab-42b3-a538-ce67a9223a04") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue KubernetesResource + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// [Preview API] +func (client *ClientImpl) AddKubernetesResourcExistingEndpoint(ctx context.Context, args AddKubernetesResourceArgsExistingEndpoint) (*KubernetesResource, error) { + if args.CreateParameters == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.CreateParameters"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + body, marshalErr := json.Marshal(*args.CreateParameters) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("73fba52f-15ab-42b3-a538-ce67a9223a04") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue KubernetesResource + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddKubernetesResourceNewEndpoint function +type AddKubernetesResourceArgsNewEndpoint struct { + // (required) + CreateParameters *KubernetesResourceCreateParametersNewEndpoint + // (required) Project ID or project name + Project *string + // (required) + EnvironmentId *int +} + +// Arguments for the AddKubernetesResourceExistingEndpoint function +type AddKubernetesResourceArgsExistingEndpoint struct { + // (required) + CreateParameters *KubernetesResourceCreateParametersExistingEndpoint + // (required) Project ID or project name + Project *string + // (required) + EnvironmentId *int +} + +// [Preview API] Create a task group. +func (client *ClientImpl) AddTaskGroup(ctx context.Context, args AddTaskGroupArgs) (*TaskGroup, error) { + if args.TaskGroup == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TaskGroup"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + body, marshalErr := json.Marshal(*args.TaskGroup) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddTaskGroup function +type AddTaskGroupArgs struct { + // (required) Task group object to create. + TaskGroup *TaskGroupCreateParameter + // (required) Project ID or project name + Project *string +} + +// [Preview API] Add a variable group. +func (client *ClientImpl) AddVariableGroup(ctx context.Context, args AddVariableGroupArgs) (*VariableGroup, error) { + if args.VariableGroupParameters == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.VariableGroupParameters"} + } + body, marshalErr := json.Marshal(*args.VariableGroupParameters) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7") + resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "7.1-preview.2", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue VariableGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the AddVariableGroup function +type AddVariableGroupArgs struct { + // (required) + VariableGroupParameters *VariableGroupParameters +} + +// [Preview API] Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization. +func (client *ClientImpl) DeleteAgent(ctx context.Context, args DeleteAgentArgs) error { + routeValues := make(map[string]string) + if args.PoolId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + if args.AgentId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.AgentId"} + } + routeValues["agentId"] = strconv.Itoa(*args.AgentId) + + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteAgent function +type DeleteAgentArgs struct { + // (required) The pool ID to remove the agent from + PoolId *int + // (required) The agent ID to remove + AgentId *int +} + +// [Preview API] +func (client *ClientImpl) DeleteAgentCloud(ctx context.Context, args DeleteAgentCloudArgs) (*TaskAgentCloud, error) { + routeValues := make(map[string]string) + if args.AgentCloudId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentCloudId"} + } + routeValues["agentCloudId"] = strconv.Itoa(*args.AgentCloudId) + + locationId, _ := uuid.Parse("bfa72b3d-0fc6-43fb-932b-a7f6559f93b9") + resp, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentCloud + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the DeleteAgentCloud function +type DeleteAgentCloudArgs struct { + // (required) + AgentCloudId *int +} + +// [Preview API] Delete an agent pool. +func (client *ClientImpl) DeleteAgentPool(ctx context.Context, args DeleteAgentPoolArgs) error { + routeValues := make(map[string]string) + if args.PoolId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteAgentPool function +type DeleteAgentPoolArgs struct { + // (required) ID of the agent pool to delete + PoolId *int +} + +// [Preview API] Removes an agent queue from a project. +func (client *ClientImpl) DeleteAgentQueue(ctx context.Context, args DeleteAgentQueueArgs) error { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + if args.QueueId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.QueueId"} + } + routeValues["queueId"] = strconv.Itoa(*args.QueueId) + + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteAgentQueue function +type DeleteAgentQueueArgs struct { + // (required) The agent queue to remove + QueueId *int + // (optional) Project ID or project name + Project *string +} + +// [Preview API] Delete a deployment group. +func (client *ClientImpl) DeleteDeploymentGroup(ctx context.Context, args DeleteDeploymentGroupArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + + locationId, _ := uuid.Parse("083c4d89-ab35-45af-aa11-7cf66895c53e") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteDeploymentGroup function +type DeleteDeploymentGroupArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group to be deleted. + DeploymentGroupId *int +} + +// [Preview API] Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. +func (client *ClientImpl) DeleteDeploymentTarget(ctx context.Context, args DeleteDeploymentTargetArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + if args.TargetId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.TargetId"} + } + routeValues["targetId"] = strconv.Itoa(*args.TargetId) + + locationId, _ := uuid.Parse("2f0aa599-c121-4256-a5fd-ba370e0ae7b6") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteDeploymentTarget function +type DeleteDeploymentTargetArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group in which deployment target is deleted. + DeploymentGroupId *int + // (required) ID of the deployment target to delete. + TargetId *int +} + +// [Preview API] Delete the specified environment. +func (client *ClientImpl) DeleteEnvironment(ctx context.Context, args DeleteEnvironmentArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + locationId, _ := uuid.Parse("8572b1fc-2482-47fa-8f74-7e3ed53ee54b") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteEnvironment function +type DeleteEnvironmentArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the environment. + EnvironmentId *int +} + +// [Preview API] +func (client *ClientImpl) DeleteKubernetesResource(ctx context.Context, args DeleteKubernetesResourceArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + if args.ResourceId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.ResourceId"} + } + routeValues["resourceId"] = strconv.Itoa(*args.ResourceId) + + locationId, _ := uuid.Parse("73fba52f-15ab-42b3-a538-ce67a9223a04") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteKubernetesResource function +type DeleteKubernetesResourceArgs struct { + // (required) Project ID or project name + Project *string + // (required) + EnvironmentId *int + // (required) + ResourceId *int +} + +// [Preview API] Delete a task group. +func (client *ClientImpl) DeleteTaskGroup(ctx context.Context, args DeleteTaskGroupArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.TaskGroupId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.TaskGroupId"} + } + routeValues["taskGroupId"] = (*args.TaskGroupId).String() + + queryParams := url.Values{} + if args.Comment != nil { + queryParams.Add("comment", *args.Comment) + } + locationId, _ := uuid.Parse("6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteTaskGroup function +type DeleteTaskGroupArgs struct { + // (required) Project ID or project name + Project *string + // (required) Id of the task group to be deleted. + TaskGroupId *uuid.UUID + // (optional) Comments to delete. + Comment *string +} + +// [Preview API] Delete a variable group +func (client *ClientImpl) DeleteVariableGroup(ctx context.Context, args DeleteVariableGroupArgs) error { + routeValues := make(map[string]string) + if args.GroupId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"} + } + routeValues["groupId"] = strconv.Itoa(*args.GroupId) + + queryParams := url.Values{} + if args.ProjectIds == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "projectIds"} + } + listAsString := strings.Join((*args.ProjectIds)[:], ",") + queryParams.Add("projectIds", listAsString) + locationId, _ := uuid.Parse("ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7") + _, err := client.Client.Send(ctx, http.MethodDelete, locationId, "7.1-preview.2", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the DeleteVariableGroup function +type DeleteVariableGroupArgs struct { + // (required) Id of the variable group. + GroupId *int + // (required) + ProjectIds *[]string +} + +// [Preview API] Get information about an agent. +func (client *ClientImpl) GetAgent(ctx context.Context, args GetAgentArgs) (*TaskAgent, error) { + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + if args.AgentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentId"} + } + routeValues["agentId"] = strconv.Itoa(*args.AgentId) + + queryParams := url.Values{} + if args.IncludeCapabilities != nil { + queryParams.Add("includeCapabilities", strconv.FormatBool(*args.IncludeCapabilities)) + } + if args.IncludeAssignedRequest != nil { + queryParams.Add("includeAssignedRequest", strconv.FormatBool(*args.IncludeAssignedRequest)) + } + if args.IncludeLastCompletedRequest != nil { + queryParams.Add("includeLastCompletedRequest", strconv.FormatBool(*args.IncludeLastCompletedRequest)) + } + if args.PropertyFilters != nil { + listAsString := strings.Join((*args.PropertyFilters)[:], ",") + queryParams.Add("propertyFilters", listAsString) + } + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgent + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgent function +type GetAgentArgs struct { + // (required) The agent pool containing the agent + PoolId *int + // (required) The agent ID to get information about + AgentId *int + // (optional) Whether to include the agent's capabilities in the response + IncludeCapabilities *bool + // (optional) Whether to include details about the agent's current work + IncludeAssignedRequest *bool + // (optional) Whether to include details about the agents' most recent completed work + IncludeLastCompletedRequest *bool + // (optional) Filter which custom properties will be returned + PropertyFilters *[]string +} + +// [Preview API] +func (client *ClientImpl) GetAgentCloud(ctx context.Context, args GetAgentCloudArgs) (*TaskAgentCloud, error) { + routeValues := make(map[string]string) + if args.AgentCloudId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentCloudId"} + } + routeValues["agentCloudId"] = strconv.Itoa(*args.AgentCloudId) + + locationId, _ := uuid.Parse("bfa72b3d-0fc6-43fb-932b-a7f6559f93b9") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentCloud + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentCloud function +type GetAgentCloudArgs struct { + // (required) + AgentCloudId *int +} + +// [Preview API] +func (client *ClientImpl) GetAgentCloudRequests(ctx context.Context, args GetAgentCloudRequestsArgs) (*[]TaskAgentCloudRequest, error) { + routeValues := make(map[string]string) + if args.AgentCloudId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentCloudId"} + } + routeValues["agentCloudId"] = strconv.Itoa(*args.AgentCloudId) + + locationId, _ := uuid.Parse("20189bd7-5134-49c2-b8e9-f9e856eea2b2") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentCloudRequest + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentCloudRequests function +type GetAgentCloudRequestsArgs struct { + // (required) + AgentCloudId *int +} + +// [Preview API] +func (client *ClientImpl) GetAgentClouds(ctx context.Context, args GetAgentCloudsArgs) (*[]TaskAgentCloud, error) { + locationId, _ := uuid.Parse("bfa72b3d-0fc6-43fb-932b-a7f6559f93b9") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", nil, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentCloud + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentClouds function +type GetAgentCloudsArgs struct { +} + +// [Preview API] Get agent cloud types. +func (client *ClientImpl) GetAgentCloudTypes(ctx context.Context, args GetAgentCloudTypesArgs) (*[]TaskAgentCloudType, error) { + locationId, _ := uuid.Parse("5932e193-f376-469d-9c3e-e5588ce12cb5") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", nil, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentCloudType + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentCloudTypes function +type GetAgentCloudTypesArgs struct { +} + +// [Preview API] Get information about an agent pool. +func (client *ClientImpl) GetAgentPool(ctx context.Context, args GetAgentPoolArgs) (*TaskAgentPool, error) { + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + + queryParams := url.Values{} + if args.Properties != nil { + listAsString := strings.Join((*args.Properties)[:], ",") + queryParams.Add("properties", listAsString) + } + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentPool + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentPool function +type GetAgentPoolArgs struct { + // (required) An agent pool ID + PoolId *int + // (optional) Agent pool properties (comma-separated) + Properties *[]string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentPoolActionFilter +} + +// [Preview API] Get a list of agent pools. +func (client *ClientImpl) GetAgentPools(ctx context.Context, args GetAgentPoolsArgs) (*[]TaskAgentPool, error) { + queryParams := url.Values{} + if args.PoolName != nil { + queryParams.Add("poolName", *args.PoolName) + } + if args.Properties != nil { + listAsString := strings.Join((*args.Properties)[:], ",") + queryParams.Add("properties", listAsString) + } + if args.PoolType != nil { + queryParams.Add("poolType", string(*args.PoolType)) + } + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", nil, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentPool + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentPools function +type GetAgentPoolsArgs struct { + // (optional) Filter by name + PoolName *string + // (optional) Filter by agent pool properties (comma-separated) + Properties *[]string + // (optional) Filter by pool type + PoolType *TaskAgentPoolType + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentPoolActionFilter +} + +// [Preview API] Get a list of agent pools. +func (client *ClientImpl) GetAgentPoolsByIds(ctx context.Context, args GetAgentPoolsByIdsArgs) (*[]TaskAgentPool, error) { + queryParams := url.Values{} + if args.PoolIds == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "poolIds"} + } + var stringList []string + for _, item := range *args.PoolIds { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("poolIds", listAsString) + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", nil, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentPool + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentPoolsByIds function +type GetAgentPoolsByIdsArgs struct { + // (required) pool Ids to fetch + PoolIds *[]int + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentPoolActionFilter +} + +// [Preview API] Get information about an agent queue. +func (client *ClientImpl) GetAgentQueue(ctx context.Context, args GetAgentQueueArgs) (*TaskAgentQueue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + if args.QueueId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.QueueId"} + } + routeValues["queueId"] = strconv.Itoa(*args.QueueId) + + queryParams := url.Values{} + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentQueue + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentQueue function +type GetAgentQueueArgs struct { + // (required) The agent queue to get information about + QueueId *int + // (optional) Project ID or project name + Project *string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentQueueActionFilter +} + +// [Preview API] Get a list of agent queues. +func (client *ClientImpl) GetAgentQueues(ctx context.Context, args GetAgentQueuesArgs) (*[]TaskAgentQueue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + queryParams := url.Values{} + if args.QueueName != nil { + queryParams.Add("queueName", *args.QueueName) + } + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentQueue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentQueues function +type GetAgentQueuesArgs struct { + // (optional) Project ID or project name + Project *string + // (optional) Filter on the agent queue name + QueueName *string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentQueueActionFilter +} + +// [Preview API] Get a list of agent queues by their IDs +func (client *ClientImpl) GetAgentQueuesByIds(ctx context.Context, args GetAgentQueuesByIdsArgs) (*[]TaskAgentQueue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + queryParams := url.Values{} + if args.QueueIds == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "queueIds"} + } + var stringList []string + for _, item := range *args.QueueIds { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("queueIds", listAsString) + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentQueue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentQueuesByIds function +type GetAgentQueuesByIdsArgs struct { + // (required) A comma-separated list of agent queue IDs to retrieve + QueueIds *[]int + // (optional) Project ID or project name + Project *string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentQueueActionFilter +} + +// [Preview API] Get a list of agent queues by their names +func (client *ClientImpl) GetAgentQueuesByNames(ctx context.Context, args GetAgentQueuesByNamesArgs) (*[]TaskAgentQueue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + queryParams := url.Values{} + if args.QueueNames == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "queueNames"} + } + listAsString := strings.Join((*args.QueueNames)[:], ",") + queryParams.Add("queueNames", listAsString) + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentQueue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentQueuesByNames function +type GetAgentQueuesByNamesArgs struct { + // (required) A comma-separated list of agent names to retrieve + QueueNames *[]string + // (optional) Project ID or project name + Project *string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentQueueActionFilter +} + +// [Preview API] Get a list of agent queues by pool ids +func (client *ClientImpl) GetAgentQueuesForPools(ctx context.Context, args GetAgentQueuesForPoolsArgs) (*[]TaskAgentQueue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + queryParams := url.Values{} + if args.PoolIds == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "poolIds"} + } + var stringList []string + for _, item := range *args.PoolIds { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("poolIds", listAsString) + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + locationId, _ := uuid.Parse("900fa995-c559-4923-aae7-f8424fe4fbea") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgentQueue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgentQueuesForPools function +type GetAgentQueuesForPoolsArgs struct { + // (required) A comma-separated list of pool ids to get the corresponding queues for + PoolIds *[]int + // (optional) Project ID or project name + Project *string + // (optional) Filter by whether the calling user has use or manage permissions + ActionFilter *TaskAgentQueueActionFilter +} + +// [Preview API] Get a list of agents. +func (client *ClientImpl) GetAgents(ctx context.Context, args GetAgentsArgs) (*[]TaskAgent, error) { + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + + queryParams := url.Values{} + if args.AgentName != nil { + queryParams.Add("agentName", *args.AgentName) + } + if args.IncludeCapabilities != nil { + queryParams.Add("includeCapabilities", strconv.FormatBool(*args.IncludeCapabilities)) + } + if args.IncludeAssignedRequest != nil { + queryParams.Add("includeAssignedRequest", strconv.FormatBool(*args.IncludeAssignedRequest)) + } + if args.IncludeLastCompletedRequest != nil { + queryParams.Add("includeLastCompletedRequest", strconv.FormatBool(*args.IncludeLastCompletedRequest)) + } + if args.PropertyFilters != nil { + listAsString := strings.Join((*args.PropertyFilters)[:], ",") + queryParams.Add("propertyFilters", listAsString) + } + if args.Demands != nil { + listAsString := strings.Join((*args.Demands)[:], ",") + queryParams.Add("demands", listAsString) + } + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskAgent + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetAgents function +type GetAgentsArgs struct { + // (required) The agent pool containing the agents + PoolId *int + // (optional) Filter on agent name + AgentName *string + // (optional) Whether to include the agents' capabilities in the response + IncludeCapabilities *bool + // (optional) Whether to include details about the agents' current work + IncludeAssignedRequest *bool + // (optional) Whether to include details about the agents' most recent completed work + IncludeLastCompletedRequest *bool + // (optional) Filter which custom properties will be returned + PropertyFilters *[]string + // (optional) Filter by demands the agents can satisfy + Demands *[]string +} + +// [Preview API] Get a deployment group by its ID. +func (client *ClientImpl) GetDeploymentGroup(ctx context.Context, args GetDeploymentGroupArgs) (*DeploymentGroup, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + + queryParams := url.Values{} + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + if args.Expand != nil { + queryParams.Add("$expand", string(*args.Expand)) + } + locationId, _ := uuid.Parse("083c4d89-ab35-45af-aa11-7cf66895c53e") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue DeploymentGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetDeploymentGroup function +type GetDeploymentGroupArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group. + DeploymentGroupId *int + // (optional) Get the deployment group only if this action can be performed on it. + ActionFilter *DeploymentGroupActionFilter + // (optional) Include these additional details in the returned object. + Expand *DeploymentGroupExpands +} + +// [Preview API] Get a list of deployment groups by name or IDs. +func (client *ClientImpl) GetDeploymentGroups(ctx context.Context, args GetDeploymentGroupsArgs) (*GetDeploymentGroupsResponseValue, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + queryParams := url.Values{} + if args.Name != nil { + queryParams.Add("name", *args.Name) + } + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + if args.Expand != nil { + queryParams.Add("$expand", string(*args.Expand)) + } + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", *args.ContinuationToken) + } + if args.Top != nil { + queryParams.Add("$top", strconv.Itoa(*args.Top)) + } + if args.Ids != nil { + var stringList []string + for _, item := range *args.Ids { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("ids", listAsString) + } + locationId, _ := uuid.Parse("083c4d89-ab35-45af-aa11-7cf66895c53e") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue GetDeploymentGroupsResponseValue + responseValue.ContinuationToken = resp.Header.Get(azuredevops.HeaderKeyContinuationToken) + err = client.Client.UnmarshalCollectionBody(resp, &responseValue.Value) + return &responseValue, err +} + +// Arguments for the GetDeploymentGroups function +type GetDeploymentGroupsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Name of the deployment group. + Name *string + // (optional) Get only deployment groups on which this action can be performed. + ActionFilter *DeploymentGroupActionFilter + // (optional) Include these additional details in the returned objects. + Expand *DeploymentGroupExpands + // (optional) Get deployment groups with names greater than this continuationToken lexicographically. + ContinuationToken *string + // (optional) Maximum number of deployment groups to return. Default is **1000**. + Top *int + // (optional) Comma separated list of IDs of the deployment groups. + Ids *[]int +} + +// Return type for the GetDeploymentGroups function +type GetDeploymentGroupsResponseValue struct { + Value []DeploymentGroup + ContinuationToken string +} + +// [Preview API] Get a deployment target by its ID in a deployment group +func (client *ClientImpl) GetDeploymentTarget(ctx context.Context, args GetDeploymentTargetArgs) (*DeploymentMachine, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + if args.TargetId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TargetId"} + } + routeValues["targetId"] = strconv.Itoa(*args.TargetId) + + queryParams := url.Values{} + if args.Expand != nil { + queryParams.Add("$expand", string(*args.Expand)) + } + locationId, _ := uuid.Parse("2f0aa599-c121-4256-a5fd-ba370e0ae7b6") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue DeploymentMachine + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetDeploymentTarget function +type GetDeploymentTargetArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group to which deployment target belongs. + DeploymentGroupId *int + // (required) ID of the deployment target to return. + TargetId *int + // (optional) Include these additional details in the returned objects. + Expand *DeploymentTargetExpands +} + +// [Preview API] Get a list of deployment targets in a deployment group. +func (client *ClientImpl) GetDeploymentTargets(ctx context.Context, args GetDeploymentTargetsArgs) (*GetDeploymentTargetsResponseValue, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + + queryParams := url.Values{} + if args.Tags != nil { + listAsString := strings.Join((*args.Tags)[:], ",") + queryParams.Add("tags", listAsString) + } + if args.Name != nil { + queryParams.Add("name", *args.Name) + } + if args.PartialNameMatch != nil { + queryParams.Add("partialNameMatch", strconv.FormatBool(*args.PartialNameMatch)) + } + if args.Expand != nil { + queryParams.Add("$expand", string(*args.Expand)) + } + if args.AgentStatus != nil { + queryParams.Add("agentStatus", string(*args.AgentStatus)) + } + if args.AgentJobResult != nil { + queryParams.Add("agentJobResult", string(*args.AgentJobResult)) + } + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", *args.ContinuationToken) + } + if args.Top != nil { + queryParams.Add("$top", strconv.Itoa(*args.Top)) + } + if args.Enabled != nil { + queryParams.Add("enabled", strconv.FormatBool(*args.Enabled)) + } + if args.PropertyFilters != nil { + listAsString := strings.Join((*args.PropertyFilters)[:], ",") + queryParams.Add("propertyFilters", listAsString) + } + locationId, _ := uuid.Parse("2f0aa599-c121-4256-a5fd-ba370e0ae7b6") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue GetDeploymentTargetsResponseValue + responseValue.ContinuationToken = resp.Header.Get(azuredevops.HeaderKeyContinuationToken) + err = client.Client.UnmarshalCollectionBody(resp, &responseValue.Value) + return &responseValue, err +} + +// Arguments for the GetDeploymentTargets function +type GetDeploymentTargetsArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group. + DeploymentGroupId *int + // (optional) Get only the deployment targets that contain all these comma separted list of tags. + Tags *[]string + // (optional) Name pattern of the deployment targets to return. + Name *string + // (optional) When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. + PartialNameMatch *bool + // (optional) Include these additional details in the returned objects. + Expand *DeploymentTargetExpands + // (optional) Get only deployment targets that have this status. + AgentStatus *TaskAgentStatusFilter + // (optional) Get only deployment targets that have this last job result. + AgentJobResult *TaskAgentJobResultFilter + // (optional) Get deployment targets with names greater than this continuationToken lexicographically. + ContinuationToken *string + // (optional) Maximum number of deployment targets to return. Default is **1000**. + Top *int + // (optional) Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. + Enabled *bool + // (optional) + PropertyFilters *[]string +} + +// Return type for the GetDeploymentTargets function +type GetDeploymentTargetsResponseValue struct { + Value []DeploymentMachine + ContinuationToken string +} + +// [Preview API] Get an environment by its ID. +func (client *ClientImpl) GetEnvironmentById(ctx context.Context, args GetEnvironmentByIdArgs) (*EnvironmentInstance, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + queryParams := url.Values{} + if args.Expands != nil { + queryParams.Add("expands", string(*args.Expands)) + } + locationId, _ := uuid.Parse("8572b1fc-2482-47fa-8f74-7e3ed53ee54b") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue EnvironmentInstance + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetEnvironmentById function +type GetEnvironmentByIdArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the environment. + EnvironmentId *int + // (optional) Include these additional details in the returned objects. + Expands *EnvironmentExpands +} + +// [Preview API] Get environment deployment execution history +func (client *ClientImpl) GetEnvironmentDeploymentExecutionRecords(ctx context.Context, args GetEnvironmentDeploymentExecutionRecordsArgs) (*GetEnvironmentDeploymentExecutionRecordsResponseValue, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + queryParams := url.Values{} + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", *args.ContinuationToken) + } + if args.Top != nil { + queryParams.Add("top", strconv.Itoa(*args.Top)) + } + locationId, _ := uuid.Parse("51bb5d21-4305-4ea6-9dbb-b7488af73334") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue GetEnvironmentDeploymentExecutionRecordsResponseValue + responseValue.ContinuationToken = resp.Header.Get(azuredevops.HeaderKeyContinuationToken) + err = client.Client.UnmarshalCollectionBody(resp, &responseValue.Value) + return &responseValue, err +} + +// Arguments for the GetEnvironmentDeploymentExecutionRecords function +type GetEnvironmentDeploymentExecutionRecordsArgs struct { + // (required) Project ID or project name + Project *string + // (required) + EnvironmentId *int + // (optional) + ContinuationToken *string + // (optional) + Top *int +} + +// Return type for the GetEnvironmentDeploymentExecutionRecords function +type GetEnvironmentDeploymentExecutionRecordsResponseValue struct { + Value []EnvironmentDeploymentExecutionRecord + ContinuationToken string +} + +// [Preview API] Get all environments. +func (client *ClientImpl) GetEnvironments(ctx context.Context, args GetEnvironmentsArgs) (*GetEnvironmentsResponseValue, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + queryParams := url.Values{} + if args.Name != nil { + queryParams.Add("name", *args.Name) + } + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", *args.ContinuationToken) + } + if args.Top != nil { + queryParams.Add("$top", strconv.Itoa(*args.Top)) + } + locationId, _ := uuid.Parse("8572b1fc-2482-47fa-8f74-7e3ed53ee54b") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue GetEnvironmentsResponseValue + responseValue.ContinuationToken = resp.Header.Get(azuredevops.HeaderKeyContinuationToken) + err = client.Client.UnmarshalCollectionBody(resp, &responseValue.Value) + return &responseValue, err +} + +// Arguments for the GetEnvironments function +type GetEnvironmentsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) + Name *string + // (optional) + ContinuationToken *string + // (optional) + Top *int +} + +// Return type for the GetEnvironments function +type GetEnvironmentsResponseValue struct { + Value []EnvironmentInstance + ContinuationToken string +} + +// [Preview API] +func (client *ClientImpl) GetKubernetesResource(ctx context.Context, args GetKubernetesResourceArgs) (*KubernetesResource, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + if args.ResourceId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ResourceId"} + } + routeValues["resourceId"] = strconv.Itoa(*args.ResourceId) + + locationId, _ := uuid.Parse("73fba52f-15ab-42b3-a538-ce67a9223a04") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue KubernetesResource + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetKubernetesResource function +type GetKubernetesResourceArgs struct { + // (required) Project ID or project name + Project *string + // (required) + EnvironmentId *int + // (required) + ResourceId *int +} + +// [Preview API] List task groups. +func (client *ClientImpl) GetTaskGroups(ctx context.Context, args GetTaskGroupsArgs) (*[]TaskGroup, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.TaskGroupId != nil { + routeValues["taskGroupId"] = (*args.TaskGroupId).String() + } + + queryParams := url.Values{} + if args.Expanded != nil { + queryParams.Add("expanded", strconv.FormatBool(*args.Expanded)) + } + if args.TaskIdFilter != nil { + queryParams.Add("taskIdFilter", (*args.TaskIdFilter).String()) + } + if args.Deleted != nil { + queryParams.Add("deleted", strconv.FormatBool(*args.Deleted)) + } + if args.Top != nil { + queryParams.Add("$top", strconv.Itoa(*args.Top)) + } + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", (*args.ContinuationToken).AsQueryParameter()) + } + if args.QueryOrder != nil { + queryParams.Add("queryOrder", string(*args.QueryOrder)) + } + locationId, _ := uuid.Parse("6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TaskGroup + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTaskGroups function +type GetTaskGroupsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Id of the task group. + TaskGroupId *uuid.UUID + // (optional) 'true' to recursively expand task groups. Default is 'false'. + Expanded *bool + // (optional) Guid of the taskId to filter. + TaskIdFilter *uuid.UUID + // (optional) 'true'to include deleted task groups. Default is 'false'. + Deleted *bool + // (optional) Number of task groups to get. + Top *int + // (optional) Gets the task groups after the continuation token provided. + ContinuationToken *azuredevops.Time + // (optional) Gets the results in the defined order. Default is 'CreatedOnDescending'. + QueryOrder *TaskGroupQueryOrder +} + +// [Preview API] Get a variable group. +func (client *ClientImpl) GetVariableGroup(ctx context.Context, args GetVariableGroupArgs) (*VariableGroup, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.GroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"} + } + routeValues["groupId"] = strconv.Itoa(*args.GroupId) + + locationId, _ := uuid.Parse("f5b09dd5-9d54-45a1-8b5a-1c8287d634cc") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.2", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue VariableGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetVariableGroup function +type GetVariableGroupArgs struct { + // (required) Project ID or project name + Project *string + // (required) Id of the variable group. + GroupId *int +} + +// [Preview API] Get variable groups. +func (client *ClientImpl) GetVariableGroups(ctx context.Context, args GetVariableGroupsArgs) (*[]VariableGroup, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + queryParams := url.Values{} + if args.GroupName != nil { + queryParams.Add("groupName", *args.GroupName) + } + if args.ActionFilter != nil { + queryParams.Add("actionFilter", string(*args.ActionFilter)) + } + if args.Top != nil { + queryParams.Add("$top", strconv.Itoa(*args.Top)) + } + if args.ContinuationToken != nil { + queryParams.Add("continuationToken", strconv.Itoa(*args.ContinuationToken)) + } + if args.QueryOrder != nil { + queryParams.Add("queryOrder", string(*args.QueryOrder)) + } + locationId, _ := uuid.Parse("f5b09dd5-9d54-45a1-8b5a-1c8287d634cc") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.2", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []VariableGroup + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetVariableGroups function +type GetVariableGroupsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Name of variable group. + GroupName *string + // (optional) Action filter for the variable group. It specifies the action which can be performed on the variable groups. + ActionFilter *VariableGroupActionFilter + // (optional) Number of variable groups to get. + Top *int + // (optional) Gets the variable groups after the continuation token provided. + ContinuationToken *int + // (optional) Gets the results in the defined order. Default is 'IdDescending'. + QueryOrder *VariableGroupQueryOrder +} + +// [Preview API] Get variable groups by ids. +func (client *ClientImpl) GetVariableGroupsById(ctx context.Context, args GetVariableGroupsByIdArgs) (*[]VariableGroup, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + queryParams := url.Values{} + if args.GroupIds == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "groupIds"} + } + var stringList []string + for _, item := range *args.GroupIds { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("groupIds", listAsString) + locationId, _ := uuid.Parse("f5b09dd5-9d54-45a1-8b5a-1c8287d634cc") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.2", routeValues, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []VariableGroup + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetVariableGroupsById function +type GetVariableGroupsByIdArgs struct { + // (required) Project ID or project name + Project *string + // (required) Comma separated list of Ids of variable groups. + GroupIds *[]int +} + +// [Preview API] GET the Yaml schema used for Yaml file validation. +func (client *ClientImpl) GetYamlSchema(ctx context.Context, args GetYamlSchemaArgs) (interface{}, error) { + queryParams := url.Values{} + if args.ValidateTaskNames != nil { + queryParams.Add("validateTaskNames", strconv.FormatBool(*args.ValidateTaskNames)) + } + locationId, _ := uuid.Parse("1f9990b9-1dba-441f-9c2e-6485888c42b6") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.1", nil, queryParams, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue interface{} + err = client.Client.UnmarshalBody(resp, responseValue) + return responseValue, err +} + +// Arguments for the GetYamlSchema function +type GetYamlSchemaArgs struct { + // (optional) Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation). + ValidateTaskNames *bool +} + +// [Preview API] Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. +func (client *ClientImpl) ReplaceAgent(ctx context.Context, args ReplaceAgentArgs) (*TaskAgent, error) { + if args.Agent == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Agent"} + } + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + if args.AgentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentId"} + } + routeValues["agentId"] = strconv.Itoa(*args.AgentId) + + body, marshalErr := json.Marshal(*args.Agent) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgent + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the ReplaceAgent function +type ReplaceAgentArgs struct { + // (required) Updated details about the replacing agent + Agent *TaskAgent + // (required) The agent pool to use + PoolId *int + // (required) The agent to replace + AgentId *int +} + +// [Preview API] Add a variable group. +func (client *ClientImpl) ShareVariableGroup(ctx context.Context, args ShareVariableGroupArgs) error { + if args.VariableGroupProjectReferences == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.VariableGroupProjectReferences"} + } + queryParams := url.Values{} + if args.VariableGroupId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "variableGroupId"} + } + queryParams.Add("variableGroupId", strconv.Itoa(*args.VariableGroupId)) + body, marshalErr := json.Marshal(*args.VariableGroupProjectReferences) + if marshalErr != nil { + return marshalErr + } + locationId, _ := uuid.Parse("ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7") + _, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.2", nil, queryParams, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the ShareVariableGroup function +type ShareVariableGroupArgs struct { + // (required) + VariableGroupProjectReferences *[]VariableGroupProjectReference + // (required) + VariableGroupId *int +} + +// [Preview API] Update agent details. +func (client *ClientImpl) UpdateAgent(ctx context.Context, args UpdateAgentArgs) (*TaskAgent, error) { + if args.Agent == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Agent"} + } + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + if args.AgentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentId"} + } + routeValues["agentId"] = strconv.Itoa(*args.AgentId) + + body, marshalErr := json.Marshal(*args.Agent) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("e298ef32-5878-4cab-993c-043836571f42") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgent + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateAgent function +type UpdateAgentArgs struct { + // (required) Updated details about the agent + Agent *TaskAgent + // (required) The agent pool to use + PoolId *int + // (required) The agent to update + AgentId *int +} + +// [Preview API] +func (client *ClientImpl) UpdateAgentCloud(ctx context.Context, args UpdateAgentCloudArgs) (*TaskAgentCloud, error) { + if args.UpdatedCloud == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.UpdatedCloud"} + } + routeValues := make(map[string]string) + if args.AgentCloudId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.AgentCloudId"} + } + routeValues["agentCloudId"] = strconv.Itoa(*args.AgentCloudId) + + body, marshalErr := json.Marshal(*args.UpdatedCloud) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("bfa72b3d-0fc6-43fb-932b-a7f6559f93b9") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentCloud + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateAgentCloud function +type UpdateAgentCloudArgs struct { + // (required) + UpdatedCloud *TaskAgentCloud + // (required) + AgentCloudId *int +} + +// [Preview API] Update properties on an agent pool +func (client *ClientImpl) UpdateAgentPool(ctx context.Context, args UpdateAgentPoolArgs) (*TaskAgentPool, error) { + if args.Pool == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Pool"} + } + routeValues := make(map[string]string) + if args.PoolId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PoolId"} + } + routeValues["poolId"] = strconv.Itoa(*args.PoolId) + + body, marshalErr := json.Marshal(*args.Pool) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("a8c47e17-4d56-4a56-92bb-de7ea7dc65be") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskAgentPool + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateAgentPool function +type UpdateAgentPoolArgs struct { + // (required) Updated agent pool details + Pool *TaskAgentPool + // (required) The agent pool to update + PoolId *int +} + +// [Preview API] Update a deployment group. +func (client *ClientImpl) UpdateDeploymentGroup(ctx context.Context, args UpdateDeploymentGroupArgs) (*DeploymentGroup, error) { + if args.DeploymentGroup == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroup"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + + body, marshalErr := json.Marshal(*args.DeploymentGroup) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("083c4d89-ab35-45af-aa11-7cf66895c53e") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue DeploymentGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateDeploymentGroup function +type UpdateDeploymentGroupArgs struct { + // (required) Deployment group to update. + DeploymentGroup *DeploymentGroupUpdateParameter + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group. + DeploymentGroupId *int +} + +// [Preview API] Update tags of a list of deployment targets in a deployment group. +func (client *ClientImpl) UpdateDeploymentTargets(ctx context.Context, args UpdateDeploymentTargetsArgs) (*[]DeploymentMachine, error) { + if args.Machines == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Machines"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.DeploymentGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DeploymentGroupId"} + } + routeValues["deploymentGroupId"] = strconv.Itoa(*args.DeploymentGroupId) + + body, marshalErr := json.Marshal(*args.Machines) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("2f0aa599-c121-4256-a5fd-ba370e0ae7b6") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []DeploymentMachine + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateDeploymentTargets function +type UpdateDeploymentTargetsArgs struct { + // (required) Deployment targets with tags to udpdate. + Machines *[]DeploymentTargetUpdateParameter + // (required) Project ID or project name + Project *string + // (required) ID of the deployment group in which deployment targets are updated. + DeploymentGroupId *int +} + +// [Preview API] Update the specified environment. +func (client *ClientImpl) UpdateEnvironment(ctx context.Context, args UpdateEnvironmentArgs) (*EnvironmentInstance, error) { + if args.EnvironmentUpdateParameter == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentUpdateParameter"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.EnvironmentId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EnvironmentId"} + } + routeValues["environmentId"] = strconv.Itoa(*args.EnvironmentId) + + body, marshalErr := json.Marshal(*args.EnvironmentUpdateParameter) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("8572b1fc-2482-47fa-8f74-7e3ed53ee54b") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue EnvironmentInstance + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateEnvironment function +type UpdateEnvironmentArgs struct { + // (required) Environment data to update. + EnvironmentUpdateParameter *EnvironmentUpdateParameter + // (required) Project ID or project name + Project *string + // (required) ID of the environment. + EnvironmentId *int +} + +// [Preview API] Update a task group. +func (client *ClientImpl) UpdateTaskGroup(ctx context.Context, args UpdateTaskGroupArgs) (*TaskGroup, error) { + if args.TaskGroup == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TaskGroup"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.TaskGroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TaskGroupId"} + } + routeValues["taskGroupId"] = (*args.TaskGroupId).String() + + body, marshalErr := json.Marshal(*args.TaskGroup) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7") + resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "7.1-preview.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TaskGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateTaskGroup function +type UpdateTaskGroupArgs struct { + // (required) Task group to update. + TaskGroup *TaskGroupUpdateParameter + // (required) Project ID or project name + Project *string + // (required) Id of the task group to update. + TaskGroupId *uuid.UUID +} + +// [Preview API] Update a variable group. +func (client *ClientImpl) UpdateVariableGroup(ctx context.Context, args UpdateVariableGroupArgs) (*VariableGroup, error) { + if args.VariableGroupParameters == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.VariableGroupParameters"} + } + routeValues := make(map[string]string) + if args.GroupId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.GroupId"} + } + routeValues["groupId"] = strconv.Itoa(*args.GroupId) + + body, marshalErr := json.Marshal(*args.VariableGroupParameters) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("ef5b7057-ffc3-4c77-bbad-c10b4a4abcc7") + resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "7.1-preview.2", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue VariableGroup + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateVariableGroup function +type UpdateVariableGroupArgs struct { + // (required) + VariableGroupParameters *VariableGroupParameters + // (required) Id of the variable group to update. + GroupId *int +} diff --git a/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/models.go b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/models.go new file mode 100644 index 00000000..636e5593 --- /dev/null +++ b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/models.go @@ -0,0 +1,3324 @@ +// -------------------------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// -------------------------------------------------------------------------------------------- +// Generated file, DO NOT EDIT +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// -------------------------------------------------------------------------------------------- + +package taskagent + +import ( + "github.com/google/uuid" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/distributedtaskcommon" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/forminput" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/webapi" +) + +type AadLoginPromptOption string + +type aadLoginPromptOptionValuesType struct { + NoOption AadLoginPromptOption + Login AadLoginPromptOption + SelectAccount AadLoginPromptOption + FreshLogin AadLoginPromptOption + FreshLoginWithMfa AadLoginPromptOption +} + +var AadLoginPromptOptionValues = aadLoginPromptOptionValuesType{ + // Do not provide a prompt option + NoOption: "noOption", + // Force the user to login again. + Login: "login", + // Force the user to select which account they are logging in with instead of automatically picking the user up from the session state. NOTE: This does not work for switching between the variants of a dual-homed user. + SelectAccount: "selectAccount", + // Force the user to login again. Ignore current authentication state and force the user to authenticate again. This option should be used instead of Login. + FreshLogin: "freshLogin", + // Force the user to login again with mfa. Ignore current authentication state and force the user to authenticate again. This option should be used instead of Login, if MFA is required. + FreshLoginWithMfa: "freshLoginWithMfa", +} + +type AadOauthTokenRequest struct { + Refresh *bool `json:"refresh,omitempty"` + Resource *string `json:"resource,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + Token *string `json:"token,omitempty"` +} + +type AadOauthTokenResult struct { + AccessToken *string `json:"accessToken,omitempty"` + RefreshTokenCache *string `json:"refreshTokenCache,omitempty"` +} + +type AgentChangeEvent struct { + Agent *TaskAgent `json:"agent,omitempty"` + EventType *string `json:"eventType,omitempty"` + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Deprecated: + PoolId *int `json:"poolId,omitempty"` + // Deprecated: + TimeStamp *azuredevops.Time `json:"timeStamp,omitempty"` +} + +type AgentJobRequestMessage struct { + Environment *JobEnvironment `json:"environment,omitempty"` + JobId *uuid.UUID `json:"jobId,omitempty"` + JobName *string `json:"jobName,omitempty"` + JobRefName *string `json:"jobRefName,omitempty"` + MessageType *string `json:"messageType,omitempty"` + Plan *TaskOrchestrationPlanReference `json:"plan,omitempty"` + Timeline *TimelineReference `json:"timeline,omitempty"` + LockedUntil *azuredevops.Time `json:"lockedUntil,omitempty"` + LockToken *uuid.UUID `json:"lockToken,omitempty"` + RequestId *uint64 `json:"requestId,omitempty"` + Tasks *[]TaskInstance `json:"tasks,omitempty"` +} + +type AgentPoolEvent struct { + EventType *string `json:"eventType,omitempty"` + Pool *TaskAgentPool `json:"pool,omitempty"` +} + +type AgentQueueEvent struct { + EventType *string `json:"eventType,omitempty"` + Queue *TaskAgentQueue `json:"queue,omitempty"` +} + +type AgentQueuesEvent struct { + EventType *string `json:"eventType,omitempty"` + Queues *[]TaskAgentQueue `json:"queues,omitempty"` +} + +type AgentRefreshMessage struct { + AgentId *int `json:"agentId,omitempty"` + TargetVersion *string `json:"targetVersion,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` +} + +type AuditAction string + +type auditActionValuesType struct { + Add AuditAction + Update AuditAction + Delete AuditAction + Undelete AuditAction +} + +var AuditActionValues = auditActionValuesType{ + Add: "add", + Update: "update", + Delete: "delete", + Undelete: "undelete", +} + +type AuthenticationSchemeReference struct { + Inputs *map[string]string `json:"inputs,omitempty"` + Type *string `json:"type,omitempty"` +} + +type AuthorizationHeader struct { + // Gets or sets the name of authorization header. + Name *string `json:"name,omitempty"` + // Gets or sets the value of authorization header. + Value *string `json:"value,omitempty"` +} + +type AzureKeyVaultPermission struct { + Provisioned *bool `json:"provisioned,omitempty"` + ResourceProvider *string `json:"resourceProvider,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` + Vault *string `json:"vault,omitempty"` +} + +type AzureKeyVaultVariableGroupProviderData struct { + LastRefreshedOn *azuredevops.Time `json:"lastRefreshedOn,omitempty"` + ServiceEndpointId *uuid.UUID `json:"serviceEndpointId,omitempty"` + Vault *string `json:"vault,omitempty"` +} + +type AzureKeyVaultVariableValue struct { + // Indicates whether the variable can be changed during script's execution runtime. + IsReadOnly *bool `json:"isReadOnly,omitempty"` + // Indicates whether the variable should be encrypted at rest. + IsSecret *bool `json:"isSecret,omitempty"` + // The value of the variable. + Value *string `json:"value,omitempty"` + ContentType *string `json:"contentType,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Expires *azuredevops.Time `json:"expires,omitempty"` +} + +// Azure Management Group +type AzureManagementGroup struct { + // Display name of azure management group + DisplayName *string `json:"displayName,omitempty"` + // Id of azure management group + Id *string `json:"id,omitempty"` + // Azure management group name + Name *string `json:"name,omitempty"` + // Id of tenant from which azure management group belongs + TenantId *string `json:"tenantId,omitempty"` +} + +// Azure management group query result +type AzureManagementGroupQueryResult struct { + // Error message in case of an exception + ErrorMessage *string `json:"errorMessage,omitempty"` + // List of azure management groups + Value *[]AzureManagementGroup `json:"value,omitempty"` +} + +type AzurePermission struct { + Provisioned *bool `json:"provisioned,omitempty"` + ResourceProvider *string `json:"resourceProvider,omitempty"` +} + +type AzureResourcePermission struct { + Provisioned *bool `json:"provisioned,omitempty"` + ResourceProvider *string `json:"resourceProvider,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +type AzureRoleAssignmentPermission struct { + Provisioned *bool `json:"provisioned,omitempty"` + ResourceProvider *string `json:"resourceProvider,omitempty"` + RoleAssignmentId *uuid.UUID `json:"roleAssignmentId,omitempty"` +} + +type AzureSpnOperationStatus struct { + State *string `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +type AzureSubscription struct { + DisplayName *string `json:"displayName,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + SubscriptionTenantId *string `json:"subscriptionTenantId,omitempty"` + SubscriptionTenantName *string `json:"subscriptionTenantName,omitempty"` +} + +type AzureSubscriptionQueryResult struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Value *[]AzureSubscription `json:"value,omitempty"` +} + +type ClientCertificate struct { + // Gets or sets the value of client certificate. + Value *string `json:"value,omitempty"` +} + +type CounterVariable struct { + Prefix *string `json:"prefix,omitempty"` + Seed *int `json:"seed,omitempty"` + Value *int `json:"value,omitempty"` +} + +type DataSource struct { + AuthenticationScheme *AuthenticationSchemeReference `json:"authenticationScheme,omitempty"` + EndpointUrl *string `json:"endpointUrl,omitempty"` + Headers *[]AuthorizationHeader `json:"headers,omitempty"` + Name *string `json:"name,omitempty"` + ResourceUrl *string `json:"resourceUrl,omitempty"` + ResultSelector *string `json:"resultSelector,omitempty"` +} + +type DataSourceBinding struct { + // Pagination format supported by this data source(ContinuationToken/SkipTop). + CallbackContextTemplate *string `json:"callbackContextTemplate,omitempty"` + // Subsequent calls needed? + CallbackRequiredTemplate *string `json:"callbackRequiredTemplate,omitempty"` + // Gets or sets the name of the data source. + DataSourceName *string `json:"dataSourceName,omitempty"` + // Gets or sets the endpoint Id. + EndpointId *string `json:"endpointId,omitempty"` + // Gets or sets the url of the service endpoint. + EndpointUrl *string `json:"endpointUrl,omitempty"` + // Gets or sets the authorization headers. + Headers *[]distributedtaskcommon.AuthorizationHeader `json:"headers,omitempty"` + // Defines the initial value of the query params + InitialContextTemplate *string `json:"initialContextTemplate,omitempty"` + // Gets or sets the parameters for the data source. + Parameters *map[string]string `json:"parameters,omitempty"` + // Gets or sets http request body + RequestContent *string `json:"requestContent,omitempty"` + // Gets or sets http request verb + RequestVerb *string `json:"requestVerb,omitempty"` + // Gets or sets the result selector. + ResultSelector *string `json:"resultSelector,omitempty"` + // Gets or sets the result template. + ResultTemplate *string `json:"resultTemplate,omitempty"` + // Gets or sets the target of the data source. + Target *string `json:"target,omitempty"` +} + +type DataSourceDetails struct { + DataSourceName *string `json:"dataSourceName,omitempty"` + DataSourceUrl *string `json:"dataSourceUrl,omitempty"` + Headers *[]AuthorizationHeader `json:"headers,omitempty"` + Parameters *map[string]string `json:"parameters,omitempty"` + ResourceUrl *string `json:"resourceUrl,omitempty"` + ResultSelector *string `json:"resultSelector,omitempty"` +} + +type Demand struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +type DemandEquals struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +type DemandExists struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +type DemandMinimumVersion struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + Source *DemandSource `json:"source,omitempty"` +} + +type DemandSource struct { + SourceName *string `json:"sourceName,omitempty"` + SourceType *DemandSourceType `json:"sourceType,omitempty"` + SourceVersion *string `json:"sourceVersion,omitempty"` +} + +type DemandSourceType string + +type demandSourceTypeValuesType struct { + Task DemandSourceType + Feature DemandSourceType +} + +var DemandSourceTypeValues = demandSourceTypeValuesType{ + Task: "task", + Feature: "feature", +} + +type DependencyBinding struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` +} + +type DependencyData struct { + Input *string `json:"input,omitempty"` + Map *[]azuredevops.KeyValuePair `json:"map,omitempty"` +} + +type DependsOn struct { + Input *string `json:"input,omitempty"` + Map *[]DependencyBinding `json:"map,omitempty"` +} + +type DeploymentGatesChangeEvent struct { + GateNames *[]string `json:"gateNames,omitempty"` +} + +// Deployment group. +type DeploymentGroup struct { + // Deployment group identifier. + Id *int `json:"id,omitempty"` + // Name of the deployment group. + Name *string `json:"name,omitempty"` + // Deployment pool in which deployment agents are registered. + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Project to which the deployment group belongs. + Project *ProjectReference `json:"project,omitempty"` + // Description of the deployment group. + Description *string `json:"description,omitempty"` + // Number of deployment targets in the deployment group. + MachineCount *int `json:"machineCount,omitempty"` + // List of deployment targets in the deployment group. + Machines *[]DeploymentMachine `json:"machines,omitempty"` + // List of unique tags across all deployment targets in the deployment group. + MachineTags *[]string `json:"machineTags,omitempty"` +} + +// [Flags] This is useful in getting a list of deployment groups, filtered for which caller has permissions to take a particular action. +type DeploymentGroupActionFilter string + +type deploymentGroupActionFilterValuesType struct { + None DeploymentGroupActionFilter + Manage DeploymentGroupActionFilter + Use DeploymentGroupActionFilter +} + +var DeploymentGroupActionFilterValues = deploymentGroupActionFilterValuesType{ + // All deployment groups. + None: "none", + // Only deployment groups for which caller has **manage** permission. + Manage: "manage", + // Only deployment groups for which caller has **use** permission. + Use: "use", +} + +// Properties to create Deployment group. +type DeploymentGroupCreateParameter struct { + // Description of the deployment group. + Description *string `json:"description,omitempty"` + // Name of the deployment group. + Name *string `json:"name,omitempty"` + // Identifier of the deployment pool in which deployment agents are registered. + PoolId *int `json:"poolId,omitempty"` +} + +// Properties of Deployment pool to create Deployment group. +type DeploymentGroupCreateParameterPoolProperty struct { + // Deployment pool identifier. + Id *int `json:"id,omitempty"` +} + +// [Flags] Properties to be included or expanded in deployment group objects. This is useful when getting a single or list of deployment grouops. +type DeploymentGroupExpands string + +type deploymentGroupExpandsValuesType struct { + None DeploymentGroupExpands + Machines DeploymentGroupExpands + Tags DeploymentGroupExpands +} + +var DeploymentGroupExpandsValues = deploymentGroupExpandsValuesType{ + // No additional properties. + None: "none", + // Deprecated: Include all the deployment targets. + Machines: "machines", + // Include unique list of tags across all deployment targets. + Tags: "tags", +} + +// Deployment group metrics. +type DeploymentGroupMetrics struct { + // List of deployment group properties. And types of metrics provided for those properties. + ColumnsHeader *MetricsColumnsHeader `json:"columnsHeader,omitempty"` + // Deployment group. + DeploymentGroup *DeploymentGroupReference `json:"deploymentGroup,omitempty"` + // Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'. + Rows *[]MetricsRow `json:"rows,omitempty"` +} + +// Deployment group reference. This is useful for referring a deployment group in another object. +type DeploymentGroupReference struct { + // Deployment group identifier. + Id *int `json:"id,omitempty"` + // Name of the deployment group. + Name *string `json:"name,omitempty"` + // Deployment pool in which deployment agents are registered. + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Project to which the deployment group belongs. + Project *ProjectReference `json:"project,omitempty"` +} + +// Deployment group update parameter. +type DeploymentGroupUpdateParameter struct { + // Description of the deployment group. + Description *string `json:"description,omitempty"` + // Name of the deployment group. + Name *string `json:"name,omitempty"` +} + +// Deployment target. +type DeploymentMachine struct { + // Deployment agent. + Agent *TaskAgent `json:"agent,omitempty"` + // Deployment target Identifier. + Id *int `json:"id,omitempty"` + // Properties of the deployment target. + Properties interface{} `json:"properties,omitempty"` + // Tags of the deployment target. + Tags *[]string `json:"tags,omitempty"` +} + +// [Flags] +type DeploymentMachineExpands string + +type deploymentMachineExpandsValuesType struct { + None DeploymentMachineExpands + Capabilities DeploymentMachineExpands + AssignedRequest DeploymentMachineExpands +} + +var DeploymentMachineExpandsValues = deploymentMachineExpandsValuesType{ + None: "none", + Capabilities: "capabilities", + AssignedRequest: "assignedRequest", +} + +type DeploymentMachineGroup struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + Project *ProjectReference `json:"project,omitempty"` + Machines *[]DeploymentMachine `json:"machines,omitempty"` + Size *int `json:"size,omitempty"` +} + +type DeploymentMachineGroupReference struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + Project *ProjectReference `json:"project,omitempty"` +} + +type DeploymentMachineChangedData struct { + // Deployment agent. + Agent *TaskAgent `json:"agent,omitempty"` + // Deployment target Identifier. + Id *int `json:"id,omitempty"` + // Properties of the deployment target. + Properties interface{} `json:"properties,omitempty"` + // Tags of the deployment target. + Tags *[]string `json:"tags,omitempty"` + AddedTags *[]string `json:"addedTags,omitempty"` + DeletedTags *[]string `json:"deletedTags,omitempty"` +} + +type DeploymentMachinesChangeEvent struct { + MachineGroupReference *DeploymentGroupReference `json:"machineGroupReference,omitempty"` + Machines *[]DeploymentMachineChangedData `json:"machines,omitempty"` +} + +// Deployment pool summary. +type DeploymentPoolSummary struct { + // List of deployment groups referring to the deployment pool. + DeploymentGroups *[]DeploymentGroupReference `json:"deploymentGroups,omitempty"` + // Number of deployment agents that are offline. + OfflineAgentsCount *int `json:"offlineAgentsCount,omitempty"` + // Number of deployment agents that are online. + OnlineAgentsCount *int `json:"onlineAgentsCount,omitempty"` + // Deployment pool. + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Virtual machine Resource referring in pool. + Resource *EnvironmentResourceReference `json:"resource,omitempty"` +} + +// [Flags] Properties to be included or expanded in deployment pool summary objects. This is useful when getting a single or list of deployment pool summaries. +type DeploymentPoolSummaryExpands string + +type deploymentPoolSummaryExpandsValuesType struct { + None DeploymentPoolSummaryExpands + DeploymentGroups DeploymentPoolSummaryExpands + Resource DeploymentPoolSummaryExpands +} + +var DeploymentPoolSummaryExpandsValues = deploymentPoolSummaryExpandsValuesType{ + // No additional properties + None: "none", + // Include deployment groups referring to the deployment pool. + DeploymentGroups: "deploymentGroups", + // Include Resource referring to the deployment pool. + Resource: "resource", +} + +// [Flags] Properties to be included or expanded in deployment target objects. This is useful when getting a single or list of deployment targets. +type DeploymentTargetExpands string + +type deploymentTargetExpandsValuesType struct { + None DeploymentTargetExpands + Capabilities DeploymentTargetExpands + AssignedRequest DeploymentTargetExpands + LastCompletedRequest DeploymentTargetExpands +} + +var DeploymentTargetExpandsValues = deploymentTargetExpandsValuesType{ + // No additional properties. + None: "none", + // Include capabilities of the deployment agent. + Capabilities: "capabilities", + // Include the job request assigned to the deployment agent. + AssignedRequest: "assignedRequest", + // Include the last completed job request of the deployment agent. + LastCompletedRequest: "lastCompletedRequest", +} + +// Deployment target update parameter. +type DeploymentTargetUpdateParameter struct { + // Identifier of the deployment target. + Id *int `json:"id,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +type DiagnosticLogMetadata struct { + AgentId *int `json:"agentId,omitempty"` + AgentName *string `json:"agentName,omitempty"` + FileName *string `json:"fileName,omitempty"` + PhaseName *string `json:"phaseName,omitempty"` + PhaseResult *string `json:"phaseResult,omitempty"` + PoolId *int `json:"poolId,omitempty"` +} + +type ElasticAgentPoolResizedEvent struct { + NewSize *int `json:"newSize,omitempty"` + PoolId *int `json:"poolId,omitempty"` + PoolName *string `json:"poolName,omitempty"` + PreviousSize *int `json:"previousSize,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +// [Flags] +type ElasticAgentState string + +type elasticAgentStateValuesType struct { + None ElasticAgentState + Enabled ElasticAgentState + Online ElasticAgentState + Assigned ElasticAgentState +} + +var ElasticAgentStateValues = elasticAgentStateValuesType{ + None: "none", + Enabled: "enabled", + Online: "online", + Assigned: "assigned", +} + +type ElasticComputeState string + +type elasticComputeStateValuesType struct { + None ElasticComputeState + Healthy ElasticComputeState + Creating ElasticComputeState + Deleting ElasticComputeState + Failed ElasticComputeState + Stopped ElasticComputeState + Reimaging ElasticComputeState +} + +var ElasticComputeStateValues = elasticComputeStateValuesType{ + None: "none", + Healthy: "healthy", + Creating: "creating", + Deleting: "deleting", + Failed: "failed", + Stopped: "stopped", + Reimaging: "reimaging", +} + +// Data and settings for an elastic node +type ElasticNode struct { + // Distributed Task's Agent Id + AgentId *int `json:"agentId,omitempty"` + // Summary of the state of the agent + AgentState *ElasticAgentState `json:"agentState,omitempty"` + // Compute Id. VMSS's InstanceId + ComputeId *string `json:"computeId,omitempty"` + // State of the compute host + ComputeState *ElasticComputeState `json:"computeState,omitempty"` + // Users can force state changes to specific states (ToReimage, ToDelete, Save) + DesiredState *ElasticNodeState `json:"desiredState,omitempty"` + // Unique identifier since the agent and/or VM may be null + Id *int `json:"id,omitempty"` + // Computer name. Used to match a scaleset VM with an agent + Name *string `json:"name,omitempty"` + // Pool Id that this node belongs to + PoolId *int `json:"poolId,omitempty"` + // Last job RequestId assigned to this agent + RequestId *uint64 `json:"requestId,omitempty"` + // State of the ElasticNode + State *ElasticNodeState `json:"state,omitempty"` + // Last state change. Only updated by SQL. + StateChangedOn *azuredevops.Time `json:"stateChangedOn,omitempty"` +} + +// Class used for updating an elastic node where only certain members are populated +type ElasticNodeSettings struct { + // State of the ElasticNode + State *ElasticNodeState `json:"state,omitempty"` +} + +type ElasticNodeState string + +type elasticNodeStateValuesType struct { + None ElasticNodeState + New ElasticNodeState + CreatingCompute ElasticNodeState + StartingAgent ElasticNodeState + Idle ElasticNodeState + Assigned ElasticNodeState + Offline ElasticNodeState + PendingReimage ElasticNodeState + PendingDelete ElasticNodeState + Saved ElasticNodeState + DeletingCompute ElasticNodeState + Deleted ElasticNodeState + Lost ElasticNodeState + ReimagingCompute ElasticNodeState + RestartingAgent ElasticNodeState + FailedToStartPendingDelete ElasticNodeState + FailedToRestartPendingDelete ElasticNodeState + FailedVMPendingDelete ElasticNodeState + AssignedPendingDelete ElasticNodeState + RetryDelete ElasticNodeState +} + +var ElasticNodeStateValues = elasticNodeStateValuesType{ + None: "none", + New: "new", + CreatingCompute: "creatingCompute", + StartingAgent: "startingAgent", + Idle: "idle", + Assigned: "assigned", + Offline: "offline", + PendingReimage: "pendingReimage", + PendingDelete: "pendingDelete", + Saved: "saved", + DeletingCompute: "deletingCompute", + Deleted: "deleted", + Lost: "lost", + ReimagingCompute: "reimagingCompute", + RestartingAgent: "restartingAgent", + FailedToStartPendingDelete: "failedToStartPendingDelete", + FailedToRestartPendingDelete: "failedToRestartPendingDelete", + FailedVMPendingDelete: "failedVMPendingDelete", + AssignedPendingDelete: "assignedPendingDelete", + RetryDelete: "retryDelete", +} + +// Data and settings for an elastic pool +type ElasticPool struct { + // Set whether agents should be configured to run with interactive UI + AgentInteractiveUI *bool `json:"agentInteractiveUI,omitempty"` + // Azure string representing to location of the resource + AzureId *string `json:"azureId,omitempty"` + // Number of agents to have ready waiting for jobs + DesiredIdle *int `json:"desiredIdle,omitempty"` + // The desired size of the pool + DesiredSize *int `json:"desiredSize,omitempty"` + // Maximum number of nodes that will exist in the elastic pool + MaxCapacity *int `json:"maxCapacity,omitempty"` + // Keep nodes in the pool on failure for investigation + MaxSavedNodeCount *int `json:"maxSavedNodeCount,omitempty"` + // Timestamp the pool was first detected to be offline + OfflineSince *azuredevops.Time `json:"offlineSince,omitempty"` + // Operating system type of the nodes in the pool + OrchestrationType *OrchestrationType `json:"orchestrationType,omitempty"` + // Operating system type of the nodes in the pool + OsType *OperatingSystemType `json:"osType,omitempty"` + // Id of the associated TaskAgentPool + PoolId *int `json:"poolId,omitempty"` + // Discard node after each job completes + RecycleAfterEachUse *bool `json:"recycleAfterEachUse,omitempty"` + // Id of the Service Endpoint used to connect to Azure + ServiceEndpointId *uuid.UUID `json:"serviceEndpointId,omitempty"` + // Scope the Service Endpoint belongs to + ServiceEndpointScope *uuid.UUID `json:"serviceEndpointScope,omitempty"` + // The number of sizing attempts executed while trying to achieve a desired size + SizingAttempts *int `json:"sizingAttempts,omitempty"` + // State of the pool + State *ElasticPoolState `json:"state,omitempty"` + // The minimum time in minutes to keep idle agents alive + TimeToLiveMinutes *int `json:"timeToLiveMinutes,omitempty"` +} + +// Returned result from creating a new elastic pool +type ElasticPoolCreationResult struct { + // Created agent pool + AgentPool *TaskAgentPool `json:"agentPool,omitempty"` + // Created agent queue + AgentQueue *TaskAgentQueue `json:"agentQueue,omitempty"` + // Created elastic pool + ElasticPool *ElasticPool `json:"elasticPool,omitempty"` +} + +// Log data for an Elastic Pool +type ElasticPoolLog struct { + // Log Id + Id *uint64 `json:"id,omitempty"` + // E.g. error, warning, info + Level *LogLevel `json:"level,omitempty"` + // Log contents + Message *string `json:"message,omitempty"` + // Operation that triggered the message being logged + Operation *OperationType `json:"operation,omitempty"` + // Id of the associated TaskAgentPool + PoolId *int `json:"poolId,omitempty"` + // Datetime that the log occurred + Timestamp *azuredevops.Time `json:"timestamp,omitempty"` +} + +// Class used for updating an elastic pool where only certain members are populated +type ElasticPoolSettings struct { + // Set whether agents should be configured to run with interactive UI + AgentInteractiveUI *bool `json:"agentInteractiveUI,omitempty"` + // Azure string representing to location of the resource + AzureId *string `json:"azureId,omitempty"` + // Number of machines to have ready waiting for jobs + DesiredIdle *int `json:"desiredIdle,omitempty"` + // Maximum number of machines that will exist in the elastic pool + MaxCapacity *int `json:"maxCapacity,omitempty"` + // Keep machines in the pool on failure for investigation + MaxSavedNodeCount *int `json:"maxSavedNodeCount,omitempty"` + // Operating system type of the machines in the pool + OrchestrationType *OrchestrationType `json:"orchestrationType,omitempty"` + // Operating system type of the machines in the pool + OsType *OperatingSystemType `json:"osType,omitempty"` + // Discard machines after each job completes + RecycleAfterEachUse *bool `json:"recycleAfterEachUse,omitempty"` + // Id of the Service Endpoint used to connect to Azure + ServiceEndpointId *uuid.UUID `json:"serviceEndpointId,omitempty"` + // Scope the Service Endpoint belongs to + ServiceEndpointScope *uuid.UUID `json:"serviceEndpointScope,omitempty"` + // The minimum time in minutes to keep idle agents alive + TimeToLiveMinutes *int `json:"timeToLiveMinutes,omitempty"` +} + +type ElasticPoolState string + +type elasticPoolStateValuesType struct { + Online ElasticPoolState + Offline ElasticPoolState + Unhealthy ElasticPoolState + New ElasticPoolState +} + +var ElasticPoolStateValues = elasticPoolStateValuesType{ + // Online and healthy + Online: "online", + Offline: "offline", + Unhealthy: "unhealthy", + New: "new", +} + +type EndpointAuthorization struct { + // Gets or sets the parameters for the selected authorization scheme. + Parameters *map[string]string `json:"parameters,omitempty"` + // Gets or sets the scheme used for service endpoint authentication. + Scheme *string `json:"scheme,omitempty"` +} + +// Represents url of the service endpoint. +type EndpointUrl struct { + // Gets or sets the dependency bindings. + DependsOn *DependsOn `json:"dependsOn,omitempty"` + // Gets or sets the display name of service endpoint url. + DisplayName *string `json:"displayName,omitempty"` + // Gets or sets the help text of service endpoint url. + HelpText *string `json:"helpText,omitempty"` + // Gets or sets the visibility of service endpoint url. + IsVisible *string `json:"isVisible,omitempty"` + // Gets or sets the value of service endpoint url. + Value *string `json:"value,omitempty"` +} + +// [Flags] This is useful in getting a list of Environments, filtered for which caller has permissions to take a particular action. +type EnvironmentActionFilter string + +type environmentActionFilterValuesType struct { + None EnvironmentActionFilter + Manage EnvironmentActionFilter + Use EnvironmentActionFilter +} + +var EnvironmentActionFilterValues = environmentActionFilterValuesType{ + // All environments for which user has **view** permission. + None: "none", + // Only environments for which caller has **manage** permission. + Manage: "manage", + // Only environments for which caller has **use** permission. + Use: "use", +} + +// Properties to create Environment. +type EnvironmentCreateParameter struct { + // Description of the environment. + Description *string `json:"description,omitempty"` + // Name of the environment. + Name *string `json:"name,omitempty"` +} + +// EnvironmentDeploymentExecutionRecord. +type EnvironmentDeploymentExecutionRecord struct { + // Definition of the environment deployment execution owner + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + // Id of the Environment + EnvironmentId *int `json:"environmentId,omitempty"` + // Finish time of the environment deployment execution + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // Id of the Environment deployment execution history record + Id *uint64 `json:"id,omitempty"` + // Job Attempt + JobAttempt *int `json:"jobAttempt,omitempty"` + // Job name + JobName *string `json:"jobName,omitempty"` + // Owner of the environment deployment execution record + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + // Plan Id + PlanId *uuid.UUID `json:"planId,omitempty"` + // Plan type of the environment deployment execution record + PlanType *string `json:"planType,omitempty"` + // Queue time of the environment deployment execution + QueueTime *azuredevops.Time `json:"queueTime,omitempty"` + // Request identifier of the Environment deployment execution history record + RequestIdentifier *string `json:"requestIdentifier,omitempty"` + // Resource Id + ResourceId *int `json:"resourceId,omitempty"` + // Result of the environment deployment execution + Result *TaskResult `json:"result,omitempty"` + // Project Id + ScopeId *uuid.UUID `json:"scopeId,omitempty"` + // Service owner Id + ServiceOwner *uuid.UUID `json:"serviceOwner,omitempty"` + // Stage Attempt + StageAttempt *int `json:"stageAttempt,omitempty"` + // Stage name + StageName *string `json:"stageName,omitempty"` + // Start time of the environment deployment execution + StartTime *azuredevops.Time `json:"startTime,omitempty"` +} + +// [Flags] Properties to be included or expanded in environment objects. This is useful when getting a single environment. +type EnvironmentExpands string + +type environmentExpandsValuesType struct { + None EnvironmentExpands + ResourceReferences EnvironmentExpands +} + +var EnvironmentExpandsValues = environmentExpandsValuesType{ + // No additional properties + None: "none", + // Include resource references referring to the environment. + ResourceReferences: "resourceReferences", +} + +// Environment. +type EnvironmentInstance struct { + // Identity reference of the user who created the Environment. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + // Creation time of the Environment + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // Description of the Environment. + Description *string `json:"description,omitempty"` + // Id of the Environment + Id *int `json:"id,omitempty"` + // Identity reference of the user who last modified the Environment. + LastModifiedBy *webapi.IdentityRef `json:"lastModifiedBy,omitempty"` + // Last modified time of the Environment + LastModifiedOn *azuredevops.Time `json:"lastModifiedOn,omitempty"` + // Name of the Environment. + Name *string `json:"name,omitempty"` + // Project information for environment. + Project *ProjectReference `json:"project,omitempty"` + Resources *[]EnvironmentResourceReference `json:"resources,omitempty"` +} + +// EnvironmentLinkedResourceReference. +type EnvironmentLinkedResourceReference struct { + // Id of the resource. + Id *string `json:"id,omitempty"` + // Type of resource. + TypeName *string `json:"typeName,omitempty"` +} + +type EnvironmentReference struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +type EnvironmentResource struct { + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + EnvironmentReference *EnvironmentReference `json:"environmentReference,omitempty"` + Id *int `json:"id,omitempty"` + LastModifiedBy *webapi.IdentityRef `json:"lastModifiedBy,omitempty"` + LastModifiedOn *azuredevops.Time `json:"lastModifiedOn,omitempty"` + Name *string `json:"name,omitempty"` + // Tags of the Environment Resource. + Tags *[]string `json:"tags,omitempty"` + // Environment resource type + Type *EnvironmentResourceType `json:"type,omitempty"` +} + +// EnvironmentResourceDeploymentExecutionRecord. +type EnvironmentResourceDeploymentExecutionRecord struct { + // Id of the Environment + EnvironmentId *int `json:"environmentId,omitempty"` + // Finish time of the environment resource deployment execution + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // Id of the Environment deployment execution history record + RequestId *uint64 `json:"requestId,omitempty"` + // Resource Id + ResourceId *int `json:"resourceId,omitempty"` + // Result of the environment deployment execution + Result *TaskResult `json:"result,omitempty"` + // Start time of the environment resource deployment execution + StartTime *azuredevops.Time `json:"startTime,omitempty"` +} + +// EnvironmentResourceReference. +type EnvironmentResourceReference struct { + // Id of the resource. + Id *int `json:"id,omitempty"` + // Name of the resource. + Name *string `json:"name,omitempty"` + // Tags of the Environment Resource Reference. + Tags *[]string `json:"tags,omitempty"` + // Type of the resource. + Type *EnvironmentResourceType `json:"type,omitempty"` +} + +// [Flags] EnvironmentResourceType. +type EnvironmentResourceType string + +type environmentResourceTypeValuesType struct { + Undefined EnvironmentResourceType + Generic EnvironmentResourceType + VirtualMachine EnvironmentResourceType + Kubernetes EnvironmentResourceType +} + +var EnvironmentResourceTypeValues = environmentResourceTypeValuesType{ + Undefined: "undefined", + // Unknown resource type + Generic: "generic", + // Virtual machine resource type + VirtualMachine: "virtualMachine", + // Kubernetes resource type + Kubernetes: "kubernetes", +} + +// Properties to update Environment. +type EnvironmentUpdateParameter struct { + // Description of the environment. + Description *string `json:"description,omitempty"` + // Name of the environment. + Name *string `json:"name,omitempty"` +} + +type EventsConfig struct { +} + +type ExclusiveLockType string + +type exclusiveLockTypeValuesType struct { + RunLatest ExclusiveLockType + Sequential ExclusiveLockType +} + +var ExclusiveLockTypeValues = exclusiveLockTypeValuesType{ + RunLatest: "runLatest", + Sequential: "sequential", +} + +type ExpressionValidationItem struct { + // Tells whether the current input is valid or not + IsValid *bool `json:"isValid,omitempty"` + // Reason for input validation failure + Reason *string `json:"reason,omitempty"` + // Type of validation item + Type *string `json:"type,omitempty"` + // Value to validate. The conditional expression to validate for the input for "expression" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master') + Value *string `json:"value,omitempty"` +} + +type HelpLink struct { + Text *string `json:"text,omitempty"` + Url *string `json:"url,omitempty"` +} + +type InputBindingContext struct { + // Value of the input + Value *string `json:"value,omitempty"` +} + +type InputValidationItem struct { + // Tells whether the current input is valid or not + IsValid *bool `json:"isValid,omitempty"` + // Reason for input validation failure + Reason *string `json:"reason,omitempty"` + // Type of validation item + Type *string `json:"type,omitempty"` + // Value to validate. The conditional expression to validate for the input for "expression" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master') + Value *string `json:"value,omitempty"` + // Provides binding context for the expression to evaluate + Context *InputBindingContext `json:"context,omitempty"` +} + +type InputValidationRequest struct { + Inputs *map[string]ValidationItem `json:"inputs,omitempty"` +} + +// An issue (error, warning) associated with a pipeline run. +type Issue struct { + // The category of the issue.
Example: Code - refers to compilation errors
Example: General - refers to generic errors + Category *string `json:"category,omitempty"` + // A dictionary containing details about the issue. + Data *map[string]string `json:"data,omitempty"` + // A description of issue. + Message *string `json:"message,omitempty"` + // The type (error, warning) of the issue. + Type *IssueType `json:"type,omitempty"` +} + +// The type of issue based on severity. +type IssueType string + +type issueTypeValuesType struct { + Error IssueType + Warning IssueType +} + +var IssueTypeValues = issueTypeValuesType{ + Error: "error", + Warning: "warning", +} + +type JobAssignedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // A pipeline job request for an agent. + Request *TaskAgentJobRequest `json:"request,omitempty"` +} + +type JobCanceledEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // The reason for job cancellation. + Reason *string `json:"reason,omitempty"` + // The job's timeout interval. + Timeout interface{} `json:"timeout,omitempty"` +} + +type JobCancelMessage struct { + JobId *uuid.UUID `json:"jobId,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` +} + +type JobCompletedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // Indicates whether the agent is in the process of shutting down. + AgentShuttingDown *bool `json:"agentShuttingDown,omitempty"` + // The ID of the request. + RequestId *uint64 `json:"requestId,omitempty"` + // The result of the request. + Result *TaskResult `json:"result,omitempty"` +} + +// Represents the context of variables and vectors for a job request. +type JobEnvironment struct { + Endpoints *[]ServiceEndpoint `json:"endpoints,omitempty"` + Mask *[]MaskHint `json:"mask,omitempty"` + Options *map[uuid.UUID]JobOption `json:"options,omitempty"` + SecureFiles *[]SecureFile `json:"secureFiles,omitempty"` + // Gets or sets the endpoint used for communicating back to the calling service. + SystemConnection *ServiceEndpoint `json:"systemConnection,omitempty"` + Variables *map[string]string `json:"variables,omitempty"` +} + +// A pipeline job event to be processed by the execution plan. +type JobEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` +} + +type JobEventConfig struct { + Timeout *string `json:"timeout,omitempty"` +} + +type JobEventsConfig struct { + JobAssigned *JobEventConfig `json:"jobAssigned,omitempty"` + JobCompleted *JobEventConfig `json:"jobCompleted,omitempty"` + JobStarted *JobEventConfig `json:"jobStarted,omitempty"` +} + +type JobMetadataEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // A message to be sent to an agent currently running the job. + Message *JobMetadataMessage `json:"message,omitempty"` +} + +// A message to be sent to an agent currently running the job. +type JobMetadataMessage struct { + // The id of the job. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The agent's frequency of posting lines to the logs console expressed in milliseconds. There are 2 modes: Slow (10 seconds) and Fast (half a second). + PostLinesFrequencyMillis *int `json:"postLinesFrequencyMillis,omitempty"` +} + +// Represents an option that may affect the way an agent runs the job. +type JobOption struct { + Data *map[string]string `json:"data,omitempty"` + // Gets the id of the option. + Id *uuid.UUID `json:"id,omitempty"` +} + +type JobRequestMessage struct { + Environment *JobEnvironment `json:"environment,omitempty"` + JobId *uuid.UUID `json:"jobId,omitempty"` + JobName *string `json:"jobName,omitempty"` + JobRefName *string `json:"jobRefName,omitempty"` + MessageType *string `json:"messageType,omitempty"` + Plan *TaskOrchestrationPlanReference `json:"plan,omitempty"` + Timeline *TimelineReference `json:"timeline,omitempty"` +} + +type JobStartedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` +} + +type KubernetesResource struct { + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + EnvironmentReference *EnvironmentReference `json:"environmentReference,omitempty"` + Id *int `json:"id,omitempty"` + LastModifiedBy *webapi.IdentityRef `json:"lastModifiedBy,omitempty"` + LastModifiedOn *azuredevops.Time `json:"lastModifiedOn,omitempty"` + Name *string `json:"name,omitempty"` + // Tags of the Environment Resource. + Tags *[]string `json:"tags,omitempty"` + // Environment resource type + Type *EnvironmentResourceType `json:"type,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ServiceEndpointId *uuid.UUID `json:"serviceEndpointId,omitempty"` +} + +type KubernetesResourceCreateParameters struct { + ClusterName *string `json:"clusterName,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + // Tags of the kubernetes resource. + Tags *[]string `json:"tags,omitempty"` +} + +type KubernetesResourceCreateParametersExistingEndpoint struct { + ClusterName *string `json:"clusterName,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + // Tags of the kubernetes resource. + Tags *[]string `json:"tags,omitempty"` + ServiceEndpointId *uuid.UUID `json:"serviceEndpointId,omitempty"` +} + +type KubernetesResourceCreateParametersNewEndpoint struct { + ClusterName *string `json:"clusterName,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + // Tags of the kubernetes resource. + Tags *[]string `json:"tags,omitempty"` + Endpoint *ServiceEndpoint `json:"endpoint,omitempty"` +} + +type KubernetesResourcePatchParameters struct { + AuthorizationParameters *map[string]string `json:"authorizationParameters,omitempty"` + // Provider type (CustomProvider or AzureKubernetesServiceProvider) of the resource to be updated + ProviderType *string `json:"providerType,omitempty"` + ResourceId *int `json:"resourceId,omitempty"` +} + +type LogLevel string + +type logLevelValuesType struct { + Error LogLevel + Warning LogLevel + Info LogLevel +} + +var LogLevelValues = logLevelValuesType{ + Error: "error", + Warning: "warning", + Info: "info", +} + +// [Flags] +type MachineGroupActionFilter string + +type machineGroupActionFilterValuesType struct { + None MachineGroupActionFilter + Manage MachineGroupActionFilter + Use MachineGroupActionFilter +} + +var MachineGroupActionFilterValues = machineGroupActionFilterValuesType{ + None: "none", + Manage: "manage", + Use: "use", +} + +// Represents a purchase of resource units in a secondary marketplace. +type MarketplacePurchasedLicense struct { + // The Marketplace display name. + MarketplaceName *string `json:"marketplaceName,omitempty"` + // The name of the identity making the purchase as seen by the marketplace + PurchaserName *string `json:"purchaserName,omitempty"` + // The quantity purchased. + PurchaseUnitCount *int `json:"purchaseUnitCount,omitempty"` +} + +type MaskHint struct { + Type *MaskType `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +type MaskType string + +type maskTypeValuesType struct { + Variable MaskType + Regex MaskType +} + +var MaskTypeValues = maskTypeValuesType{ + Variable: "variable", + Regex: "regex", +} + +// Meta data for a metrics column. +type MetricsColumnMetaData struct { + // Name. + ColumnName *string `json:"columnName,omitempty"` + // Data type. + ColumnValueType *string `json:"columnValueType,omitempty"` +} + +// Metrics columns header +type MetricsColumnsHeader struct { + // Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState + Dimensions *[]MetricsColumnMetaData `json:"dimensions,omitempty"` + // The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets. + Metrics *[]MetricsColumnMetaData `json:"metrics,omitempty"` +} + +// Metrics row. +type MetricsRow struct { + // The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets. + Dimensions *[]string `json:"dimensions,omitempty"` + // Metrics in serialized format. Should be deserialized based on the data type provided in header. + Metrics *[]string `json:"metrics,omitempty"` +} + +type OperatingSystemType string + +type operatingSystemTypeValuesType struct { + Windows OperatingSystemType + Linux OperatingSystemType +} + +var OperatingSystemTypeValues = operatingSystemTypeValuesType{ + Windows: "windows", + Linux: "linux", +} + +type OperationType string + +type operationTypeValuesType struct { + ConfigurationJob OperationType + SizingJob OperationType + IncreaseCapacity OperationType + Reimage OperationType + DeleteVMs OperationType +} + +var OperationTypeValues = operationTypeValuesType{ + ConfigurationJob: "configurationJob", + SizingJob: "sizingJob", + IncreaseCapacity: "increaseCapacity", + Reimage: "reimage", + DeleteVMs: "deleteVMs", +} + +type OrchestrationType string + +type orchestrationTypeValuesType struct { + Uniform OrchestrationType + Flexible OrchestrationType +} + +var OrchestrationTypeValues = orchestrationTypeValuesType{ + Uniform: "uniform", + Flexible: "flexible", +} + +// Represents a downloadable package. +type PackageMetadata struct { + // The date the package was created + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // A direct link to download the package. + DownloadUrl *string `json:"downloadUrl,omitempty"` + // The UI uses this to display instructions, i.e. "unzip MyAgent.zip" + Filename *string `json:"filename,omitempty"` + // MD5 hash as a base64 string + HashValue *string `json:"hashValue,omitempty"` + // A link to documentation + InfoUrl *string `json:"infoUrl,omitempty"` + // The platform (win7, linux, etc.) + Platform *string `json:"platform,omitempty"` + // The type of package (e.g. "agent") + Type *string `json:"type,omitempty"` + // The package version. + Version *PackageVersion `json:"version,omitempty"` +} + +type PackageVersion struct { + Major *int `json:"major,omitempty"` + Minor *int `json:"minor,omitempty"` + Patch *int `json:"patch,omitempty"` +} + +type PlanEnvironment struct { + Mask *[]MaskHint `json:"mask,omitempty"` + Options *map[uuid.UUID]JobOption `json:"options,omitempty"` + Variables *map[string]string `json:"variables,omitempty"` +} + +// [Flags] +type PlanGroupStatus string + +type planGroupStatusValuesType struct { + Running PlanGroupStatus + Queued PlanGroupStatus + All PlanGroupStatus +} + +var PlanGroupStatusValues = planGroupStatusValuesType{ + Running: "running", + Queued: "queued", + All: "all", +} + +// [Flags] +type PlanGroupStatusFilter string + +type planGroupStatusFilterValuesType struct { + Running PlanGroupStatusFilter + Queued PlanGroupStatusFilter + All PlanGroupStatusFilter +} + +var PlanGroupStatusFilterValues = planGroupStatusFilterValuesType{ + Running: "running", + Queued: "queued", + All: "all", +} + +type ProjectReference struct { + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +type PublishTaskGroupMetadata struct { + Comment *string `json:"comment,omitempty"` + ParentDefinitionRevision *int `json:"parentDefinitionRevision,omitempty"` + Preview *bool `json:"preview,omitempty"` + TaskGroupId *uuid.UUID `json:"taskGroupId,omitempty"` + TaskGroupRevision *int `json:"taskGroupRevision,omitempty"` +} + +type ResourceFilterOptions struct { + Identities *[]webapi.IdentityRef `json:"identities,omitempty"` + ResourceTypes *[]string `json:"resourceTypes,omitempty"` +} + +type ResourceFilters struct { + CreatedBy *[]uuid.UUID `json:"createdBy,omitempty"` + ResourceType *[]string `json:"resourceType,omitempty"` + SearchText *string `json:"searchText,omitempty"` +} + +// Resources include Service Connections, Variable Groups and Secure Files. +type ResourceItem struct { + // Gets or sets the identity who created the resource. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + // Gets or sets description of the resource. + Description *string `json:"description,omitempty"` + // Gets or sets icon url of the resource. + IconUrl *string `json:"iconUrl,omitempty"` + // Gets or sets Id of the resource. + Id *string `json:"id,omitempty"` + // Indicates whether resource is shared with other projects or not. + IsShared *bool `json:"isShared,omitempty"` + // Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Gets or sets internal properties of the resource. + Properties *map[string]string `json:"properties,omitempty"` + // Gets or sets resource type. + ResourceType *string `json:"resourceType,omitempty"` +} + +type ResourceLimit struct { + FailedToReachAllProviders *bool `json:"failedToReachAllProviders,omitempty"` + HostId *uuid.UUID `json:"hostId,omitempty"` + IsHosted *bool `json:"isHosted,omitempty"` + IsPremium *bool `json:"isPremium,omitempty"` + ParallelismTag *string `json:"parallelismTag,omitempty"` + ResourceLimitsData *map[string]string `json:"resourceLimitsData,omitempty"` + TotalCount *int `json:"totalCount,omitempty"` + TotalMinutes *int `json:"totalMinutes,omitempty"` +} + +// A request for a resource's exclusive lock +type ResourceLockRequest struct { + // The date/time this request was assigned. + AssignTime *azuredevops.Time `json:"assignTime,omitempty"` + // The ID of the pipeline that requested this resource + DefinitionId *int `json:"definitionId,omitempty"` + // The date/time this request was finished. + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // The ID of the check run waiting on this request + CheckRunId *uuid.UUID `json:"checkRunId,omitempty"` + // The behavior this request should exhibit in relation to other lock requests + LockType *ExclusiveLockType `json:"lockType,omitempty"` + // Attempt of the graph node + NodeAttempt *int `json:"nodeAttempt,omitempty"` + // Name of the graph node (currently stage) requesting this resource + NodeName *string `json:"nodeName,omitempty"` + // Internal ID for the orchestration plan connected with this request. + PlanId *uuid.UUID `json:"planId,omitempty"` + // The ID of the project of the check run and definition exist in + ProjectId *uuid.UUID `json:"projectId,omitempty"` + // The date/time this request was queued. + QueueTime *azuredevops.Time `json:"queueTime,omitempty"` + // ID of the request. + RequestId *uint64 `json:"requestId,omitempty"` + // The id of the resource + ResourceId *string `json:"resourceId,omitempty"` + // The type of the resource + ResourceType *string `json:"resourceType,omitempty"` + // The result of this request. + Status *ResourceLockStatus `json:"status,omitempty"` +} + +type ResourceLockStatus string + +type resourceLockStatusValuesType struct { + Queued ResourceLockStatus + InUse ResourceLockStatus + Finished ResourceLockStatus + TimedOut ResourceLockStatus + Canceled ResourceLockStatus + Abandoned ResourceLockStatus + WaitingOnChecks ResourceLockStatus +} + +var ResourceLockStatusValues = resourceLockStatusValuesType{ + Queued: "queued", + InUse: "inUse", + Finished: "finished", + TimedOut: "timedOut", + Canceled: "canceled", + Abandoned: "abandoned", + WaitingOnChecks: "waitingOnChecks", +} + +type ResourcesHubData struct { + ContinuationToken *string `json:"continuationToken,omitempty"` + HasProjectLevelManagePermission *bool `json:"hasProjectLevelManagePermission,omitempty"` + ResourceFilterOptions *ResourceFilterOptions `json:"resourceFilterOptions,omitempty"` + ResourceFilters *ResourceFilters `json:"resourceFilters,omitempty"` + ResourceItems *[]ResourceItem `json:"resourceItems,omitempty"` +} + +type ResourceUsage struct { + ResourceLimit *ResourceLimit `json:"resourceLimit,omitempty"` + RunningRequests *[]TaskAgentJobRequest `json:"runningRequests,omitempty"` + UsedCount *int `json:"usedCount,omitempty"` + UsedMinutes *int `json:"usedMinutes,omitempty"` +} + +type ResultTransformationDetails struct { + ResultTemplate *string `json:"resultTemplate,omitempty"` +} + +type SecureFile struct { + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + ModifiedBy *webapi.IdentityRef `json:"modifiedBy,omitempty"` + ModifiedOn *azuredevops.Time `json:"modifiedOn,omitempty"` + Name *string `json:"name,omitempty"` + Properties *map[string]string `json:"properties,omitempty"` + Ticket *string `json:"ticket,omitempty"` +} + +// [Flags] +type SecureFileActionFilter string + +type secureFileActionFilterValuesType struct { + None SecureFileActionFilter + Manage SecureFileActionFilter + Use SecureFileActionFilter +} + +var SecureFileActionFilterValues = secureFileActionFilterValuesType{ + None: "none", + Manage: "manage", + Use: "use", +} + +type SecureFileEvent struct { + EventType *string `json:"eventType,omitempty"` + ProjectId *uuid.UUID `json:"projectId,omitempty"` + SecureFiles *[]SecureFile `json:"secureFiles,omitempty"` +} + +type SendJobResponse struct { + Events *JobEventsConfig `json:"events,omitempty"` + Variables *map[string]string `json:"variables,omitempty"` +} + +type ServerExecutionDefinition struct { + Events *EventsConfig `json:"events,omitempty"` + HandlerName *string `json:"handlerName,omitempty"` +} + +type ServerTaskRequestMessage struct { + Environment *JobEnvironment `json:"environment,omitempty"` + JobId *uuid.UUID `json:"jobId,omitempty"` + JobName *string `json:"jobName,omitempty"` + JobRefName *string `json:"jobRefName,omitempty"` + MessageType *string `json:"messageType,omitempty"` + Plan *TaskOrchestrationPlanReference `json:"plan,omitempty"` + Timeline *TimelineReference `json:"timeline,omitempty"` + TaskDefinition *TaskDefinition `json:"taskDefinition,omitempty"` + TaskInstance *TaskInstance `json:"taskInstance,omitempty"` +} + +// Represents an endpoint which may be used by an orchestration job. +type ServiceEndpoint struct { + // Gets or sets the identity reference for the administrators group of the service endpoint. + AdministratorsGroup *webapi.IdentityRef `json:"administratorsGroup,omitempty"` + // Gets or sets the authorization data for talking to the endpoint. + Authorization *EndpointAuthorization `json:"authorization,omitempty"` + // Gets or sets the identity reference for the user who created the Service endpoint. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + Data *map[string]string `json:"data,omitempty"` + // Gets or sets the description of endpoint. + Description *string `json:"description,omitempty"` + GroupScopeId *uuid.UUID `json:"groupScopeId,omitempty"` + // Gets or sets the identifier of this endpoint. + Id *uuid.UUID `json:"id,omitempty"` + // EndPoint state indicator + IsReady *bool `json:"isReady,omitempty"` + // Indicates whether service endpoint is shared with other projects or not. + IsShared *bool `json:"isShared,omitempty"` + // Gets or sets the friendly name of the endpoint. + Name *string `json:"name,omitempty"` + // Error message during creation/deletion of endpoint + OperationStatus interface{} `json:"operationStatus,omitempty"` + // Gets or sets the owner of the endpoint. + Owner *string `json:"owner,omitempty"` + // Gets or sets the identity reference for the readers group of the service endpoint. + ReadersGroup *webapi.IdentityRef `json:"readersGroup,omitempty"` + // Gets or sets the type of the endpoint. + Type *string `json:"type,omitempty"` + // Gets or sets the url of the endpoint. + Url *string `json:"url,omitempty"` +} + +type ServiceEndpointAuthenticationScheme struct { + // Gets or sets the authorization headers of service endpoint authentication scheme. + AuthorizationHeaders *[]AuthorizationHeader `json:"authorizationHeaders,omitempty"` + // Gets or sets the certificates of service endpoint authentication scheme. + ClientCertificates *[]ClientCertificate `json:"clientCertificates,omitempty"` + // Gets or sets the display name for the service endpoint authentication scheme. + DisplayName *string `json:"displayName,omitempty"` + // Gets or sets the input descriptors for the service endpoint authentication scheme. + InputDescriptors *[]forminput.InputDescriptor `json:"inputDescriptors,omitempty"` + // Gets or sets the scheme for service endpoint authentication. + Scheme *string `json:"scheme,omitempty"` +} + +type ServiceEndpointDetails struct { + Authorization *EndpointAuthorization `json:"authorization,omitempty"` + Data *map[string]string `json:"data,omitempty"` + Type *string `json:"type,omitempty"` + Url *string `json:"url,omitempty"` +} + +// Represents service endpoint execution data. +type ServiceEndpointExecutionData struct { + // Gets the definition of service endpoint execution owner. + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + // Gets the finish time of service endpoint execution. + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // Gets the Id of service endpoint execution data. + Id *uint64 `json:"id,omitempty"` + // Gets the owner of service endpoint execution data. + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + // Gets the plan type of service endpoint execution data. + PlanType *string `json:"planType,omitempty"` + // Gets the result of service endpoint execution. + Result *TaskResult `json:"result,omitempty"` + // Gets the start time of service endpoint execution. + StartTime *azuredevops.Time `json:"startTime,omitempty"` +} + +type ServiceEndpointExecutionRecord struct { + // Gets the execution data of service endpoint execution. + Data *ServiceEndpointExecutionData `json:"data,omitempty"` + // Gets the Id of service endpoint. + EndpointId *uuid.UUID `json:"endpointId,omitempty"` +} + +type ServiceEndpointExecutionRecordsInput struct { + Data *ServiceEndpointExecutionData `json:"data,omitempty"` + EndpointIds *[]uuid.UUID `json:"endpointIds,omitempty"` +} + +type ServiceEndpointRequest struct { + DataSourceDetails *DataSourceDetails `json:"dataSourceDetails,omitempty"` + ResultTransformationDetails *ResultTransformationDetails `json:"resultTransformationDetails,omitempty"` + ServiceEndpointDetails *ServiceEndpointDetails `json:"serviceEndpointDetails,omitempty"` +} + +type ServiceEndpointRequestResult struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Result interface{} `json:"result,omitempty"` + StatusCode *string `json:"statusCode,omitempty"` +} + +// Represents type of the service endpoint. +type ServiceEndpointType struct { + // Authentication scheme of service endpoint type. + AuthenticationSchemes *[]ServiceEndpointAuthenticationScheme `json:"authenticationSchemes,omitempty"` + // Data sources of service endpoint type. + DataSources *[]DataSource `json:"dataSources,omitempty"` + // Dependency data of service endpoint type. + DependencyData *[]DependencyData `json:"dependencyData,omitempty"` + // Gets or sets the description of service endpoint type. + Description *string `json:"description,omitempty"` + // Gets or sets the display name of service endpoint type. + DisplayName *string `json:"displayName,omitempty"` + // Gets or sets the endpoint url of service endpoint type. + EndpointUrl *EndpointUrl `json:"endpointUrl,omitempty"` + // Gets or sets the help link of service endpoint type. + HelpLink *HelpLink `json:"helpLink,omitempty"` + HelpMarkDown *string `json:"helpMarkDown,omitempty"` + // Gets or sets the icon url of service endpoint type. + IconUrl *string `json:"iconUrl,omitempty"` + // Input descriptor of service endpoint type. + InputDescriptors *[]forminput.InputDescriptor `json:"inputDescriptors,omitempty"` + // Gets or sets the name of service endpoint type. + Name *string `json:"name,omitempty"` + // Trusted hosts of a service endpoint type. + TrustedHosts *[]string `json:"trustedHosts,omitempty"` + // Gets or sets the ui contribution id of service endpoint type. + UiContributionId *string `json:"uiContributionId,omitempty"` +} + +// A task agent. +type TaskAgent struct { + Links interface{} `json:"_links,omitempty"` + // This agent's access point. + AccessPoint *string `json:"accessPoint,omitempty"` + // Whether or not this agent should run jobs. + Enabled *bool `json:"enabled,omitempty"` + // Identifier of the agent. + Id *int `json:"id,omitempty"` + // Name of the agent. + Name *string `json:"name,omitempty"` + // Agent OS. + OsDescription *string `json:"osDescription,omitempty"` + // Provisioning state of this agent. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Whether or not the agent is online. + Status *TaskAgentStatus `json:"status,omitempty"` + // Agent version. + Version *string `json:"version,omitempty"` + // The agent cloud request that's currently associated with this agent. + AssignedAgentCloudRequest *TaskAgentCloudRequest `json:"assignedAgentCloudRequest,omitempty"` + // The request which is currently assigned to this agent. + AssignedRequest *TaskAgentJobRequest `json:"assignedRequest,omitempty"` + // Authorization information for this agent. + Authorization *TaskAgentAuthorization `json:"authorization,omitempty"` + // Date on which this agent was created. + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // The last request which was completed by this agent. + LastCompletedRequest *TaskAgentJobRequest `json:"lastCompletedRequest,omitempty"` + // Maximum job parallelism allowed for this agent. + MaxParallelism *int `json:"maxParallelism,omitempty"` + // Pending update for this agent. + PendingUpdate *TaskAgentUpdate `json:"pendingUpdate,omitempty"` + Properties interface{} `json:"properties,omitempty"` + // Date on which the last connectivity status change occurred. + StatusChangedOn *azuredevops.Time `json:"statusChangedOn,omitempty"` + // System-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities. + SystemCapabilities *map[string]string `json:"systemCapabilities,omitempty"` + // User-defined capabilities supported by this agent's host. Warning: To set capabilities use the PUT method, PUT will completely overwrite existing capabilities. + UserCapabilities *map[string]string `json:"userCapabilities,omitempty"` +} + +// Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows. +type TaskAgentAuthorization struct { + // Endpoint used to obtain access tokens from the configured token service. + AuthorizationUrl *string `json:"authorizationUrl,omitempty"` + // Client identifier for this agent. + ClientId *uuid.UUID `json:"clientId,omitempty"` + // Public key used to verify the identity of this agent. + PublicKey *TaskAgentPublicKey `json:"publicKey,omitempty"` +} + +type TaskAgentCloud struct { + // Gets or sets a AcquireAgentEndpoint using which a request can be made to acquire new agent + AcquireAgentEndpoint *string `json:"acquireAgentEndpoint,omitempty"` + AcquisitionTimeout *int `json:"acquisitionTimeout,omitempty"` + AgentCloudId *int `json:"agentCloudId,omitempty"` + GetAccountParallelismEndpoint *string `json:"getAccountParallelismEndpoint,omitempty"` + GetAgentDefinitionEndpoint *string `json:"getAgentDefinitionEndpoint,omitempty"` + GetAgentRequestStatusEndpoint *string `json:"getAgentRequestStatusEndpoint,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + // Signifies that this Agent Cloud is internal and should not be user-manageable + Internal *bool `json:"internal,omitempty"` + MaxParallelism *int `json:"maxParallelism,omitempty"` + Name *string `json:"name,omitempty"` + ReleaseAgentEndpoint *string `json:"releaseAgentEndpoint,omitempty"` + SharedSecret *string `json:"sharedSecret,omitempty"` + // Gets or sets the type of the endpoint. + Type *string `json:"type,omitempty"` +} + +type TaskAgentCloudRequest struct { + Agent *TaskAgentReference `json:"agent,omitempty"` + AgentCloudId *int `json:"agentCloudId,omitempty"` + AgentConnectedTime *azuredevops.Time `json:"agentConnectedTime,omitempty"` + AgentData interface{} `json:"agentData,omitempty"` + AgentSpecification interface{} `json:"agentSpecification,omitempty"` + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + ProvisionedTime *azuredevops.Time `json:"provisionedTime,omitempty"` + ProvisionRequestTime *azuredevops.Time `json:"provisionRequestTime,omitempty"` + ReleaseRequestTime *azuredevops.Time `json:"releaseRequestTime,omitempty"` + RequestId *uuid.UUID `json:"requestId,omitempty"` +} + +type TaskAgentCloudType struct { + // Gets or sets the display name of agent cloud type. + DisplayName *string `json:"displayName,omitempty"` + // Gets or sets the input descriptors + InputDescriptors *[]forminput.InputDescriptor `json:"inputDescriptors,omitempty"` + // Gets or sets the name of agent cloud type. + Name *string `json:"name,omitempty"` +} + +type TaskAgentDowngrade struct { + Code *TaskAgentUpdateReasonType `json:"code,omitempty"` +} + +type TaskAgentJob struct { + Container *string `json:"container,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SidecarContainers *map[string]string `json:"sidecarContainers,omitempty"` + Steps *[]TaskAgentJobStep `json:"steps,omitempty"` + Variables *[]TaskAgentJobVariable `json:"variables,omitempty"` +} + +// A job request for an agent. +type TaskAgentJobRequest struct { + AgentSpecification interface{} `json:"agentSpecification,omitempty"` + // The date/time this request was assigned. + AssignTime *azuredevops.Time `json:"assignTime,omitempty"` + // Additional data about the request. + Data *map[string]string `json:"data,omitempty"` + // The pipeline definition associated with this request + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + // A list of demands required to fulfill this request. + Demands *[]interface{} `json:"demands,omitempty"` + // The date/time this request was finished. + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // The host which triggered this request. + HostId *uuid.UUID `json:"hostId,omitempty"` + // ID of the job resulting from this request. + JobId *uuid.UUID `json:"jobId,omitempty"` + // Name of the job resulting from this request. + JobName *string `json:"jobName,omitempty"` + // The deadline for the agent to renew the lock. + LockedUntil *azuredevops.Time `json:"lockedUntil,omitempty"` + MatchedAgents *[]TaskAgentReference `json:"matchedAgents,omitempty"` + MatchesAllAgentsInPool *bool `json:"matchesAllAgentsInPool,omitempty"` + OrchestrationId *string `json:"orchestrationId,omitempty"` + // The pipeline associated with this request + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + PlanGroup *string `json:"planGroup,omitempty"` + // Internal ID for the orchestration plan connected with this request. + PlanId *uuid.UUID `json:"planId,omitempty"` + // Internal detail representing the type of orchestration plan. + PlanType *string `json:"planType,omitempty"` + // The ID of the pool this request targets + PoolId *int `json:"poolId,omitempty"` + Priority *int `json:"priority,omitempty"` + // The ID of the queue this request targets + QueueId *int `json:"queueId,omitempty"` + // The date/time this request was queued. + QueueTime *azuredevops.Time `json:"queueTime,omitempty"` + // The date/time this request was receieved by an agent. + ReceiveTime *azuredevops.Time `json:"receiveTime,omitempty"` + // ID of the request. + RequestId *uint64 `json:"requestId,omitempty"` + // The agent allocated for this request. + ReservedAgent *TaskAgentReference `json:"reservedAgent,omitempty"` + // The result of this request. + Result *TaskResult `json:"result,omitempty"` + // Scope of the pipeline; matches the project ID. + ScopeId *uuid.UUID `json:"scopeId,omitempty"` + // The service which owns this request. + ServiceOwner *uuid.UUID `json:"serviceOwner,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + UserDelayed *bool `json:"userDelayed,omitempty"` +} + +// [Flags] This is useful in getting a list of deployment targets, filtered by the result of their last job. +type TaskAgentJobResultFilter string + +type taskAgentJobResultFilterValuesType struct { + Failed TaskAgentJobResultFilter + Passed TaskAgentJobResultFilter + NeverDeployed TaskAgentJobResultFilter + All TaskAgentJobResultFilter +} + +var TaskAgentJobResultFilterValues = taskAgentJobResultFilterValuesType{ + // Only those deployment targets on which last job failed (**Abandoned**, **Canceled**, **Failed**, **Skipped**). + Failed: "failed", + // Only those deployment targets on which last job Passed (**Succeeded**, **Succeeded with issues**). + Passed: "passed", + // Only those deployment targets that never executed a job. + NeverDeployed: "neverDeployed", + // All deployment targets. + All: "all", +} + +type TaskAgentJobStep struct { + Condition *string `json:"condition,omitempty"` + ContinueOnError *bool `json:"continueOnError,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Env *map[string]string `json:"env,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Inputs *map[string]string `json:"inputs,omitempty"` + Name *string `json:"name,omitempty"` + RetryCountOnTaskFailure *int `json:"retryCountOnTaskFailure,omitempty"` + Task *TaskAgentJobTask `json:"task,omitempty"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + Type *TaskAgentJobStepType `json:"type,omitempty"` +} + +type TaskAgentJobStepType string + +type taskAgentJobStepTypeValuesType struct { + Task TaskAgentJobStepType + Action TaskAgentJobStepType +} + +var TaskAgentJobStepTypeValues = taskAgentJobStepTypeValuesType{ + Task: "task", + Action: "action", +} + +type TaskAgentJobTask struct { + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` +} + +type TaskAgentJobVariable struct { + Name *string `json:"name,omitempty"` + Secret *bool `json:"secret,omitempty"` + Value *string `json:"value,omitempty"` +} + +type TaskAgentManualUpdate struct { + Code *TaskAgentUpdateReasonType `json:"code,omitempty"` +} + +// Provides a contract for receiving messages from the task orchestrator. +type TaskAgentMessage struct { + // Gets or sets the body of the message. If the IV property is provided the body will need to be decrypted using the TaskAgentSession.EncryptionKey value in addition to the IV. + Body *string `json:"body,omitempty"` + // Gets or sets the initialization vector used to encrypt this message. + Iv *[]byte `json:"iv,omitempty"` + // Gets or sets the message identifier. + MessageId *uint64 `json:"messageId,omitempty"` + // Gets or sets the message type, describing the data contract found in TaskAgentMessage.Body. + MessageType *string `json:"messageType,omitempty"` +} + +type TaskAgentMinAgentVersionRequiredUpdate struct { + Code *TaskAgentUpdateReasonType `json:"code,omitempty"` + JobDefinition *TaskOrchestrationOwner `json:"jobDefinition,omitempty"` + JobOwner *TaskOrchestrationOwner `json:"jobOwner,omitempty"` + MinAgentVersion interface{} `json:"minAgentVersion,omitempty"` +} + +// An organization-level grouping of agents. +type TaskAgentPool struct { + Id *int `json:"id,omitempty"` + // Gets or sets a value indicating whether or not this pool is managed by the service. + IsHosted *bool `json:"isHosted,omitempty"` + // Determines whether the pool is legacy. + IsLegacy *bool `json:"isLegacy,omitempty"` + Name *string `json:"name,omitempty"` + // Additional pool settings and details + Options *TaskAgentPoolOptions `json:"options,omitempty"` + // Gets or sets the type of the pool + PoolType *TaskAgentPoolType `json:"poolType,omitempty"` + Scope *uuid.UUID `json:"scope,omitempty"` + // Gets the current size of the pool. + Size *int `json:"size,omitempty"` + // The ID of the associated agent cloud. + AgentCloudId *int `json:"agentCloudId,omitempty"` + // Whether or not a queue should be automatically provisioned for each project collection. + AutoProvision *bool `json:"autoProvision,omitempty"` + // Whether or not the pool should autosize itself based on the Agent Cloud Provider settings. + AutoSize *bool `json:"autoSize,omitempty"` + // Whether or not agents in this pool are allowed to automatically update + AutoUpdate *bool `json:"autoUpdate,omitempty"` + // Creator of the pool. The creator of the pool is automatically added into the administrators group for the pool on creation. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + // The date/time of the pool creation. + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // Owner or administrator of the pool. + Owner *webapi.IdentityRef `json:"owner,omitempty"` + Properties interface{} `json:"properties,omitempty"` + // Target parallelism - Only applies to agent pools that are backed by pool providers. It will be null for regular pools. + TargetSize *int `json:"targetSize,omitempty"` +} + +// [Flags] Filters pools based on whether the calling user has permission to use or manage the pool. +type TaskAgentPoolActionFilter string + +type taskAgentPoolActionFilterValuesType struct { + None TaskAgentPoolActionFilter + Manage TaskAgentPoolActionFilter + Use TaskAgentPoolActionFilter +} + +var TaskAgentPoolActionFilterValues = taskAgentPoolActionFilterValuesType{ + None: "none", + Manage: "manage", + Use: "use", +} + +type TaskAgentPoolMaintenanceDefinition struct { + // Enable maintenance + Enabled *bool `json:"enabled,omitempty"` + // Id + Id *int `json:"id,omitempty"` + // Maintenance job timeout per agent + JobTimeoutInMinutes *int `json:"jobTimeoutInMinutes,omitempty"` + // Max percentage of agents within a pool running maintenance job at given time + MaxConcurrentAgentsPercentage *int `json:"maxConcurrentAgentsPercentage,omitempty"` + Options *TaskAgentPoolMaintenanceOptions `json:"options,omitempty"` + // Pool reference for the maintenance definition + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + RetentionPolicy *TaskAgentPoolMaintenanceRetentionPolicy `json:"retentionPolicy,omitempty"` + ScheduleSetting *TaskAgentPoolMaintenanceSchedule `json:"scheduleSetting,omitempty"` +} + +type TaskAgentPoolMaintenanceJob struct { + // The maintenance definition for the maintenance job + DefinitionId *int `json:"definitionId,omitempty"` + // The total error counts during the maintenance job + ErrorCount *int `json:"errorCount,omitempty"` + // Time that the maintenance job was completed + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // Id of the maintenance job + JobId *int `json:"jobId,omitempty"` + // The log download url for the maintenance job + LogsDownloadUrl *string `json:"logsDownloadUrl,omitempty"` + // Orchestration/Plan Id for the maintenance job + OrchestrationId *uuid.UUID `json:"orchestrationId,omitempty"` + // Pool reference for the maintenance job + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Time that the maintenance job was queued + QueueTime *azuredevops.Time `json:"queueTime,omitempty"` + // The identity that queued the maintenance job + RequestedBy *webapi.IdentityRef `json:"requestedBy,omitempty"` + // The maintenance job result + Result *TaskAgentPoolMaintenanceJobResult `json:"result,omitempty"` + // Time that the maintenance job was started + StartTime *azuredevops.Time `json:"startTime,omitempty"` + // Status of the maintenance job + Status *TaskAgentPoolMaintenanceJobStatus `json:"status,omitempty"` + TargetAgents *[]TaskAgentPoolMaintenanceJobTargetAgent `json:"targetAgents,omitempty"` + // The total warning counts during the maintenance job + WarningCount *int `json:"warningCount,omitempty"` +} + +type TaskAgentPoolMaintenanceJobResult string + +type taskAgentPoolMaintenanceJobResultValuesType struct { + Succeeded TaskAgentPoolMaintenanceJobResult + Failed TaskAgentPoolMaintenanceJobResult + Canceled TaskAgentPoolMaintenanceJobResult +} + +var TaskAgentPoolMaintenanceJobResultValues = taskAgentPoolMaintenanceJobResultValuesType{ + Succeeded: "succeeded", + Failed: "failed", + Canceled: "canceled", +} + +type TaskAgentPoolMaintenanceJobStatus string + +type taskAgentPoolMaintenanceJobStatusValuesType struct { + InProgress TaskAgentPoolMaintenanceJobStatus + Completed TaskAgentPoolMaintenanceJobStatus + Cancelling TaskAgentPoolMaintenanceJobStatus + Queued TaskAgentPoolMaintenanceJobStatus +} + +var TaskAgentPoolMaintenanceJobStatusValues = taskAgentPoolMaintenanceJobStatusValuesType{ + InProgress: "inProgress", + Completed: "completed", + Cancelling: "cancelling", + Queued: "queued", +} + +type TaskAgentPoolMaintenanceJobTargetAgent struct { + Agent *TaskAgentReference `json:"agent,omitempty"` + JobId *int `json:"jobId,omitempty"` + Result *TaskAgentPoolMaintenanceJobResult `json:"result,omitempty"` + Status *TaskAgentPoolMaintenanceJobStatus `json:"status,omitempty"` +} + +type TaskAgentPoolMaintenanceOptions struct { + // time to consider a System.DefaultWorkingDirectory is stale + WorkingDirectoryExpirationInDays *int `json:"workingDirectoryExpirationInDays,omitempty"` +} + +type TaskAgentPoolMaintenanceRetentionPolicy struct { + // Number of records to keep for maintenance job executed with this definition. + NumberOfHistoryRecordsToKeep *int `json:"numberOfHistoryRecordsToKeep,omitempty"` +} + +type TaskAgentPoolMaintenanceSchedule struct { + // Days for a build (flags enum for days of the week) + DaysToBuild *TaskAgentPoolMaintenanceScheduleDays `json:"daysToBuild,omitempty"` + // The Job Id of the Scheduled job that will queue the pool maintenance job. + ScheduleJobId *uuid.UUID `json:"scheduleJobId,omitempty"` + // Local timezone hour to start + StartHours *int `json:"startHours,omitempty"` + // Local timezone minute to start + StartMinutes *int `json:"startMinutes,omitempty"` + // Time zone of the build schedule (string representation of the time zone id) + TimeZoneId *string `json:"timeZoneId,omitempty"` +} + +type TaskAgentPoolMaintenanceScheduleDays string + +type taskAgentPoolMaintenanceScheduleDaysValuesType struct { + None TaskAgentPoolMaintenanceScheduleDays + Monday TaskAgentPoolMaintenanceScheduleDays + Tuesday TaskAgentPoolMaintenanceScheduleDays + Wednesday TaskAgentPoolMaintenanceScheduleDays + Thursday TaskAgentPoolMaintenanceScheduleDays + Friday TaskAgentPoolMaintenanceScheduleDays + Saturday TaskAgentPoolMaintenanceScheduleDays + Sunday TaskAgentPoolMaintenanceScheduleDays + All TaskAgentPoolMaintenanceScheduleDays +} + +var TaskAgentPoolMaintenanceScheduleDaysValues = taskAgentPoolMaintenanceScheduleDaysValuesType{ + // Do not run. + None: "none", + // Run on Monday. + Monday: "monday", + // Run on Tuesday. + Tuesday: "tuesday", + // Run on Wednesday. + Wednesday: "wednesday", + // Run on Thursday. + Thursday: "thursday", + // Run on Friday. + Friday: "friday", + // Run on Saturday. + Saturday: "saturday", + // Run on Sunday. + Sunday: "sunday", + // Run on all days of the week. + All: "all", +} + +// [Flags] Additional settings and descriptors for a TaskAgentPool +type TaskAgentPoolOptions string + +type taskAgentPoolOptionsValuesType struct { + None TaskAgentPoolOptions + ElasticPool TaskAgentPoolOptions + SingleUseAgents TaskAgentPoolOptions + PreserveAgentOnJobFailure TaskAgentPoolOptions +} + +var TaskAgentPoolOptionsValues = taskAgentPoolOptionsValuesType{ + None: "none", + // TaskAgentPool backed by the Elastic pool service + ElasticPool: "elasticPool", + // Set to true if agents are re-imaged after each TaskAgentJobRequest + SingleUseAgents: "singleUseAgents", + // Set to true if agents are held for investigation after a TaskAgentJobRequest failure + PreserveAgentOnJobFailure: "preserveAgentOnJobFailure", +} + +type TaskAgentPoolReference struct { + Id *int `json:"id,omitempty"` + // Gets or sets a value indicating whether or not this pool is managed by the service. + IsHosted *bool `json:"isHosted,omitempty"` + // Determines whether the pool is legacy. + IsLegacy *bool `json:"isLegacy,omitempty"` + Name *string `json:"name,omitempty"` + // Additional pool settings and details + Options *TaskAgentPoolOptions `json:"options,omitempty"` + // Gets or sets the type of the pool + PoolType *TaskAgentPoolType `json:"poolType,omitempty"` + Scope *uuid.UUID `json:"scope,omitempty"` + // Gets the current size of the pool. + Size *int `json:"size,omitempty"` +} + +type TaskAgentPoolStatus struct { + Id *int `json:"id,omitempty"` + // Gets or sets a value indicating whether or not this pool is managed by the service. + IsHosted *bool `json:"isHosted,omitempty"` + // Determines whether the pool is legacy. + IsLegacy *bool `json:"isLegacy,omitempty"` + Name *string `json:"name,omitempty"` + // Additional pool settings and details + Options *TaskAgentPoolOptions `json:"options,omitempty"` + // Gets or sets the type of the pool + PoolType *TaskAgentPoolType `json:"poolType,omitempty"` + Scope *uuid.UUID `json:"scope,omitempty"` + // Gets the current size of the pool. + Size *int `json:"size,omitempty"` + // Number of requests queued and assigned to an agent. Not running yet. + AssignedRequestCount *int `json:"assignedRequestCount,omitempty"` + // Number of queued requests which are not assigned to any agents + QueuedRequestCount *int `json:"queuedRequestCount,omitempty"` + // Number of currently running requests + RunningRequestCount *int `json:"runningRequestCount,omitempty"` +} + +type TaskAgentPoolSummary struct { + ColumnsHeader *MetricsColumnsHeader `json:"columnsHeader,omitempty"` + DeploymentGroups *[]DeploymentGroupReference `json:"deploymentGroups,omitempty"` + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + Queues *[]TaskAgentQueue `json:"queues,omitempty"` + Rows *[]MetricsRow `json:"rows,omitempty"` +} + +// The type of agent pool. +type TaskAgentPoolType string + +type taskAgentPoolTypeValuesType struct { + Automation TaskAgentPoolType + Deployment TaskAgentPoolType +} + +var TaskAgentPoolTypeValues = taskAgentPoolTypeValuesType{ + // A typical pool of task agents + Automation: "automation", + // A deployment pool + Deployment: "deployment", +} + +// Represents the public key portion of an RSA asymmetric key. +type TaskAgentPublicKey struct { + // Gets or sets the exponent for the public key. + Exponent *[]byte `json:"exponent,omitempty"` + // Gets or sets the modulus for the public key. + Modulus *[]byte `json:"modulus,omitempty"` +} + +// An agent queue. +type TaskAgentQueue struct { + // ID of the queue + Id *int `json:"id,omitempty"` + // Name of the queue + Name *string `json:"name,omitempty"` + // Pool reference for this queue + Pool *TaskAgentPoolReference `json:"pool,omitempty"` + // Project ID + ProjectId *uuid.UUID `json:"projectId,omitempty"` +} + +// [Flags] Filters queues based on whether the calling user has permission to use or manage the queue. +type TaskAgentQueueActionFilter string + +type taskAgentQueueActionFilterValuesType struct { + None TaskAgentQueueActionFilter + Manage TaskAgentQueueActionFilter + Use TaskAgentQueueActionFilter +} + +var TaskAgentQueueActionFilterValues = taskAgentQueueActionFilterValuesType{ + None: "none", + Manage: "manage", + Use: "use", +} + +// A reference to an agent. +type TaskAgentReference struct { + Links interface{} `json:"_links,omitempty"` + // This agent's access point. + AccessPoint *string `json:"accessPoint,omitempty"` + // Whether or not this agent should run jobs. + Enabled *bool `json:"enabled,omitempty"` + // Identifier of the agent. + Id *int `json:"id,omitempty"` + // Name of the agent. + Name *string `json:"name,omitempty"` + // Agent OS. + OsDescription *string `json:"osDescription,omitempty"` + // Provisioning state of this agent. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Whether or not the agent is online. + Status *TaskAgentStatus `json:"status,omitempty"` + // Agent version. + Version *string `json:"version,omitempty"` +} + +// [Flags] +type TaskAgentRequestUpdateOptions string + +type taskAgentRequestUpdateOptionsValuesType struct { + None TaskAgentRequestUpdateOptions + BumpRequestToTop TaskAgentRequestUpdateOptions +} + +var TaskAgentRequestUpdateOptionsValues = taskAgentRequestUpdateOptionsValuesType{ + None: "none", + BumpRequestToTop: "bumpRequestToTop", +} + +// Represents a session for performing message exchanges from an agent. +type TaskAgentSession struct { + // Gets or sets the agent which is the target of the session. + Agent *TaskAgentReference `json:"agent,omitempty"` + // Gets the key used to encrypt message traffic for this session. + EncryptionKey *TaskAgentSessionKey `json:"encryptionKey,omitempty"` + // Gets or sets the owner name of this session. Generally this will be the machine of origination. + OwnerName *string `json:"ownerName,omitempty"` + // Gets the unique identifier for this session. + SessionId *uuid.UUID `json:"sessionId,omitempty"` + SystemCapabilities *map[string]string `json:"systemCapabilities,omitempty"` +} + +// Represents a symmetric key used for message-level encryption for communication sent to an agent. +type TaskAgentSessionKey struct { + // Gets or sets a value indicating whether or not the key value is encrypted. If this value is true, the Value property should be decrypted using the RSA key exchanged with the server during registration. + Encrypted *bool `json:"encrypted,omitempty"` + // Gets or sets the symmetric key value. + Value *[]byte `json:"value,omitempty"` +} + +type TaskAgentStatus string + +type taskAgentStatusValuesType struct { + Offline TaskAgentStatus + Online TaskAgentStatus +} + +var TaskAgentStatusValues = taskAgentStatusValuesType{ + Offline: "offline", + Online: "online", +} + +// [Flags] This is useful in getting a list of deployment targets, filtered by the deployment agent status. +type TaskAgentStatusFilter string + +type taskAgentStatusFilterValuesType struct { + Offline TaskAgentStatusFilter + Online TaskAgentStatusFilter + All TaskAgentStatusFilter +} + +var TaskAgentStatusFilterValues = taskAgentStatusFilterValuesType{ + // Only deployment targets that are offline. + Offline: "offline", + // Only deployment targets that are online. + Online: "online", + // All deployment targets. + All: "all", +} + +// Details about an agent update. +type TaskAgentUpdate struct { + // Current state of this agent update. + CurrentState *string `json:"currentState,omitempty"` + // Reason for this update. + Reason *TaskAgentUpdateReason `json:"reason,omitempty"` + // Identity which requested this update. + RequestedBy *webapi.IdentityRef `json:"requestedBy,omitempty"` + // Date on which this update was requested. + RequestTime *azuredevops.Time `json:"requestTime,omitempty"` + // Source agent version of the update. + SourceVersion *PackageVersion `json:"sourceVersion,omitempty"` + // Target agent version of the update. + TargetVersion *PackageVersion `json:"targetVersion,omitempty"` +} + +type TaskAgentUpdateReason struct { + Code *TaskAgentUpdateReasonType `json:"code,omitempty"` +} + +type TaskAgentUpdateReasonType string + +type taskAgentUpdateReasonTypeValuesType struct { + Manual TaskAgentUpdateReasonType + MinAgentVersionRequired TaskAgentUpdateReasonType + Downgrade TaskAgentUpdateReasonType +} + +var TaskAgentUpdateReasonTypeValues = taskAgentUpdateReasonTypeValuesType{ + Manual: "manual", + MinAgentVersionRequired: "minAgentVersionRequired", + Downgrade: "downgrade", +} + +type TaskAssignedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // The ID of the task definition. + TaskId *uuid.UUID `json:"taskId,omitempty"` +} + +type TaskAttachment struct { + Links interface{} `json:"_links,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + LastChangedBy *uuid.UUID `json:"lastChangedBy,omitempty"` + LastChangedOn *azuredevops.Time `json:"lastChangedOn,omitempty"` + Name *string `json:"name,omitempty"` + RecordId *uuid.UUID `json:"recordId,omitempty"` + TimelineId *uuid.UUID `json:"timelineId,omitempty"` + Type *string `json:"type,omitempty"` +} + +type TaskCommandMode string + +type taskCommandModeValuesType struct { + Any TaskCommandMode + Restricted TaskCommandMode +} + +var TaskCommandModeValues = taskCommandModeValuesType{ + Any: "any", + Restricted: "restricted", +} + +type TaskCommandRestrictions struct { + Mode *TaskCommandMode `json:"mode,omitempty"` +} + +type TaskCompletedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // The ID of the task definition. + TaskId *uuid.UUID `json:"taskId,omitempty"` + // The result of the task. + Result *TaskResult `json:"result,omitempty"` +} + +type TaskDefinition struct { + AgentExecution *TaskExecution `json:"agentExecution,omitempty"` + Author *string `json:"author,omitempty"` + Category *string `json:"category,omitempty"` + ContentsUploaded *bool `json:"contentsUploaded,omitempty"` + ContributionIdentifier *string `json:"contributionIdentifier,omitempty"` + ContributionVersion *string `json:"contributionVersion,omitempty"` + DataSourceBindings *[]DataSourceBinding `json:"dataSourceBindings,omitempty"` + DefinitionType *string `json:"definitionType,omitempty"` + Demands *[]interface{} `json:"demands,omitempty"` + Deprecated *bool `json:"deprecated,omitempty"` + Description *string `json:"description,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + // Deprecated: Ecosystem property is not currently supported. + Ecosystem *string `json:"ecosystem,omitempty"` + Execution *map[string]interface{} `json:"execution,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Groups *[]TaskGroupDefinition `json:"groups,omitempty"` + HelpMarkDown *string `json:"helpMarkDown,omitempty"` + HelpUrl *string `json:"helpUrl,omitempty"` + HostType *string `json:"hostType,omitempty"` + IconUrl *string `json:"iconUrl,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Inputs *[]TaskInputDefinition `json:"inputs,omitempty"` + InstanceNameFormat *string `json:"instanceNameFormat,omitempty"` + MinimumAgentVersion *string `json:"minimumAgentVersion,omitempty"` + Name *string `json:"name,omitempty"` + OutputVariables *[]TaskOutputVariable `json:"outputVariables,omitempty"` + PackageLocation *string `json:"packageLocation,omitempty"` + PackageType *string `json:"packageType,omitempty"` + PostJobExecution *map[string]interface{} `json:"postJobExecution,omitempty"` + PreJobExecution *map[string]interface{} `json:"preJobExecution,omitempty"` + Preview *bool `json:"preview,omitempty"` + ReleaseNotes *string `json:"releaseNotes,omitempty"` + Restrictions *TaskRestrictions `json:"restrictions,omitempty"` + RunsOn *[]string `json:"runsOn,omitempty"` + Satisfies *[]string `json:"satisfies,omitempty"` + ServerOwned *bool `json:"serverOwned,omitempty"` + ShowEnvironmentVariables *bool `json:"showEnvironmentVariables,omitempty"` + SourceDefinitions *[]TaskSourceDefinition `json:"sourceDefinitions,omitempty"` + SourceLocation *string `json:"sourceLocation,omitempty"` + Version *TaskVersion `json:"version,omitempty"` + Visibility *[]string `json:"visibility,omitempty"` +} + +type TaskDefinitionEndpoint struct { + // An ID that identifies a service connection to be used for authenticating endpoint requests. + ConnectionId *string `json:"connectionId,omitempty"` + // An Json based keyselector to filter response returned by fetching the endpoint Url.A Json based keyselector must be prefixed with "jsonpath:". KeySelector can be used to specify the filter to get the keys for the values specified with Selector. The following keyselector defines an Json for extracting nodes named 'ServiceName'. endpoint.KeySelector = "jsonpath://ServiceName"; + KeySelector *string `json:"keySelector,omitempty"` + // The scope as understood by Connected Services. Essentially, a project-id for now. + Scope *string `json:"scope,omitempty"` + // An XPath/Json based selector to filter response returned by fetching the endpoint Url. An XPath based selector must be prefixed with the string "xpath:". A Json based selector must be prefixed with "jsonpath:". The following selector defines an XPath for extracting nodes named 'ServiceName'. endpoint.Selector = "xpath://ServiceName"; + Selector *string `json:"selector,omitempty"` + // TaskId that this endpoint belongs to. + TaskId *string `json:"taskId,omitempty"` + // URL to GET. + Url *string `json:"url,omitempty"` +} + +type TaskDefinitionReference struct { + // Gets or sets the definition type. Values can be 'task' or 'metaTask'. + DefinitionType *string `json:"definitionType,omitempty"` + // Gets or sets the unique identifier of task. + Id *uuid.UUID `json:"id,omitempty"` + // Gets or sets the version specification of task. + VersionSpec *string `json:"versionSpec,omitempty"` +} + +type TaskDefinitionStatus string + +type taskDefinitionStatusValuesType struct { + Preinstalled TaskDefinitionStatus + ReceivedInstallOrUpdate TaskDefinitionStatus + Installed TaskDefinitionStatus + ReceivedUninstall TaskDefinitionStatus + Uninstalled TaskDefinitionStatus + RequestedUpdate TaskDefinitionStatus + Updated TaskDefinitionStatus + AlreadyUpToDate TaskDefinitionStatus + InlineUpdateReceived TaskDefinitionStatus +} + +var TaskDefinitionStatusValues = taskDefinitionStatusValuesType{ + Preinstalled: "preinstalled", + ReceivedInstallOrUpdate: "receivedInstallOrUpdate", + Installed: "installed", + ReceivedUninstall: "receivedUninstall", + Uninstalled: "uninstalled", + RequestedUpdate: "requestedUpdate", + Updated: "updated", + AlreadyUpToDate: "alreadyUpToDate", + InlineUpdateReceived: "inlineUpdateReceived", +} + +type TaskEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // The ID of the task definition. + TaskId *uuid.UUID `json:"taskId,omitempty"` +} + +type TaskExecution struct { + // The utility task to run. Specifying this means that this task definition is simply a meta task to call another task. This is useful for tasks that call utility tasks like powershell and commandline + ExecTask *TaskReference `json:"execTask,omitempty"` + // If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } net20: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } java: { jar: "powershelltask.tasks.automation.teamfoundation.microsoft.com", } node: { script: "powershellhost.js", } + PlatformInstructions *map[string]map[string]string `json:"platformInstructions,omitempty"` +} + +type TaskGroup struct { + AgentExecution *TaskExecution `json:"agentExecution,omitempty"` + Author *string `json:"author,omitempty"` + Category *string `json:"category,omitempty"` + ContentsUploaded *bool `json:"contentsUploaded,omitempty"` + ContributionIdentifier *string `json:"contributionIdentifier,omitempty"` + ContributionVersion *string `json:"contributionVersion,omitempty"` + DataSourceBindings *[]DataSourceBinding `json:"dataSourceBindings,omitempty"` + DefinitionType *string `json:"definitionType,omitempty"` + Demands *[]interface{} `json:"demands,omitempty"` + Deprecated *bool `json:"deprecated,omitempty"` + Description *string `json:"description,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Execution *map[string]interface{} `json:"execution,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Groups *[]TaskGroupDefinition `json:"groups,omitempty"` + HelpMarkDown *string `json:"helpMarkDown,omitempty"` + HelpUrl *string `json:"helpUrl,omitempty"` + HostType *string `json:"hostType,omitempty"` + IconUrl *string `json:"iconUrl,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Inputs *[]TaskInputDefinition `json:"inputs,omitempty"` + InstanceNameFormat *string `json:"instanceNameFormat,omitempty"` + MinimumAgentVersion *string `json:"minimumAgentVersion,omitempty"` + Name *string `json:"name,omitempty"` + OutputVariables *[]TaskOutputVariable `json:"outputVariables,omitempty"` + PackageLocation *string `json:"packageLocation,omitempty"` + PackageType *string `json:"packageType,omitempty"` + PostJobExecution *map[string]interface{} `json:"postJobExecution,omitempty"` + PreJobExecution *map[string]interface{} `json:"preJobExecution,omitempty"` + Preview *bool `json:"preview,omitempty"` + ReleaseNotes *string `json:"releaseNotes,omitempty"` + Restrictions *TaskRestrictions `json:"restrictions,omitempty"` + RunsOn *[]string `json:"runsOn,omitempty"` + Satisfies *[]string `json:"satisfies,omitempty"` + ServerOwned *bool `json:"serverOwned,omitempty"` + ShowEnvironmentVariables *bool `json:"showEnvironmentVariables,omitempty"` + SourceDefinitions *[]TaskSourceDefinition `json:"sourceDefinitions,omitempty"` + SourceLocation *string `json:"sourceLocation,omitempty"` + Version *TaskVersion `json:"version,omitempty"` + Visibility *[]string `json:"visibility,omitempty"` + // Gets or sets comment. + Comment *string `json:"comment,omitempty"` + // Gets or sets the identity who created. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + // Gets or sets date on which it got created. + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // Gets or sets as 'true' to indicate as deleted, 'false' otherwise. + Deleted *bool `json:"deleted,omitempty"` + // Gets or sets the identity who modified. + ModifiedBy *webapi.IdentityRef `json:"modifiedBy,omitempty"` + // Gets or sets date on which it got modified. + ModifiedOn *azuredevops.Time `json:"modifiedOn,omitempty"` + // Gets or sets the owner. + Owner *string `json:"owner,omitempty"` + // Gets or sets parent task group Id. This is used while creating a draft task group. + ParentDefinitionId *uuid.UUID `json:"parentDefinitionId,omitempty"` + // Gets or sets revision. + Revision *int `json:"revision,omitempty"` + // Gets or sets the tasks. + Tasks *[]TaskGroupStep `json:"tasks,omitempty"` +} + +type TaskGroupCreateParameter struct { + // Sets author name of the task group. + Author *string `json:"author,omitempty"` + // Sets category of the task group. + Category *string `json:"category,omitempty"` + // Sets description of the task group. + Description *string `json:"description,omitempty"` + // Sets friendly name of the task group. + FriendlyName *string `json:"friendlyName,omitempty"` + // Sets url icon of the task group. + IconUrl *string `json:"iconUrl,omitempty"` + // Sets input for the task group. + Inputs *[]TaskInputDefinition `json:"inputs,omitempty"` + // Sets display name of the task group. + InstanceNameFormat *string `json:"instanceNameFormat,omitempty"` + // Sets name of the task group. + Name *string `json:"name,omitempty"` + // Sets parent task group Id. This is used while creating a draft task group. + ParentDefinitionId *uuid.UUID `json:"parentDefinitionId,omitempty"` + // Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'. + RunsOn *[]string `json:"runsOn,omitempty"` + // Sets tasks for the task group. + Tasks *[]TaskGroupStep `json:"tasks,omitempty"` + // Sets version of the task group. + Version *TaskVersion `json:"version,omitempty"` +} + +type TaskGroupDefinition struct { + DisplayName *string `json:"displayName,omitempty"` + IsExpanded *bool `json:"isExpanded,omitempty"` + Name *string `json:"name,omitempty"` + Tags *[]string `json:"tags,omitempty"` + VisibleRule *string `json:"visibleRule,omitempty"` +} + +// [Flags] +type TaskGroupExpands string + +type taskGroupExpandsValuesType struct { + None TaskGroupExpands + Tasks TaskGroupExpands +} + +var TaskGroupExpandsValues = taskGroupExpandsValuesType{ + None: "none", + Tasks: "tasks", +} + +type TaskGroupPublishPreviewParameter struct { + // Comment for this update request + Comment *string `json:"comment,omitempty"` + // This is to disable previous versions of task group upon publish + DisablePriorVersions *bool `json:"disablePriorVersions,omitempty"` + // Denotes if task group is in preview + Preview *bool `json:"preview,omitempty"` + // This is the revision of task group that is getting published + Revision *int `json:"revision,omitempty"` + // This is the version of task group that is getting published + Version *TaskVersion `json:"version,omitempty"` +} + +// Specifies the desired ordering of taskGroups. +type TaskGroupQueryOrder string + +type taskGroupQueryOrderValuesType struct { + CreatedOnAscending TaskGroupQueryOrder + CreatedOnDescending TaskGroupQueryOrder +} + +var TaskGroupQueryOrderValues = taskGroupQueryOrderValuesType{ + // Order by createdon ascending. + CreatedOnAscending: "createdOnAscending", + // Order by createdon descending. + CreatedOnDescending: "createdOnDescending", +} + +type TaskGroupRestoreParameter struct { + // Comment for this update request + Comment *string `json:"comment,omitempty"` + // This is to restore deleted Task Group + Restore *bool `json:"restore,omitempty"` +} + +type TaskGroupRevision struct { + Comment *string `json:"comment,omitempty"` + FileId *int `json:"fileId,omitempty"` + ChangedBy *webapi.IdentityRef `json:"changedBy,omitempty"` + ChangedDate *azuredevops.Time `json:"changedDate,omitempty"` + ChangeType *AuditAction `json:"changeType,omitempty"` + MajorVersion *int `json:"majorVersion,omitempty"` + Revision *int `json:"revision,omitempty"` + TaskGroupId *uuid.UUID `json:"taskGroupId,omitempty"` +} + +// Represents tasks in the task group. +type TaskGroupStep struct { + // Gets or sets as 'true' to run the task always, 'false' otherwise. + AlwaysRun *bool `json:"alwaysRun,omitempty"` + // Gets or sets condition for the task. + Condition *string `json:"condition,omitempty"` + // Gets or sets as 'true' to continue on error, 'false' otherwise. + ContinueOnError *bool `json:"continueOnError,omitempty"` + // Gets or sets the display name. + DisplayName *string `json:"displayName,omitempty"` + // Gets or sets as task is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Gets dictionary of environment variables. + Environment *map[string]string `json:"environment,omitempty"` + // Gets or sets dictionary of inputs. + Inputs *map[string]string `json:"inputs,omitempty"` + // Gets or sets the maximum number of retries + RetryCountOnTaskFailure *int `json:"retryCountOnTaskFailure,omitempty"` + // Gets or sets the reference of the task. + Task *TaskDefinitionReference `json:"task,omitempty"` + // Gets or sets the maximum time, in minutes, that a task is allowed to execute on agent before being cancelled by server. A zero value indicates an infinite timeout. + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` +} + +type TaskGroupUpdateParameter struct { + // Sets author name of the task group. + Author *string `json:"author,omitempty"` + // Sets category of the task group. + Category *string `json:"category,omitempty"` + // Sets comment of the task group. + Comment *string `json:"comment,omitempty"` + // Sets description of the task group. + Description *string `json:"description,omitempty"` + // Sets friendly name of the task group. + FriendlyName *string `json:"friendlyName,omitempty"` + // Sets url icon of the task group. + IconUrl *string `json:"iconUrl,omitempty"` + // Sets the unique identifier of this field. + Id *uuid.UUID `json:"id,omitempty"` + // Sets input for the task group. + Inputs *[]TaskInputDefinition `json:"inputs,omitempty"` + // Sets display name of the task group. + InstanceNameFormat *string `json:"instanceNameFormat,omitempty"` + // Sets name of the task group. + Name *string `json:"name,omitempty"` + // Gets or sets parent task group Id. This is used while creating a draft task group. + ParentDefinitionId *uuid.UUID `json:"parentDefinitionId,omitempty"` + // Sets revision of the task group. + Revision *int `json:"revision,omitempty"` + // Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'. + RunsOn *[]string `json:"runsOn,omitempty"` + // Sets tasks for the task group. + Tasks *[]TaskGroupStep `json:"tasks,omitempty"` + // Sets version of the task group. + Version *TaskVersion `json:"version,omitempty"` +} + +type TaskGroupUpdatePropertiesBase struct { + // Comment for this update request + Comment *string `json:"comment,omitempty"` +} + +type TaskHubLicenseDetails struct { + EnterpriseUsersCount *int `json:"enterpriseUsersCount,omitempty"` + FailedToReachAllProviders *bool `json:"failedToReachAllProviders,omitempty"` + FreeHostedLicenseCount *int `json:"freeHostedLicenseCount,omitempty"` + FreeLicenseCount *int `json:"freeLicenseCount,omitempty"` + HasLicenseCountEverUpdated *bool `json:"hasLicenseCountEverUpdated,omitempty"` + HostedAgentMinutesFreeCount *int `json:"hostedAgentMinutesFreeCount,omitempty"` + HostedAgentMinutesUsedCount *int `json:"hostedAgentMinutesUsedCount,omitempty"` + HostedLicensesArePremium *bool `json:"hostedLicensesArePremium,omitempty"` + MsdnUsersCount *int `json:"msdnUsersCount,omitempty"` + // Microsoft-hosted licenses purchased from VSTS directly. + PurchasedHostedLicenseCount *int `json:"purchasedHostedLicenseCount,omitempty"` + // Self-hosted licenses purchased from VSTS directly. + PurchasedLicenseCount *int `json:"purchasedLicenseCount,omitempty"` + TotalHostedLicenseCount *int `json:"totalHostedLicenseCount,omitempty"` + TotalLicenseCount *int `json:"totalLicenseCount,omitempty"` + TotalPrivateLicenseCount *int `json:"totalPrivateLicenseCount,omitempty"` +} + +type TaskHubOidcToken struct { + OidcToken *string `json:"oidcToken,omitempty"` +} + +type TaskInputDefinition struct { + Aliases *[]string `json:"aliases,omitempty"` + DefaultValue *string `json:"defaultValue,omitempty"` + GroupName *string `json:"groupName,omitempty"` + HelpMarkDown *string `json:"helpMarkDown,omitempty"` + Label *string `json:"label,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Properties *map[string]string `json:"properties,omitempty"` + Required *bool `json:"required,omitempty"` + Type *string `json:"type,omitempty"` + Validation *distributedtaskcommon.TaskInputValidation `json:"validation,omitempty"` + VisibleRule *string `json:"visibleRule,omitempty"` +} + +type TaskInstance struct { + // The ID of the task definition. Corresponds to the id value of task.json file.
Example: CmdLineV2 { "id": "D9BAFED4-0B18-4F58-968D-86655B4D2CE9" } + Id *uuid.UUID `json:"id,omitempty"` + // A dictionary of inputs specific to a task definition. Corresponds to inputs value of task.json file. + Inputs *map[string]string `json:"inputs,omitempty"` + // The name of the task definition. Corresponds to the name value of task.json file.
Example: CmdLineV2 { "name": "CmdLine" } + Name *string `json:"name,omitempty"` + // The version of the task definition. Corresponds to the version value of task.json file.
Example: CmdLineV2 { "version": { "Major": 2, "Minor": 212, "Patch": 0 } } + Version *string `json:"version,omitempty"` + AlwaysRun *bool `json:"alwaysRun,omitempty"` + Condition *string `json:"condition,omitempty"` + ContinueOnError *bool `json:"continueOnError,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Environment *map[string]string `json:"environment,omitempty"` + InstanceId *uuid.UUID `json:"instanceId,omitempty"` + RefName *string `json:"refName,omitempty"` + RetryCountOnTaskFailure *int `json:"retryCountOnTaskFailure,omitempty"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` +} + +// A task log connected to a timeline record. +type TaskLog struct { + // The ID of the task log. + Id *int `json:"id,omitempty"` + // The REST URL of the task log. + Location *string `json:"location,omitempty"` + // The time of the task log creation. + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // The REST URL of the task log when indexed. + IndexLocation *string `json:"indexLocation,omitempty"` + // The time of the last modification of the task log. + LastChangedOn *azuredevops.Time `json:"lastChangedOn,omitempty"` + // The number of the task log lines. + LineCount *uint64 `json:"lineCount,omitempty"` + // The path of the task log. + Path *string `json:"path,omitempty"` +} + +// A reference to a task log. This class contains information about the output printed to the timeline record's logs console during pipeline run. +type TaskLogReference struct { + // The ID of the task log. + Id *int `json:"id,omitempty"` + // The REST URL of the task log. + Location *string `json:"location,omitempty"` +} + +type TaskOrchestrationContainer struct { + ItemType *TaskOrchestrationItemType `json:"itemType,omitempty"` + ContinueOnError *bool `json:"continueOnError,omitempty"` + Data *map[string]string `json:"data,omitempty"` + Children *[]TaskOrchestrationItem `json:"children,omitempty"` + MaxConcurrency *int `json:"maxConcurrency,omitempty"` + Parallel *bool `json:"parallel,omitempty"` + Rollback *TaskOrchestrationContainer `json:"rollback,omitempty"` +} + +type TaskOrchestrationItem struct { + ItemType *TaskOrchestrationItemType `json:"itemType,omitempty"` +} + +type TaskOrchestrationItemType string + +type taskOrchestrationItemTypeValuesType struct { + Container TaskOrchestrationItemType + Job TaskOrchestrationItemType +} + +var TaskOrchestrationItemTypeValues = taskOrchestrationItemTypeValuesType{ + Container: "container", + Job: "job", +} + +type TaskOrchestrationJob struct { + ItemType *TaskOrchestrationItemType `json:"itemType,omitempty"` + Demands *[]interface{} `json:"demands,omitempty"` + ExecuteAs *webapi.IdentityRef `json:"executeAs,omitempty"` + ExecutionMode *string `json:"executionMode,omitempty"` + ExecutionTimeout interface{} `json:"executionTimeout,omitempty"` + InstanceId *uuid.UUID `json:"instanceId,omitempty"` + Name *string `json:"name,omitempty"` + RefName *string `json:"refName,omitempty"` + Tasks *[]TaskInstance `json:"tasks,omitempty"` + Variables *map[string]string `json:"variables,omitempty"` +} + +type TaskOrchestrationOwner struct { + Links interface{} `json:"_links,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +type TaskOrchestrationPlan struct { + ArtifactLocation *string `json:"artifactLocation,omitempty"` + ArtifactUri *string `json:"artifactUri,omitempty"` + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + PlanGroup *string `json:"planGroup,omitempty"` + PlanId *uuid.UUID `json:"planId,omitempty"` + PlanType *string `json:"planType,omitempty"` + ScopeIdentifier *uuid.UUID `json:"scopeIdentifier,omitempty"` + Version *int `json:"version,omitempty"` + Environment *PlanEnvironment `json:"environment,omitempty"` + ExpandedYaml *TaskLogReference `json:"expandedYaml,omitempty"` + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + Implementation *TaskOrchestrationContainer `json:"implementation,omitempty"` + InitializationLog *TaskLogReference `json:"initializationLog,omitempty"` + RequestedById *uuid.UUID `json:"requestedById,omitempty"` + RequestedForId *uuid.UUID `json:"requestedForId,omitempty"` + Result *TaskResult `json:"result,omitempty"` + ResultCode *string `json:"resultCode,omitempty"` + StartTime *azuredevops.Time `json:"startTime,omitempty"` + State *TaskOrchestrationPlanState `json:"state,omitempty"` + Timeline *TimelineReference `json:"timeline,omitempty"` +} + +type TaskOrchestrationPlanGroup struct { + PlanGroup *string `json:"planGroup,omitempty"` + Project *ProjectReference `json:"project,omitempty"` + RunningRequests *[]TaskAgentJobRequest `json:"runningRequests,omitempty"` +} + +type TaskOrchestrationPlanGroupsQueueMetrics struct { + Count *int `json:"count,omitempty"` + Status *PlanGroupStatus `json:"status,omitempty"` +} + +type TaskOrchestrationPlanReference struct { + ArtifactLocation *string `json:"artifactLocation,omitempty"` + ArtifactUri *string `json:"artifactUri,omitempty"` + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + PlanGroup *string `json:"planGroup,omitempty"` + PlanId *uuid.UUID `json:"planId,omitempty"` + PlanType *string `json:"planType,omitempty"` + ScopeIdentifier *uuid.UUID `json:"scopeIdentifier,omitempty"` + Version *int `json:"version,omitempty"` +} + +type TaskOrchestrationPlanState string + +type taskOrchestrationPlanStateValuesType struct { + InProgress TaskOrchestrationPlanState + Queued TaskOrchestrationPlanState + Completed TaskOrchestrationPlanState + Throttled TaskOrchestrationPlanState +} + +var TaskOrchestrationPlanStateValues = taskOrchestrationPlanStateValuesType{ + InProgress: "inProgress", + Queued: "queued", + Completed: "completed", + Throttled: "throttled", +} + +type TaskOrchestrationQueuedPlan struct { + AssignTime *azuredevops.Time `json:"assignTime,omitempty"` + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + PlanGroup *string `json:"planGroup,omitempty"` + PlanId *uuid.UUID `json:"planId,omitempty"` + PoolId *int `json:"poolId,omitempty"` + QueuePosition *int `json:"queuePosition,omitempty"` + QueueTime *azuredevops.Time `json:"queueTime,omitempty"` + ScopeIdentifier *uuid.UUID `json:"scopeIdentifier,omitempty"` +} + +type TaskOrchestrationQueuedPlanGroup struct { + Definition *TaskOrchestrationOwner `json:"definition,omitempty"` + Owner *TaskOrchestrationOwner `json:"owner,omitempty"` + PlanGroup *string `json:"planGroup,omitempty"` + Plans *[]TaskOrchestrationQueuedPlan `json:"plans,omitempty"` + Project *ProjectReference `json:"project,omitempty"` + QueuePosition *int `json:"queuePosition,omitempty"` +} + +type TaskOutputVariable struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +type TaskPackageMetadata struct { + // Gets the name of the package. + Type *string `json:"type,omitempty"` + // Gets the url of the package. + Url *string `json:"url,omitempty"` + // Gets the version of the package. + Version *string `json:"version,omitempty"` +} + +// A reference to a task. +type TaskReference struct { + // The ID of the task definition. Corresponds to the id value of task.json file.
Example: CmdLineV2 { "id": "D9BAFED4-0B18-4F58-968D-86655B4D2CE9" } + Id *uuid.UUID `json:"id,omitempty"` + // A dictionary of inputs specific to a task definition. Corresponds to inputs value of task.json file. + Inputs *map[string]string `json:"inputs,omitempty"` + // The name of the task definition. Corresponds to the name value of task.json file.
Example: CmdLineV2 { "name": "CmdLine" } + Name *string `json:"name,omitempty"` + // The version of the task definition. Corresponds to the version value of task.json file.
Example: CmdLineV2 { "version": { "Major": 2, "Minor": 212, "Patch": 0 } } + Version *string `json:"version,omitempty"` +} + +type TaskRestrictions struct { + Commands *TaskCommandRestrictions `json:"commands,omitempty"` + SettableVariables *TaskVariableRestrictions `json:"settableVariables,omitempty"` +} + +// The result of an operation tracked by a timeline record. +type TaskResult string + +type taskResultValuesType struct { + Succeeded TaskResult + SucceededWithIssues TaskResult + Failed TaskResult + Canceled TaskResult + Skipped TaskResult + Abandoned TaskResult +} + +var TaskResultValues = taskResultValuesType{ + Succeeded: "succeeded", + SucceededWithIssues: "succeededWithIssues", + Failed: "failed", + Canceled: "canceled", + Skipped: "skipped", + Abandoned: "abandoned", +} + +type TaskSourceDefinition struct { + AuthKey *string `json:"authKey,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + KeySelector *string `json:"keySelector,omitempty"` + Selector *string `json:"selector,omitempty"` + Target *string `json:"target,omitempty"` +} + +type TaskStartedEvent struct { + // The ID of the pipeline job affected by the event. + JobId *uuid.UUID `json:"jobId,omitempty"` + // The name of the pipeline job event. + Name *string `json:"name,omitempty"` + // The ID of the task definition. + TaskId *uuid.UUID `json:"taskId,omitempty"` +} + +type TaskVariableRestrictions struct { + Allowed *[]string `json:"allowed,omitempty"` +} + +type TaskVersion struct { + IsTest *bool `json:"isTest,omitempty"` + Major *int `json:"major,omitempty"` + Minor *int `json:"minor,omitempty"` + Patch *int `json:"patch,omitempty"` +} + +type Timeline struct { + // The change ID. + ChangeId *int `json:"changeId,omitempty"` + // The ID of the timeline. + Id *uuid.UUID `json:"id,omitempty"` + // The REST URL of the timeline. + Location *string `json:"location,omitempty"` + LastChangedBy *uuid.UUID `json:"lastChangedBy,omitempty"` + LastChangedOn *azuredevops.Time `json:"lastChangedOn,omitempty"` + Records *[]TimelineRecord `json:"records,omitempty"` +} + +// An attempt to update a TimelineRecord. +type TimelineAttempt struct { + // The attempt of the record. + Attempt *int `json:"attempt,omitempty"` + // The unique identifier for the record. + Identifier *string `json:"identifier,omitempty"` + // The record identifier located within the specified timeline. + RecordId *uuid.UUID `json:"recordId,omitempty"` + // The timeline identifier which owns the record representing this attempt. + TimelineId *uuid.UUID `json:"timelineId,omitempty"` +} + +// Detailed information about the execution of different operations during pipeline run. +type TimelineRecord struct { + // The specification of an agent running a pipeline job, in binary format. Applicable when record is of type Job.
Example: { "VMImage" : "windows-2019" } + AgentSpecification interface{} `json:"agentSpecification,omitempty"` + // The number of record attempts. + Attempt *int `json:"attempt,omitempty"` + // A string that indicates the current operation. + CurrentOperation *string `json:"currentOperation,omitempty"` + // A reference to a sub-timeline. + Details *TimelineReference `json:"details,omitempty"` + // The number of errors produced by this operation. + ErrorCount *int `json:"errorCount,omitempty"` + // The finish time of the record. + FinishTime *azuredevops.Time `json:"finishTime,omitempty"` + // The ID connecting all records updated at the same time. This value is taken from timeline's ChangeId. + ChangeId *int `json:"changeId,omitempty"` + // The ID of the record. + Id *uuid.UUID `json:"id,omitempty"` + // String identifier that is consistent across attempts. + Identifier *string `json:"identifier,omitempty"` + // The list of issues produced by this operation. + Issues *[]Issue `json:"issues,omitempty"` + // The time the record was last modified. + LastModified *azuredevops.Time `json:"lastModified,omitempty"` + // The REST URL of the record. + Location *string `json:"location,omitempty"` + // A reference to the log produced by this operation. + Log *TaskLogReference `json:"log,omitempty"` + // The name of the record. + Name *string `json:"name,omitempty"` + // An ordinal value relative to other records within the timeline. + Order *int `json:"order,omitempty"` + // The ID of the record's parent.
Example: Stage is a parent of a Phase, Phase is a parent of a Job, Job is a parent of a Task. + ParentId *uuid.UUID `json:"parentId,omitempty"` + // The percentage of record completion. + PercentComplete *int `json:"percentComplete,omitempty"` + // The previous record attempts. + PreviousAttempts *[]TimelineAttempt `json:"previousAttempts,omitempty"` + // The ID of the queue which connects projects to agent pools on which the operation ran on. Applicable when record is of type Job. + QueueId *int `json:"queueId,omitempty"` + // Name of the referenced record. + RefName *string `json:"refName,omitempty"` + // The result of the record. + Result *TaskResult `json:"result,omitempty"` + // Evaluation of predefined conditions upon completion of record's operation.
Example: Evaluating `succeeded()`, Result = True
Example: Evaluating `and(succeeded(), eq(variables['system.debug'], False))`, Result = False + ResultCode *string `json:"resultCode,omitempty"` + // The start time of the record. + StartTime *azuredevops.Time `json:"startTime,omitempty"` + // The state of the record. + State *TimelineRecordState `json:"state,omitempty"` + // A reference to the task. Applicable when record is of type Task. + Task *TaskReference `json:"task,omitempty"` + // The type of operation being tracked by the record.
Example: Stage, Phase, Job, Task... + Type *string `json:"type,omitempty"` + // The variables of the record. + Variables *map[string]interface{} `json:"variables,omitempty"` + // The number of warnings produced by this operation. + WarningCount *int `json:"warningCount,omitempty"` + // The name of the agent running the operation. Applicable when record is of type Job. + WorkerName *string `json:"workerName,omitempty"` +} + +type TimelineRecordFeedLinesWrapper struct { + Count *int `json:"count,omitempty"` + EndLine *uint64 `json:"endLine,omitempty"` + StartLine *uint64 `json:"startLine,omitempty"` + StepId *uuid.UUID `json:"stepId,omitempty"` + Value *[]string `json:"value,omitempty"` +} + +// The state of the timeline record. +type TimelineRecordState string + +type timelineRecordStateValuesType struct { + Pending TimelineRecordState + InProgress TimelineRecordState + Completed TimelineRecordState +} + +var TimelineRecordStateValues = timelineRecordStateValuesType{ + Pending: "pending", + InProgress: "inProgress", + Completed: "completed", +} + +// A reference to a timeline. +type TimelineReference struct { + // The change ID. + ChangeId *int `json:"changeId,omitempty"` + // The ID of the timeline. + Id *uuid.UUID `json:"id,omitempty"` + // The REST URL of the timeline. + Location *string `json:"location,omitempty"` +} + +type ValidationItem struct { + // Tells whether the current input is valid or not + IsValid *bool `json:"isValid,omitempty"` + // Reason for input validation failure + Reason *string `json:"reason,omitempty"` + // Type of validation item + Type *string `json:"type,omitempty"` + // Value to validate. The conditional expression to validate for the input for "expression" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master') + Value *string `json:"value,omitempty"` +} + +// A variable group is a collection of related variables. +type VariableGroup struct { + // Gets or sets the identity who created the variable group. + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + // Gets or sets the time when variable group was created. + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + // Gets or sets description of the variable group. + Description *string `json:"description,omitempty"` + // Gets or sets id of the variable group. + Id *int `json:"id,omitempty"` + // Indicates whether variable group is shared with other projects or not. + IsShared *bool `json:"isShared,omitempty"` + // Gets or sets the identity who modified the variable group. + ModifiedBy *webapi.IdentityRef `json:"modifiedBy,omitempty"` + // Gets or sets the time when variable group was modified + ModifiedOn *azuredevops.Time `json:"modifiedOn,omitempty"` + // Gets or sets name of the variable group. + Name *string `json:"name,omitempty"` + // Gets or sets provider data. + ProviderData interface{} `json:"providerData,omitempty"` + // Gets or sets type of the variable group. + Type *string `json:"type,omitempty"` + // all project references where the variable group is shared with other projects. + VariableGroupProjectReferences *[]VariableGroupProjectReference `json:"variableGroupProjectReferences,omitempty"` + // Gets or sets variables contained in the variable group. + Variables *map[string]interface{} `json:"variables,omitempty"` +} + +// [Flags] +type VariableGroupActionFilter string + +type variableGroupActionFilterValuesType struct { + None VariableGroupActionFilter + Manage VariableGroupActionFilter + Use VariableGroupActionFilter +} + +var VariableGroupActionFilterValues = variableGroupActionFilterValuesType{ + None: "none", + Manage: "manage", + Use: "use", +} + +type VariableGroupParameters struct { + // Sets description of the variable group. + Description *string `json:"description,omitempty"` + // Sets name of the variable group. + Name *string `json:"name,omitempty"` + // Sets provider data. + ProviderData interface{} `json:"providerData,omitempty"` + // Sets type of the variable group. + Type *string `json:"type,omitempty"` + VariableGroupProjectReferences *[]VariableGroupProjectReference `json:"variableGroupProjectReferences,omitempty"` + // Sets variables contained in the variable group. + Variables *map[string]interface{} `json:"variables,omitempty"` +} + +// A variable group reference is a shallow reference to variable group. +type VariableGroupProjectReference struct { + // Gets or sets description of the variable group. + Description *string `json:"description,omitempty"` + // Gets or sets name of the variable group. + Name *string `json:"name,omitempty"` + // Gets or sets project reference of the variable group. + ProjectReference *ProjectReference `json:"projectReference,omitempty"` +} + +// Defines provider data of the variable group. +type VariableGroupProviderData struct { +} + +// Specifies the desired ordering of variableGroups. +type VariableGroupQueryOrder string + +type variableGroupQueryOrderValuesType struct { + IdAscending VariableGroupQueryOrder + IdDescending VariableGroupQueryOrder +} + +var VariableGroupQueryOrderValues = variableGroupQueryOrderValuesType{ + // Order by id ascending. + IdAscending: "idAscending", + // Order by id descending. + IdDescending: "idDescending", +} + +// A wrapper class for a generic variable. +type VariableValue struct { + // Indicates whether the variable can be changed during script's execution runtime. + IsReadOnly *bool `json:"isReadOnly,omitempty"` + // Indicates whether the variable should be encrypted at rest. + IsSecret *bool `json:"isSecret,omitempty"` + // The value of the variable. + Value *string `json:"value,omitempty"` +} + +type VirtualMachine struct { + Agent *TaskAgent `json:"agent,omitempty"` + Id *int `json:"id,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +type VirtualMachineGroup struct { + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + EnvironmentReference *EnvironmentReference `json:"environmentReference,omitempty"` + Id *int `json:"id,omitempty"` + LastModifiedBy *webapi.IdentityRef `json:"lastModifiedBy,omitempty"` + LastModifiedOn *azuredevops.Time `json:"lastModifiedOn,omitempty"` + Name *string `json:"name,omitempty"` + // Tags of the Environment Resource. + Tags *[]string `json:"tags,omitempty"` + // Environment resource type + Type *EnvironmentResourceType `json:"type,omitempty"` + PoolId *int `json:"poolId,omitempty"` +} + +type VirtualMachineGroupCreateParameters struct { + Name *string `json:"name,omitempty"` +} + +type VirtualMachineResource struct { + CreatedBy *webapi.IdentityRef `json:"createdBy,omitempty"` + CreatedOn *azuredevops.Time `json:"createdOn,omitempty"` + EnvironmentReference *EnvironmentReference `json:"environmentReference,omitempty"` + Id *int `json:"id,omitempty"` + LastModifiedBy *webapi.IdentityRef `json:"lastModifiedBy,omitempty"` + LastModifiedOn *azuredevops.Time `json:"lastModifiedOn,omitempty"` + Name *string `json:"name,omitempty"` + // Tags of the Environment Resource. + Tags *[]string `json:"tags,omitempty"` + // Environment resource type + Type *EnvironmentResourceType `json:"type,omitempty"` + Agent *TaskAgent `json:"agent,omitempty"` +} + +type VirtualMachineResourceCreateParameters struct { + VirtualMachineResource *VirtualMachineResource `json:"virtualMachineResource,omitempty"` +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b626e329..b379c7b6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -149,6 +149,7 @@ github.com/microsoft/azure-devops-go-api/azuredevops/v7/profile github.com/microsoft/azure-devops-go-api/azuredevops/v7/security github.com/microsoft/azure-devops-go-api/azuredevops/v7/serviceendpoint github.com/microsoft/azure-devops-go-api/azuredevops/v7/system +github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent github.com/microsoft/azure-devops-go-api/azuredevops/v7/webapi github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking # github.com/muesli/reflow v0.3.0 From 83b1134185b87cfeecbf5911f9fd3c348ddf72ee Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:25:51 +0000 Subject: [PATCH 2/8] =?UTF-8?q?test:=20=F0=9F=A7=AA=20generate=20taskagent?= =?UTF-8?q?=20client=20mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add generated MockTaskAgentClient and wire TaskAgent into the mock client factory. Update the mock generation script to produce the new taskagent mock file so tests can stub TaskAgent API calls. --- internal/mocks/connection_factory_mock.go | 16 + internal/mocks/taskagent_client_mock.go | 887 ++++++++++++++++++++++ scripts/generate_mocks.sh | 6 + 3 files changed, 909 insertions(+) create mode 100644 internal/mocks/taskagent_client_mock.go diff --git a/internal/mocks/connection_factory_mock.go b/internal/mocks/connection_factory_mock.go index 4501f5d4..5a265858 100644 --- a/internal/mocks/connection_factory_mock.go +++ b/internal/mocks/connection_factory_mock.go @@ -25,6 +25,7 @@ import ( operations "github.com/microsoft/azure-devops-go-api/azuredevops/v7/operations" security "github.com/microsoft/azure-devops-go-api/azuredevops/v7/security" serviceendpoint "github.com/microsoft/azure-devops-go-api/azuredevops/v7/serviceendpoint" + taskagent "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" workitemtracking "github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking" azdo "github.com/tmeckel/azdo-cli/internal/azdo" extensions "github.com/tmeckel/azdo-cli/internal/azdo/extensions" @@ -435,6 +436,21 @@ func (mr *MockClientFactoryMockRecorder) ServiceEndpoint(ctx, organization any) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceEndpoint", reflect.TypeOf((*MockClientFactory)(nil).ServiceEndpoint), ctx, organization) } +// TaskAgent mocks base method. +func (m *MockClientFactory) TaskAgent(ctx context.Context, organization string) (taskagent.Client, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TaskAgent", ctx, organization) + ret0, _ := ret[0].(taskagent.Client) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TaskAgent indicates an expected call of TaskAgent. +func (mr *MockClientFactoryMockRecorder) TaskAgent(ctx, organization any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaskAgent", reflect.TypeOf((*MockClientFactory)(nil).TaskAgent), ctx, organization) +} + // WorkItemTracking mocks base method. func (m *MockClientFactory) WorkItemTracking(ctx context.Context, organization string) (workitemtracking.Client, error) { m.ctrl.T.Helper() diff --git a/internal/mocks/taskagent_client_mock.go b/internal/mocks/taskagent_client_mock.go new file mode 100644 index 00000000..f2a7dc64 --- /dev/null +++ b/internal/mocks/taskagent_client_mock.go @@ -0,0 +1,887 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent (interfaces: Client) +// +// Generated by this command: +// +// mockgen -package=mocks -destination internal/mocks/taskagent_client_mock.go -mock_names Client=MockTaskAgentClient github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent Client +// + +// Package mocks is a generated GoMock package. +package mocks + +import ( + context "context" + reflect "reflect" + + taskagent "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" + gomock "go.uber.org/mock/gomock" +) + +// MockTaskAgentClient is a mock of Client interface. +type MockTaskAgentClient struct { + ctrl *gomock.Controller + recorder *MockTaskAgentClientMockRecorder + isgomock struct{} +} + +// MockTaskAgentClientMockRecorder is the mock recorder for MockTaskAgentClient. +type MockTaskAgentClientMockRecorder struct { + mock *MockTaskAgentClient +} + +// NewMockTaskAgentClient creates a new mock instance. +func NewMockTaskAgentClient(ctrl *gomock.Controller) *MockTaskAgentClient { + mock := &MockTaskAgentClient{ctrl: ctrl} + mock.recorder = &MockTaskAgentClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTaskAgentClient) EXPECT() *MockTaskAgentClientMockRecorder { + return m.recorder +} + +// AddAgent mocks base method. +func (m *MockTaskAgentClient) AddAgent(arg0 context.Context, arg1 taskagent.AddAgentArgs) (*taskagent.TaskAgent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddAgent", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddAgent indicates an expected call of AddAgent. +func (mr *MockTaskAgentClientMockRecorder) AddAgent(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAgent", reflect.TypeOf((*MockTaskAgentClient)(nil).AddAgent), arg0, arg1) +} + +// AddAgentCloud mocks base method. +func (m *MockTaskAgentClient) AddAgentCloud(arg0 context.Context, arg1 taskagent.AddAgentCloudArgs) (*taskagent.TaskAgentCloud, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddAgentCloud", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentCloud) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddAgentCloud indicates an expected call of AddAgentCloud. +func (mr *MockTaskAgentClientMockRecorder) AddAgentCloud(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAgentCloud", reflect.TypeOf((*MockTaskAgentClient)(nil).AddAgentCloud), arg0, arg1) +} + +// AddAgentPool mocks base method. +func (m *MockTaskAgentClient) AddAgentPool(arg0 context.Context, arg1 taskagent.AddAgentPoolArgs) (*taskagent.TaskAgentPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddAgentPool", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddAgentPool indicates an expected call of AddAgentPool. +func (mr *MockTaskAgentClientMockRecorder) AddAgentPool(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAgentPool", reflect.TypeOf((*MockTaskAgentClient)(nil).AddAgentPool), arg0, arg1) +} + +// AddAgentQueue mocks base method. +func (m *MockTaskAgentClient) AddAgentQueue(arg0 context.Context, arg1 taskagent.AddAgentQueueArgs) (*taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddAgentQueue", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddAgentQueue indicates an expected call of AddAgentQueue. +func (mr *MockTaskAgentClientMockRecorder) AddAgentQueue(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAgentQueue", reflect.TypeOf((*MockTaskAgentClient)(nil).AddAgentQueue), arg0, arg1) +} + +// AddDeploymentGroup mocks base method. +func (m *MockTaskAgentClient) AddDeploymentGroup(arg0 context.Context, arg1 taskagent.AddDeploymentGroupArgs) (*taskagent.DeploymentGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddDeploymentGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.DeploymentGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddDeploymentGroup indicates an expected call of AddDeploymentGroup. +func (mr *MockTaskAgentClientMockRecorder) AddDeploymentGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddDeploymentGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).AddDeploymentGroup), arg0, arg1) +} + +// AddEnvironment mocks base method. +func (m *MockTaskAgentClient) AddEnvironment(arg0 context.Context, arg1 taskagent.AddEnvironmentArgs) (*taskagent.EnvironmentInstance, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddEnvironment", arg0, arg1) + ret0, _ := ret[0].(*taskagent.EnvironmentInstance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddEnvironment indicates an expected call of AddEnvironment. +func (mr *MockTaskAgentClientMockRecorder) AddEnvironment(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEnvironment", reflect.TypeOf((*MockTaskAgentClient)(nil).AddEnvironment), arg0, arg1) +} + +// AddKubernetesResourcExistingEndpoint mocks base method. +func (m *MockTaskAgentClient) AddKubernetesResourcExistingEndpoint(ctx context.Context, args taskagent.AddKubernetesResourceArgsExistingEndpoint) (*taskagent.KubernetesResource, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddKubernetesResourcExistingEndpoint", ctx, args) + ret0, _ := ret[0].(*taskagent.KubernetesResource) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddKubernetesResourcExistingEndpoint indicates an expected call of AddKubernetesResourcExistingEndpoint. +func (mr *MockTaskAgentClientMockRecorder) AddKubernetesResourcExistingEndpoint(ctx, args any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddKubernetesResourcExistingEndpoint", reflect.TypeOf((*MockTaskAgentClient)(nil).AddKubernetesResourcExistingEndpoint), ctx, args) +} + +// AddKubernetesResourceNewEndpoint mocks base method. +func (m *MockTaskAgentClient) AddKubernetesResourceNewEndpoint(ctx context.Context, args taskagent.AddKubernetesResourceArgsNewEndpoint) (*taskagent.KubernetesResource, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddKubernetesResourceNewEndpoint", ctx, args) + ret0, _ := ret[0].(*taskagent.KubernetesResource) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddKubernetesResourceNewEndpoint indicates an expected call of AddKubernetesResourceNewEndpoint. +func (mr *MockTaskAgentClientMockRecorder) AddKubernetesResourceNewEndpoint(ctx, args any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddKubernetesResourceNewEndpoint", reflect.TypeOf((*MockTaskAgentClient)(nil).AddKubernetesResourceNewEndpoint), ctx, args) +} + +// AddTaskGroup mocks base method. +func (m *MockTaskAgentClient) AddTaskGroup(arg0 context.Context, arg1 taskagent.AddTaskGroupArgs) (*taskagent.TaskGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddTaskGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddTaskGroup indicates an expected call of AddTaskGroup. +func (mr *MockTaskAgentClientMockRecorder) AddTaskGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTaskGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).AddTaskGroup), arg0, arg1) +} + +// AddVariableGroup mocks base method. +func (m *MockTaskAgentClient) AddVariableGroup(arg0 context.Context, arg1 taskagent.AddVariableGroupArgs) (*taskagent.VariableGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddVariableGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.VariableGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddVariableGroup indicates an expected call of AddVariableGroup. +func (mr *MockTaskAgentClientMockRecorder) AddVariableGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddVariableGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).AddVariableGroup), arg0, arg1) +} + +// DeleteAgent mocks base method. +func (m *MockTaskAgentClient) DeleteAgent(arg0 context.Context, arg1 taskagent.DeleteAgentArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAgent", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAgent indicates an expected call of DeleteAgent. +func (mr *MockTaskAgentClientMockRecorder) DeleteAgent(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAgent", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteAgent), arg0, arg1) +} + +// DeleteAgentCloud mocks base method. +func (m *MockTaskAgentClient) DeleteAgentCloud(arg0 context.Context, arg1 taskagent.DeleteAgentCloudArgs) (*taskagent.TaskAgentCloud, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAgentCloud", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentCloud) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteAgentCloud indicates an expected call of DeleteAgentCloud. +func (mr *MockTaskAgentClientMockRecorder) DeleteAgentCloud(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAgentCloud", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteAgentCloud), arg0, arg1) +} + +// DeleteAgentPool mocks base method. +func (m *MockTaskAgentClient) DeleteAgentPool(arg0 context.Context, arg1 taskagent.DeleteAgentPoolArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAgentPool", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAgentPool indicates an expected call of DeleteAgentPool. +func (mr *MockTaskAgentClientMockRecorder) DeleteAgentPool(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAgentPool", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteAgentPool), arg0, arg1) +} + +// DeleteAgentQueue mocks base method. +func (m *MockTaskAgentClient) DeleteAgentQueue(arg0 context.Context, arg1 taskagent.DeleteAgentQueueArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAgentQueue", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAgentQueue indicates an expected call of DeleteAgentQueue. +func (mr *MockTaskAgentClientMockRecorder) DeleteAgentQueue(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAgentQueue", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteAgentQueue), arg0, arg1) +} + +// DeleteDeploymentGroup mocks base method. +func (m *MockTaskAgentClient) DeleteDeploymentGroup(arg0 context.Context, arg1 taskagent.DeleteDeploymentGroupArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteDeploymentGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDeploymentGroup indicates an expected call of DeleteDeploymentGroup. +func (mr *MockTaskAgentClientMockRecorder) DeleteDeploymentGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDeploymentGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteDeploymentGroup), arg0, arg1) +} + +// DeleteDeploymentTarget mocks base method. +func (m *MockTaskAgentClient) DeleteDeploymentTarget(arg0 context.Context, arg1 taskagent.DeleteDeploymentTargetArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteDeploymentTarget", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDeploymentTarget indicates an expected call of DeleteDeploymentTarget. +func (mr *MockTaskAgentClientMockRecorder) DeleteDeploymentTarget(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDeploymentTarget", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteDeploymentTarget), arg0, arg1) +} + +// DeleteEnvironment mocks base method. +func (m *MockTaskAgentClient) DeleteEnvironment(arg0 context.Context, arg1 taskagent.DeleteEnvironmentArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteEnvironment", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteEnvironment indicates an expected call of DeleteEnvironment. +func (mr *MockTaskAgentClientMockRecorder) DeleteEnvironment(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEnvironment", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteEnvironment), arg0, arg1) +} + +// DeleteKubernetesResource mocks base method. +func (m *MockTaskAgentClient) DeleteKubernetesResource(arg0 context.Context, arg1 taskagent.DeleteKubernetesResourceArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteKubernetesResource", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteKubernetesResource indicates an expected call of DeleteKubernetesResource. +func (mr *MockTaskAgentClientMockRecorder) DeleteKubernetesResource(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteKubernetesResource", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteKubernetesResource), arg0, arg1) +} + +// DeleteTaskGroup mocks base method. +func (m *MockTaskAgentClient) DeleteTaskGroup(arg0 context.Context, arg1 taskagent.DeleteTaskGroupArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTaskGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteTaskGroup indicates an expected call of DeleteTaskGroup. +func (mr *MockTaskAgentClientMockRecorder) DeleteTaskGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTaskGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteTaskGroup), arg0, arg1) +} + +// DeleteVariableGroup mocks base method. +func (m *MockTaskAgentClient) DeleteVariableGroup(arg0 context.Context, arg1 taskagent.DeleteVariableGroupArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteVariableGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteVariableGroup indicates an expected call of DeleteVariableGroup. +func (mr *MockTaskAgentClientMockRecorder) DeleteVariableGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVariableGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).DeleteVariableGroup), arg0, arg1) +} + +// GetAgent mocks base method. +func (m *MockTaskAgentClient) GetAgent(arg0 context.Context, arg1 taskagent.GetAgentArgs) (*taskagent.TaskAgent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgent", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgent indicates an expected call of GetAgent. +func (mr *MockTaskAgentClientMockRecorder) GetAgent(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgent", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgent), arg0, arg1) +} + +// GetAgentCloud mocks base method. +func (m *MockTaskAgentClient) GetAgentCloud(arg0 context.Context, arg1 taskagent.GetAgentCloudArgs) (*taskagent.TaskAgentCloud, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentCloud", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentCloud) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentCloud indicates an expected call of GetAgentCloud. +func (mr *MockTaskAgentClientMockRecorder) GetAgentCloud(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentCloud", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentCloud), arg0, arg1) +} + +// GetAgentCloudRequests mocks base method. +func (m *MockTaskAgentClient) GetAgentCloudRequests(arg0 context.Context, arg1 taskagent.GetAgentCloudRequestsArgs) (*[]taskagent.TaskAgentCloudRequest, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentCloudRequests", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentCloudRequest) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentCloudRequests indicates an expected call of GetAgentCloudRequests. +func (mr *MockTaskAgentClientMockRecorder) GetAgentCloudRequests(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentCloudRequests", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentCloudRequests), arg0, arg1) +} + +// GetAgentCloudTypes mocks base method. +func (m *MockTaskAgentClient) GetAgentCloudTypes(arg0 context.Context, arg1 taskagent.GetAgentCloudTypesArgs) (*[]taskagent.TaskAgentCloudType, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentCloudTypes", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentCloudType) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentCloudTypes indicates an expected call of GetAgentCloudTypes. +func (mr *MockTaskAgentClientMockRecorder) GetAgentCloudTypes(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentCloudTypes", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentCloudTypes), arg0, arg1) +} + +// GetAgentClouds mocks base method. +func (m *MockTaskAgentClient) GetAgentClouds(arg0 context.Context, arg1 taskagent.GetAgentCloudsArgs) (*[]taskagent.TaskAgentCloud, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentClouds", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentCloud) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentClouds indicates an expected call of GetAgentClouds. +func (mr *MockTaskAgentClientMockRecorder) GetAgentClouds(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentClouds", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentClouds), arg0, arg1) +} + +// GetAgentPool mocks base method. +func (m *MockTaskAgentClient) GetAgentPool(arg0 context.Context, arg1 taskagent.GetAgentPoolArgs) (*taskagent.TaskAgentPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentPool", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentPool indicates an expected call of GetAgentPool. +func (mr *MockTaskAgentClientMockRecorder) GetAgentPool(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentPool", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentPool), arg0, arg1) +} + +// GetAgentPools mocks base method. +func (m *MockTaskAgentClient) GetAgentPools(arg0 context.Context, arg1 taskagent.GetAgentPoolsArgs) (*[]taskagent.TaskAgentPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentPools", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentPools indicates an expected call of GetAgentPools. +func (mr *MockTaskAgentClientMockRecorder) GetAgentPools(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentPools", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentPools), arg0, arg1) +} + +// GetAgentPoolsByIds mocks base method. +func (m *MockTaskAgentClient) GetAgentPoolsByIds(arg0 context.Context, arg1 taskagent.GetAgentPoolsByIdsArgs) (*[]taskagent.TaskAgentPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentPoolsByIds", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentPoolsByIds indicates an expected call of GetAgentPoolsByIds. +func (mr *MockTaskAgentClientMockRecorder) GetAgentPoolsByIds(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentPoolsByIds", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentPoolsByIds), arg0, arg1) +} + +// GetAgentQueue mocks base method. +func (m *MockTaskAgentClient) GetAgentQueue(arg0 context.Context, arg1 taskagent.GetAgentQueueArgs) (*taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentQueue", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentQueue indicates an expected call of GetAgentQueue. +func (mr *MockTaskAgentClientMockRecorder) GetAgentQueue(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentQueue", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentQueue), arg0, arg1) +} + +// GetAgentQueues mocks base method. +func (m *MockTaskAgentClient) GetAgentQueues(arg0 context.Context, arg1 taskagent.GetAgentQueuesArgs) (*[]taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentQueues", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentQueues indicates an expected call of GetAgentQueues. +func (mr *MockTaskAgentClientMockRecorder) GetAgentQueues(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentQueues", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentQueues), arg0, arg1) +} + +// GetAgentQueuesByIds mocks base method. +func (m *MockTaskAgentClient) GetAgentQueuesByIds(arg0 context.Context, arg1 taskagent.GetAgentQueuesByIdsArgs) (*[]taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentQueuesByIds", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentQueuesByIds indicates an expected call of GetAgentQueuesByIds. +func (mr *MockTaskAgentClientMockRecorder) GetAgentQueuesByIds(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentQueuesByIds", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentQueuesByIds), arg0, arg1) +} + +// GetAgentQueuesByNames mocks base method. +func (m *MockTaskAgentClient) GetAgentQueuesByNames(arg0 context.Context, arg1 taskagent.GetAgentQueuesByNamesArgs) (*[]taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentQueuesByNames", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentQueuesByNames indicates an expected call of GetAgentQueuesByNames. +func (mr *MockTaskAgentClientMockRecorder) GetAgentQueuesByNames(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentQueuesByNames", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentQueuesByNames), arg0, arg1) +} + +// GetAgentQueuesForPools mocks base method. +func (m *MockTaskAgentClient) GetAgentQueuesForPools(arg0 context.Context, arg1 taskagent.GetAgentQueuesForPoolsArgs) (*[]taskagent.TaskAgentQueue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgentQueuesForPools", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgentQueue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgentQueuesForPools indicates an expected call of GetAgentQueuesForPools. +func (mr *MockTaskAgentClientMockRecorder) GetAgentQueuesForPools(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgentQueuesForPools", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgentQueuesForPools), arg0, arg1) +} + +// GetAgents mocks base method. +func (m *MockTaskAgentClient) GetAgents(arg0 context.Context, arg1 taskagent.GetAgentsArgs) (*[]taskagent.TaskAgent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAgents", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskAgent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAgents indicates an expected call of GetAgents. +func (mr *MockTaskAgentClientMockRecorder) GetAgents(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAgents", reflect.TypeOf((*MockTaskAgentClient)(nil).GetAgents), arg0, arg1) +} + +// GetDeploymentGroup mocks base method. +func (m *MockTaskAgentClient) GetDeploymentGroup(arg0 context.Context, arg1 taskagent.GetDeploymentGroupArgs) (*taskagent.DeploymentGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeploymentGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.DeploymentGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeploymentGroup indicates an expected call of GetDeploymentGroup. +func (mr *MockTaskAgentClientMockRecorder) GetDeploymentGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeploymentGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).GetDeploymentGroup), arg0, arg1) +} + +// GetDeploymentGroups mocks base method. +func (m *MockTaskAgentClient) GetDeploymentGroups(arg0 context.Context, arg1 taskagent.GetDeploymentGroupsArgs) (*taskagent.GetDeploymentGroupsResponseValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeploymentGroups", arg0, arg1) + ret0, _ := ret[0].(*taskagent.GetDeploymentGroupsResponseValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeploymentGroups indicates an expected call of GetDeploymentGroups. +func (mr *MockTaskAgentClientMockRecorder) GetDeploymentGroups(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeploymentGroups", reflect.TypeOf((*MockTaskAgentClient)(nil).GetDeploymentGroups), arg0, arg1) +} + +// GetDeploymentTarget mocks base method. +func (m *MockTaskAgentClient) GetDeploymentTarget(arg0 context.Context, arg1 taskagent.GetDeploymentTargetArgs) (*taskagent.DeploymentMachine, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeploymentTarget", arg0, arg1) + ret0, _ := ret[0].(*taskagent.DeploymentMachine) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeploymentTarget indicates an expected call of GetDeploymentTarget. +func (mr *MockTaskAgentClientMockRecorder) GetDeploymentTarget(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeploymentTarget", reflect.TypeOf((*MockTaskAgentClient)(nil).GetDeploymentTarget), arg0, arg1) +} + +// GetDeploymentTargets mocks base method. +func (m *MockTaskAgentClient) GetDeploymentTargets(arg0 context.Context, arg1 taskagent.GetDeploymentTargetsArgs) (*taskagent.GetDeploymentTargetsResponseValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeploymentTargets", arg0, arg1) + ret0, _ := ret[0].(*taskagent.GetDeploymentTargetsResponseValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeploymentTargets indicates an expected call of GetDeploymentTargets. +func (mr *MockTaskAgentClientMockRecorder) GetDeploymentTargets(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeploymentTargets", reflect.TypeOf((*MockTaskAgentClient)(nil).GetDeploymentTargets), arg0, arg1) +} + +// GetEnvironmentById mocks base method. +func (m *MockTaskAgentClient) GetEnvironmentById(arg0 context.Context, arg1 taskagent.GetEnvironmentByIdArgs) (*taskagent.EnvironmentInstance, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEnvironmentById", arg0, arg1) + ret0, _ := ret[0].(*taskagent.EnvironmentInstance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEnvironmentById indicates an expected call of GetEnvironmentById. +func (mr *MockTaskAgentClientMockRecorder) GetEnvironmentById(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnvironmentById", reflect.TypeOf((*MockTaskAgentClient)(nil).GetEnvironmentById), arg0, arg1) +} + +// GetEnvironmentDeploymentExecutionRecords mocks base method. +func (m *MockTaskAgentClient) GetEnvironmentDeploymentExecutionRecords(arg0 context.Context, arg1 taskagent.GetEnvironmentDeploymentExecutionRecordsArgs) (*taskagent.GetEnvironmentDeploymentExecutionRecordsResponseValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEnvironmentDeploymentExecutionRecords", arg0, arg1) + ret0, _ := ret[0].(*taskagent.GetEnvironmentDeploymentExecutionRecordsResponseValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEnvironmentDeploymentExecutionRecords indicates an expected call of GetEnvironmentDeploymentExecutionRecords. +func (mr *MockTaskAgentClientMockRecorder) GetEnvironmentDeploymentExecutionRecords(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnvironmentDeploymentExecutionRecords", reflect.TypeOf((*MockTaskAgentClient)(nil).GetEnvironmentDeploymentExecutionRecords), arg0, arg1) +} + +// GetEnvironments mocks base method. +func (m *MockTaskAgentClient) GetEnvironments(arg0 context.Context, arg1 taskagent.GetEnvironmentsArgs) (*taskagent.GetEnvironmentsResponseValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEnvironments", arg0, arg1) + ret0, _ := ret[0].(*taskagent.GetEnvironmentsResponseValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEnvironments indicates an expected call of GetEnvironments. +func (mr *MockTaskAgentClientMockRecorder) GetEnvironments(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnvironments", reflect.TypeOf((*MockTaskAgentClient)(nil).GetEnvironments), arg0, arg1) +} + +// GetKubernetesResource mocks base method. +func (m *MockTaskAgentClient) GetKubernetesResource(arg0 context.Context, arg1 taskagent.GetKubernetesResourceArgs) (*taskagent.KubernetesResource, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetKubernetesResource", arg0, arg1) + ret0, _ := ret[0].(*taskagent.KubernetesResource) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetKubernetesResource indicates an expected call of GetKubernetesResource. +func (mr *MockTaskAgentClientMockRecorder) GetKubernetesResource(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKubernetesResource", reflect.TypeOf((*MockTaskAgentClient)(nil).GetKubernetesResource), arg0, arg1) +} + +// GetTaskGroups mocks base method. +func (m *MockTaskAgentClient) GetTaskGroups(arg0 context.Context, arg1 taskagent.GetTaskGroupsArgs) (*[]taskagent.TaskGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTaskGroups", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.TaskGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTaskGroups indicates an expected call of GetTaskGroups. +func (mr *MockTaskAgentClientMockRecorder) GetTaskGroups(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTaskGroups", reflect.TypeOf((*MockTaskAgentClient)(nil).GetTaskGroups), arg0, arg1) +} + +// GetVariableGroup mocks base method. +func (m *MockTaskAgentClient) GetVariableGroup(arg0 context.Context, arg1 taskagent.GetVariableGroupArgs) (*taskagent.VariableGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVariableGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.VariableGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVariableGroup indicates an expected call of GetVariableGroup. +func (mr *MockTaskAgentClientMockRecorder) GetVariableGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVariableGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).GetVariableGroup), arg0, arg1) +} + +// GetVariableGroups mocks base method. +func (m *MockTaskAgentClient) GetVariableGroups(arg0 context.Context, arg1 taskagent.GetVariableGroupsArgs) (*[]taskagent.VariableGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVariableGroups", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.VariableGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVariableGroups indicates an expected call of GetVariableGroups. +func (mr *MockTaskAgentClientMockRecorder) GetVariableGroups(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVariableGroups", reflect.TypeOf((*MockTaskAgentClient)(nil).GetVariableGroups), arg0, arg1) +} + +// GetVariableGroupsById mocks base method. +func (m *MockTaskAgentClient) GetVariableGroupsById(arg0 context.Context, arg1 taskagent.GetVariableGroupsByIdArgs) (*[]taskagent.VariableGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVariableGroupsById", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.VariableGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVariableGroupsById indicates an expected call of GetVariableGroupsById. +func (mr *MockTaskAgentClientMockRecorder) GetVariableGroupsById(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVariableGroupsById", reflect.TypeOf((*MockTaskAgentClient)(nil).GetVariableGroupsById), arg0, arg1) +} + +// GetYamlSchema mocks base method. +func (m *MockTaskAgentClient) GetYamlSchema(arg0 context.Context, arg1 taskagent.GetYamlSchemaArgs) (any, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetYamlSchema", arg0, arg1) + ret0, _ := ret[0].(any) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetYamlSchema indicates an expected call of GetYamlSchema. +func (mr *MockTaskAgentClientMockRecorder) GetYamlSchema(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetYamlSchema", reflect.TypeOf((*MockTaskAgentClient)(nil).GetYamlSchema), arg0, arg1) +} + +// ReplaceAgent mocks base method. +func (m *MockTaskAgentClient) ReplaceAgent(arg0 context.Context, arg1 taskagent.ReplaceAgentArgs) (*taskagent.TaskAgent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReplaceAgent", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReplaceAgent indicates an expected call of ReplaceAgent. +func (mr *MockTaskAgentClientMockRecorder) ReplaceAgent(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReplaceAgent", reflect.TypeOf((*MockTaskAgentClient)(nil).ReplaceAgent), arg0, arg1) +} + +// ShareVariableGroup mocks base method. +func (m *MockTaskAgentClient) ShareVariableGroup(arg0 context.Context, arg1 taskagent.ShareVariableGroupArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ShareVariableGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ShareVariableGroup indicates an expected call of ShareVariableGroup. +func (mr *MockTaskAgentClientMockRecorder) ShareVariableGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShareVariableGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).ShareVariableGroup), arg0, arg1) +} + +// UpdateAgent mocks base method. +func (m *MockTaskAgentClient) UpdateAgent(arg0 context.Context, arg1 taskagent.UpdateAgentArgs) (*taskagent.TaskAgent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAgent", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateAgent indicates an expected call of UpdateAgent. +func (mr *MockTaskAgentClientMockRecorder) UpdateAgent(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAgent", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateAgent), arg0, arg1) +} + +// UpdateAgentCloud mocks base method. +func (m *MockTaskAgentClient) UpdateAgentCloud(arg0 context.Context, arg1 taskagent.UpdateAgentCloudArgs) (*taskagent.TaskAgentCloud, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAgentCloud", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentCloud) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateAgentCloud indicates an expected call of UpdateAgentCloud. +func (mr *MockTaskAgentClientMockRecorder) UpdateAgentCloud(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAgentCloud", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateAgentCloud), arg0, arg1) +} + +// UpdateAgentPool mocks base method. +func (m *MockTaskAgentClient) UpdateAgentPool(arg0 context.Context, arg1 taskagent.UpdateAgentPoolArgs) (*taskagent.TaskAgentPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAgentPool", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskAgentPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateAgentPool indicates an expected call of UpdateAgentPool. +func (mr *MockTaskAgentClientMockRecorder) UpdateAgentPool(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAgentPool", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateAgentPool), arg0, arg1) +} + +// UpdateDeploymentGroup mocks base method. +func (m *MockTaskAgentClient) UpdateDeploymentGroup(arg0 context.Context, arg1 taskagent.UpdateDeploymentGroupArgs) (*taskagent.DeploymentGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateDeploymentGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.DeploymentGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateDeploymentGroup indicates an expected call of UpdateDeploymentGroup. +func (mr *MockTaskAgentClientMockRecorder) UpdateDeploymentGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDeploymentGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateDeploymentGroup), arg0, arg1) +} + +// UpdateDeploymentTargets mocks base method. +func (m *MockTaskAgentClient) UpdateDeploymentTargets(arg0 context.Context, arg1 taskagent.UpdateDeploymentTargetsArgs) (*[]taskagent.DeploymentMachine, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateDeploymentTargets", arg0, arg1) + ret0, _ := ret[0].(*[]taskagent.DeploymentMachine) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateDeploymentTargets indicates an expected call of UpdateDeploymentTargets. +func (mr *MockTaskAgentClientMockRecorder) UpdateDeploymentTargets(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDeploymentTargets", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateDeploymentTargets), arg0, arg1) +} + +// UpdateEnvironment mocks base method. +func (m *MockTaskAgentClient) UpdateEnvironment(arg0 context.Context, arg1 taskagent.UpdateEnvironmentArgs) (*taskagent.EnvironmentInstance, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateEnvironment", arg0, arg1) + ret0, _ := ret[0].(*taskagent.EnvironmentInstance) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateEnvironment indicates an expected call of UpdateEnvironment. +func (mr *MockTaskAgentClientMockRecorder) UpdateEnvironment(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEnvironment", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateEnvironment), arg0, arg1) +} + +// UpdateTaskGroup mocks base method. +func (m *MockTaskAgentClient) UpdateTaskGroup(arg0 context.Context, arg1 taskagent.UpdateTaskGroupArgs) (*taskagent.TaskGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTaskGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.TaskGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTaskGroup indicates an expected call of UpdateTaskGroup. +func (mr *MockTaskAgentClientMockRecorder) UpdateTaskGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTaskGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateTaskGroup), arg0, arg1) +} + +// UpdateVariableGroup mocks base method. +func (m *MockTaskAgentClient) UpdateVariableGroup(arg0 context.Context, arg1 taskagent.UpdateVariableGroupArgs) (*taskagent.VariableGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateVariableGroup", arg0, arg1) + ret0, _ := ret[0].(*taskagent.VariableGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateVariableGroup indicates an expected call of UpdateVariableGroup. +func (mr *MockTaskAgentClientMockRecorder) UpdateVariableGroup(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVariableGroup", reflect.TypeOf((*MockTaskAgentClient)(nil).UpdateVariableGroup), arg0, arg1) +} diff --git a/scripts/generate_mocks.sh b/scripts/generate_mocks.sh index 7210745a..7d19502a 100644 --- a/scripts/generate_mocks.sh +++ b/scripts/generate_mocks.sh @@ -59,6 +59,12 @@ mockgen \ -mock_names Client=MockWorkItemTrackingClient \ github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking Client +echo "Generating Azure DevOps TaskAgent client mock..." +mockgen \ + -package=mocks -destination internal/mocks/taskagent_client_mock.go \ + -mock_names Client=MockTaskAgentClient \ + github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent Client + echo "Generating Repository mock..." mockgen -source internal/azdo/repo.go \ -package=mocks -destination internal/mocks/repository_mock.go From c24c87dd2672da9b41740ab173dcf7f764d580b2 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:26:38 +0000 Subject: [PATCH 3/8] feat: add GetVariableGroups REST client Add a raw REST client for the Azure DevOps variable groups endpoint to work around the SDK's mis-shaped response for variable groups.This enables listing variable groups (with continuation) reliably when the taskagent SDK wrapper is insufficient. --- internal/azdo/extensions/extension.go | 3 + internal/azdo/extensions/variablegroups.go | 79 ++++++++++++++++++++++ internal/mocks/extension_mock.go | 17 +++++ 3 files changed, 99 insertions(+) create mode 100644 internal/azdo/extensions/variablegroups.go diff --git a/internal/azdo/extensions/extension.go b/internal/azdo/extensions/extension.go index 31019688..9fd465d2 100644 --- a/internal/azdo/extensions/extension.go +++ b/internal/azdo/extensions/extension.go @@ -11,6 +11,7 @@ import ( "github.com/microsoft/azure-devops-go-api/azuredevops/v7" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/graph" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/identity" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" "github.com/tmeckel/azdo-cli/internal/types" ) @@ -20,6 +21,8 @@ type Client interface { GetSelfID(ctx context.Context) (uuid.UUID, error) // GetSubjectID resolves the storage key (UUID) for a given subject (user) name within the organization. GetSubjectID(ctx context.Context, subject string) (uuid.UUID, error) + // GetVariableGroups fetches variable groups using the raw REST API, returning the continuation token with the response. + GetVariableGroups(ctx context.Context, args taskagent.GetVariableGroupsArgs) (*VariableGroupsResponse, error) // FindGroupsByDisplayName locates Azure DevOps security groups that match the provided display name, // optionally scoped to a project descriptor, and returns their full details. FindGroupsByDisplayName(ctx context.Context, displayName string, scopeDescriptor *string) ([]*graph.GraphGroup, error) diff --git a/internal/azdo/extensions/variablegroups.go b/internal/azdo/extensions/variablegroups.go new file mode 100644 index 00000000..e51c6a93 --- /dev/null +++ b/internal/azdo/extensions/variablegroups.go @@ -0,0 +1,79 @@ +package extensions + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" +) + +// VariableGroupsResponse represents the REST payload returned by +// GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/variablegroups +type VariableGroupsResponse struct { + Count *int `json:"count,omitempty"` + ContinuationToken *string `json:"continuationToken,omitempty"` + Value []taskagent.VariableGroup `json:"value,omitempty"` +} + +// GetVariableGroups issues a raw REST request that mirrors the Azure DevOps GetVariableGroups +// endpoint. The SDK's 7.1 wrapper currently mis-shapes the response body, so we decode the REST +// payload directly and hand the caller the continuation token alongside the variable groups. +func (c *extensionClient) GetVariableGroups(ctx context.Context, args taskagent.GetVariableGroupsArgs) (*VariableGroupsResponse, error) { + if args.Project == nil || strings.TrimSpace(*args.Project) == "" { + return nil, fmt.Errorf("project is required to list variable groups") + } + + baseURL := strings.TrimRight(c.conn.BaseUrl, "/") + project := url.PathEscape(strings.TrimSpace(*args.Project)) + requestURL := fmt.Sprintf("%s/%s/_apis/distributedtask/variablegroups", baseURL, project) + + query := url.Values{} + query.Set("api-version", "7.1") + if args.GroupName != nil && strings.TrimSpace(*args.GroupName) != "" { + query.Set("groupName", strings.TrimSpace(*args.GroupName)) + } + if args.ActionFilter != nil && string(*args.ActionFilter) != "" { + query.Set("actionFilter", string(*args.ActionFilter)) + } + if args.Top != nil { + query.Set("$top", strconv.Itoa(*args.Top)) + } + if args.ContinuationToken != nil { + query.Set("continuationToken", strconv.Itoa(*args.ContinuationToken)) + } + if args.QueryOrder != nil && string(*args.QueryOrder) != "" { + query.Set("queryOrder", string(*args.QueryOrder)) + } + + if encoded := query.Encode(); encoded != "" { + requestURL = fmt.Sprintf("%s?%s", requestURL, encoded) + } + + client := c.conn.GetClientByUrl(requestURL) + req, err := client.CreateRequestMessage(ctx, http.MethodGet, requestURL, "", nil, "", "", nil) + if err != nil { + return nil, err + } + + resp, err := client.SendRequest(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, client.UnwrapError(resp) + } + + var payload VariableGroupsResponse + if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil { + return nil, err + } + + return &payload, nil +} diff --git a/internal/mocks/extension_mock.go b/internal/mocks/extension_mock.go index 0f0a27aa..6ca4054a 100644 --- a/internal/mocks/extension_mock.go +++ b/internal/mocks/extension_mock.go @@ -16,6 +16,8 @@ import ( uuid "github.com/google/uuid" graph "github.com/microsoft/azure-devops-go-api/azuredevops/v7/graph" identity "github.com/microsoft/azure-devops-go-api/azuredevops/v7/identity" + taskagent "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" + extensions "github.com/tmeckel/azdo-cli/internal/azdo/extensions" gomock "go.uber.org/mock/gomock" ) @@ -88,6 +90,21 @@ func (mr *MockAzDOExtensionMockRecorder) GetSubjectID(ctx, subject any) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubjectID", reflect.TypeOf((*MockAzDOExtension)(nil).GetSubjectID), ctx, subject) } +// GetVariableGroups mocks base method. +func (m *MockAzDOExtension) GetVariableGroups(ctx context.Context, args taskagent.GetVariableGroupsArgs) (*extensions.VariableGroupsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVariableGroups", ctx, args) + ret0, _ := ret[0].(*extensions.VariableGroupsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVariableGroups indicates an expected call of GetVariableGroups. +func (mr *MockAzDOExtensionMockRecorder) GetVariableGroups(ctx, args any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVariableGroups", reflect.TypeOf((*MockAzDOExtension)(nil).GetVariableGroups), ctx, args) +} + // ResolveIdentity mocks base method. func (m *MockAzDOExtension) ResolveIdentity(ctx context.Context, member string) (*identity.Identity, error) { m.ctrl.T.Helper() From f119717d1dfdb83b37a85476f62fd77e3a98b8f2 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:29:42 +0000 Subject: [PATCH 4/8] feat: add taskagent client to client factory Introduce support for the Azure DevOps taskagent v7 client by: - adding the taskagent import and TaskAgent method to the ClientFactory - implementing TaskAgent in the client factory to create a taskagent client from a connection --- internal/azdo/connection.go | 2 ++ internal/azdo/factory.go | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/internal/azdo/connection.go b/internal/azdo/connection.go index a0f11b34..51163c7f 100644 --- a/internal/azdo/connection.go +++ b/internal/azdo/connection.go @@ -15,6 +15,7 @@ import ( "github.com/microsoft/azure-devops-go-api/azuredevops/v7/operations" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/security" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/serviceendpoint" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking" "github.com/tmeckel/azdo-cli/internal/azdo/extensions" ) @@ -52,6 +53,7 @@ type ClientFactory interface { Operations(ctx context.Context, organization string) (operations.Client, error) ServiceEndpoint(ctx context.Context, organization string) (serviceendpoint.Client, error) Security(ctx context.Context, organization string) (security.Client, error) + TaskAgent(ctx context.Context, organization string) (taskagent.Client, error) Extensions(ctx context.Context, organization string) (extensions.Client, error) WorkItemTracking(ctx context.Context, organization string) (workitemtracking.Client, error) } diff --git a/internal/azdo/factory.go b/internal/azdo/factory.go index 07e748d2..595c345f 100644 --- a/internal/azdo/factory.go +++ b/internal/azdo/factory.go @@ -11,6 +11,7 @@ import ( "github.com/microsoft/azure-devops-go-api/azuredevops/v7/operations" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/security" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/serviceendpoint" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking" "github.com/tmeckel/azdo-cli/internal/azdo/extensions" "github.com/tmeckel/azdo-cli/internal/config" @@ -23,9 +24,10 @@ type connectionFactory struct { func NewConnectionFactory(cfg config.Config, auth Authenticator) (ConnectionFactory, error) { return &connectionFactory{ - cfg: cfg, - auth: auth, - }, nil + cfg: cfg, + auth: auth, + }, + nil } func (c *connectionFactory) Connection(organization string) (client Connection, err error) { @@ -49,8 +51,9 @@ type clientFactory struct { func NewClientFactory(factory ConnectionFactory) (ClientFactory, error) { return &clientFactory{ - factory: factory, - }, nil + factory: factory, + }, + nil } func (c *clientFactory) Git(ctx context.Context, org string) (git.Client, error) { @@ -109,6 +112,14 @@ func (c *clientFactory) Security(ctx context.Context, org string) (security.Clie return security.NewClient(ctx, conn.(*connectionAdapter).conn), nil } +func (c *clientFactory) TaskAgent(ctx context.Context, org string) (taskagent.Client, error) { + conn, err := c.factory.Connection(org) + if err != nil { + return nil, err + } + return taskagent.NewClient(ctx, conn.(*connectionAdapter).conn) +} + func (c *clientFactory) Extensions(ctx context.Context, org string) (extensions.Client, error) { conn, err := c.factory.Connection(org) if err != nil { From 905834a5304cbbb03744b11abfe7e7b0bf595623 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:30:18 +0000 Subject: [PATCH 5/8] feat(azdo): add GetVariableGroups to loader Add a GetVariableGroups helper to internal/azdo/loader.go that uses the taskagent client to list all variable groups for a given project. --- internal/azdo/loader.go | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/internal/azdo/loader.go b/internal/azdo/loader.go index 22cbd39b..c27bc548 100644 --- a/internal/azdo/loader.go +++ b/internal/azdo/loader.go @@ -4,8 +4,11 @@ import ( "context" "fmt" "strconv" + "strings" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/core" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" + "github.com/tmeckel/azdo-cli/internal/azdo/extensions" ) func GetProjects(ctx context.Context, client core.Client, args core.GetProjectsArgs) ([]core.TeamProjectReference, error) { @@ -39,3 +42,54 @@ func GetProjects(ctx context.Context, client core.Client, args core.GetProjectsA } return result, nil } + +func GetVariableGroups(ctx context.Context, client extensions.Client, args taskagent.GetVariableGroupsArgs) ([]taskagent.VariableGroup, error) { + project := "" + if args.Project != nil { + project = strings.TrimSpace(*args.Project) + } + if project == "" { + return nil, fmt.Errorf("project is required to list variable groups") + } + + var ( + result []taskagent.VariableGroup + nextTokenPointer = args.ContinuationToken + nextTokenValue int + ) + + for { + currentArgs := args + if nextTokenPointer != nil { + currentArgs.ContinuationToken = nextTokenPointer + } else { + currentArgs.ContinuationToken = nil + } + + resp, err := client.GetVariableGroups(ctx, currentArgs) + if err != nil { + return nil, err + } + if resp == nil { + break + } + + if len(resp.Value) > 0 { + result = append(result, resp.Value...) + } + + if resp.ContinuationToken == nil || strings.TrimSpace(*resp.ContinuationToken) == "" { + break + } + + token, err := strconv.Atoi(strings.TrimSpace(*resp.ContinuationToken)) + if err != nil { + return nil, fmt.Errorf("failed to parse continuation token %q to list variable groups: %w", *resp.ContinuationToken, err) + } + + nextTokenValue = token + nextTokenPointer = &nextTokenValue + } + + return result, nil +} From 272756303660feedd84c345a46806dd5edaa34a1 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:30:49 +0000 Subject: [PATCH 6/8] feat: add pipelines variable-groups list command Add a new top-level `pipelines` command and a `variable-groups list` subcommand to list Azure DevOps variable groups for a project. --- internal/cmd/pipelines/pipelines.go | 18 ++ .../cmd/pipelines/variablegroups/list/list.go | 256 ++++++++++++++++++ .../variablegroups/variablegroups.go | 22 ++ internal/cmd/root/root.go | 2 + 4 files changed, 298 insertions(+) create mode 100644 internal/cmd/pipelines/pipelines.go create mode 100644 internal/cmd/pipelines/variablegroups/list/list.go create mode 100644 internal/cmd/pipelines/variablegroups/variablegroups.go diff --git a/internal/cmd/pipelines/pipelines.go b/internal/cmd/pipelines/pipelines.go new file mode 100644 index 00000000..8604659e --- /dev/null +++ b/internal/cmd/pipelines/pipelines.go @@ -0,0 +1,18 @@ +package pipelines + +import ( + "github.com/spf13/cobra" + "github.com/tmeckel/azdo-cli/internal/cmd/pipelines/variablegroups" + "github.com/tmeckel/azdo-cli/internal/cmd/util" +) + +func NewCmd(ctx util.CmdContext) *cobra.Command { + cmd := &cobra.Command{ + Use: "pipelines", + Short: "Manage Azure DevOps pipelines", + Aliases: []string{"p"}, + } + + cmd.AddCommand(variablegroups.NewCmd(ctx)) + return cmd +} diff --git a/internal/cmd/pipelines/variablegroups/list/list.go b/internal/cmd/pipelines/variablegroups/list/list.go new file mode 100644 index 00000000..cb74ad63 --- /dev/null +++ b/internal/cmd/pipelines/variablegroups/list/list.go @@ -0,0 +1,256 @@ +package list + +import ( + "fmt" + "strings" + + "github.com/MakeNowJust/heredoc" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/webapi" + "github.com/spf13/cobra" + "github.com/tmeckel/azdo-cli/internal/azdo" + "github.com/tmeckel/azdo-cli/internal/cmd/util" + "github.com/tmeckel/azdo-cli/internal/types" + "go.uber.org/zap" +) + +type opts struct { + scope string + action string + order string + top int + maxItems int + exporter util.Exporter +} + +type identityJSON struct { + ID string `json:"id,omitempty"` + DisplayName string `json:"displayName,omitempty"` + UniqueName string `json:"uniqueName,omitempty"` +} + +type variableGroupJSON struct { + ID *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + IsShared *bool `json:"isShared,omitempty"` + CreatedBy *identityJSON `json:"createdBy,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + ModifiedBy *identityJSON `json:"modifiedBy,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProjectRefs *[]taskagent.VariableGroupProjectReference `json:"projectReferences,omitempty"` + Variables *map[string]interface{} `json:"variables,omitempty"` +} + +func NewCmd(ctx util.CmdContext) *cobra.Command { + opts := &opts{} + + cmd := &cobra.Command{ + Use: "list [ORGANIZATION/]PROJECT", + Short: "List variable groups", + Long: heredoc.Doc(` + List every variable group defined in a project with optional filtering. + `), + Example: heredoc.Doc(` + # List all variable groups in a project + $ azdo pipelines variable-groups list "my-project" + + # List variable groups with a specific name + $ azdo pipelines variable-groups list "my-project" --name "my-variable-group" + `), + Aliases: []string{ + "ls", + "l", + }, + Args: util.ExactArgs(1, "project argument is required"), + RunE: func(cmd *cobra.Command, args []string) error { + opts.scope = args[0] + return run(ctx, opts) + }, + } + + util.StringEnumFlag(cmd, &opts.action, "action", "", "", []string{"none", "manage", "use"}, "Action filter string (e.g., 'manage', 'use')") + util.StringEnumFlag(cmd, &opts.order, "order", "", "desc", []string{"desc", "asc"}, "Order of variable groups (asc, desc)") + cmd.Flags().IntVar(&opts.top, "top", 0, "Server-side page size hint (positive integer)") + cmd.Flags().IntVar(&opts.maxItems, "max-items", 0, "Optional client-side cap on results; stop fetching once reached") + util.AddJSONFlags(cmd, &opts.exporter, []string{ + "id", + "name", + "type", + "description", + "isShared", + "createdBy", + "createdOn", + "modifiedBy", + "modifiedOn", + "projectReferences", + "variables", + }) + + return cmd +} + +func run(cmdCtx util.CmdContext, opts *opts) error { + ios, err := cmdCtx.IOStreams() + if err != nil { + return err + } + ios.StartProgressIndicator() + defer ios.StopProgressIndicator() + + if opts.top < 0 { + return util.FlagErrorf("invalid --top value %d; must be greater than 0", opts.top) + } + if opts.maxItems < 0 { + return util.FlagErrorf("invalid --max-items value %d; must be greater than 0", opts.maxItems) + } + + scope, err := util.ParseProjectScope(cmdCtx, opts.scope) + if err != nil { + return util.FlagErrorf("invalid project argument: %w", err) + } + + var actionFilter *taskagent.VariableGroupActionFilter + if strings.TrimSpace(opts.action) != "" { + switch strings.ToLower(strings.TrimSpace(opts.action)) { + case "manage": + value := taskagent.VariableGroupActionFilterValues.Manage + actionFilter = &value + case "use": + value := taskagent.VariableGroupActionFilterValues.Use + actionFilter = &value + case "none": + value := taskagent.VariableGroupActionFilterValues.None + actionFilter = &value + default: + return util.FlagErrorf("invalid action %q; expected manage, use, or none", opts.action) + } + } + + var queryOrder taskagent.VariableGroupQueryOrder + switch strings.ToLower(strings.TrimSpace(opts.order)) { + case "", "desc", "iddescending": + queryOrder = taskagent.VariableGroupQueryOrderValues.IdDescending + case "asc", "idascending": + queryOrder = taskagent.VariableGroupQueryOrderValues.IdAscending + default: + return util.FlagErrorf("invalid order %q; expected asc or desc", opts.order) + } + + var top *int + if opts.top > 0 { + top = types.ToPtr(opts.top) + } + + extensionClient, err := cmdCtx.ClientFactory().Extensions(cmdCtx.Context(), scope.Organization) + if err != nil { + return err + } + + getVariableGroupsArgs := taskagent.GetVariableGroupsArgs{ + Project: types.ToPtr(scope.Project), + ActionFilter: actionFilter, + QueryOrder: &queryOrder, + Top: top, + } + + variableGroups, err := azdo.GetVariableGroups(cmdCtx.Context(), extensionClient, getVariableGroupsArgs) + if err != nil { + return err + } + + logger := zap.L() + + if opts.maxItems > 0 && len(variableGroups) > opts.maxItems { + logger.Debug("truncating result set to max-items", zap.Int("maxItems", opts.maxItems)) + variableGroups = variableGroups[:opts.maxItems] + } + + ios.StopProgressIndicator() + + if opts.exporter != nil { + payload := make([]variableGroupJSON, 0, len(variableGroups)) + for _, vg := range variableGroups { + payload = append(payload, newVariableGroupJSON(vg)) + } + return opts.exporter.Write(ios, payload) + } + + tp, err := cmdCtx.Printer("table") + if err != nil { + return err + } + + tp.AddColumns("ID", "NAME", "TYPE", "VARIABLE COUNT", "DESCRIPTION") + + for _, vg := range variableGroups { + id := types.GetValue(vg.Id, 0) + name := types.GetValue(vg.Name, "") + typeVal := types.GetValue(vg.Type, "") + + var variableCount int + if vg.Variables != nil { + variableCount = len(*vg.Variables) + } + + description := types.GetValue(vg.Description, "") + + tp.AddField(fmt.Sprintf("%d", id)) + tp.AddField(name) + tp.AddField(typeVal) + tp.AddField(fmt.Sprintf("%d", variableCount)) + tp.AddField(description) + tp.EndRow() + } + + return tp.Render() +} + +func newVariableGroupJSON(vg taskagent.VariableGroup) variableGroupJSON { + return variableGroupJSON{ + ID: vg.Id, + Name: vg.Name, + Type: vg.Type, + Description: vg.Description, + IsShared: vg.IsShared, + CreatedBy: newIdentityJSON(vg.CreatedBy), + CreatedOn: formatTimePtr(vg.CreatedOn), + ModifiedBy: newIdentityJSON(vg.ModifiedBy), + ModifiedOn: formatTimePtr(vg.ModifiedOn), + ProjectRefs: vg.VariableGroupProjectReferences, + Variables: vg.Variables, + } +} + +func newIdentityJSON(ref *webapi.IdentityRef) *identityJSON { + if ref == nil { + return nil + } + + id := types.GetValue(ref.Id, "") + display := types.GetValue(ref.DisplayName, "") + unique := types.GetValue(ref.UniqueName, "") + + if id == "" && display == "" && unique == "" { + return nil + } + + return &identityJSON{ + ID: id, + DisplayName: display, + UniqueName: unique, + } +} + +func formatTimePtr(ts *azuredevops.Time) *string { + if ts == nil { + return nil + } + formatted := ts.AsQueryParameter() + if strings.TrimSpace(formatted) == "" { + return nil + } + return &formatted +} diff --git a/internal/cmd/pipelines/variablegroups/variablegroups.go b/internal/cmd/pipelines/variablegroups/variablegroups.go new file mode 100644 index 00000000..351a4cc9 --- /dev/null +++ b/internal/cmd/pipelines/variablegroups/variablegroups.go @@ -0,0 +1,22 @@ +package variablegroups + +import ( + "github.com/spf13/cobra" + "github.com/tmeckel/azdo-cli/internal/cmd/pipelines/variablegroups/list" + "github.com/tmeckel/azdo-cli/internal/cmd/util" +) + +func NewCmd(ctx util.CmdContext) *cobra.Command { + cmd := &cobra.Command{ + Use: "variable-groups", + Short: "Manage Azure DevOps variable groups", + Aliases: []string{ + "variable-groups", + "variablegroups", + "vg", + }, + } + + cmd.AddCommand(list.NewCmd(ctx)) + return cmd +} diff --git a/internal/cmd/root/root.go b/internal/cmd/root/root.go index c11dfef6..ec93d683 100644 --- a/internal/cmd/root/root.go +++ b/internal/cmd/root/root.go @@ -11,6 +11,7 @@ import ( "github.com/tmeckel/azdo-cli/internal/cmd/boards" "github.com/tmeckel/azdo-cli/internal/cmd/config" "github.com/tmeckel/azdo-cli/internal/cmd/graph" + "github.com/tmeckel/azdo-cli/internal/cmd/pipelines" "github.com/tmeckel/azdo-cli/internal/cmd/pr" "github.com/tmeckel/azdo-cli/internal/cmd/project" "github.com/tmeckel/azdo-cli/internal/cmd/repo" @@ -95,6 +96,7 @@ func NewCmdRoot(ctx util.CmdContext, version, buildDate string) (*cobra.Command, cmd.AddCommand(security.NewCmd(ctx)) cmd.AddCommand(serviceendpoint.NewCmd(ctx)) cmd.AddCommand(boards.NewCmd(ctx)) + cmd.AddCommand(pipelines.NewCmd(ctx)) // Help topics var referenceCmd *cobra.Command From 9aeb56fc53421b4ecc638aef1b38ecedf54d4457 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:32:16 +0000 Subject: [PATCH 7/8] =?UTF-8?q?docs:=20=F0=9F=93=84add=20azdo=20pipelines?= =?UTF-8?q?=20variable-groups=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new documentation pages for the `azdo pipelines` command and the `azdo pipelines variable-groups` subcommands, including a detailed `list` command reference. --- docs/azdo.md | 1 + docs/azdo_help_reference.md | 40 +++++++++++++ docs/azdo_pipelines.md | 15 +++++ docs/azdo_pipelines_variable-groups.md | 17 ++++++ docs/azdo_pipelines_variable-groups_list.md | 63 +++++++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 docs/azdo_pipelines.md create mode 100644 docs/azdo_pipelines_variable-groups.md create mode 100644 docs/azdo_pipelines_variable-groups_list.md diff --git a/docs/azdo.md b/docs/azdo.md index 52e9daa8..a7716623 100644 --- a/docs/azdo.md +++ b/docs/azdo.md @@ -23,6 +23,7 @@ Work seamlessly with Azure DevOps from the command line. ### Additional commands * [azdo config](./azdo_config.md) +* [azdo pipelines](./azdo_pipelines.md) ### Options diff --git a/docs/azdo_help_reference.md b/docs/azdo_help_reference.md index 51070281..ee72dcd1 100644 --- a/docs/azdo_help_reference.md +++ b/docs/azdo_help_reference.md @@ -190,6 +190,46 @@ Aliases ls ``` +## `azdo pipelines` + +Manage Azure DevOps pipelines + +Aliases + +``` +p +``` + +### `azdo pipelines variable-groups` + +Manage Azure DevOps variable groups + +Aliases + +``` +variable-groups, variablegroups, vg +``` + +#### `azdo pipelines variable-groups list [ORGANIZATION/]PROJECT [flags]` + +List variable groups + +``` + --action string Action filter string (e.g., 'manage', 'use'): {none|manage|use} +-q, --jq expression Filter JSON output using a jq expression + --json fields[=*] Output JSON with the specified fields. Prefix a field with '-' to exclude it. + --max-items int Optional client-side cap on results; stop fetching once reached + --order string Order of variable groups (asc, desc): {desc|asc} (default "desc") +-t, --template string Format JSON output using a Go template; see "azdo help formatting" + --top int Server-side page size hint (positive integer) +``` + +Aliases + +``` +ls, l +``` + ## `azdo pr [flags]` Manage pull requests diff --git a/docs/azdo_pipelines.md b/docs/azdo_pipelines.md new file mode 100644 index 00000000..1c789d02 --- /dev/null +++ b/docs/azdo_pipelines.md @@ -0,0 +1,15 @@ +## Command `azdo pipelines` + +Manage Azure DevOps pipelines + +### Available commands + +* [azdo pipelines variable-groups](./azdo_pipelines_variable-groups.md) + +### ALIASES + +- `p` + +### See also + +* [azdo](./azdo.md) diff --git a/docs/azdo_pipelines_variable-groups.md b/docs/azdo_pipelines_variable-groups.md new file mode 100644 index 00000000..3e36666f --- /dev/null +++ b/docs/azdo_pipelines_variable-groups.md @@ -0,0 +1,17 @@ +## Command `azdo pipelines variable-groups` + +Manage Azure DevOps variable groups + +### Available commands + +* [azdo pipelines variable-groups list](./azdo_pipelines_variable-groups_list.md) + +### ALIASES + +- `variable-groups` +- `variablegroups` +- `vg` + +### See also + +* [azdo pipelines](./azdo_pipelines.md) diff --git a/docs/azdo_pipelines_variable-groups_list.md b/docs/azdo_pipelines_variable-groups_list.md new file mode 100644 index 00000000..7ccb5009 --- /dev/null +++ b/docs/azdo_pipelines_variable-groups_list.md @@ -0,0 +1,63 @@ +## Command `azdo pipelines variable-groups list` + +``` +azdo pipelines variable-groups list [ORGANIZATION/]PROJECT [flags] +``` + +List every variable group defined in a project with optional filtering. + + +### Options + + +* `--action` `string` + + Action filter string (e.g., 'manage', 'use'): {none|manage|use} + +* `-q`, `--jq` `expression` + + Filter JSON output using a jq expression + +* `--json` `fields` + + Output JSON with the specified fields. Prefix a field with '-' to exclude it. + +* `--max-items` `int` (default `0`) + + Optional client-side cap on results; stop fetching once reached + +* `--order` `string` (default `"desc"`) + + Order of variable groups (asc, desc): {desc|asc} + +* `-t`, `--template` `string` + + Format JSON output using a Go template; see "azdo help formatting" + +* `--top` `int` (default `0`) + + Server-side page size hint (positive integer) + + +### ALIASES + +- `ls` +- `l` + +### JSON Fields + +`createdBy`, `createdOn`, `description`, `id`, `isShared`, `modifiedBy`, `modifiedOn`, `name`, `projectReferences`, `type`, `variables` + +### Examples + +```bash +# List all variable groups in a project +$ azdo pipelines variable-groups list "my-project" + +# List variable groups with a specific name +$ azdo pipelines variable-groups list "my-project" --name "my-variable-group" +``` + +### See also + +* [azdo pipelines variable-groups](./azdo_pipelines_variable-groups.md) From 65889d5fc8875292848249e082a81950ec405e20 Mon Sep 17 00:00:00 2001 From: Codex CLI Date: Sat, 15 Nov 2025 15:33:01 +0000 Subject: [PATCH 8/8] chore: clarify JSON output guidance for commands Clarify how commands should register and produce JSON output. Explicitly require the slice passed to util.AddJSONFlags to enumerate every JSON field (matching struct tag names) so consumers can filter reliably. --- AGENTS.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e8c26356..fa4e30a0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -78,12 +78,13 @@ Do not hand-roll HTTP calls if an SDK client can be introduced through this proc ### Implementing Commands with JSON and Table/Plain Output - **JSON and Table/Plain output are handled via separate code paths.** -- Use `util.AddJSONFlags(cmd, &opts.exporter, ...)` in `NewCmd` to register JSON-related flags (`--json`, `--jq`, `--template`). This populates the `opts.exporter` field when a user specifies one of those flags. +- Use `util.AddJSONFlags(cmd, &opts.exporter, ...)` in `NewCmd` to register JSON-related flags (`--json`, `--jq`, `--template`). This populates the `opts.exporter` field when a user specifies one of those flags. The string slice you pass **must** list every JSON field you expose (matching the struct tag names) so users can filter output predictably. - **JSON Output Logic:** - In the command's `run...` function, check if `opts.exporter != nil`. - If true, this indicates the user wants JSON output. - - Create and populate a struct (either named or anonymous) with the data to be exported. This struct should have `json:"..."` tags. + - Define a dedicated view struct (or slice of structs) that represents the JSON surface you intend to support. Field names must match the strings you register with `util.AddJSONFlags` and every optional field should use a pointer type with `json:"...,omitempty"` so unset values disappear from the payload. + - Populate that view struct from the SDK model (write small helper functions when mapping requires normalization—e.g., formatting `azuredevops.Time`, collapsing identities, adding derived counts). Avoid returning the raw SDK types directly; surface only the columns you are committed to supporting. - Call `opts.exporter.Write(ios, result)` to serialize the struct and print it. - **Table/Plain Output Logic:** @@ -176,12 +177,12 @@ Do not hand-roll HTTP calls if an SDK client can be introduced through this proc ### Implementing Commands with JSON and Table/Plain Output - **JSON and Table/Plain output are handled via separate code paths.** -- Use `util.AddJSONFlags(cmd, &opts.exporter, ...)` in `NewCmd` to register JSON-related flags (`--json`, `--jq`, `--template`). This populates the `opts.exporter` field when a user specifies one of those flags. +- Use `util.AddJSONFlags(cmd, &opts.exporter, ...)` in `NewCmd` to register JSON-related flags (`--json`, `--jq`, `--template`). This populates the `opts.exporter` field when a user specifies one of those flags, and the provided slice must enumerate every JSON field (matching the struct tags) that the command supports so consumers can filter reliably. - **JSON Output Logic:** - In the command's `run...` function, check if `opts.exporter != nil`. - If true, this indicates the user wants JSON output. - - Create and populate a struct (either named or anonymous) with the data to be exported. This struct should have `json:"..."` tags. If there are optional fields in the struct use a pointer type and add `omitempty` to the JSON tag. + - Define a dedicated view struct (or slice of structs) with explicit `json:"..."` tags and register the matching field names with `util.AddJSONFlags`. Use pointer types plus `omitempty` for optional fields so unset data is omitted, and map values from the SDK into this view (formatting times, flattening identities, computing derived helpers). Do not expose raw SDK structs in the JSON response. - Call `opts.exporter.Write(ios, result)` to serialize the struct and print it. - **Table/Plain Output Logic:**