mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
3885
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/build/client.go
generated
vendored
3885
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/build/client.go
generated
vendored
File diff suppressed because it is too large
Load Diff
989
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/core/client.go
generated
vendored
989
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/core/client.go
generated
vendored
File diff suppressed because it is too large
Load Diff
6318
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/git/client.go
generated
vendored
6318
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/git/client.go
generated
vendored
File diff suppressed because it is too large
Load Diff
6
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/git/models.go
generated
vendored
6
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/git/models.go
generated
vendored
@@ -1454,7 +1454,7 @@ type GitPullRequestCompletionOptions struct {
|
||||
MergeCommitMessage *string `json:"mergeCommitMessage,omitempty"`
|
||||
// Specify the strategy used to merge the pull request during completion. If MergeStrategy is not set to any value, a no-FF merge will be created if SquashMerge == false. If MergeStrategy is not set to any value, the pull request commits will be squash if SquashMerge == true. The SquashMerge member is deprecated. It is recommended that you explicitly set MergeStrategy in all cases. If an explicit value is provided for MergeStrategy, the SquashMerge member will be ignored.
|
||||
MergeStrategy *GitPullRequestMergeStrategy `json:"mergeStrategy,omitempty"`
|
||||
// SquashMerge is deprecated. You should explicity set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true.
|
||||
// SquashMerge is deprecated. You should explicitly set the value of MergeStrategy. If MergeStrategy is set to any value, the SquashMerge value will be ignored. If MergeStrategy is not set, the merge strategy will be no-fast-forward if this flag is false, or squash if true.
|
||||
SquashMerge *bool `json:"squashMerge,omitempty"`
|
||||
// If true, we will attempt to transition any work items linked to the pull request into the next logical state (i.e. Active -> Resolved)
|
||||
TransitionWorkItems *bool `json:"transitionWorkItems,omitempty"`
|
||||
@@ -2162,7 +2162,7 @@ type GitTemplate struct {
|
||||
type GitTreeDiff struct {
|
||||
// ObjectId of the base tree of this diff.
|
||||
BaseTreeId *string `json:"baseTreeId,omitempty"`
|
||||
// List of tree entries that differ between the base and target tree. Renames and object type changes are returned as a delete for the old object and add for the new object. If a continuation token is returned in the response header, some tree entries are yet to be processed and may yeild more diff entries. If the continuation token is not returned all the diff entries have been included in this response.
|
||||
// List of tree entries that differ between the base and target tree. Renames and object type changes are returned as a delete for the old object and add for the new object. If a continuation token is returned in the response header, some tree entries are yet to be processed and may yield more diff entries. If the continuation token is not returned all the diff entries have been included in this response.
|
||||
DiffEntries *[]GitTreeDiffEntry `json:"diffEntries,omitempty"`
|
||||
// ObjectId of the target tree of this diff.
|
||||
TargetTreeId *string `json:"targetTreeId,omitempty"`
|
||||
@@ -2518,7 +2518,7 @@ var PullRequestStatusValues = pullRequestStatusValuesType{
|
||||
Abandoned: "abandoned",
|
||||
// Pull request is completed.
|
||||
Completed: "completed",
|
||||
// Used in pull request search criterias to include all statuses.
|
||||
// Used in pull request search criteria to include all statuses.
|
||||
All: "all",
|
||||
}
|
||||
|
||||
|
||||
992
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/identity/client.go
generated
vendored
992
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/identity/client.go
generated
vendored
File diff suppressed because it is too large
Load Diff
13
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/operations/client.go
generated
vendored
13
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/operations/client.go
generated
vendored
@@ -16,19 +16,24 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
type Client interface {
|
||||
// Gets an operation from the the operationId using the given pluginId.
|
||||
GetOperation(context.Context, GetOperationArgs) (*Operation, error)
|
||||
}
|
||||
|
||||
type ClientImpl struct {
|
||||
Client azuredevops.Client
|
||||
}
|
||||
|
||||
func NewClient(ctx context.Context, connection *azuredevops.Connection) *Client {
|
||||
func NewClient(ctx context.Context, connection *azuredevops.Connection) Client {
|
||||
client := connection.GetClientByUrl(connection.BaseUrl)
|
||||
return &Client{
|
||||
return &ClientImpl{
|
||||
Client: *client,
|
||||
}
|
||||
}
|
||||
|
||||
// Gets an operation from the the operationId using the given pluginId.
|
||||
func (client *Client) GetOperation(ctx context.Context, args GetOperationArgs) (*Operation, error) {
|
||||
func (client *ClientImpl) GetOperation(ctx context.Context, args GetOperationArgs) (*Operation, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.OperationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.OperationId"}
|
||||
|
||||
359
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/policy/client.go
generated
vendored
359
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/policy/client.go
generated
vendored
@@ -21,22 +21,49 @@ import (
|
||||
|
||||
var ResourceAreaId, _ = uuid.Parse("fb13a388-40dd-4a04-b530-013a739c72ef")
|
||||
|
||||
type Client struct {
|
||||
type Client interface {
|
||||
// Create a policy configuration of a given policy type.
|
||||
CreatePolicyConfiguration(context.Context, CreatePolicyConfigurationArgs) (*PolicyConfiguration, error)
|
||||
// Delete a policy configuration by its ID.
|
||||
DeletePolicyConfiguration(context.Context, DeletePolicyConfigurationArgs) error
|
||||
// Get a policy configuration by its ID.
|
||||
GetPolicyConfiguration(context.Context, GetPolicyConfigurationArgs) (*PolicyConfiguration, error)
|
||||
// Retrieve a specific revision of a given policy by ID.
|
||||
GetPolicyConfigurationRevision(context.Context, GetPolicyConfigurationRevisionArgs) (*PolicyConfiguration, error)
|
||||
// Retrieve all revisions for a given policy.
|
||||
GetPolicyConfigurationRevisions(context.Context, GetPolicyConfigurationRevisionsArgs) (*[]PolicyConfiguration, error)
|
||||
// Get a list of policy configurations in a project.
|
||||
GetPolicyConfigurations(context.Context, GetPolicyConfigurationsArgs) (*GetPolicyConfigurationsResponseValue, error)
|
||||
// [Preview API] Gets the present evaluation state of a policy.
|
||||
GetPolicyEvaluation(context.Context, GetPolicyEvaluationArgs) (*PolicyEvaluationRecord, error)
|
||||
// [Preview API] Retrieves a list of all the policy evaluation statuses for a specific pull request.
|
||||
GetPolicyEvaluations(context.Context, GetPolicyEvaluationsArgs) (*[]PolicyEvaluationRecord, error)
|
||||
// Retrieve a specific policy type by ID.
|
||||
GetPolicyType(context.Context, GetPolicyTypeArgs) (*PolicyType, error)
|
||||
// Retrieve all available policy types.
|
||||
GetPolicyTypes(context.Context, GetPolicyTypesArgs) (*[]PolicyType, error)
|
||||
// [Preview API] Requeue the policy evaluation.
|
||||
RequeuePolicyEvaluation(context.Context, RequeuePolicyEvaluationArgs) (*PolicyEvaluationRecord, error)
|
||||
// Update a policy configuration by its ID.
|
||||
UpdatePolicyConfiguration(context.Context, UpdatePolicyConfigurationArgs) (*PolicyConfiguration, error)
|
||||
}
|
||||
|
||||
type ClientImpl struct {
|
||||
Client azuredevops.Client
|
||||
}
|
||||
|
||||
func NewClient(ctx context.Context, connection *azuredevops.Connection) (*Client, error) {
|
||||
func NewClient(ctx context.Context, connection *azuredevops.Connection) (Client, error) {
|
||||
client, err := connection.GetClientByResourceAreaId(ctx, ResourceAreaId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Client{
|
||||
return &ClientImpl{
|
||||
Client: *client,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Create a policy configuration of a given policy type.
|
||||
func (client *Client) CreatePolicyConfiguration(ctx context.Context, args CreatePolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
func (client *ClientImpl) CreatePolicyConfiguration(ctx context.Context, args CreatePolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
if args.Configuration == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Configuration"}
|
||||
}
|
||||
@@ -75,7 +102,7 @@ type CreatePolicyConfigurationArgs struct {
|
||||
}
|
||||
|
||||
// Delete a policy configuration by its ID.
|
||||
func (client *Client) DeletePolicyConfiguration(ctx context.Context, args DeletePolicyConfigurationArgs) error {
|
||||
func (client *ClientImpl) DeletePolicyConfiguration(ctx context.Context, args DeletePolicyConfigurationArgs) error {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -104,7 +131,7 @@ type DeletePolicyConfigurationArgs struct {
|
||||
}
|
||||
|
||||
// Get a policy configuration by its ID.
|
||||
func (client *Client) GetPolicyConfiguration(ctx context.Context, args GetPolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
func (client *ClientImpl) GetPolicyConfiguration(ctx context.Context, args GetPolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -134,8 +161,87 @@ type GetPolicyConfigurationArgs struct {
|
||||
ConfigurationId *int
|
||||
}
|
||||
|
||||
// Retrieve a specific revision of a given policy by ID.
|
||||
func (client *ClientImpl) GetPolicyConfigurationRevision(ctx context.Context, args GetPolicyConfigurationRevisionArgs) (*PolicyConfiguration, 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.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
if args.RevisionId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.RevisionId"}
|
||||
}
|
||||
routeValues["revisionId"] = strconv.Itoa(*args.RevisionId)
|
||||
|
||||
locationId, _ := uuid.Parse("fe1e68a2-60d3-43cb-855b-85e41ae97c95")
|
||||
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyConfiguration
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the GetPolicyConfigurationRevision function
|
||||
type GetPolicyConfigurationRevisionArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) The policy configuration ID.
|
||||
ConfigurationId *int
|
||||
// (required) The revision ID.
|
||||
RevisionId *int
|
||||
}
|
||||
|
||||
// Retrieve all revisions for a given policy.
|
||||
func (client *ClientImpl) GetPolicyConfigurationRevisions(ctx context.Context, args GetPolicyConfigurationRevisionsArgs) (*[]PolicyConfiguration, 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.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
|
||||
queryParams := url.Values{}
|
||||
if args.Top != nil {
|
||||
queryParams.Add("$top", strconv.Itoa(*args.Top))
|
||||
}
|
||||
if args.Skip != nil {
|
||||
queryParams.Add("$skip", strconv.Itoa(*args.Skip))
|
||||
}
|
||||
locationId, _ := uuid.Parse("fe1e68a2-60d3-43cb-855b-85e41ae97c95")
|
||||
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue []PolicyConfiguration
|
||||
err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the GetPolicyConfigurationRevisions function
|
||||
type GetPolicyConfigurationRevisionsArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) The policy configuration ID.
|
||||
ConfigurationId *int
|
||||
// (optional) The number of revisions to retrieve.
|
||||
Top *int
|
||||
// (optional) The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
|
||||
Skip *int
|
||||
}
|
||||
|
||||
// Get a list of policy configurations in a project.
|
||||
func (client *Client) GetPolicyConfigurations(ctx context.Context, args GetPolicyConfigurationsArgs) (*GetPolicyConfigurationsResponseValue, error) {
|
||||
func (client *ClientImpl) GetPolicyConfigurations(ctx context.Context, args GetPolicyConfigurationsArgs) (*GetPolicyConfigurationsResponseValue, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -146,6 +252,12 @@ func (client *Client) GetPolicyConfigurations(ctx context.Context, args GetPolic
|
||||
if args.Scope != nil {
|
||||
queryParams.Add("scope", *args.Scope)
|
||||
}
|
||||
if args.Top != nil {
|
||||
queryParams.Add("$top", strconv.Itoa(*args.Top))
|
||||
}
|
||||
if args.ContinuationToken != nil {
|
||||
queryParams.Add("continuationToken", *args.ContinuationToken)
|
||||
}
|
||||
if args.PolicyType != nil {
|
||||
queryParams.Add("policyType", (*args.PolicyType).String())
|
||||
}
|
||||
@@ -167,6 +279,10 @@ type GetPolicyConfigurationsArgs struct {
|
||||
Project *string
|
||||
// (optional) [Provided for legacy reasons] The scope on which a subset of policies is defined.
|
||||
Scope *string
|
||||
// (optional) Maximum number of policies to return.
|
||||
Top *int
|
||||
// (optional) The continuation token used for pagination.
|
||||
ContinuationToken *string
|
||||
// (optional) Filter returned policies to only this type
|
||||
PolicyType *uuid.UUID
|
||||
}
|
||||
@@ -178,48 +294,8 @@ type GetPolicyConfigurationsResponseValue struct {
|
||||
ContinuationToken string
|
||||
}
|
||||
|
||||
// Update a policy configuration by its ID.
|
||||
func (client *Client) UpdatePolicyConfiguration(ctx context.Context, args UpdatePolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
if args.Configuration == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Configuration"}
|
||||
}
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
}
|
||||
routeValues["project"] = *args.Project
|
||||
if args.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
|
||||
body, marshalErr := json.Marshal(*args.Configuration)
|
||||
if marshalErr != nil {
|
||||
return nil, marshalErr
|
||||
}
|
||||
locationId, _ := uuid.Parse("dad91cbe-d183-45f8-9c6e-9c1164472121")
|
||||
resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "5.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyConfiguration
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the UpdatePolicyConfiguration function
|
||||
type UpdatePolicyConfigurationArgs struct {
|
||||
// (required) The policy configuration to update.
|
||||
Configuration *PolicyConfiguration
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) ID of the existing policy configuration to be updated.
|
||||
ConfigurationId *int
|
||||
}
|
||||
|
||||
// [Preview API] Gets the present evaluation state of a policy.
|
||||
func (client *Client) GetPolicyEvaluation(ctx context.Context, args GetPolicyEvaluationArgs) (*PolicyEvaluationRecord, error) {
|
||||
func (client *ClientImpl) GetPolicyEvaluation(ctx context.Context, args GetPolicyEvaluationArgs) (*PolicyEvaluationRecord, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -249,39 +325,8 @@ type GetPolicyEvaluationArgs struct {
|
||||
EvaluationId *uuid.UUID
|
||||
}
|
||||
|
||||
// [Preview API] Requeue the policy evaluation.
|
||||
func (client *Client) RequeuePolicyEvaluation(ctx context.Context, args RequeuePolicyEvaluationArgs) (*PolicyEvaluationRecord, 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.EvaluationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EvaluationId"}
|
||||
}
|
||||
routeValues["evaluationId"] = (*args.EvaluationId).String()
|
||||
|
||||
locationId, _ := uuid.Parse("46aecb7a-5d2c-4647-897b-0209505a9fe4")
|
||||
resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyEvaluationRecord
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the RequeuePolicyEvaluation function
|
||||
type RequeuePolicyEvaluationArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) ID of the policy evaluation to be retrieved.
|
||||
EvaluationId *uuid.UUID
|
||||
}
|
||||
|
||||
// [Preview API] Retrieves a list of all the policy evaluation statuses for a specific pull request.
|
||||
func (client *Client) GetPolicyEvaluations(ctx context.Context, args GetPolicyEvaluationsArgs) (*[]PolicyEvaluationRecord, error) {
|
||||
func (client *ClientImpl) GetPolicyEvaluations(ctx context.Context, args GetPolicyEvaluationsArgs) (*[]PolicyEvaluationRecord, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -327,87 +372,8 @@ type GetPolicyEvaluationsArgs struct {
|
||||
Skip *int
|
||||
}
|
||||
|
||||
// Retrieve a specific revision of a given policy by ID.
|
||||
func (client *Client) GetPolicyConfigurationRevision(ctx context.Context, args GetPolicyConfigurationRevisionArgs) (*PolicyConfiguration, 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.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
if args.RevisionId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.RevisionId"}
|
||||
}
|
||||
routeValues["revisionId"] = strconv.Itoa(*args.RevisionId)
|
||||
|
||||
locationId, _ := uuid.Parse("fe1e68a2-60d3-43cb-855b-85e41ae97c95")
|
||||
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyConfiguration
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the GetPolicyConfigurationRevision function
|
||||
type GetPolicyConfigurationRevisionArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) The policy configuration ID.
|
||||
ConfigurationId *int
|
||||
// (required) The revision ID.
|
||||
RevisionId *int
|
||||
}
|
||||
|
||||
// Retrieve all revisions for a given policy.
|
||||
func (client *Client) GetPolicyConfigurationRevisions(ctx context.Context, args GetPolicyConfigurationRevisionsArgs) (*[]PolicyConfiguration, 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.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
|
||||
queryParams := url.Values{}
|
||||
if args.Top != nil {
|
||||
queryParams.Add("$top", strconv.Itoa(*args.Top))
|
||||
}
|
||||
if args.Skip != nil {
|
||||
queryParams.Add("$skip", strconv.Itoa(*args.Skip))
|
||||
}
|
||||
locationId, _ := uuid.Parse("fe1e68a2-60d3-43cb-855b-85e41ae97c95")
|
||||
resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue []PolicyConfiguration
|
||||
err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the GetPolicyConfigurationRevisions function
|
||||
type GetPolicyConfigurationRevisionsArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) The policy configuration ID.
|
||||
ConfigurationId *int
|
||||
// (optional) The number of revisions to retrieve.
|
||||
Top *int
|
||||
// (optional) The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.
|
||||
Skip *int
|
||||
}
|
||||
|
||||
// Retrieve a specific policy type by ID.
|
||||
func (client *Client) GetPolicyType(ctx context.Context, args GetPolicyTypeArgs) (*PolicyType, error) {
|
||||
func (client *ClientImpl) GetPolicyType(ctx context.Context, args GetPolicyTypeArgs) (*PolicyType, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -438,7 +404,7 @@ type GetPolicyTypeArgs struct {
|
||||
}
|
||||
|
||||
// Retrieve all available policy types.
|
||||
func (client *Client) GetPolicyTypes(ctx context.Context, args GetPolicyTypesArgs) (*[]PolicyType, error) {
|
||||
func (client *ClientImpl) GetPolicyTypes(ctx context.Context, args GetPolicyTypesArgs) (*[]PolicyType, error) {
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
@@ -461,3 +427,74 @@ type GetPolicyTypesArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
}
|
||||
|
||||
// [Preview API] Requeue the policy evaluation.
|
||||
func (client *ClientImpl) RequeuePolicyEvaluation(ctx context.Context, args RequeuePolicyEvaluationArgs) (*PolicyEvaluationRecord, 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.EvaluationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.EvaluationId"}
|
||||
}
|
||||
routeValues["evaluationId"] = (*args.EvaluationId).String()
|
||||
|
||||
locationId, _ := uuid.Parse("46aecb7a-5d2c-4647-897b-0209505a9fe4")
|
||||
resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyEvaluationRecord
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the RequeuePolicyEvaluation function
|
||||
type RequeuePolicyEvaluationArgs struct {
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) ID of the policy evaluation to be retrieved.
|
||||
EvaluationId *uuid.UUID
|
||||
}
|
||||
|
||||
// Update a policy configuration by its ID.
|
||||
func (client *ClientImpl) UpdatePolicyConfiguration(ctx context.Context, args UpdatePolicyConfigurationArgs) (*PolicyConfiguration, error) {
|
||||
if args.Configuration == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Configuration"}
|
||||
}
|
||||
routeValues := make(map[string]string)
|
||||
if args.Project == nil || *args.Project == "" {
|
||||
return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"}
|
||||
}
|
||||
routeValues["project"] = *args.Project
|
||||
if args.ConfigurationId == nil {
|
||||
return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.ConfigurationId"}
|
||||
}
|
||||
routeValues["configurationId"] = strconv.Itoa(*args.ConfigurationId)
|
||||
|
||||
body, marshalErr := json.Marshal(*args.Configuration)
|
||||
if marshalErr != nil {
|
||||
return nil, marshalErr
|
||||
}
|
||||
locationId, _ := uuid.Parse("dad91cbe-d183-45f8-9c6e-9c1164472121")
|
||||
resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "5.1", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var responseValue PolicyConfiguration
|
||||
err = client.Client.UnmarshalBody(resp, &responseValue)
|
||||
return &responseValue, err
|
||||
}
|
||||
|
||||
// Arguments for the UpdatePolicyConfiguration function
|
||||
type UpdatePolicyConfigurationArgs struct {
|
||||
// (required) The policy configuration to update.
|
||||
Configuration *PolicyConfiguration
|
||||
// (required) Project ID or project name
|
||||
Project *string
|
||||
// (required) ID of the existing policy configuration to be updated.
|
||||
ConfigurationId *int
|
||||
}
|
||||
|
||||
2291
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/test/client.go
generated
vendored
2291
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/test/client.go
generated
vendored
File diff suppressed because it is too large
Load Diff
2
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/test/models.go
generated
vendored
2
vendor/github.com/Microsoft/azure-devops-go-api/azuredevops/test/models.go
generated
vendored
@@ -238,7 +238,7 @@ type CloneOperationInformation struct {
|
||||
SourcePlan *ShallowReference `json:"sourcePlan,omitempty"`
|
||||
// Shallow reference of the source
|
||||
SourceProject *ShallowReference `json:"sourceProject,omitempty"`
|
||||
// Current state of the operation. When State reaches Suceeded or Failed, the operation is complete
|
||||
// Current state of the operation. When State reaches Succeeded or Failed, the operation is complete
|
||||
State *CloneOperationState `json:"state,omitempty"`
|
||||
// Url for getting the clone information
|
||||
Url *string `json:"url,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user