diff --git a/Makefile b/Makefile index a01929e9..6f10a345 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ fmt: ## format source with gofumpt .PHONY: lint lint: ## lint source @echo "Check for golangci-lint"; [ -e "$(shell which golangci-lint)" ] - @echo "Executing golangci-lint"; golangci-lint run -v --timeout $(TIMEOUT) ./internal + @echo "Executing golangci-lint"; golangci-lint run -v --timeout $(TIMEOUT) ./internal/... .PHONY: test test: ## run unit tests with gotestsum diff --git a/docs/azdo_boards_area.md b/docs/azdo_boards_area.md index 37867cef..c36babaa 100644 --- a/docs/azdo_boards_area.md +++ b/docs/azdo_boards_area.md @@ -5,6 +5,7 @@ Manage area paths used by Azure Boards. ### Available commands * [azdo boards area project](./azdo_boards_area_project.md) +* [azdo boards area team](./azdo_boards_area_team.md) ### ALIASES diff --git a/docs/azdo_boards_area_team.md b/docs/azdo_boards_area_team.md new file mode 100644 index 00000000..9b4427bb --- /dev/null +++ b/docs/azdo_boards_area_team.md @@ -0,0 +1,25 @@ +## Command `azdo boards area team` + +Manage area paths scoped to a team. + +### Available commands + +* [azdo boards area team list](./azdo_boards_area_team_list.md) + +### ALIASES + +- `t` + +### Examples + +```bash +# List team area paths for a project in the default organization +azdo boards area team list Fabrikam/"My Team" + +# List team area paths for a project in a specific organization +azdo boards area team list myOrg/Fabrikam/"My Team" +``` + +### See also + +* [azdo boards area](./azdo_boards_area.md) diff --git a/docs/azdo_boards_area_team_list.md b/docs/azdo_boards_area_team_list.md new file mode 100644 index 00000000..cd5c7609 --- /dev/null +++ b/docs/azdo_boards_area_team_list.md @@ -0,0 +1,50 @@ +## Command `azdo boards area team list` + +``` +azdo boards area team list [ORGANIZATION/]PROJECT/TEAM [flags] +``` + +List Azure Boards area paths assigned to a team. The TEAM argument accepts +the ID (GUID) or name of the team. The argument accepts the form +[ORGANIZATION/]PROJECT/TEAM. When the organization segment is omitted, +the default organization from configuration is used. + + +### Options + + +* `-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. + +* `-t`, `--template` `string` + + Format JSON output using a Go template; see "azdo help formatting" + + +### ALIASES + +- `ls` +- `l` + +### JSON Fields + +`areaPath`, `includeChildren`, `isDefault` + +### Examples + +```bash +# List area paths for a team using the default organization +azdo boards area team list Fabrikam/"Fabrikam Engineering" + +# List area paths for a team in a specific organization +azdo boards area team list MyOrg/Fabrikam/"My Team" +``` + +### See also + +* [azdo boards area team](./azdo_boards_area_team.md) diff --git a/docs/azdo_help_reference.md b/docs/azdo_help_reference.md index c8c8fc51..b3848368 100644 --- a/docs/azdo_help_reference.md +++ b/docs/azdo_help_reference.md @@ -81,6 +81,32 @@ Aliases ls, l ``` +#### `azdo boards area team ` + +Manage area paths scoped to a team. + +Aliases + +``` +t +``` + +##### `azdo boards area team list [ORGANIZATION/]PROJECT/TEAM [flags]` + +List area paths assigned to a team. + +``` +-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. +-t, --template string Format JSON output using a Go template; see "azdo help formatting" +``` + +Aliases + +``` +ls, l +``` + ### `azdo boards iteration ` Work with iteration/classification nodes. diff --git a/internal/azdo/connection.go b/internal/azdo/connection.go index 91266edf..25e58088 100644 --- a/internal/azdo/connection.go +++ b/internal/azdo/connection.go @@ -18,6 +18,7 @@ import ( "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/work" "github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking" "github.com/tmeckel/azdo-cli/internal/azdo/extensions" ) @@ -59,5 +60,6 @@ type ClientFactory interface { 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) + Work(ctx context.Context, organization string) (work.Client, error) WorkItemTracking(ctx context.Context, organization string) (workitemtracking.Client, error) } diff --git a/internal/azdo/factory.go b/internal/azdo/factory.go index e8a14889..babb1715 100644 --- a/internal/azdo/factory.go +++ b/internal/azdo/factory.go @@ -14,6 +14,7 @@ import ( "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/work" "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" @@ -146,6 +147,14 @@ func (c *clientFactory) Extensions(ctx context.Context, org string) (extensions. return extensions.NewClient(ctx, conn.(*connectionAdapter).conn), nil } +func (c *clientFactory) Work(ctx context.Context, org string) (work.Client, error) { + conn, err := c.factory.Connection(org) + if err != nil { + return nil, err + } + return work.NewClient(ctx, conn.(*connectionAdapter).conn) +} + func (c *clientFactory) WorkItemTracking(ctx context.Context, org string) (workitemtracking.Client, error) { conn, err := c.factory.Connection(org) if err != nil { diff --git a/internal/cmd/boards/area/area.go b/internal/cmd/boards/area/area.go index 653ce267..1c69f912 100644 --- a/internal/cmd/boards/area/area.go +++ b/internal/cmd/boards/area/area.go @@ -3,7 +3,8 @@ package area import ( "github.com/MakeNowJust/heredoc/v2" "github.com/spf13/cobra" - projectcmd "github.com/tmeckel/azdo-cli/internal/cmd/boards/area/project" + "github.com/tmeckel/azdo-cli/internal/cmd/boards/area/project" + "github.com/tmeckel/azdo-cli/internal/cmd/boards/area/team" "github.com/tmeckel/azdo-cli/internal/cmd/util" ) @@ -21,7 +22,8 @@ func NewCmd(ctx util.CmdContext) *cobra.Command { }, } - cmd.AddCommand(projectcmd.NewCmd(ctx)) + cmd.AddCommand(project.NewCmd(ctx)) + cmd.AddCommand(team.NewCmd(ctx)) return cmd } diff --git a/internal/cmd/boards/area/team/list/list.go b/internal/cmd/boards/area/team/list/list.go new file mode 100644 index 00000000..13ec7a8f --- /dev/null +++ b/internal/cmd/boards/area/team/list/list.go @@ -0,0 +1,148 @@ +package list + +import ( + "fmt" + "sort" + "strings" + + "github.com/MakeNowJust/heredoc/v2" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/work" + "github.com/spf13/cobra" + + "github.com/tmeckel/azdo-cli/internal/cmd/util" + "github.com/tmeckel/azdo-cli/internal/types" +) + +type listOptions struct { + targetArg string + exporter util.Exporter +} + +type teamFieldValueView struct { + AreaPath string `json:"areaPath"` + IncludeChildren bool `json:"includeChildren"` + IsDefault bool `json:"isDefault"` +} + +func NewCmd(ctx util.CmdContext) *cobra.Command { + opts := &listOptions{} + + cmd := &cobra.Command{ + Use: "list [ORGANIZATION/]PROJECT/TEAM", + Short: "List area paths assigned to a team.", + Long: heredoc.Doc(` + List Azure Boards area paths assigned to a team. The TEAM argument accepts + the ID (GUID) or name of the team. The argument accepts the form + [ORGANIZATION/]PROJECT/TEAM. When the organization segment is omitted, + the default organization from configuration is used. + `), + Example: heredoc.Doc(` + # List area paths for a team using the default organization + azdo boards area team list Fabrikam/"Fabrikam Engineering" + + # List area paths for a team in a specific organization + azdo boards area team list MyOrg/Fabrikam/"My Team" + `), + Aliases: []string{"ls", "l"}, + Args: util.ExactArgs(1, "team argument required"), + RunE: func(cmd *cobra.Command, args []string) error { + opts.targetArg = args[0] + return runList(ctx, opts) + }, + } + + util.AddJSONFlags(cmd, &opts.exporter, []string{"areaPath", "includeChildren", "isDefault"}) + + return cmd +} + +func runList(ctx util.CmdContext, opts *listOptions) error { + ios, err := ctx.IOStreams() + if err != nil { + return err + } + + ios.StartProgressIndicator() + defer ios.StopProgressIndicator() + + scope, err := util.ParseProjectTargetWithDefaultOrganization(ctx, opts.targetArg) + if err != nil { + return util.FlagErrorWrap(err) + } + + client, err := ctx.ClientFactory().Work(ctx.Context(), scope.Organization) + if err != nil { + return fmt.Errorf("failed to create Work client: %w", err) + } + + teamFieldValues, err := client.GetTeamFieldValues(ctx.Context(), work.GetTeamFieldValuesArgs{ + Project: &scope.Project, + Team: &scope.Targets[0], + }) + if err != nil { + return fmt.Errorf("failed to fetch team field values: %w", err) + } + + ios.StopProgressIndicator() + + if opts.exporter != nil { + return opts.exporter.Write(ios, buildView(teamFieldValues)) + } + + return renderTable(ctx, teamFieldValues) +} + +func buildView(tfv *work.TeamFieldValues) []teamFieldValueView { + if tfv == nil || tfv.Values == nil { + return nil + } + + defaultValue := types.GetValue(tfv.DefaultValue, "") + + views := make([]teamFieldValueView, 0, len(*tfv.Values)) + for _, v := range *tfv.Values { + areaPath := types.GetValue(v.Value, "") + views = append(views, teamFieldValueView{ + AreaPath: areaPath, + IncludeChildren: types.GetValue(v.IncludeChildren, false), + IsDefault: strings.EqualFold(areaPath, defaultValue), + }) + } + + sort.Slice(views, func(i, j int) bool { + return strings.ToLower(views[i].AreaPath) < strings.ToLower(views[j].AreaPath) + }) + + return views +} + +func renderTable(ctx util.CmdContext, tfv *work.TeamFieldValues) error { + views := buildView(tfv) + if len(views) == 0 { + return util.NewNoResultsError("no team area paths found") + } + + tp, err := ctx.Printer("list") + if err != nil { + return err + } + + tp.AddColumns("AREA PATH", "INCLUDE SUB AREAS") + tp.EndRow() + + for _, v := range views { + label := v.AreaPath + if v.IsDefault { + label += " (default)" + } + tp.AddField(label) + if v.IncludeChildren { + tp.AddField("yes") + } else { + tp.AddField("no") + } + tp.EndRow() + } + + return tp.Render() +} diff --git a/internal/cmd/boards/area/team/list/list_test.go b/internal/cmd/boards/area/team/list/list_test.go new file mode 100644 index 00000000..2f8dd93f --- /dev/null +++ b/internal/cmd/boards/area/team/list/list_test.go @@ -0,0 +1,376 @@ +package list + +import ( + "bytes" + "context" + "errors" + "strings" + "testing" + + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/work" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tmeckel/azdo-cli/internal/iostreams" + "github.com/tmeckel/azdo-cli/internal/mocks" + "github.com/tmeckel/azdo-cli/internal/printer" + "github.com/tmeckel/azdo-cli/internal/types" + "go.uber.org/mock/gomock" +) + +type dependencies struct { + cmd *mocks.MockCmdContext + clientFact *mocks.MockClientFactory + workClient *mocks.MockWorkClient + config *mocks.MockConfig + authCfg *mocks.MockAuthConfig +} + +func newDependencies(t *testing.T, organization string) (*dependencies, *bytes.Buffer) { + t.Helper() + + ctrl := gomock.NewController(t) + t.Cleanup(ctrl.Finish) + + io, _, out, _ := iostreams.Test() + io.SetStdoutTTY(false) + io.SetStderrTTY(false) + + tp, err := printer.NewTablePrinter(out, false, 200) + require.NoError(t, err) + + deps := &dependencies{ + cmd: mocks.NewMockCmdContext(ctrl), + clientFact: mocks.NewMockClientFactory(ctrl), + workClient: mocks.NewMockWorkClient(ctrl), + config: mocks.NewMockConfig(ctrl), + authCfg: mocks.NewMockAuthConfig(ctrl), + } + + deps.cmd.EXPECT().IOStreams().Return(io, nil).AnyTimes() + deps.cmd.EXPECT().Context().Return(context.Background()).AnyTimes() + deps.cmd.EXPECT().ClientFactory().Return(deps.clientFact).AnyTimes() + deps.cmd.EXPECT().Printer(gomock.Any()).Return(tp, nil).AnyTimes() + deps.clientFact.EXPECT().Work(gomock.Any(), organization).Return(deps.workClient, nil).AnyTimes() + + return deps, out +} + +func tfv(value string, includeChildren bool) work.TeamFieldValue { + return work.TeamFieldValue{ + Value: &value, + IncludeChildren: &includeChildren, + } +} + +func TestList_EmptyResult(t *testing.T) { + deps, _ := newDependencies(t, "myOrg") + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{Values: &[]work.TeamFieldValue{}}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "no team area paths found") +} + +func TestList_RendersTable(t *testing.T) { + deps, out := newDependencies(t, "myOrg") + + values := []work.TeamFieldValue{ + tfv("Fabrikam/Frontend", true), + tfv("Fabrikam/Backend", false), + tfv("Fabrikam/DevOps", true), + } + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{DefaultValue: types.ToPtr("Fabrikam/Frontend"), Values: &values}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.NoError(t, err) + + output := out.String() + + assert.Contains(t, output, "Fabrikam/Backend") + assert.Contains(t, output, "Fabrikam/DevOps") + assert.Contains(t, output, "Fabrikam/Frontend") + + assert.Contains(t, output, "yes") + assert.Contains(t, output, "no") + + assert.Contains(t, output, "Fabrikam/Frontend (default)") + assert.Equal(t, 1, strings.Count(output, "(default)"), "only one row should have (default) marker") + assert.NotContains(t, output, "Fabrikam/Backend (default)") + assert.NotContains(t, output, "Fabrikam/DevOps (default)") +} + +func TestList_SortedOutput(t *testing.T) { + deps, out := newDependencies(t, "myOrg") + + values := []work.TeamFieldValue{ + tfv("Z/Path", false), + tfv("A/Path", true), + tfv("M/Path", false), + } + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{DefaultValue: types.ToPtr("M/Path"), Values: &values}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.NoError(t, err) + + aIdx := bytes.Index(out.Bytes(), []byte("A/Path")) + mIdx := bytes.Index(out.Bytes(), []byte("M/Path")) + zIdx := bytes.Index(out.Bytes(), []byte("Z/Path")) + assert.True(t, aIdx < mIdx && mIdx < zIdx, "expected sorted order") +} + +func TestList_JSONOutput(t *testing.T) { + deps, out := newDependencies(t, "myOrg") + + values := []work.TeamFieldValue{ + tfv("Z/Path", false), + tfv("A/Path", true), + } + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{DefaultValue: types.ToPtr("A/Path"), Values: &values}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam", "--json=areaPath,includeChildren,isDefault"}) + err := cmd.Execute() + require.NoError(t, err) + + output := out.String() + assert.Contains(t, output, "\"areaPath\"") + assert.Contains(t, output, "\"includeChildren\":true") + assert.Contains(t, output, "\"isDefault\":true") + assert.NotContains(t, output, "AREA PATH") + assert.NotContains(t, output, "INCLUDE SUB AREAS") + + aIdx := strings.Index(output, "A/Path") + zIdx := strings.Index(output, "Z/Path") + assert.True(t, aIdx < zIdx, "expected sorted JSON output") +} + +func TestList_JSONOutput_EmptyValuesReturnsEmptyArray(t *testing.T) { + deps, out := newDependencies(t, "myOrg") + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{Values: &[]work.TeamFieldValue{}}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam", "--json=areaPath,includeChildren,isDefault"}) + err := cmd.Execute() + require.NoError(t, err) + + assert.Equal(t, "[]\n", out.String()) +} + +func TestList_TargetArg_ParsesOrgSlashProjectSlashTeam(t *testing.T) { + deps, _ := newDependencies(t, "myOrg") + + var capturedArgs work.GetTeamFieldValuesArgs + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + DoAndReturn(func(_ context.Context, args work.GetTeamFieldValuesArgs) (*work.TeamFieldValues, error) { + capturedArgs = args + return &work.TeamFieldValues{Values: &[]work.TeamFieldValue{tfv("Area/One", true)}}, nil + }) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/My Team"}) + err := cmd.Execute() + require.NoError(t, err) + + require.NotNil(t, capturedArgs.Project) + assert.Equal(t, "myProject", *capturedArgs.Project) + require.NotNil(t, capturedArgs.Team) + assert.Equal(t, "My Team", *capturedArgs.Team) +} + +func TestList_TargetArg_UsesDefaultOrganization(t *testing.T) { + deps, _ := newDependencies(t, "defaultOrg") + deps.cmd.EXPECT().Config().Return(deps.config, nil).AnyTimes() + deps.config.EXPECT().Authentication().Return(deps.authCfg).AnyTimes() + deps.authCfg.EXPECT().GetDefaultOrganization().Return("defaultOrg", nil).AnyTimes() + + var capturedArgs work.GetTeamFieldValuesArgs + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + DoAndReturn(func(_ context.Context, args work.GetTeamFieldValuesArgs) (*work.TeamFieldValues, error) { + capturedArgs = args + return &work.TeamFieldValues{Values: &[]work.TeamFieldValue{tfv("Area/One", true)}}, nil + }) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myProject/MyTeam"}) + err := cmd.Execute() + require.NoError(t, err) + + require.NotNil(t, capturedArgs.Project) + assert.Equal(t, "myProject", *capturedArgs.Project) + require.NotNil(t, capturedArgs.Team) + assert.Equal(t, "MyTeam", *capturedArgs.Team) +} + +func TestList_InvalidTargetArg(t *testing.T) { + run := func(arg string) { + t.Helper() + + deps, _ := newDependencies(t, "myOrg") + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{arg}) + + err := cmd.Execute() + require.Error(t, err) + assert.Contains(t, err.Error(), "expected") + } + + run("myOrg") + run("myOrg/myProject/MyTeam/extra") +} + +func TestList_WorkClientFactoryError(t *testing.T) { + ctrl := gomock.NewController(t) + t.Cleanup(ctrl.Finish) + + io, _, _, _ := iostreams.Test() + io.SetStdoutTTY(false) + io.SetStderrTTY(false) + + cmdCtx := mocks.NewMockCmdContext(ctrl) + clientFact := mocks.NewMockClientFactory(ctrl) + cmdCtx.EXPECT().IOStreams().Return(io, nil).AnyTimes() + cmdCtx.EXPECT().Context().Return(context.Background()).AnyTimes() + cmdCtx.EXPECT().ClientFactory().Return(clientFact).AnyTimes() + clientFact.EXPECT().Work(gomock.Any(), "myOrg").Return(nil, errors.New("boom")) + cmd := NewCmd(cmdCtx) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "failed to create Work client") + require.ErrorContains(t, err, "boom") +} + +func TestList_GetTeamFieldValuesError(t *testing.T) { + deps, _ := newDependencies(t, "myOrg") + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(nil, errors.New("api failed")) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "failed to fetch team field values") + require.ErrorContains(t, err, "api failed") +} + +func TestList_PrinterError(t *testing.T) { + ctrl := gomock.NewController(t) + t.Cleanup(ctrl.Finish) + + io, _, out, _ := iostreams.Test() + io.SetStdoutTTY(false) + io.SetStderrTTY(false) + + deps := &dependencies{ + cmd: mocks.NewMockCmdContext(ctrl), + clientFact: mocks.NewMockClientFactory(ctrl), + workClient: mocks.NewMockWorkClient(ctrl), + } + deps.cmd.EXPECT().IOStreams().Return(io, nil).AnyTimes() + deps.cmd.EXPECT().Context().Return(context.Background()).AnyTimes() + deps.cmd.EXPECT().ClientFactory().Return(deps.clientFact).AnyTimes() + deps.clientFact.EXPECT().Work(gomock.Any(), "myOrg").Return(deps.workClient, nil).AnyTimes() + _ = out + + values := []work.TeamFieldValue{tfv("A/Path", true)} + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{DefaultValue: types.ToPtr("A/Path"), Values: &values}, nil) + + deps.cmd.EXPECT().Printer("list").Return(nil, errors.New("printer failed")) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "printer failed") +} + +func TestList_NilResponse(t *testing.T) { + deps, _ := newDependencies(t, "myOrg") + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(nil, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "no team area paths found") +} + +func TestList_NilValues(t *testing.T) { + deps, _ := newDependencies(t, "myOrg") + + deps.workClient.EXPECT().GetTeamFieldValues(gomock.Any(), gomock.Any()). + Return(&work.TeamFieldValues{Values: nil}, nil) + + cmd := NewCmd(deps.cmd) + cmd.SetArgs([]string{"myOrg/myProject/MyTeam"}) + err := cmd.Execute() + require.ErrorContains(t, err, "no team area paths found") +} + +func TestBuildView_NilResponse(t *testing.T) { + got := buildView(nil) + assert.Nil(t, got) +} + +func TestBuildView_NilValues(t *testing.T) { + got := buildView(&work.TeamFieldValues{Values: nil}) + assert.Nil(t, got) +} + +func TestBuildView_NilRowFields(t *testing.T) { + values := []work.TeamFieldValue{{Value: nil, IncludeChildren: nil}} + got := buildView(&work.TeamFieldValues{ + DefaultValue: types.ToPtr("Other"), + Values: &values, + }) + require.Len(t, got, 1) + assert.Equal(t, "", got[0].AreaPath) + assert.False(t, got[0].IncludeChildren) + assert.False(t, got[0].IsDefault) +} + +func TestBuildView_Sorting(t *testing.T) { + values := []work.TeamFieldValue{ + tfv("z/path", false), + tfv("A/path", false), + } + got := buildView(&work.TeamFieldValues{Values: &values}) + require.Len(t, got, 2) + assert.Equal(t, "A/path", got[0].AreaPath) + assert.Equal(t, "z/path", got[1].AreaPath) +} + +func TestBuildView_DefaultMatchingIsCaseInsensitive(t *testing.T) { + values := []work.TeamFieldValue{tfv("Fabrikam/Frontend", true)} + got := buildView(&work.TeamFieldValues{ + DefaultValue: types.ToPtr("fabrikam/frontend"), + Values: &values, + }) + require.Len(t, got, 1) + assert.True(t, got[0].IsDefault) +} + +func TestBuildView_NoMatchDefault(t *testing.T) { + values := []work.TeamFieldValue{tfv("Fabrikam/Frontend", true)} + got := buildView(&work.TeamFieldValues{ + DefaultValue: types.ToPtr("Other/Path"), + Values: &values, + }) + require.Len(t, got, 1) + assert.False(t, got[0].IsDefault) +} diff --git a/internal/cmd/boards/area/team/team.go b/internal/cmd/boards/area/team/team.go new file mode 100644 index 00000000..03cd00a6 --- /dev/null +++ b/internal/cmd/boards/area/team/team.go @@ -0,0 +1,29 @@ +package team + +import ( + "github.com/MakeNowJust/heredoc/v2" + "github.com/spf13/cobra" + listcmd "github.com/tmeckel/azdo-cli/internal/cmd/boards/area/team/list" + "github.com/tmeckel/azdo-cli/internal/cmd/util" +) + +func NewCmd(ctx util.CmdContext) *cobra.Command { + cmd := &cobra.Command{ + Use: "team ", + Short: "Manage area paths scoped to a team.", + Example: heredoc.Doc(` + # List team area paths for a project in the default organization + azdo boards area team list Fabrikam/"My Team" + + # List team area paths for a project in a specific organization + azdo boards area team list myOrg/Fabrikam/"My Team" + `), + Aliases: []string{ + "t", + }, + } + + cmd.AddCommand(listcmd.NewCmd(ctx)) + + return cmd +} diff --git a/internal/mocks/connection_factory_mock.go b/internal/mocks/connection_factory_mock.go index 899c1c1c..a38105a7 100644 --- a/internal/mocks/connection_factory_mock.go +++ b/internal/mocks/connection_factory_mock.go @@ -28,6 +28,7 @@ import ( 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" + work "github.com/microsoft/azure-devops-go-api/azuredevops/v7/work" 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" @@ -483,6 +484,21 @@ func (mr *MockClientFactoryMockRecorder) TaskAgent(ctx, organization any) *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaskAgent", reflect.TypeOf((*MockClientFactory)(nil).TaskAgent), ctx, organization) } +// Work mocks base method. +func (m *MockClientFactory) Work(ctx context.Context, organization string) (work.Client, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Work", ctx, organization) + ret0, _ := ret[0].(work.Client) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Work indicates an expected call of Work. +func (mr *MockClientFactoryMockRecorder) Work(ctx, organization any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Work", reflect.TypeOf((*MockClientFactory)(nil).Work), 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/work_client_mock.go b/internal/mocks/work_client_mock.go new file mode 100644 index 00000000..badd0715 --- /dev/null +++ b/internal/mocks/work_client_mock.go @@ -0,0 +1,847 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/microsoft/azure-devops-go-api/azuredevops/v7/work (interfaces: Client) +// +// Generated by this command: +// +// mockgen -package=mocks -destination internal/mocks/work_client_mock.go -mock_names Client=MockWorkClient github.com/microsoft/azure-devops-go-api/azuredevops/v7/work Client +// + +// Package mocks is a generated GoMock package. +package mocks + +import ( + context "context" + reflect "reflect" + + work "github.com/microsoft/azure-devops-go-api/azuredevops/v7/work" + gomock "go.uber.org/mock/gomock" +) + +// MockWorkClient is a mock of Client interface. +type MockWorkClient struct { + ctrl *gomock.Controller + recorder *MockWorkClientMockRecorder + isgomock struct{} +} + +// MockWorkClientMockRecorder is the mock recorder for MockWorkClient. +type MockWorkClientMockRecorder struct { + mock *MockWorkClient +} + +// NewMockWorkClient creates a new mock instance. +func NewMockWorkClient(ctrl *gomock.Controller) *MockWorkClient { + mock := &MockWorkClient{ctrl: ctrl} + mock.recorder = &MockWorkClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkClient) EXPECT() *MockWorkClientMockRecorder { + return m.recorder +} + +// CreatePlan mocks base method. +func (m *MockWorkClient) CreatePlan(arg0 context.Context, arg1 work.CreatePlanArgs) (*work.Plan, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreatePlan", arg0, arg1) + ret0, _ := ret[0].(*work.Plan) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePlan indicates an expected call of CreatePlan. +func (mr *MockWorkClientMockRecorder) CreatePlan(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePlan", reflect.TypeOf((*MockWorkClient)(nil).CreatePlan), arg0, arg1) +} + +// DeletePlan mocks base method. +func (m *MockWorkClient) DeletePlan(arg0 context.Context, arg1 work.DeletePlanArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeletePlan", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeletePlan indicates an expected call of DeletePlan. +func (mr *MockWorkClientMockRecorder) DeletePlan(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePlan", reflect.TypeOf((*MockWorkClient)(nil).DeletePlan), arg0, arg1) +} + +// DeleteTeamIteration mocks base method. +func (m *MockWorkClient) DeleteTeamIteration(arg0 context.Context, arg1 work.DeleteTeamIterationArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTeamIteration", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteTeamIteration indicates an expected call of DeleteTeamIteration. +func (mr *MockWorkClientMockRecorder) DeleteTeamIteration(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTeamIteration", reflect.TypeOf((*MockWorkClient)(nil).DeleteTeamIteration), arg0, arg1) +} + +// GetBacklog mocks base method. +func (m *MockWorkClient) GetBacklog(arg0 context.Context, arg1 work.GetBacklogArgs) (*work.BacklogLevelConfiguration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBacklog", arg0, arg1) + ret0, _ := ret[0].(*work.BacklogLevelConfiguration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBacklog indicates an expected call of GetBacklog. +func (mr *MockWorkClientMockRecorder) GetBacklog(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBacklog", reflect.TypeOf((*MockWorkClient)(nil).GetBacklog), arg0, arg1) +} + +// GetBacklogConfigurations mocks base method. +func (m *MockWorkClient) GetBacklogConfigurations(arg0 context.Context, arg1 work.GetBacklogConfigurationsArgs) (*work.BacklogConfiguration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBacklogConfigurations", arg0, arg1) + ret0, _ := ret[0].(*work.BacklogConfiguration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBacklogConfigurations indicates an expected call of GetBacklogConfigurations. +func (mr *MockWorkClientMockRecorder) GetBacklogConfigurations(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBacklogConfigurations", reflect.TypeOf((*MockWorkClient)(nil).GetBacklogConfigurations), arg0, arg1) +} + +// GetBacklogLevelWorkItems mocks base method. +func (m *MockWorkClient) GetBacklogLevelWorkItems(arg0 context.Context, arg1 work.GetBacklogLevelWorkItemsArgs) (*work.BacklogLevelWorkItems, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBacklogLevelWorkItems", arg0, arg1) + ret0, _ := ret[0].(*work.BacklogLevelWorkItems) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBacklogLevelWorkItems indicates an expected call of GetBacklogLevelWorkItems. +func (mr *MockWorkClientMockRecorder) GetBacklogLevelWorkItems(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBacklogLevelWorkItems", reflect.TypeOf((*MockWorkClient)(nil).GetBacklogLevelWorkItems), arg0, arg1) +} + +// GetBacklogs mocks base method. +func (m *MockWorkClient) GetBacklogs(arg0 context.Context, arg1 work.GetBacklogsArgs) (*[]work.BacklogLevelConfiguration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBacklogs", arg0, arg1) + ret0, _ := ret[0].(*[]work.BacklogLevelConfiguration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBacklogs indicates an expected call of GetBacklogs. +func (mr *MockWorkClientMockRecorder) GetBacklogs(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBacklogs", reflect.TypeOf((*MockWorkClient)(nil).GetBacklogs), arg0, arg1) +} + +// GetBoard mocks base method. +func (m *MockWorkClient) GetBoard(arg0 context.Context, arg1 work.GetBoardArgs) (*work.Board, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoard", arg0, arg1) + ret0, _ := ret[0].(*work.Board) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoard indicates an expected call of GetBoard. +func (mr *MockWorkClientMockRecorder) GetBoard(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoard", reflect.TypeOf((*MockWorkClient)(nil).GetBoard), arg0, arg1) +} + +// GetBoardCardRuleSettings mocks base method. +func (m *MockWorkClient) GetBoardCardRuleSettings(arg0 context.Context, arg1 work.GetBoardCardRuleSettingsArgs) (*work.BoardCardRuleSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardCardRuleSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardCardRuleSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardCardRuleSettings indicates an expected call of GetBoardCardRuleSettings. +func (mr *MockWorkClientMockRecorder) GetBoardCardRuleSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardCardRuleSettings", reflect.TypeOf((*MockWorkClient)(nil).GetBoardCardRuleSettings), arg0, arg1) +} + +// GetBoardCardSettings mocks base method. +func (m *MockWorkClient) GetBoardCardSettings(arg0 context.Context, arg1 work.GetBoardCardSettingsArgs) (*work.BoardCardSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardCardSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardCardSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardCardSettings indicates an expected call of GetBoardCardSettings. +func (mr *MockWorkClientMockRecorder) GetBoardCardSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardCardSettings", reflect.TypeOf((*MockWorkClient)(nil).GetBoardCardSettings), arg0, arg1) +} + +// GetBoardChart mocks base method. +func (m *MockWorkClient) GetBoardChart(arg0 context.Context, arg1 work.GetBoardChartArgs) (*work.BoardChart, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardChart", arg0, arg1) + ret0, _ := ret[0].(*work.BoardChart) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardChart indicates an expected call of GetBoardChart. +func (mr *MockWorkClientMockRecorder) GetBoardChart(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardChart", reflect.TypeOf((*MockWorkClient)(nil).GetBoardChart), arg0, arg1) +} + +// GetBoardCharts mocks base method. +func (m *MockWorkClient) GetBoardCharts(arg0 context.Context, arg1 work.GetBoardChartsArgs) (*[]work.BoardChartReference, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardCharts", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardChartReference) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardCharts indicates an expected call of GetBoardCharts. +func (mr *MockWorkClientMockRecorder) GetBoardCharts(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardCharts", reflect.TypeOf((*MockWorkClient)(nil).GetBoardCharts), arg0, arg1) +} + +// GetBoardColumns mocks base method. +func (m *MockWorkClient) GetBoardColumns(arg0 context.Context, arg1 work.GetBoardColumnsArgs) (*[]work.BoardColumn, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardColumns", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardColumn) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardColumns indicates an expected call of GetBoardColumns. +func (mr *MockWorkClientMockRecorder) GetBoardColumns(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardColumns", reflect.TypeOf((*MockWorkClient)(nil).GetBoardColumns), arg0, arg1) +} + +// GetBoardMappingParentItems mocks base method. +func (m *MockWorkClient) GetBoardMappingParentItems(arg0 context.Context, arg1 work.GetBoardMappingParentItemsArgs) (*[]work.ParentChildWIMap, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardMappingParentItems", arg0, arg1) + ret0, _ := ret[0].(*[]work.ParentChildWIMap) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardMappingParentItems indicates an expected call of GetBoardMappingParentItems. +func (mr *MockWorkClientMockRecorder) GetBoardMappingParentItems(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardMappingParentItems", reflect.TypeOf((*MockWorkClient)(nil).GetBoardMappingParentItems), arg0, arg1) +} + +// GetBoardRows mocks base method. +func (m *MockWorkClient) GetBoardRows(arg0 context.Context, arg1 work.GetBoardRowsArgs) (*[]work.BoardRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardRows", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardRows indicates an expected call of GetBoardRows. +func (mr *MockWorkClientMockRecorder) GetBoardRows(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardRows", reflect.TypeOf((*MockWorkClient)(nil).GetBoardRows), arg0, arg1) +} + +// GetBoardUserSettings mocks base method. +func (m *MockWorkClient) GetBoardUserSettings(arg0 context.Context, arg1 work.GetBoardUserSettingsArgs) (*work.BoardUserSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoardUserSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardUserSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoardUserSettings indicates an expected call of GetBoardUserSettings. +func (mr *MockWorkClientMockRecorder) GetBoardUserSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoardUserSettings", reflect.TypeOf((*MockWorkClient)(nil).GetBoardUserSettings), arg0, arg1) +} + +// GetBoards mocks base method. +func (m *MockWorkClient) GetBoards(arg0 context.Context, arg1 work.GetBoardsArgs) (*[]work.BoardReference, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBoards", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardReference) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetBoards indicates an expected call of GetBoards. +func (mr *MockWorkClientMockRecorder) GetBoards(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBoards", reflect.TypeOf((*MockWorkClient)(nil).GetBoards), arg0, arg1) +} + +// GetCapacitiesWithIdentityRefAndTotals mocks base method. +func (m *MockWorkClient) GetCapacitiesWithIdentityRefAndTotals(arg0 context.Context, arg1 work.GetCapacitiesWithIdentityRefAndTotalsArgs) (*work.TeamCapacity, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCapacitiesWithIdentityRefAndTotals", arg0, arg1) + ret0, _ := ret[0].(*work.TeamCapacity) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCapacitiesWithIdentityRefAndTotals indicates an expected call of GetCapacitiesWithIdentityRefAndTotals. +func (mr *MockWorkClientMockRecorder) GetCapacitiesWithIdentityRefAndTotals(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapacitiesWithIdentityRefAndTotals", reflect.TypeOf((*MockWorkClient)(nil).GetCapacitiesWithIdentityRefAndTotals), arg0, arg1) +} + +// GetCapacityWithIdentityRef mocks base method. +func (m *MockWorkClient) GetCapacityWithIdentityRef(arg0 context.Context, arg1 work.GetCapacityWithIdentityRefArgs) (*work.TeamMemberCapacityIdentityRef, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCapacityWithIdentityRef", arg0, arg1) + ret0, _ := ret[0].(*work.TeamMemberCapacityIdentityRef) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCapacityWithIdentityRef indicates an expected call of GetCapacityWithIdentityRef. +func (mr *MockWorkClientMockRecorder) GetCapacityWithIdentityRef(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapacityWithIdentityRef", reflect.TypeOf((*MockWorkClient)(nil).GetCapacityWithIdentityRef), arg0, arg1) +} + +// GetColumnSuggestedValues mocks base method. +func (m *MockWorkClient) GetColumnSuggestedValues(arg0 context.Context, arg1 work.GetColumnSuggestedValuesArgs) (*[]work.BoardSuggestedValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetColumnSuggestedValues", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardSuggestedValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetColumnSuggestedValues indicates an expected call of GetColumnSuggestedValues. +func (mr *MockWorkClientMockRecorder) GetColumnSuggestedValues(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetColumnSuggestedValues", reflect.TypeOf((*MockWorkClient)(nil).GetColumnSuggestedValues), arg0, arg1) +} + +// GetColumns mocks base method. +func (m *MockWorkClient) GetColumns(arg0 context.Context, arg1 work.GetColumnsArgs) (*work.TaskboardColumns, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetColumns", arg0, arg1) + ret0, _ := ret[0].(*work.TaskboardColumns) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetColumns indicates an expected call of GetColumns. +func (mr *MockWorkClientMockRecorder) GetColumns(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetColumns", reflect.TypeOf((*MockWorkClient)(nil).GetColumns), arg0, arg1) +} + +// GetDeliveryTimelineData mocks base method. +func (m *MockWorkClient) GetDeliveryTimelineData(arg0 context.Context, arg1 work.GetDeliveryTimelineDataArgs) (*work.DeliveryViewData, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeliveryTimelineData", arg0, arg1) + ret0, _ := ret[0].(*work.DeliveryViewData) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeliveryTimelineData indicates an expected call of GetDeliveryTimelineData. +func (mr *MockWorkClientMockRecorder) GetDeliveryTimelineData(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeliveryTimelineData", reflect.TypeOf((*MockWorkClient)(nil).GetDeliveryTimelineData), arg0, arg1) +} + +// GetIterationWorkItems mocks base method. +func (m *MockWorkClient) GetIterationWorkItems(arg0 context.Context, arg1 work.GetIterationWorkItemsArgs) (*work.IterationWorkItems, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetIterationWorkItems", arg0, arg1) + ret0, _ := ret[0].(*work.IterationWorkItems) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetIterationWorkItems indicates an expected call of GetIterationWorkItems. +func (mr *MockWorkClientMockRecorder) GetIterationWorkItems(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIterationWorkItems", reflect.TypeOf((*MockWorkClient)(nil).GetIterationWorkItems), arg0, arg1) +} + +// GetPlan mocks base method. +func (m *MockWorkClient) GetPlan(arg0 context.Context, arg1 work.GetPlanArgs) (*work.Plan, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPlan", arg0, arg1) + ret0, _ := ret[0].(*work.Plan) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPlan indicates an expected call of GetPlan. +func (mr *MockWorkClientMockRecorder) GetPlan(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPlan", reflect.TypeOf((*MockWorkClient)(nil).GetPlan), arg0, arg1) +} + +// GetPlans mocks base method. +func (m *MockWorkClient) GetPlans(arg0 context.Context, arg1 work.GetPlansArgs) (*[]work.Plan, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPlans", arg0, arg1) + ret0, _ := ret[0].(*[]work.Plan) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPlans indicates an expected call of GetPlans. +func (mr *MockWorkClientMockRecorder) GetPlans(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPlans", reflect.TypeOf((*MockWorkClient)(nil).GetPlans), arg0, arg1) +} + +// GetProcessConfiguration mocks base method. +func (m *MockWorkClient) GetProcessConfiguration(arg0 context.Context, arg1 work.GetProcessConfigurationArgs) (*work.ProcessConfiguration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProcessConfiguration", arg0, arg1) + ret0, _ := ret[0].(*work.ProcessConfiguration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProcessConfiguration indicates an expected call of GetProcessConfiguration. +func (mr *MockWorkClientMockRecorder) GetProcessConfiguration(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProcessConfiguration", reflect.TypeOf((*MockWorkClient)(nil).GetProcessConfiguration), arg0, arg1) +} + +// GetRowSuggestedValues mocks base method. +func (m *MockWorkClient) GetRowSuggestedValues(arg0 context.Context, arg1 work.GetRowSuggestedValuesArgs) (*[]work.BoardSuggestedValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRowSuggestedValues", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardSuggestedValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRowSuggestedValues indicates an expected call of GetRowSuggestedValues. +func (mr *MockWorkClientMockRecorder) GetRowSuggestedValues(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRowSuggestedValues", reflect.TypeOf((*MockWorkClient)(nil).GetRowSuggestedValues), arg0, arg1) +} + +// GetTeamDaysOff mocks base method. +func (m *MockWorkClient) GetTeamDaysOff(arg0 context.Context, arg1 work.GetTeamDaysOffArgs) (*work.TeamSettingsDaysOff, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTeamDaysOff", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSettingsDaysOff) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTeamDaysOff indicates an expected call of GetTeamDaysOff. +func (mr *MockWorkClientMockRecorder) GetTeamDaysOff(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeamDaysOff", reflect.TypeOf((*MockWorkClient)(nil).GetTeamDaysOff), arg0, arg1) +} + +// GetTeamFieldValues mocks base method. +func (m *MockWorkClient) GetTeamFieldValues(arg0 context.Context, arg1 work.GetTeamFieldValuesArgs) (*work.TeamFieldValues, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTeamFieldValues", arg0, arg1) + ret0, _ := ret[0].(*work.TeamFieldValues) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTeamFieldValues indicates an expected call of GetTeamFieldValues. +func (mr *MockWorkClientMockRecorder) GetTeamFieldValues(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeamFieldValues", reflect.TypeOf((*MockWorkClient)(nil).GetTeamFieldValues), arg0, arg1) +} + +// GetTeamIteration mocks base method. +func (m *MockWorkClient) GetTeamIteration(arg0 context.Context, arg1 work.GetTeamIterationArgs) (*work.TeamSettingsIteration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTeamIteration", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSettingsIteration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTeamIteration indicates an expected call of GetTeamIteration. +func (mr *MockWorkClientMockRecorder) GetTeamIteration(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeamIteration", reflect.TypeOf((*MockWorkClient)(nil).GetTeamIteration), arg0, arg1) +} + +// GetTeamIterations mocks base method. +func (m *MockWorkClient) GetTeamIterations(arg0 context.Context, arg1 work.GetTeamIterationsArgs) (*[]work.TeamSettingsIteration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTeamIterations", arg0, arg1) + ret0, _ := ret[0].(*[]work.TeamSettingsIteration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTeamIterations indicates an expected call of GetTeamIterations. +func (mr *MockWorkClientMockRecorder) GetTeamIterations(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeamIterations", reflect.TypeOf((*MockWorkClient)(nil).GetTeamIterations), arg0, arg1) +} + +// GetTeamSettings mocks base method. +func (m *MockWorkClient) GetTeamSettings(arg0 context.Context, arg1 work.GetTeamSettingsArgs) (*work.TeamSetting, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTeamSettings", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSetting) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTeamSettings indicates an expected call of GetTeamSettings. +func (mr *MockWorkClientMockRecorder) GetTeamSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTeamSettings", reflect.TypeOf((*MockWorkClient)(nil).GetTeamSettings), arg0, arg1) +} + +// GetTotalIterationCapacities mocks base method. +func (m *MockWorkClient) GetTotalIterationCapacities(arg0 context.Context, arg1 work.GetTotalIterationCapacitiesArgs) (*work.IterationCapacity, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTotalIterationCapacities", arg0, arg1) + ret0, _ := ret[0].(*work.IterationCapacity) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTotalIterationCapacities indicates an expected call of GetTotalIterationCapacities. +func (mr *MockWorkClientMockRecorder) GetTotalIterationCapacities(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTotalIterationCapacities", reflect.TypeOf((*MockWorkClient)(nil).GetTotalIterationCapacities), arg0, arg1) +} + +// GetWorkItemColumns mocks base method. +func (m *MockWorkClient) GetWorkItemColumns(arg0 context.Context, arg1 work.GetWorkItemColumnsArgs) (*[]work.TaskboardWorkItemColumn, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkItemColumns", arg0, arg1) + ret0, _ := ret[0].(*[]work.TaskboardWorkItemColumn) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkItemColumns indicates an expected call of GetWorkItemColumns. +func (mr *MockWorkClientMockRecorder) GetWorkItemColumns(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkItemColumns", reflect.TypeOf((*MockWorkClient)(nil).GetWorkItemColumns), arg0, arg1) +} + +// PostTeamIteration mocks base method. +func (m *MockWorkClient) PostTeamIteration(arg0 context.Context, arg1 work.PostTeamIterationArgs) (*work.TeamSettingsIteration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PostTeamIteration", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSettingsIteration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PostTeamIteration indicates an expected call of PostTeamIteration. +func (mr *MockWorkClientMockRecorder) PostTeamIteration(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostTeamIteration", reflect.TypeOf((*MockWorkClient)(nil).PostTeamIteration), arg0, arg1) +} + +// ReorderBacklogWorkItems mocks base method. +func (m *MockWorkClient) ReorderBacklogWorkItems(arg0 context.Context, arg1 work.ReorderBacklogWorkItemsArgs) (*[]work.ReorderResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReorderBacklogWorkItems", arg0, arg1) + ret0, _ := ret[0].(*[]work.ReorderResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReorderBacklogWorkItems indicates an expected call of ReorderBacklogWorkItems. +func (mr *MockWorkClientMockRecorder) ReorderBacklogWorkItems(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReorderBacklogWorkItems", reflect.TypeOf((*MockWorkClient)(nil).ReorderBacklogWorkItems), arg0, arg1) +} + +// ReorderIterationWorkItems mocks base method. +func (m *MockWorkClient) ReorderIterationWorkItems(arg0 context.Context, arg1 work.ReorderIterationWorkItemsArgs) (*[]work.ReorderResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReorderIterationWorkItems", arg0, arg1) + ret0, _ := ret[0].(*[]work.ReorderResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReorderIterationWorkItems indicates an expected call of ReorderIterationWorkItems. +func (mr *MockWorkClientMockRecorder) ReorderIterationWorkItems(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReorderIterationWorkItems", reflect.TypeOf((*MockWorkClient)(nil).ReorderIterationWorkItems), arg0, arg1) +} + +// ReplaceCapacitiesWithIdentityRef mocks base method. +func (m *MockWorkClient) ReplaceCapacitiesWithIdentityRef(arg0 context.Context, arg1 work.ReplaceCapacitiesWithIdentityRefArgs) (*[]work.TeamMemberCapacityIdentityRef, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReplaceCapacitiesWithIdentityRef", arg0, arg1) + ret0, _ := ret[0].(*[]work.TeamMemberCapacityIdentityRef) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReplaceCapacitiesWithIdentityRef indicates an expected call of ReplaceCapacitiesWithIdentityRef. +func (mr *MockWorkClientMockRecorder) ReplaceCapacitiesWithIdentityRef(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReplaceCapacitiesWithIdentityRef", reflect.TypeOf((*MockWorkClient)(nil).ReplaceCapacitiesWithIdentityRef), arg0, arg1) +} + +// SetBoardOptions mocks base method. +func (m *MockWorkClient) SetBoardOptions(arg0 context.Context, arg1 work.SetBoardOptionsArgs) (*map[string]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetBoardOptions", arg0, arg1) + ret0, _ := ret[0].(*map[string]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetBoardOptions indicates an expected call of SetBoardOptions. +func (mr *MockWorkClientMockRecorder) SetBoardOptions(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBoardOptions", reflect.TypeOf((*MockWorkClient)(nil).SetBoardOptions), arg0, arg1) +} + +// UpdateBoardCardRuleSettings mocks base method. +func (m *MockWorkClient) UpdateBoardCardRuleSettings(arg0 context.Context, arg1 work.UpdateBoardCardRuleSettingsArgs) (*work.BoardCardRuleSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardCardRuleSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardCardRuleSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardCardRuleSettings indicates an expected call of UpdateBoardCardRuleSettings. +func (mr *MockWorkClientMockRecorder) UpdateBoardCardRuleSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardCardRuleSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardCardRuleSettings), arg0, arg1) +} + +// UpdateBoardCardSettings mocks base method. +func (m *MockWorkClient) UpdateBoardCardSettings(arg0 context.Context, arg1 work.UpdateBoardCardSettingsArgs) (*work.BoardCardSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardCardSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardCardSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardCardSettings indicates an expected call of UpdateBoardCardSettings. +func (mr *MockWorkClientMockRecorder) UpdateBoardCardSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardCardSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardCardSettings), arg0, arg1) +} + +// UpdateBoardChart mocks base method. +func (m *MockWorkClient) UpdateBoardChart(arg0 context.Context, arg1 work.UpdateBoardChartArgs) (*work.BoardChart, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardChart", arg0, arg1) + ret0, _ := ret[0].(*work.BoardChart) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardChart indicates an expected call of UpdateBoardChart. +func (mr *MockWorkClientMockRecorder) UpdateBoardChart(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardChart", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardChart), arg0, arg1) +} + +// UpdateBoardColumns mocks base method. +func (m *MockWorkClient) UpdateBoardColumns(arg0 context.Context, arg1 work.UpdateBoardColumnsArgs) (*[]work.BoardColumn, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardColumns", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardColumn) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardColumns indicates an expected call of UpdateBoardColumns. +func (mr *MockWorkClientMockRecorder) UpdateBoardColumns(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardColumns", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardColumns), arg0, arg1) +} + +// UpdateBoardRows mocks base method. +func (m *MockWorkClient) UpdateBoardRows(arg0 context.Context, arg1 work.UpdateBoardRowsArgs) (*[]work.BoardRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardRows", arg0, arg1) + ret0, _ := ret[0].(*[]work.BoardRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardRows indicates an expected call of UpdateBoardRows. +func (mr *MockWorkClientMockRecorder) UpdateBoardRows(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardRows", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardRows), arg0, arg1) +} + +// UpdateBoardUserSettings mocks base method. +func (m *MockWorkClient) UpdateBoardUserSettings(arg0 context.Context, arg1 work.UpdateBoardUserSettingsArgs) (*work.BoardUserSettings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateBoardUserSettings", arg0, arg1) + ret0, _ := ret[0].(*work.BoardUserSettings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateBoardUserSettings indicates an expected call of UpdateBoardUserSettings. +func (mr *MockWorkClientMockRecorder) UpdateBoardUserSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBoardUserSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateBoardUserSettings), arg0, arg1) +} + +// UpdateCapacityWithIdentityRef mocks base method. +func (m *MockWorkClient) UpdateCapacityWithIdentityRef(arg0 context.Context, arg1 work.UpdateCapacityWithIdentityRefArgs) (*work.TeamMemberCapacityIdentityRef, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCapacityWithIdentityRef", arg0, arg1) + ret0, _ := ret[0].(*work.TeamMemberCapacityIdentityRef) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateCapacityWithIdentityRef indicates an expected call of UpdateCapacityWithIdentityRef. +func (mr *MockWorkClientMockRecorder) UpdateCapacityWithIdentityRef(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCapacityWithIdentityRef", reflect.TypeOf((*MockWorkClient)(nil).UpdateCapacityWithIdentityRef), arg0, arg1) +} + +// UpdateColumns mocks base method. +func (m *MockWorkClient) UpdateColumns(arg0 context.Context, arg1 work.UpdateColumnsArgs) (*work.TaskboardColumns, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateColumns", arg0, arg1) + ret0, _ := ret[0].(*work.TaskboardColumns) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateColumns indicates an expected call of UpdateColumns. +func (mr *MockWorkClientMockRecorder) UpdateColumns(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateColumns", reflect.TypeOf((*MockWorkClient)(nil).UpdateColumns), arg0, arg1) +} + +// UpdatePlan mocks base method. +func (m *MockWorkClient) UpdatePlan(arg0 context.Context, arg1 work.UpdatePlanArgs) (*work.Plan, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdatePlan", arg0, arg1) + ret0, _ := ret[0].(*work.Plan) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePlan indicates an expected call of UpdatePlan. +func (mr *MockWorkClientMockRecorder) UpdatePlan(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePlan", reflect.TypeOf((*MockWorkClient)(nil).UpdatePlan), arg0, arg1) +} + +// UpdateTaskboardCardRuleSettings mocks base method. +func (m *MockWorkClient) UpdateTaskboardCardRuleSettings(arg0 context.Context, arg1 work.UpdateTaskboardCardRuleSettingsArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTaskboardCardRuleSettings", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateTaskboardCardRuleSettings indicates an expected call of UpdateTaskboardCardRuleSettings. +func (mr *MockWorkClientMockRecorder) UpdateTaskboardCardRuleSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTaskboardCardRuleSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateTaskboardCardRuleSettings), arg0, arg1) +} + +// UpdateTaskboardCardSettings mocks base method. +func (m *MockWorkClient) UpdateTaskboardCardSettings(arg0 context.Context, arg1 work.UpdateTaskboardCardSettingsArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTaskboardCardSettings", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateTaskboardCardSettings indicates an expected call of UpdateTaskboardCardSettings. +func (mr *MockWorkClientMockRecorder) UpdateTaskboardCardSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTaskboardCardSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateTaskboardCardSettings), arg0, arg1) +} + +// UpdateTeamDaysOff mocks base method. +func (m *MockWorkClient) UpdateTeamDaysOff(arg0 context.Context, arg1 work.UpdateTeamDaysOffArgs) (*work.TeamSettingsDaysOff, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTeamDaysOff", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSettingsDaysOff) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTeamDaysOff indicates an expected call of UpdateTeamDaysOff. +func (mr *MockWorkClientMockRecorder) UpdateTeamDaysOff(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTeamDaysOff", reflect.TypeOf((*MockWorkClient)(nil).UpdateTeamDaysOff), arg0, arg1) +} + +// UpdateTeamFieldValues mocks base method. +func (m *MockWorkClient) UpdateTeamFieldValues(arg0 context.Context, arg1 work.UpdateTeamFieldValuesArgs) (*work.TeamFieldValues, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTeamFieldValues", arg0, arg1) + ret0, _ := ret[0].(*work.TeamFieldValues) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTeamFieldValues indicates an expected call of UpdateTeamFieldValues. +func (mr *MockWorkClientMockRecorder) UpdateTeamFieldValues(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTeamFieldValues", reflect.TypeOf((*MockWorkClient)(nil).UpdateTeamFieldValues), arg0, arg1) +} + +// UpdateTeamSettings mocks base method. +func (m *MockWorkClient) UpdateTeamSettings(arg0 context.Context, arg1 work.UpdateTeamSettingsArgs) (*work.TeamSetting, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTeamSettings", arg0, arg1) + ret0, _ := ret[0].(*work.TeamSetting) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTeamSettings indicates an expected call of UpdateTeamSettings. +func (mr *MockWorkClientMockRecorder) UpdateTeamSettings(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTeamSettings", reflect.TypeOf((*MockWorkClient)(nil).UpdateTeamSettings), arg0, arg1) +} + +// UpdateWorkItemColumn mocks base method. +func (m *MockWorkClient) UpdateWorkItemColumn(arg0 context.Context, arg1 work.UpdateWorkItemColumnArgs) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateWorkItemColumn", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkItemColumn indicates an expected call of UpdateWorkItemColumn. +func (mr *MockWorkClientMockRecorder) UpdateWorkItemColumn(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkItemColumn", reflect.TypeOf((*MockWorkClient)(nil).UpdateWorkItemColumn), arg0, arg1) +} diff --git a/scripts/generate_mocks.sh b/scripts/generate_mocks.sh index d9ad7a0a..2af67fa2 100644 --- a/scripts/generate_mocks.sh +++ b/scripts/generate_mocks.sh @@ -65,6 +65,12 @@ mockgen \ -mock_names Client=MockWorkItemTrackingClient \ github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking Client +echo "Generating Azure DevOps Work client mock..." +mockgen \ + -package=mocks -destination internal/mocks/work_client_mock.go \ + -mock_names Client=MockWorkClient \ + github.com/microsoft/azure-devops-go-api/azuredevops/v7/work Client + echo "Generating Azure DevOps TaskAgent client mock..." mockgen \ -package=mocks -destination internal/mocks/taskagent_client_mock.go \ diff --git a/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/client.go b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/client.go new file mode 100644 index 00000000..6871e1e1 --- /dev/null +++ b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/client.go @@ -0,0 +1,2180 @@ +// -------------------------------------------------------------------------------------------- +// 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 work + +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("1d4f49f9-02b9-4e26-b826-2cdb6195f2a9") + +type Client interface { + // [Preview API] Add a new plan for the team + CreatePlan(context.Context, CreatePlanArgs) (*Plan, error) + // [Preview API] Delete the specified plan + DeletePlan(context.Context, DeletePlanArgs) error + // [Preview API] Delete a team's iteration by iterationId + DeleteTeamIteration(context.Context, DeleteTeamIterationArgs) error + // [Preview API] Get a backlog level + GetBacklog(context.Context, GetBacklogArgs) (*BacklogLevelConfiguration, error) + // [Preview API] Gets backlog configuration for a team + GetBacklogConfigurations(context.Context, GetBacklogConfigurationsArgs) (*BacklogConfiguration, error) + // [Preview API] Get a list of work items within a backlog level + GetBacklogLevelWorkItems(context.Context, GetBacklogLevelWorkItemsArgs) (*BacklogLevelWorkItems, error) + // [Preview API] List all backlog levels + GetBacklogs(context.Context, GetBacklogsArgs) (*[]BacklogLevelConfiguration, error) + // [Preview API] Get board + GetBoard(context.Context, GetBoardArgs) (*Board, error) + // [Preview API] Get board card Rule settings for the board id or board by name + GetBoardCardRuleSettings(context.Context, GetBoardCardRuleSettingsArgs) (*BoardCardRuleSettings, error) + // [Preview API] Get board card settings for the board id or board by name + GetBoardCardSettings(context.Context, GetBoardCardSettingsArgs) (*BoardCardSettings, error) + // [Preview API] Get columns on a board + GetBoardColumns(context.Context, GetBoardColumnsArgs) (*[]BoardColumn, error) + // [Preview API] Get a board chart + GetBoardChart(context.Context, GetBoardChartArgs) (*BoardChart, error) + // [Preview API] Get board charts + GetBoardCharts(context.Context, GetBoardChartsArgs) (*[]BoardChartReference, error) + // [Preview API] Returns the list of parent field filter model for the given list of workitem ids + GetBoardMappingParentItems(context.Context, GetBoardMappingParentItemsArgs) (*[]ParentChildWIMap, error) + // [Preview API] Get rows on a board + GetBoardRows(context.Context, GetBoardRowsArgs) (*[]BoardRow, error) + // [Preview API] Get boards + GetBoards(context.Context, GetBoardsArgs) (*[]BoardReference, error) + // [Preview API] Get board user settings for a board id + GetBoardUserSettings(context.Context, GetBoardUserSettingsArgs) (*BoardUserSettings, error) + // [Preview API] Get a team's capacity including total capacity and days off + GetCapacitiesWithIdentityRefAndTotals(context.Context, GetCapacitiesWithIdentityRefAndTotalsArgs) (*TeamCapacity, error) + // [Preview API] Get a team member's capacity + GetCapacityWithIdentityRef(context.Context, GetCapacityWithIdentityRefArgs) (*TeamMemberCapacityIdentityRef, error) + // [Preview API] + GetColumns(context.Context, GetColumnsArgs) (*TaskboardColumns, error) + // [Preview API] Get available board columns in a project + GetColumnSuggestedValues(context.Context, GetColumnSuggestedValuesArgs) (*[]BoardSuggestedValue, error) + // [Preview API] Get Delivery View Data + GetDeliveryTimelineData(context.Context, GetDeliveryTimelineDataArgs) (*DeliveryViewData, error) + // [Preview API] Get work items for iteration + GetIterationWorkItems(context.Context, GetIterationWorkItemsArgs) (*IterationWorkItems, error) + // [Preview API] Get the information for the specified plan + GetPlan(context.Context, GetPlanArgs) (*Plan, error) + // [Preview API] Get the information for all the plans configured for the given team + GetPlans(context.Context, GetPlansArgs) (*[]Plan, error) + // [Preview API] Get process configuration + GetProcessConfiguration(context.Context, GetProcessConfigurationArgs) (*ProcessConfiguration, error) + // [Preview API] Get available board rows in a project + GetRowSuggestedValues(context.Context, GetRowSuggestedValuesArgs) (*[]BoardSuggestedValue, error) + // [Preview API] Get team's days off for an iteration + GetTeamDaysOff(context.Context, GetTeamDaysOffArgs) (*TeamSettingsDaysOff, error) + // [Preview API] Get a collection of team field values + GetTeamFieldValues(context.Context, GetTeamFieldValuesArgs) (*TeamFieldValues, error) + // [Preview API] Get team's iteration by iterationId + GetTeamIteration(context.Context, GetTeamIterationArgs) (*TeamSettingsIteration, error) + // [Preview API] Get a team's iterations using timeframe filter + GetTeamIterations(context.Context, GetTeamIterationsArgs) (*[]TeamSettingsIteration, error) + // [Preview API] Get a team's settings + GetTeamSettings(context.Context, GetTeamSettingsArgs) (*TeamSetting, error) + // [Preview API] Get an iteration's capacity for all teams in iteration + GetTotalIterationCapacities(context.Context, GetTotalIterationCapacitiesArgs) (*IterationCapacity, error) + // [Preview API] + GetWorkItemColumns(context.Context, GetWorkItemColumnsArgs) (*[]TaskboardWorkItemColumn, error) + // [Preview API] Add an iteration to the team + PostTeamIteration(context.Context, PostTeamIterationArgs) (*TeamSettingsIteration, error) + // [Preview API] Reorder Product Backlog/Boards Work Items + ReorderBacklogWorkItems(context.Context, ReorderBacklogWorkItemsArgs) (*[]ReorderResult, error) + // [Preview API] Reorder Sprint Backlog/Taskboard Work Items + ReorderIterationWorkItems(context.Context, ReorderIterationWorkItemsArgs) (*[]ReorderResult, error) + // [Preview API] Replace a team's capacity + ReplaceCapacitiesWithIdentityRef(context.Context, ReplaceCapacitiesWithIdentityRefArgs) (*[]TeamMemberCapacityIdentityRef, error) + // [Preview API] Update board options + SetBoardOptions(context.Context, SetBoardOptionsArgs) (*map[string]string, error) + // [Preview API] Update board card Rule settings for the board id or board by name + UpdateBoardCardRuleSettings(context.Context, UpdateBoardCardRuleSettingsArgs) (*BoardCardRuleSettings, error) + // [Preview API] Update board card settings for the board id or board by name + UpdateBoardCardSettings(context.Context, UpdateBoardCardSettingsArgs) (*BoardCardSettings, error) + // [Preview API] Update columns on a board + UpdateBoardColumns(context.Context, UpdateBoardColumnsArgs) (*[]BoardColumn, error) + // [Preview API] Update a board chart + UpdateBoardChart(context.Context, UpdateBoardChartArgs) (*BoardChart, error) + // [Preview API] Update rows on a board + UpdateBoardRows(context.Context, UpdateBoardRowsArgs) (*[]BoardRow, error) + // [Preview API] Update board user settings for the board id + UpdateBoardUserSettings(context.Context, UpdateBoardUserSettingsArgs) (*BoardUserSettings, error) + // [Preview API] Update a team member's capacity + UpdateCapacityWithIdentityRef(context.Context, UpdateCapacityWithIdentityRefArgs) (*TeamMemberCapacityIdentityRef, error) + // [Preview API] + UpdateColumns(context.Context, UpdateColumnsArgs) (*TaskboardColumns, error) + // [Preview API] Update the information for the specified plan + UpdatePlan(context.Context, UpdatePlanArgs) (*Plan, error) + // [Preview API] Update taskboard card Rule settings + UpdateTaskboardCardRuleSettings(context.Context, UpdateTaskboardCardRuleSettingsArgs) error + // [Preview API] Update taskboard card settings + UpdateTaskboardCardSettings(context.Context, UpdateTaskboardCardSettingsArgs) error + // [Preview API] Set a team's days off for an iteration + UpdateTeamDaysOff(context.Context, UpdateTeamDaysOffArgs) (*TeamSettingsDaysOff, error) + // [Preview API] Update team field values + UpdateTeamFieldValues(context.Context, UpdateTeamFieldValuesArgs) (*TeamFieldValues, error) + // [Preview API] Update a team's settings + UpdateTeamSettings(context.Context, UpdateTeamSettingsArgs) (*TeamSetting, error) + // [Preview API] + UpdateWorkItemColumn(context.Context, UpdateWorkItemColumnArgs) 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] Add a new plan for the team +func (client *ClientImpl) CreatePlan(ctx context.Context, args CreatePlanArgs) (*Plan, error) { + if args.PostedPlan == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.PostedPlan"} + } + 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.PostedPlan) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("0b42cb47-cd73-4810-ac90-19c9ba147453") + 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 Plan + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the CreatePlan function +type CreatePlanArgs struct { + // (required) Plan definition + PostedPlan *CreatePlan + // (required) Project ID or project name + Project *string +} + +// [Preview API] Delete the specified plan +func (client *ClientImpl) DeletePlan(ctx context.Context, args DeletePlanArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Id == nil || *args.Id == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + locationId, _ := uuid.Parse("0b42cb47-cd73-4810-ac90-19c9ba147453") + _, 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 DeletePlan function +type DeletePlanArgs struct { + // (required) Project ID or project name + Project *string + // (required) Identifier of the plan + Id *string +} + +// [Preview API] Delete a team's iteration by iterationId +func (client *ClientImpl) DeleteTeamIteration(ctx context.Context, args DeleteTeamIterationArgs) error { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Id == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.Id"} + } + routeValues["id"] = (*args.Id).String() + + locationId, _ := uuid.Parse("c9175577-28a1-4b06-9197-8636af9f64ad") + _, 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 DeleteTeamIteration function +type DeleteTeamIterationArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + Id *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a backlog level +func (client *ClientImpl) GetBacklog(ctx context.Context, args GetBacklogArgs) (*BacklogLevelConfiguration, 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.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + if args.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + locationId, _ := uuid.Parse("a93726f9-7867-4e38-b4f2-0bfafc2f6a94") + 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 BacklogLevelConfiguration + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBacklog function +type GetBacklogArgs struct { + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string + // (required) The id of the backlog level + Id *string +} + +// [Preview API] Gets backlog configuration for a team +func (client *ClientImpl) GetBacklogConfigurations(ctx context.Context, args GetBacklogConfigurationsArgs) (*BacklogConfiguration, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + locationId, _ := uuid.Parse("7799f497-3cb5-4f16-ad4f-5cd06012db64") + 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 BacklogConfiguration + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBacklogConfigurations function +type GetBacklogConfigurationsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a list of work items within a backlog level +func (client *ClientImpl) GetBacklogLevelWorkItems(ctx context.Context, args GetBacklogLevelWorkItemsArgs) (*BacklogLevelWorkItems, 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.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + if args.BacklogId == nil || *args.BacklogId == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.BacklogId"} + } + routeValues["backlogId"] = *args.BacklogId + + locationId, _ := uuid.Parse("7c468d96-ab1d-4294-a360-92f07e9ccd98") + 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 BacklogLevelWorkItems + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBacklogLevelWorkItems function +type GetBacklogLevelWorkItemsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string + // (required) + BacklogId *string +} + +// [Preview API] List all backlog levels +func (client *ClientImpl) GetBacklogs(ctx context.Context, args GetBacklogsArgs) (*[]BacklogLevelConfiguration, 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.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + locationId, _ := uuid.Parse("a93726f9-7867-4e38-b4f2-0bfafc2f6a94") + 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 []BacklogLevelConfiguration + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBacklogs function +type GetBacklogsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Get board +func (client *ClientImpl) GetBoard(ctx context.Context, args GetBoardArgs) (*Board, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + locationId, _ := uuid.Parse("23ad19fc-3b8e-4877-8462-b3f92bc06b40") + 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 Board + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoard function +type GetBoardArgs struct { + // (required) Project ID or project name + Project *string + // (required) identifier for board, either board's backlog level name (Eg:"Stories") or Id + Id *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get board card Rule settings for the board id or board by name +func (client *ClientImpl) GetBoardCardRuleSettings(ctx context.Context, args GetBoardCardRuleSettingsArgs) (*BoardCardRuleSettings, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("b044a3d9-02ea-49c7-91a1-b730949cc896") + 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 BoardCardRuleSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardCardRuleSettings function +type GetBoardCardRuleSettingsArgs struct { + // (required) Project ID or project name + Project *string + // (required) + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get board card settings for the board id or board by name +func (client *ClientImpl) GetBoardCardSettings(ctx context.Context, args GetBoardCardSettingsArgs) (*BoardCardSettings, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("07c3b467-bc60-4f05-8e34-599ce288fafc") + 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 BoardCardSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardCardSettings function +type GetBoardCardSettingsArgs struct { + // (required) Project ID or project name + Project *string + // (required) + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get columns on a board +func (client *ClientImpl) GetBoardColumns(ctx context.Context, args GetBoardColumnsArgs) (*[]BoardColumn, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("c555d7ff-84e1-47df-9923-a3fe0cd8751b") + 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 []BoardColumn + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardColumns function +type GetBoardColumnsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Name or ID of the specific board + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a board chart +func (client *ClientImpl) GetBoardChart(ctx context.Context, args GetBoardChartArgs) (*BoardChart, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + if args.Name == nil || *args.Name == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Name"} + } + routeValues["name"] = *args.Name + + locationId, _ := uuid.Parse("45fe888c-239e-49fd-958c-df1a1ab21d97") + 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 BoardChart + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardChart function +type GetBoardChartArgs struct { + // (required) Project ID or project name + Project *string + // (required) Identifier for board, either board's backlog level name (Eg:"Stories") or Id + Board *string + // (required) The chart name + Name *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get board charts +func (client *ClientImpl) GetBoardCharts(ctx context.Context, args GetBoardChartsArgs) (*[]BoardChartReference, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("45fe888c-239e-49fd-958c-df1a1ab21d97") + 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 []BoardChartReference + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardCharts function +type GetBoardChartsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Identifier for board, either board's backlog level name (Eg:"Stories") or Id + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Returns the list of parent field filter model for the given list of workitem ids +func (client *ClientImpl) GetBoardMappingParentItems(ctx context.Context, args GetBoardMappingParentItemsArgs) (*[]ParentChildWIMap, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + queryParams := url.Values{} + if args.ChildBacklogContextCategoryRefName == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "childBacklogContextCategoryRefName"} + } + queryParams.Add("childBacklogContextCategoryRefName", *args.ChildBacklogContextCategoryRefName) + if args.WorkitemIds == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "workitemIds"} + } + var stringList []string + for _, item := range *args.WorkitemIds { + stringList = append(stringList, strconv.Itoa(item)) + } + listAsString := strings.Join((stringList)[:], ",") + queryParams.Add("workitemIds", listAsString) + locationId, _ := uuid.Parse("186abea3-5c35-432f-9e28-7a15b4312a0e") + 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 []ParentChildWIMap + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardMappingParentItems function +type GetBoardMappingParentItemsArgs struct { + // (required) Project ID or project name + Project *string + // (required) + ChildBacklogContextCategoryRefName *string + // (required) + WorkitemIds *[]int + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get rows on a board +func (client *ClientImpl) GetBoardRows(ctx context.Context, args GetBoardRowsArgs) (*[]BoardRow, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("0863355d-aefd-4d63-8669-984c9b7b0e78") + 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 []BoardRow + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardRows function +type GetBoardRowsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Name or ID of the specific board + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get boards +func (client *ClientImpl) GetBoards(ctx context.Context, args GetBoardsArgs) (*[]BoardReference, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + locationId, _ := uuid.Parse("23ad19fc-3b8e-4877-8462-b3f92bc06b40") + 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 []BoardReference + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoards function +type GetBoardsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get board user settings for a board id +func (client *ClientImpl) GetBoardUserSettings(ctx context.Context, args GetBoardUserSettingsArgs) (*BoardUserSettings, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + locationId, _ := uuid.Parse("b30d9f58-1891-4b0a-b168-c46408f919b0") + 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 BoardUserSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetBoardUserSettings function +type GetBoardUserSettingsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Board ID or Name + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a team's capacity including total capacity and days off +func (client *ClientImpl) GetCapacitiesWithIdentityRefAndTotals(ctx context.Context, args GetCapacitiesWithIdentityRefAndTotalsArgs) (*TeamCapacity, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + locationId, _ := uuid.Parse("74412d15-8c1a-4352-a48d-ef1ed5587d57") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.3", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TeamCapacity + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetCapacitiesWithIdentityRefAndTotals function +type GetCapacitiesWithIdentityRefAndTotalsArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a team member's capacity +func (client *ClientImpl) GetCapacityWithIdentityRef(ctx context.Context, args GetCapacityWithIdentityRefArgs) (*TeamMemberCapacityIdentityRef, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + if args.TeamMemberId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TeamMemberId"} + } + routeValues["teamMemberId"] = (*args.TeamMemberId).String() + + locationId, _ := uuid.Parse("74412d15-8c1a-4352-a48d-ef1ed5587d57") + resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "7.1-preview.3", routeValues, nil, nil, "", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TeamMemberCapacityIdentityRef + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetCapacityWithIdentityRef function +type GetCapacityWithIdentityRefArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (required) ID of the team member + TeamMemberId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] +func (client *ClientImpl) GetColumns(ctx context.Context, args GetColumnsArgs) (*TaskboardColumns, 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.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + locationId, _ := uuid.Parse("c6815dbe-8e7e-4ffe-9a79-e83ee712aa92") + 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 TaskboardColumns + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetColumns function +type GetColumnsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Get available board columns in a project +func (client *ClientImpl) GetColumnSuggestedValues(ctx context.Context, args GetColumnSuggestedValuesArgs) (*[]BoardSuggestedValue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + locationId, _ := uuid.Parse("eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d") + 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 []BoardSuggestedValue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetColumnSuggestedValues function +type GetColumnSuggestedValuesArgs struct { + // (optional) Project ID or project name + Project *string +} + +// [Preview API] Get Delivery View Data +func (client *ClientImpl) GetDeliveryTimelineData(ctx context.Context, args GetDeliveryTimelineDataArgs) (*DeliveryViewData, 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.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + queryParams := url.Values{} + if args.Revision != nil { + queryParams.Add("revision", strconv.Itoa(*args.Revision)) + } + if args.StartDate != nil { + queryParams.Add("startDate", (*args.StartDate).AsQueryParameter()) + } + if args.EndDate != nil { + queryParams.Add("endDate", (*args.EndDate).AsQueryParameter()) + } + locationId, _ := uuid.Parse("bdd0834e-101f-49f0-a6ae-509f384a12b4") + 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 DeliveryViewData + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetDeliveryTimelineData function +type GetDeliveryTimelineDataArgs struct { + // (required) Project ID or project name + Project *string + // (required) Identifier for delivery view + Id *string + // (optional) Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. + Revision *int + // (optional) The start date of timeline + StartDate *azuredevops.Time + // (optional) The end date of timeline + EndDate *azuredevops.Time +} + +// [Preview API] Get work items for iteration +func (client *ClientImpl) GetIterationWorkItems(ctx context.Context, args GetIterationWorkItemsArgs) (*IterationWorkItems, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + locationId, _ := uuid.Parse("5b3ef1a6-d3ab-44cd-bafd-c7f45db850fa") + 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 IterationWorkItems + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetIterationWorkItems function +type GetIterationWorkItemsArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get the information for the specified plan +func (client *ClientImpl) GetPlan(ctx context.Context, args GetPlanArgs) (*Plan, 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.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + locationId, _ := uuid.Parse("0b42cb47-cd73-4810-ac90-19c9ba147453") + 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 Plan + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetPlan function +type GetPlanArgs struct { + // (required) Project ID or project name + Project *string + // (required) Identifier of the plan + Id *string +} + +// [Preview API] Get the information for all the plans configured for the given team +func (client *ClientImpl) GetPlans(ctx context.Context, args GetPlansArgs) (*[]Plan, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + locationId, _ := uuid.Parse("0b42cb47-cd73-4810-ac90-19c9ba147453") + 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 []Plan + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetPlans function +type GetPlansArgs struct { + // (required) Project ID or project name + Project *string +} + +// [Preview API] Get process configuration +func (client *ClientImpl) GetProcessConfiguration(ctx context.Context, args GetProcessConfigurationArgs) (*ProcessConfiguration, error) { + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + + locationId, _ := uuid.Parse("f901ba42-86d2-4b0c-89c1-3f86d06daa84") + 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 ProcessConfiguration + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetProcessConfiguration function +type GetProcessConfigurationArgs struct { + // (required) Project ID or project name + Project *string +} + +// [Preview API] Get available board rows in a project +func (client *ClientImpl) GetRowSuggestedValues(ctx context.Context, args GetRowSuggestedValuesArgs) (*[]BoardSuggestedValue, error) { + routeValues := make(map[string]string) + if args.Project != nil && *args.Project != "" { + routeValues["project"] = *args.Project + } + + locationId, _ := uuid.Parse("bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9") + 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 []BoardSuggestedValue + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetRowSuggestedValues function +type GetRowSuggestedValuesArgs struct { + // (optional) Project ID or project name + Project *string +} + +// [Preview API] Get team's days off for an iteration +func (client *ClientImpl) GetTeamDaysOff(ctx context.Context, args GetTeamDaysOffArgs) (*TeamSettingsDaysOff, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + locationId, _ := uuid.Parse("2d4faa2e-9150-4cbf-a47a-932b1b4a0773") + 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 TeamSettingsDaysOff + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTeamDaysOff function +type GetTeamDaysOffArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a collection of team field values +func (client *ClientImpl) GetTeamFieldValues(ctx context.Context, args GetTeamFieldValuesArgs) (*TeamFieldValues, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + locationId, _ := uuid.Parse("07ced576-58ed-49e6-9c1e-5cb53ab8bf2a") + 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 TeamFieldValues + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTeamFieldValues function +type GetTeamFieldValuesArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get team's iteration by iterationId +func (client *ClientImpl) GetTeamIteration(ctx context.Context, args GetTeamIterationArgs) (*TeamSettingsIteration, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Id == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Id"} + } + routeValues["id"] = (*args.Id).String() + + locationId, _ := uuid.Parse("c9175577-28a1-4b06-9197-8636af9f64ad") + 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 TeamSettingsIteration + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTeamIteration function +type GetTeamIterationArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + Id *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get a team's iterations using timeframe filter +func (client *ClientImpl) GetTeamIterations(ctx context.Context, args GetTeamIterationsArgs) (*[]TeamSettingsIteration, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + queryParams := url.Values{} + if args.Timeframe != nil { + queryParams.Add("$timeframe", *args.Timeframe) + } + locationId, _ := uuid.Parse("c9175577-28a1-4b06-9197-8636af9f64ad") + 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 []TeamSettingsIteration + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTeamIterations function +type GetTeamIterationsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string + // (optional) A filter for which iterations are returned based on relative time. Only Current is supported currently. + Timeframe *string +} + +// [Preview API] Get a team's settings +func (client *ClientImpl) GetTeamSettings(ctx context.Context, args GetTeamSettingsArgs) (*TeamSetting, 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.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + locationId, _ := uuid.Parse("c3c1012b-bea7-49d7-b45e-1664e566f84c") + 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 TeamSetting + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTeamSettings function +type GetTeamSettingsArgs struct { + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Get an iteration's capacity for all teams in iteration +func (client *ClientImpl) GetTotalIterationCapacities(ctx context.Context, args GetTotalIterationCapacitiesArgs) (*IterationCapacity, 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.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + locationId, _ := uuid.Parse("1e385ce0-396b-4273-8171-d64562c18d37") + 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 IterationCapacity + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetTotalIterationCapacities function +type GetTotalIterationCapacitiesArgs struct { + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID +} + +// [Preview API] +func (client *ClientImpl) GetWorkItemColumns(ctx context.Context, args GetWorkItemColumnsArgs) (*[]TaskboardWorkItemColumn, 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.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + locationId, _ := uuid.Parse("1be23c36-8872-4abc-b57d-402cd6c669d9") + 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 []TaskboardWorkItemColumn + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the GetWorkItemColumns function +type GetWorkItemColumnsArgs struct { + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string + // (required) + IterationId *uuid.UUID +} + +// [Preview API] Add an iteration to the team +func (client *ClientImpl) PostTeamIteration(ctx context.Context, args PostTeamIterationArgs) (*TeamSettingsIteration, error) { + if args.Iteration == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Iteration"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + body, marshalErr := json.Marshal(*args.Iteration) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("c9175577-28a1-4b06-9197-8636af9f64ad") + 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 TeamSettingsIteration + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the PostTeamIteration function +type PostTeamIterationArgs struct { + // (required) Iteration to add + Iteration *TeamSettingsIteration + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Reorder Product Backlog/Boards Work Items +func (client *ClientImpl) ReorderBacklogWorkItems(ctx context.Context, args ReorderBacklogWorkItemsArgs) (*[]ReorderResult, error) { + if args.Operation == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Operation"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + body, marshalErr := json.Marshal(*args.Operation) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("1c22b714-e7e4-41b9-85e0-56ee13ef55ed") + 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 []ReorderResult + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the ReorderBacklogWorkItems function +type ReorderBacklogWorkItemsArgs struct { + // (required) + Operation *ReorderOperation + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Reorder Sprint Backlog/Taskboard Work Items +func (client *ClientImpl) ReorderIterationWorkItems(ctx context.Context, args ReorderIterationWorkItemsArgs) (*[]ReorderResult, error) { + if args.Operation == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Operation"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + body, marshalErr := json.Marshal(*args.Operation) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("47755db2-d7eb-405a-8c25-675401525fc9") + 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 []ReorderResult + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the ReorderIterationWorkItems function +type ReorderIterationWorkItemsArgs struct { + // (required) + Operation *ReorderOperation + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string + // (required) The id of the iteration + IterationId *uuid.UUID +} + +// [Preview API] Replace a team's capacity +func (client *ClientImpl) ReplaceCapacitiesWithIdentityRef(ctx context.Context, args ReplaceCapacitiesWithIdentityRefArgs) (*[]TeamMemberCapacityIdentityRef, error) { + if args.Capacities == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Capacities"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + body, marshalErr := json.Marshal(*args.Capacities) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("74412d15-8c1a-4352-a48d-ef1ed5587d57") + resp, err := client.Client.Send(ctx, http.MethodPut, locationId, "7.1-preview.3", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue []TeamMemberCapacityIdentityRef + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the ReplaceCapacitiesWithIdentityRef function +type ReplaceCapacitiesWithIdentityRefArgs struct { + // (required) Team capacity to replace + Capacities *[]TeamMemberCapacityIdentityRef + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update board options +func (client *ClientImpl) SetBoardOptions(ctx context.Context, args SetBoardOptionsArgs) (*map[string]string, error) { + if args.Options == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Options"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + body, marshalErr := json.Marshal(*args.Options) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("23ad19fc-3b8e-4877-8462-b3f92bc06b40") + 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 map[string]string + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the SetBoardOptions function +type SetBoardOptionsArgs struct { + // (required) options to updated + Options *map[string]string + // (required) Project ID or project name + Project *string + // (required) identifier for board, either category plural name (Eg:"Stories") or guid + Id *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update board card Rule settings for the board id or board by name +func (client *ClientImpl) UpdateBoardCardRuleSettings(ctx context.Context, args UpdateBoardCardRuleSettingsArgs) (*BoardCardRuleSettings, error) { + if args.BoardCardRuleSettings == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.BoardCardRuleSettings"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + body, marshalErr := json.Marshal(*args.BoardCardRuleSettings) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("b044a3d9-02ea-49c7-91a1-b730949cc896") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.2", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue BoardCardRuleSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardCardRuleSettings function +type UpdateBoardCardRuleSettingsArgs struct { + // (required) + BoardCardRuleSettings *BoardCardRuleSettings + // (required) Project ID or project name + Project *string + // (required) + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update board card settings for the board id or board by name +func (client *ClientImpl) UpdateBoardCardSettings(ctx context.Context, args UpdateBoardCardSettingsArgs) (*BoardCardSettings, error) { + if args.BoardCardSettingsToSave == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.BoardCardSettingsToSave"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + body, marshalErr := json.Marshal(*args.BoardCardSettingsToSave) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("07c3b467-bc60-4f05-8e34-599ce288fafc") + 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 BoardCardSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardCardSettings function +type UpdateBoardCardSettingsArgs struct { + // (required) + BoardCardSettingsToSave *BoardCardSettings + // (required) Project ID or project name + Project *string + // (required) + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update columns on a board +func (client *ClientImpl) UpdateBoardColumns(ctx context.Context, args UpdateBoardColumnsArgs) (*[]BoardColumn, error) { + if args.BoardColumns == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.BoardColumns"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + body, marshalErr := json.Marshal(*args.BoardColumns) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("c555d7ff-84e1-47df-9923-a3fe0cd8751b") + 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 []BoardColumn + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardColumns function +type UpdateBoardColumnsArgs struct { + // (required) List of board columns to update + BoardColumns *[]BoardColumn + // (required) Project ID or project name + Project *string + // (required) Name or ID of the specific board + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update a board chart +func (client *ClientImpl) UpdateBoardChart(ctx context.Context, args UpdateBoardChartArgs) (*BoardChart, error) { + if args.Chart == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Chart"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + if args.Name == nil || *args.Name == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Name"} + } + routeValues["name"] = *args.Name + + body, marshalErr := json.Marshal(*args.Chart) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("45fe888c-239e-49fd-958c-df1a1ab21d97") + 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 BoardChart + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardChart function +type UpdateBoardChartArgs struct { + // (required) + Chart *BoardChart + // (required) Project ID or project name + Project *string + // (required) Identifier for board, either board's backlog level name (Eg:"Stories") or Id + Board *string + // (required) The chart name + Name *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update rows on a board +func (client *ClientImpl) UpdateBoardRows(ctx context.Context, args UpdateBoardRowsArgs) (*[]BoardRow, error) { + if args.BoardRows == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.BoardRows"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + body, marshalErr := json.Marshal(*args.BoardRows) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("0863355d-aefd-4d63-8669-984c9b7b0e78") + 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 []BoardRow + err = client.Client.UnmarshalCollectionBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardRows function +type UpdateBoardRowsArgs struct { + // (required) List of board rows to update + BoardRows *[]BoardRow + // (required) Project ID or project name + Project *string + // (required) Name or ID of the specific board + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update board user settings for the board id +func (client *ClientImpl) UpdateBoardUserSettings(ctx context.Context, args UpdateBoardUserSettingsArgs) (*BoardUserSettings, error) { + if args.BoardUserSettings == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.BoardUserSettings"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.Board == nil || *args.Board == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Board"} + } + routeValues["board"] = *args.Board + + body, marshalErr := json.Marshal(*args.BoardUserSettings) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("b30d9f58-1891-4b0a-b168-c46408f919b0") + 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 BoardUserSettings + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateBoardUserSettings function +type UpdateBoardUserSettingsArgs struct { + // (required) + BoardUserSettings *map[string]string + // (required) Project ID or project name + Project *string + // (required) + Board *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update a team member's capacity +func (client *ClientImpl) UpdateCapacityWithIdentityRef(ctx context.Context, args UpdateCapacityWithIdentityRefArgs) (*TeamMemberCapacityIdentityRef, error) { + if args.Patch == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Patch"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + if args.TeamMemberId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TeamMemberId"} + } + routeValues["teamMemberId"] = (*args.TeamMemberId).String() + + body, marshalErr := json.Marshal(*args.Patch) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("74412d15-8c1a-4352-a48d-ef1ed5587d57") + resp, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.3", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return nil, err + } + + var responseValue TeamMemberCapacityIdentityRef + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateCapacityWithIdentityRef function +type UpdateCapacityWithIdentityRefArgs struct { + // (required) Updated capacity + Patch *CapacityPatch + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (required) ID of the team member + TeamMemberId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] +func (client *ClientImpl) UpdateColumns(ctx context.Context, args UpdateColumnsArgs) (*TaskboardColumns, error) { + if args.UpdateColumns == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.UpdateColumns"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + body, marshalErr := json.Marshal(*args.UpdateColumns) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("c6815dbe-8e7e-4ffe-9a79-e83ee712aa92") + 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 TaskboardColumns + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateColumns function +type UpdateColumnsArgs struct { + // (required) + UpdateColumns *[]UpdateTaskboardColumn + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Update the information for the specified plan +func (client *ClientImpl) UpdatePlan(ctx context.Context, args UpdatePlanArgs) (*Plan, error) { + if args.UpdatedPlan == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.UpdatedPlan"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Id == nil || *args.Id == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Id"} + } + routeValues["id"] = *args.Id + + body, marshalErr := json.Marshal(*args.UpdatedPlan) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("0b42cb47-cd73-4810-ac90-19c9ba147453") + 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 Plan + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdatePlan function +type UpdatePlanArgs struct { + // (required) Plan definition to be updated + UpdatedPlan *UpdatePlan + // (required) Project ID or project name + Project *string + // (required) Identifier of the plan + Id *string +} + +// [Preview API] Update taskboard card Rule settings +func (client *ClientImpl) UpdateTaskboardCardRuleSettings(ctx context.Context, args UpdateTaskboardCardRuleSettingsArgs) error { + if args.BoardCardRuleSettings == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.BoardCardRuleSettings"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + body, marshalErr := json.Marshal(*args.BoardCardRuleSettings) + if marshalErr != nil { + return marshalErr + } + locationId, _ := uuid.Parse("3f84a8d1-1aab-423e-a94b-6dcbdcca511f") + _, err := client.Client.Send(ctx, http.MethodPatch, locationId, "7.1-preview.2", routeValues, nil, bytes.NewReader(body), "application/json", "application/json", nil) + if err != nil { + return err + } + + return nil +} + +// Arguments for the UpdateTaskboardCardRuleSettings function +type UpdateTaskboardCardRuleSettingsArgs struct { + // (required) + BoardCardRuleSettings *BoardCardRuleSettings + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Update taskboard card settings +func (client *ClientImpl) UpdateTaskboardCardSettings(ctx context.Context, args UpdateTaskboardCardSettingsArgs) error { + if args.BoardCardSettingsToSave == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.BoardCardSettingsToSave"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + + body, marshalErr := json.Marshal(*args.BoardCardSettingsToSave) + if marshalErr != nil { + return marshalErr + } + locationId, _ := uuid.Parse("0d63745f-31f3-4cf3-9056-2a064e567637") + _, 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 err + } + + return nil +} + +// Arguments for the UpdateTaskboardCardSettings function +type UpdateTaskboardCardSettingsArgs struct { + // (required) + BoardCardSettingsToSave *BoardCardSettings + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string +} + +// [Preview API] Set a team's days off for an iteration +func (client *ClientImpl) UpdateTeamDaysOff(ctx context.Context, args UpdateTeamDaysOffArgs) (*TeamSettingsDaysOff, error) { + if args.DaysOffPatch == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.DaysOffPatch"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + if args.IterationId == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + + body, marshalErr := json.Marshal(*args.DaysOffPatch) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("2d4faa2e-9150-4cbf-a47a-932b1b4a0773") + 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 TeamSettingsDaysOff + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateTeamDaysOff function +type UpdateTeamDaysOffArgs struct { + // (required) Team's days off patch containing a list of start and end dates + DaysOffPatch *TeamSettingsDaysOffPatch + // (required) Project ID or project name + Project *string + // (required) ID of the iteration + IterationId *uuid.UUID + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update team field values +func (client *ClientImpl) UpdateTeamFieldValues(ctx context.Context, args UpdateTeamFieldValuesArgs) (*TeamFieldValues, error) { + if args.Patch == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Patch"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + body, marshalErr := json.Marshal(*args.Patch) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("07ced576-58ed-49e6-9c1e-5cb53ab8bf2a") + 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 TeamFieldValues + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateTeamFieldValues function +type UpdateTeamFieldValuesArgs struct { + // (required) + Patch *TeamFieldValuesPatch + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] Update a team's settings +func (client *ClientImpl) UpdateTeamSettings(ctx context.Context, args UpdateTeamSettingsArgs) (*TeamSetting, error) { + if args.TeamSettingsPatch == nil { + return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TeamSettingsPatch"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team != nil && *args.Team != "" { + routeValues["team"] = *args.Team + } + + body, marshalErr := json.Marshal(*args.TeamSettingsPatch) + if marshalErr != nil { + return nil, marshalErr + } + locationId, _ := uuid.Parse("c3c1012b-bea7-49d7-b45e-1664e566f84c") + 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 TeamSetting + err = client.Client.UnmarshalBody(resp, &responseValue) + return &responseValue, err +} + +// Arguments for the UpdateTeamSettings function +type UpdateTeamSettingsArgs struct { + // (required) TeamSettings changes + TeamSettingsPatch *TeamSettingsPatch + // (required) Project ID or project name + Project *string + // (optional) Team ID or team name + Team *string +} + +// [Preview API] +func (client *ClientImpl) UpdateWorkItemColumn(ctx context.Context, args UpdateWorkItemColumnArgs) error { + if args.UpdateColumn == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.UpdateColumn"} + } + routeValues := make(map[string]string) + if args.Project == nil || *args.Project == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Project"} + } + routeValues["project"] = *args.Project + if args.Team == nil || *args.Team == "" { + return &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.Team"} + } + routeValues["team"] = *args.Team + if args.IterationId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.IterationId"} + } + routeValues["iterationId"] = (*args.IterationId).String() + if args.WorkItemId == nil { + return &azuredevops.ArgumentNilError{ArgumentName: "args.WorkItemId"} + } + routeValues["workItemId"] = strconv.Itoa(*args.WorkItemId) + + body, marshalErr := json.Marshal(*args.UpdateColumn) + if marshalErr != nil { + return marshalErr + } + locationId, _ := uuid.Parse("1be23c36-8872-4abc-b57d-402cd6c669d9") + _, 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 err + } + + return nil +} + +// Arguments for the UpdateWorkItemColumn function +type UpdateWorkItemColumnArgs struct { + // (required) + UpdateColumn *UpdateTaskboardWorkItemColumn + // (required) Project ID or project name + Project *string + // (required) Team ID or team name + Team *string + // (required) + IterationId *uuid.UUID + // (required) + WorkItemId *int +} diff --git a/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/models.go b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/models.go new file mode 100644 index 00000000..d49eb426 --- /dev/null +++ b/vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/work/models.go @@ -0,0 +1,1017 @@ +// -------------------------------------------------------------------------------------------- +// 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 work + +import ( + "github.com/google/uuid" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/webapi" + "github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking" +) + +type Activity struct { + CapacityPerDay *float32 `json:"capacityPerDay,omitempty"` + Name *string `json:"name,omitempty"` +} + +type attribute struct { +} + +type BacklogColumn struct { + ColumnFieldReference *workitemtracking.WorkItemFieldReference `json:"columnFieldReference,omitempty"` + Width *int `json:"width,omitempty"` +} + +type BacklogConfiguration struct { + // Behavior/type field mapping + BacklogFields *BacklogFields `json:"backlogFields,omitempty"` + // Bugs behavior + BugsBehavior *BugsBehavior `json:"bugsBehavior,omitempty"` + // Hidden Backlog + HiddenBacklogs *[]string `json:"hiddenBacklogs,omitempty"` + // Is BugsBehavior Configured in the process + IsBugsBehaviorConfigured *bool `json:"isBugsBehaviorConfigured,omitempty"` + // Portfolio backlog descriptors + PortfolioBacklogs *[]BacklogLevelConfiguration `json:"portfolioBacklogs,omitempty"` + // Requirement backlog + RequirementBacklog *BacklogLevelConfiguration `json:"requirementBacklog,omitempty"` + // Task backlog + TaskBacklog *BacklogLevelConfiguration `json:"taskBacklog,omitempty"` + Url *string `json:"url,omitempty"` + // Mapped states for work item types + WorkItemTypeMappedStates *[]WorkItemTypeStateInfo `json:"workItemTypeMappedStates,omitempty"` +} + +type BacklogFields struct { + // Field Type (e.g. Order, Activity) to Field Reference Name map + TypeFields *map[string]string `json:"typeFields,omitempty"` +} + +// Contract representing a backlog level +type BacklogLevel struct { + // Reference name of the corresponding WIT category + CategoryReferenceName *string `json:"categoryReferenceName,omitempty"` + // Plural name for the backlog level + PluralName *string `json:"pluralName,omitempty"` + // Collection of work item states that are included in the plan. The server will filter to only these work item types. + WorkItemStates *[]string `json:"workItemStates,omitempty"` + // Collection of valid workitem type names for the given backlog level + WorkItemTypes *[]string `json:"workItemTypes,omitempty"` +} + +type BacklogLevelConfiguration struct { + // List of fields to include in Add Panel + AddPanelFields *[]workitemtracking.WorkItemFieldReference `json:"addPanelFields,omitempty"` + // Color for the backlog level + Color *string `json:"color,omitempty"` + // Default list of columns for the backlog + ColumnFields *[]BacklogColumn `json:"columnFields,omitempty"` + // Default Work Item Type for the backlog + DefaultWorkItemType *workitemtracking.WorkItemTypeReference `json:"defaultWorkItemType,omitempty"` + // Backlog Id (for Legacy Backlog Level from process config it can be categoryref name) + Id *string `json:"id,omitempty"` + // Indicates whether the backlog level is hidden + IsHidden *bool `json:"isHidden,omitempty"` + // Backlog Name + Name *string `json:"name,omitempty"` + // Backlog Rank (Taskbacklog is 0) + Rank *int `json:"rank,omitempty"` + // The type of this backlog level + Type *BacklogType `json:"type,omitempty"` + // Max number of work items to show in the given backlog + WorkItemCountLimit *int `json:"workItemCountLimit,omitempty"` + // Work Item types participating in this backlog as known by the project/Process, can be overridden by team settings for bugs + WorkItemTypes *[]workitemtracking.WorkItemTypeReference `json:"workItemTypes,omitempty"` +} + +// Represents work items in a backlog level +type BacklogLevelWorkItems struct { + // A list of work items within a backlog level + WorkItems *[]workitemtracking.WorkItemLink `json:"workItems,omitempty"` +} + +// Definition of the type of backlog level +type BacklogType string + +type backlogTypeValuesType struct { + Portfolio BacklogType + Requirement BacklogType + Task BacklogType +} + +var BacklogTypeValues = backlogTypeValuesType{ + // Portfolio backlog level + Portfolio: "portfolio", + // Requirement backlog level + Requirement: "requirement", + // Task backlog level + Task: "task", +} + +type Board struct { + // Id of the resource + Id *uuid.UUID `json:"id,omitempty"` + // Name of the resource + Name *string `json:"name,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + Links interface{} `json:"_links,omitempty"` + AllowedMappings *map[string]map[string][]string `json:"allowedMappings,omitempty"` + CanEdit *bool `json:"canEdit,omitempty"` + Columns *[]BoardColumn `json:"columns,omitempty"` + Fields *BoardFields `json:"fields,omitempty"` + IsValid *bool `json:"isValid,omitempty"` + Revision *int `json:"revision,omitempty"` + Rows *[]BoardRow `json:"rows,omitempty"` +} + +// Represents a board badge. +type BoardBadge struct { + // The ID of the board represented by this badge. + BoardId *uuid.UUID `json:"boardId,omitempty"` + // A link to the SVG resource. + ImageUrl *string `json:"imageUrl,omitempty"` +} + +// Determines what columns to include on the board badge +type BoardBadgeColumnOptions string + +type boardBadgeColumnOptionsValuesType struct { + InProgressColumns BoardBadgeColumnOptions + AllColumns BoardBadgeColumnOptions + CustomColumns BoardBadgeColumnOptions +} + +var BoardBadgeColumnOptionsValues = boardBadgeColumnOptionsValuesType{ + // Only include In Progress columns + InProgressColumns: "inProgressColumns", + // Include all columns + AllColumns: "allColumns", + // Include a custom set of columns + CustomColumns: "customColumns", +} + +type BoardCardRuleSettings struct { + Links interface{} `json:"_links,omitempty"` + Rules *map[string][]Rule `json:"rules,omitempty"` + Url *string `json:"url,omitempty"` +} + +type BoardCardSettings struct { + Cards *map[string][]FieldSetting `json:"cards,omitempty"` +} + +type BoardColumn struct { + ColumnType *BoardColumnType `json:"columnType,omitempty"` + Description *string `json:"description,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + IsSplit *bool `json:"isSplit,omitempty"` + ItemLimit *int `json:"itemLimit,omitempty"` + Name *string `json:"name,omitempty"` + StateMappings *map[string]string `json:"stateMappings,omitempty"` +} + +type BoardColumnType string + +type boardColumnTypeValuesType struct { + Incoming BoardColumnType + InProgress BoardColumnType + Outgoing BoardColumnType +} + +var BoardColumnTypeValues = boardColumnTypeValuesType{ + Incoming: "incoming", + InProgress: "inProgress", + Outgoing: "outgoing", +} + +type BoardFields struct { + ColumnField *FieldReference `json:"columnField,omitempty"` + DoneField *FieldReference `json:"doneField,omitempty"` + RowField *FieldReference `json:"rowField,omitempty"` +} + +type BoardChart struct { + // Name of the resource + Name *string `json:"name,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // The links for the resource + Links interface{} `json:"_links,omitempty"` + // The settings for the resource + Settings *map[string]interface{} `json:"settings,omitempty"` +} + +type BoardChartReference struct { + // Name of the resource + Name *string `json:"name,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` +} + +type BoardReference struct { + // Id of the resource + Id *uuid.UUID `json:"id,omitempty"` + // Name of the resource + Name *string `json:"name,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` +} + +type BoardRow struct { + Color *string `json:"color,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +type BoardSuggestedValue struct { + Name *string `json:"name,omitempty"` +} + +type BoardUserSettings struct { + AutoRefreshState *bool `json:"autoRefreshState,omitempty"` +} + +// The behavior of the work item types that are in the work item category specified in the BugWorkItems section in the Process Configuration +type BugsBehavior string + +type bugsBehaviorValuesType struct { + Off BugsBehavior + AsRequirements BugsBehavior + AsTasks BugsBehavior +} + +var BugsBehaviorValues = bugsBehaviorValuesType{ + Off: "off", + AsRequirements: "asRequirements", + AsTasks: "asTasks", +} + +type CapacityContractBase struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Collection of capacities associated with the team member + Activities *[]Activity `json:"activities,omitempty"` + // The days off associated with the team member + DaysOff *[]DateRange `json:"daysOff,omitempty"` +} + +// Expected data from PATCH +type CapacityPatch struct { + Activities *[]Activity `json:"activities,omitempty"` + DaysOff *[]DateRange `json:"daysOff,omitempty"` +} + +// Card settings, such as fields and rules +type CardFieldSettings struct { + // A collection of field information of additional fields on cards. The index in the collection signifies the order of the field among the additional fields. Currently unused. Should be used with User Story 691539: Card setting: additional fields + AdditionalFields *[]FieldInfo `json:"additionalFields,omitempty"` + // Display format for the assigned to field + AssignedToDisplayFormat *IdentityDisplayFormat `json:"assignedToDisplayFormat,omitempty"` + // A collection of field information of rendered core fields on cards. + CoreFields *[]FieldInfo `json:"coreFields,omitempty"` + // Flag indicating whether to show assigned to field on cards. When true, AssignedToDisplayFormat will determine how the field will be displayed + ShowAssignedTo *bool `json:"showAssignedTo,omitempty"` + // Flag indicating whether to show empty fields on cards + ShowEmptyFields *bool `json:"showEmptyFields,omitempty"` + // Flag indicating whether to show child rollup on cards + ShowChildRollup *bool `json:"showChildRollup,omitempty"` + // Flag indicating whether to show ID on cards + ShowId *bool `json:"showId,omitempty"` + // Flag indicating whether to show parent field on cards + ShowParent *bool `json:"showParent,omitempty"` + // Flag indicating whether to show state field on cards + ShowState *bool `json:"showState,omitempty"` + // Flag indicating whether to show tags on cards + ShowTags *bool `json:"showTags,omitempty"` +} + +// Card settings, such as fields and rules +type CardSettings struct { + // A collection of settings related to rendering of fields on cards + Fields *CardFieldSettings `json:"fields,omitempty"` +} + +// Details about a given backlog category +type CategoryConfiguration struct { + // Name + Name *string `json:"name,omitempty"` + // Category Reference Name + ReferenceName *string `json:"referenceName,omitempty"` + // Work item types for the backlog category + WorkItemTypes *[]workitemtracking.WorkItemTypeReference `json:"workItemTypes,omitempty"` +} + +type CreatePlan struct { + // Description of the plan + Description *string `json:"description,omitempty"` + // Name of the plan to create. + Name *string `json:"name,omitempty"` + // Plan properties. + Properties interface{} `json:"properties,omitempty"` + // Type of plan to create. + Type *PlanType `json:"type,omitempty"` +} + +type DateRange struct { + // End of the date range. + End *azuredevops.Time `json:"end,omitempty"` + // Start of the date range. + Start *azuredevops.Time `json:"start,omitempty"` +} + +// Data contract for Data of Delivery View +type DeliveryViewData struct { + Id *uuid.UUID `json:"id,omitempty"` + Revision *int `json:"revision,omitempty"` + // Filter criteria status of the timeline + CriteriaStatus *TimelineCriteriaStatus `json:"criteriaStatus,omitempty"` + // The end date of the delivery view data + EndDate *azuredevops.Time `json:"endDate,omitempty"` + // Work item child id to parent id map + ChildIdToParentIdMap *map[int]int `json:"childIdToParentIdMap,omitempty"` + // Max number of teams that can be configured for a delivery plan + MaxExpandedTeams *int `json:"maxExpandedTeams,omitempty"` + // Mapping between parent id, title and all the child work item ids + ParentItemMaps *[]ParentChildWIMap `json:"parentItemMaps,omitempty"` + // The start date for the delivery view data + StartDate *azuredevops.Time `json:"startDate,omitempty"` + // All the team data + Teams *[]TimelineTeamData `json:"teams,omitempty"` + // List of all work item ids that have a dependency but not a violation + WorkItemDependencies *[]int `json:"workItemDependencies,omitempty"` + // List of all work item ids that have a violation + WorkItemViolations *[]int `json:"workItemViolations,omitempty"` +} + +// Collection of properties, specific to the DeliveryTimelineView +type DeliveryViewPropertyCollection struct { + // Card settings + CardSettings *CardSettings `json:"cardSettings,omitempty"` + // Field criteria + Criteria *[]FilterClause `json:"criteria,omitempty"` + // Markers. Will be missing/null if there are no markers. + Markers *[]Marker `json:"markers,omitempty"` + // Card style settings + StyleSettings *[]Rule `json:"styleSettings,omitempty"` + // tag style settings + TagStyleSettings *[]Rule `json:"tagStyleSettings,omitempty"` + // Team backlog mappings + TeamBacklogMappings *[]TeamBacklogMapping `json:"teamBacklogMappings,omitempty"` +} + +// Object bag storing the set of permissions relevant to this plan +type FieldInfo struct { + // The additional field display name + DisplayName *string `json:"displayName,omitempty"` + // The additional field type + FieldType *FieldType `json:"fieldType,omitempty"` + // Indicates if the field definition is for an identity field. + IsIdentity *bool `json:"isIdentity,omitempty"` + // The additional field reference name + ReferenceName *string `json:"referenceName,omitempty"` +} + +// An abstracted reference to a field +type FieldReference struct { + // fieldRefName for the field + ReferenceName *string `json:"referenceName,omitempty"` + // Full http link to more information about the field + Url *string `json:"url,omitempty"` +} + +type FieldSetting struct { +} + +type FieldType string + +type fieldTypeValuesType struct { + String FieldType + PlainText FieldType + Integer FieldType + DateTime FieldType + TreePath FieldType + Boolean FieldType + Double FieldType +} + +var FieldTypeValues = fieldTypeValuesType{ + String: "string", + PlainText: "plainText", + Integer: "integer", + DateTime: "dateTime", + TreePath: "treePath", + Boolean: "boolean", + Double: "double", +} + +type FilterClause struct { + FieldName *string `json:"fieldName,omitempty"` + Index *int `json:"index,omitempty"` + LogicalOperator *string `json:"logicalOperator,omitempty"` + Operator *string `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` +} + +type FilterGroup struct { + End *int `json:"end,omitempty"` + Level *int `json:"level,omitempty"` + Start *int `json:"start,omitempty"` +} + +// Enum for the various modes of identity picker +type IdentityDisplayFormat string + +type identityDisplayFormatValuesType struct { + AvatarOnly IdentityDisplayFormat + FullName IdentityDisplayFormat + AvatarAndFullName IdentityDisplayFormat +} + +var IdentityDisplayFormatValues = identityDisplayFormatValuesType{ + // Display avatar only + AvatarOnly: "avatarOnly", + // Display Full name only + FullName: "fullName", + // Display Avatar and Full name + AvatarAndFullName: "avatarAndFullName", +} + +type ITaskboardColumnMapping struct { + State *string `json:"state,omitempty"` + WorkItemType *string `json:"workItemType,omitempty"` +} + +// Capacity and teams for all teams in an iteration +type IterationCapacity struct { + Teams *[]TeamCapacityTotals `json:"teams,omitempty"` + TotalIterationCapacityPerDay *float64 `json:"totalIterationCapacityPerDay,omitempty"` + TotalIterationDaysOff *int `json:"totalIterationDaysOff,omitempty"` +} + +// Represents work items in an iteration backlog +type IterationWorkItems struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Work item relations + WorkItemRelations *[]workitemtracking.WorkItemLink `json:"workItemRelations,omitempty"` +} + +// Client serialization contract for Delivery Timeline Markers. +type Marker struct { + // Color associated with the marker. + Color *string `json:"color,omitempty"` + // Where the marker should be displayed on the timeline. + Date *azuredevops.Time `json:"date,omitempty"` + // Label/title for the marker. + Label *string `json:"label,omitempty"` +} + +type Member struct { + DisplayName *string `json:"displayName,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + ImageUrl *string `json:"imageUrl,omitempty"` + UniqueName *string `json:"uniqueName,omitempty"` + Url *string `json:"url,omitempty"` +} + +type ParentChildWIMap struct { + ChildWorkItemIds *[]int `json:"childWorkItemIds,omitempty"` + Id *int `json:"id,omitempty"` + Title *string `json:"title,omitempty"` + WorkItemTypeName *string `json:"workItemTypeName,omitempty"` +} + +// Data contract for the plan definition +type Plan struct { + // Identity that created this plan. Defaults to null for records before upgrading to ScaledAgileViewComponent4. + CreatedByIdentity *webapi.IdentityRef `json:"createdByIdentity,omitempty"` + // Date when the plan was created + CreatedDate *azuredevops.Time `json:"createdDate,omitempty"` + // Description of the plan + Description *string `json:"description,omitempty"` + // Id of the plan + Id *uuid.UUID `json:"id,omitempty"` + // Date when the plan was last accessed. Default is null. + LastAccessed *azuredevops.Time `json:"lastAccessed,omitempty"` + // Identity that last modified this plan. Defaults to null for records before upgrading to ScaledAgileViewComponent4. + ModifiedByIdentity *webapi.IdentityRef `json:"modifiedByIdentity,omitempty"` + // Date when the plan was last modified. Default to CreatedDate when the plan is first created. + ModifiedDate *azuredevops.Time `json:"modifiedDate,omitempty"` + // Name of the plan + Name *string `json:"name,omitempty"` + // The PlanPropertyCollection instance associated with the plan. These are dependent on the type of the plan. For example, DeliveryTimelineView, it would be of type DeliveryViewPropertyCollection. + Properties interface{} `json:"properties,omitempty"` + // Revision of the plan. Used to safeguard users from overwriting each other's changes. + Revision *int `json:"revision,omitempty"` + // Type of the plan + Type *PlanType `json:"type,omitempty"` + // The resource url to locate the plan via rest api + Url *string `json:"url,omitempty"` + // Bit flag indicating set of permissions a user has to the plan. + UserPermissions *PlanUserPermissions `json:"userPermissions,omitempty"` +} + +// Metadata about a plan definition that is stored in favorites service +type PlanMetadata struct { + // Identity of the creator of the plan + CreatedByIdentity *webapi.IdentityRef `json:"createdByIdentity,omitempty"` + // Description of plan + Description *string `json:"description,omitempty"` + // Last modified date of the plan + ModifiedDate *azuredevops.Time `json:"modifiedDate,omitempty"` + // Bit flag indicating set of permissions a user has to the plan. + UserPermissions *PlanUserPermissions `json:"userPermissions,omitempty"` +} + +// Enum for the various types of plans +type PlanType string + +type planTypeValuesType struct { + DeliveryTimelineView PlanType +} + +var PlanTypeValues = planTypeValuesType{ + DeliveryTimelineView: "deliveryTimelineView", +} + +// [Flags] Flag for permissions a user can have for this plan. +type PlanUserPermissions string + +type planUserPermissionsValuesType struct { + None PlanUserPermissions + View PlanUserPermissions + Edit PlanUserPermissions + Delete PlanUserPermissions + Manage PlanUserPermissions + AllPermissions PlanUserPermissions +} + +var PlanUserPermissionsValues = planUserPermissionsValuesType{ + // None + None: "none", + // Permission to view this plan. + View: "view", + // Permission to update this plan. + Edit: "edit", + // Permission to delete this plan. + Delete: "delete", + // Permission to manage this plan. + Manage: "manage", + // Full control permission for this plan. + AllPermissions: "allPermissions", +} + +// Base class for plan view data contracts. Anything common goes here. +type PlanViewData struct { + Id *uuid.UUID `json:"id,omitempty"` + Revision *int `json:"revision,omitempty"` +} + +// Represents a single pre-defined query. +type PredefinedQuery struct { + // Whether or not the query returned the complete set of data or if the data was truncated. + HasMore *bool `json:"hasMore,omitempty"` + // Id of the query + Id *string `json:"id,omitempty"` + // Localized name of the query + Name *string `json:"name,omitempty"` + // The results of the query. This will be a set of WorkItem objects with only the 'id' set. The client is responsible for paging in the data as needed. + Results *[]workitemtracking.WorkItem `json:"results,omitempty"` + // REST API Url to use to retrieve results for this query + Url *string `json:"url,omitempty"` + // Url to use to display a page in the browser with the results of this query + WebUrl *string `json:"webUrl,omitempty"` +} + +// Process Configurations for the project +type ProcessConfiguration struct { + // Details about bug work items + BugWorkItems *CategoryConfiguration `json:"bugWorkItems,omitempty"` + // Details about portfolio backlogs + PortfolioBacklogs *[]CategoryConfiguration `json:"portfolioBacklogs,omitempty"` + // Details of requirement backlog + RequirementBacklog *CategoryConfiguration `json:"requirementBacklog,omitempty"` + // Details of task backlog + TaskBacklog *CategoryConfiguration `json:"taskBacklog,omitempty"` + // Type fields for the process configuration + TypeFields *map[string]workitemtracking.WorkItemFieldReference `json:"typeFields,omitempty"` + Url *string `json:"url,omitempty"` +} + +// Represents a reorder request for one or more work items. +type ReorderOperation struct { + // IDs of the work items to be reordered. Must be valid WorkItem Ids. + Ids *[]int `json:"ids,omitempty"` + // IterationPath for reorder operation. This is only used when we reorder from the Iteration Backlog + IterationPath *string `json:"iterationPath,omitempty"` + // ID of the work item that should be after the reordered items. Can use 0 to specify the end of the list. + NextId *int `json:"nextId,omitempty"` + // Parent ID for all of the work items involved in this operation. Can use 0 to indicate the items don't have a parent. + ParentId *int `json:"parentId,omitempty"` + // ID of the work item that should be before the reordered items. Can use 0 to specify the beginning of the list. + PreviousId *int `json:"previousId,omitempty"` +} + +// Represents a reorder result for a work item. +type ReorderResult struct { + // The ID of the work item that was reordered. + Id *int `json:"id,omitempty"` + // The updated order value of the work item that was reordered. + Order *float64 `json:"order,omitempty"` +} + +type Rule struct { + Clauses *[]FilterClause `json:"clauses,omitempty"` + Filter *string `json:"filter,omitempty"` + IsEnabled *string `json:"isEnabled,omitempty"` + Name *string `json:"name,omitempty"` + Settings *attribute `json:"settings,omitempty"` +} + +// Represents the taskbord column +type TaskboardColumn struct { + // Column ID + Id *uuid.UUID `json:"id,omitempty"` + // Work item type states mapped to this column to support auto state update when column is updated. + Mappings *[]ITaskboardColumnMapping `json:"mappings,omitempty"` + // Column name + Name *string `json:"name,omitempty"` + // Column position relative to other columns in the same board + Order *int `json:"order,omitempty"` +} + +// Represents the state to column mapping per work item type This allows auto state update when the column changes +type TaskboardColumnMapping struct { + // State of the work item type mapped to the column + State *string `json:"state,omitempty"` + // Work Item Type name who's state is mapped to the column + WorkItemType *string `json:"workItemType,omitempty"` +} + +type TaskboardColumns struct { + Columns *[]TaskboardColumn `json:"columns,omitempty"` + // Are the columns cutomized for this team + IsCustomized *bool `json:"isCustomized,omitempty"` + // Specifies if the referenced WIT and State is valid + IsValid *bool `json:"isValid,omitempty"` + // Details of validation failure if the state to column mapping is invalid + ValidationMesssage *string `json:"validationMesssage,omitempty"` +} + +// Column value of a work item in the taskboard +type TaskboardWorkItemColumn struct { + // Work item column value in the taskboard + Column *string `json:"column,omitempty"` + // Work item column id in the taskboard + ColumnId *uuid.UUID `json:"columnId,omitempty"` + // Work Item state value + State *string `json:"state,omitempty"` + // Work item id + WorkItemId *int `json:"workItemId,omitempty"` +} + +// Mapping of teams to the corresponding work item category +type TeamBacklogMapping struct { + CategoryReferenceName *string `json:"categoryReferenceName,omitempty"` + TeamId *uuid.UUID `json:"teamId,omitempty"` +} + +// Represents team member capacity with totals aggregated +type TeamCapacity struct { + TeamMembers *[]TeamMemberCapacityIdentityRef `json:"teamMembers,omitempty"` + TotalCapacityPerDay *float64 `json:"totalCapacityPerDay,omitempty"` + TotalDaysOff *int `json:"totalDaysOff,omitempty"` +} + +// Team information with total capacity and days off +type TeamCapacityTotals struct { + TeamCapacityPerDay *float64 `json:"teamCapacityPerDay,omitempty"` + TeamId *uuid.UUID `json:"teamId,omitempty"` + TeamTotalDaysOff *int `json:"teamTotalDaysOff,omitempty"` +} + +// Represents a single TeamFieldValue +type TeamFieldValue struct { + IncludeChildren *bool `json:"includeChildren,omitempty"` + Value *string `json:"value,omitempty"` +} + +// Essentially a collection of team field values +type TeamFieldValues struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // The default team field value + DefaultValue *string `json:"defaultValue,omitempty"` + // Shallow ref to the field being used as a team field + Field *FieldReference `json:"field,omitempty"` + // Collection of all valid team field values + Values *[]TeamFieldValue `json:"values,omitempty"` +} + +// Expected data from PATCH +type TeamFieldValuesPatch struct { + DefaultValue *string `json:"defaultValue,omitempty"` + Values *[]TeamFieldValue `json:"values,omitempty"` +} + +type TeamIterationAttributes struct { + // Finish date of the iteration. Date-only, correct unadjusted at midnight in UTC. + FinishDate *azuredevops.Time `json:"finishDate,omitempty"` + // Start date of the iteration. Date-only, correct unadjusted at midnight in UTC. + StartDate *azuredevops.Time `json:"startDate,omitempty"` + // Time frame of the iteration, such as past, current or future. + TimeFrame *TimeFrame `json:"timeFrame,omitempty"` +} + +// Represents capacity for a specific team member +type TeamMemberCapacity struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Collection of capacities associated with the team member + Activities *[]Activity `json:"activities,omitempty"` + // The days off associated with the team member + DaysOff *[]DateRange `json:"daysOff,omitempty"` + // Shallow Ref to the associated team member + TeamMember *Member `json:"teamMember,omitempty"` +} + +// Represents capacity for a specific team member +type TeamMemberCapacityIdentityRef struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Collection of capacities associated with the team member + Activities *[]Activity `json:"activities,omitempty"` + // The days off associated with the team member + DaysOff *[]DateRange `json:"daysOff,omitempty"` + // Identity ref of the associated team member + TeamMember *webapi.IdentityRef `json:"teamMember,omitempty"` +} + +// Data contract for TeamSettings +type TeamSetting struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Backlog Iteration + BacklogIteration *TeamSettingsIteration `json:"backlogIteration,omitempty"` + // Information about categories that are visible on the backlog. + BacklogVisibilities *map[string]bool `json:"backlogVisibilities,omitempty"` + // BugsBehavior (Off, AsTasks, AsRequirements, ...) + BugsBehavior *BugsBehavior `json:"bugsBehavior,omitempty"` + // Default Iteration, the iteration used when creating a new work item on the queries page. + DefaultIteration *TeamSettingsIteration `json:"defaultIteration,omitempty"` + // Default Iteration macro (if any) + DefaultIterationMacro *string `json:"defaultIterationMacro,omitempty"` + // Days that the team is working + WorkingDays *[]string `json:"workingDays,omitempty"` +} + +// Base class for TeamSettings data contracts. Anything common goes here. +type TeamSettingsDataContractBase struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` +} + +type TeamSettingsDaysOff struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + DaysOff *[]DateRange `json:"daysOff,omitempty"` +} + +type TeamSettingsDaysOffPatch struct { + DaysOff *[]DateRange `json:"daysOff,omitempty"` +} + +// Represents a shallow ref for a single iteration. +type TeamSettingsIteration struct { + // Collection of links relevant to resource + Links interface{} `json:"_links,omitempty"` + // Full http link to the resource + Url *string `json:"url,omitempty"` + // Attributes of the iteration such as start and end date. + Attributes *TeamIterationAttributes `json:"attributes,omitempty"` + // Id of the iteration. + Id *uuid.UUID `json:"id,omitempty"` + // Name of the iteration. + Name *string `json:"name,omitempty"` + // Relative path of the iteration. + Path *string `json:"path,omitempty"` +} + +// Data contract for what we expect to receive when PATCH +type TeamSettingsPatch struct { + BacklogIteration *uuid.UUID `json:"backlogIteration,omitempty"` + BacklogVisibilities *map[string]bool `json:"backlogVisibilities,omitempty"` + BugsBehavior *BugsBehavior `json:"bugsBehavior,omitempty"` + DefaultIteration *uuid.UUID `json:"defaultIteration,omitempty"` + DefaultIterationMacro *string `json:"defaultIterationMacro,omitempty"` + WorkingDays *[]string `json:"workingDays,omitempty"` +} + +type TimeFrame string + +type timeFrameValuesType struct { + Past TimeFrame + Current TimeFrame + Future TimeFrame +} + +var TimeFrameValues = timeFrameValuesType{ + Past: "past", + Current: "current", + Future: "future", +} + +type TimelineCriteriaStatus struct { + Message *string `json:"message,omitempty"` + Type *TimelineCriteriaStatusCode `json:"type,omitempty"` +} + +type TimelineCriteriaStatusCode string + +type timelineCriteriaStatusCodeValuesType struct { + Ok TimelineCriteriaStatusCode + InvalidFilterClause TimelineCriteriaStatusCode + Unknown TimelineCriteriaStatusCode +} + +var TimelineCriteriaStatusCodeValues = timelineCriteriaStatusCodeValuesType{ + // No error - filter is good. + Ok: "ok", + // One of the filter clause is invalid. + InvalidFilterClause: "invalidFilterClause", + // Unknown error. + Unknown: "unknown", +} + +type TimelineIterationStatus struct { + Message *string `json:"message,omitempty"` + Type *TimelineIterationStatusCode `json:"type,omitempty"` +} + +type TimelineIterationStatusCode string + +type timelineIterationStatusCodeValuesType struct { + Ok TimelineIterationStatusCode + IsOverlapping TimelineIterationStatusCode +} + +var TimelineIterationStatusCodeValues = timelineIterationStatusCodeValuesType{ + // No error - iteration data is good. + Ok: "ok", + // This iteration overlaps with another iteration, no data is returned for this iteration. + IsOverlapping: "isOverlapping", +} + +type TimelineTeamData struct { + // Backlog matching the mapped backlog associated with this team. + Backlog *BacklogLevel `json:"backlog,omitempty"` + // The field reference names of the work item data + FieldReferenceNames *[]string `json:"fieldReferenceNames,omitempty"` + // The id of the team + Id *uuid.UUID `json:"id,omitempty"` + // Was iteration and work item data retrieved for this team. Teams with IsExpanded false have not had their iteration, work item, and field related data queried and will never contain this data. If true then these items are queried and, if there are items in the queried range, there will be data. + IsExpanded *bool `json:"isExpanded,omitempty"` + // The iteration data, including the work items, in the queried date range. + Iterations *[]TimelineTeamIteration `json:"iterations,omitempty"` + // The name of the team + Name *string `json:"name,omitempty"` + // The order by field name of this team + OrderByField *string `json:"orderByField,omitempty"` + // The field reference names of the partially paged work items, such as ID, WorkItemType + PartiallyPagedFieldReferenceNames *[]string `json:"partiallyPagedFieldReferenceNames,omitempty"` + PartiallyPagedWorkItems *[][]interface{} `json:"partiallyPagedWorkItems,omitempty"` + // The project id the team belongs team + ProjectId *uuid.UUID `json:"projectId,omitempty"` + // Work item types for which we will collect roll up data on the client side + RollupWorkItemTypes *[]string `json:"rollupWorkItemTypes,omitempty"` + // Status for this team. + Status *TimelineTeamStatus `json:"status,omitempty"` + // The team field default value + TeamFieldDefaultValue *string `json:"teamFieldDefaultValue,omitempty"` + // The team field name of this team + TeamFieldName *string `json:"teamFieldName,omitempty"` + // The team field values + TeamFieldValues *[]TeamFieldValue `json:"teamFieldValues,omitempty"` + // Work items associated with the team that are not under any of the team's iterations + WorkItems *[][]interface{} `json:"workItems,omitempty"` + // Colors for the work item types. + WorkItemTypeColors *[]WorkItemColor `json:"workItemTypeColors,omitempty"` +} + +type TimelineTeamIteration struct { + // The iteration CSS Node Id + CssNodeId *string `json:"cssNodeId,omitempty"` + // The end date of the iteration + FinishDate *azuredevops.Time `json:"finishDate,omitempty"` + // The iteration name + Name *string `json:"name,omitempty"` + // All the partially paged workitems in this iteration. + PartiallyPagedWorkItems *[][]interface{} `json:"partiallyPagedWorkItems,omitempty"` + // The iteration path + Path *string `json:"path,omitempty"` + // The start date of the iteration + StartDate *azuredevops.Time `json:"startDate,omitempty"` + // The status of this iteration + Status *TimelineIterationStatus `json:"status,omitempty"` + // The work items that have been paged in this iteration + WorkItems *[][]interface{} `json:"workItems,omitempty"` +} + +type TimelineTeamStatus struct { + Message *string `json:"message,omitempty"` + Type *TimelineTeamStatusCode `json:"type,omitempty"` +} + +type TimelineTeamStatusCode string + +type timelineTeamStatusCodeValuesType struct { + Ok TimelineTeamStatusCode + DoesntExistOrAccessDenied TimelineTeamStatusCode + MaxTeamsExceeded TimelineTeamStatusCode + MaxTeamFieldsExceeded TimelineTeamStatusCode + BacklogInError TimelineTeamStatusCode + MissingTeamFieldValue TimelineTeamStatusCode + NoIterationsExist TimelineTeamStatusCode +} + +var TimelineTeamStatusCodeValues = timelineTeamStatusCodeValuesType{ + // No error - all data for team is good. + Ok: "ok", + // Team does not exist or access is denied. + DoesntExistOrAccessDenied: "doesntExistOrAccessDenied", + // Maximum number of teams was exceeded. No team data will be returned for this team. + MaxTeamsExceeded: "maxTeamsExceeded", + // Maximum number of team fields (ie Area paths) have been exceeded. No team data will be returned for this team. + MaxTeamFieldsExceeded: "maxTeamFieldsExceeded", + // Backlog does not exist or is missing crucial information. + BacklogInError: "backlogInError", + // Team field value is not set for this team. No team data will be returned for this team + MissingTeamFieldValue: "missingTeamFieldValue", + // Team does not have a single iteration with date range. + NoIterationsExist: "noIterationsExist", +} + +type UpdatePlan struct { + // Description of the plan + Description *string `json:"description,omitempty"` + // Name of the plan to create. + Name *string `json:"name,omitempty"` + // Plan properties. + Properties interface{} `json:"properties,omitempty"` + // Revision of the plan that was updated - the value used here should match the one the server gave the client in the Plan. + Revision *int `json:"revision,omitempty"` + // Type of the plan + Type *PlanType `json:"type,omitempty"` +} + +type UpdateTaskboardColumn struct { + // Column ID, keep it null for new column + Id *uuid.UUID `json:"id,omitempty"` + // Work item type states mapped to this column to support auto state update when column is updated. + Mappings *[]TaskboardColumnMapping `json:"mappings,omitempty"` + // Column name is required + Name *string `json:"name,omitempty"` + // Column position relative to other columns in the same board + Order *int `json:"order,omitempty"` +} + +type UpdateTaskboardWorkItemColumn struct { + NewColumn *string `json:"newColumn,omitempty"` +} + +// Work item color and icon. +type WorkItemColor struct { + Icon *string `json:"icon,omitempty"` + PrimaryColor *string `json:"primaryColor,omitempty"` + WorkItemTypeName *string `json:"workItemTypeName,omitempty"` +} + +type WorkItemTypeStateInfo struct { + // State name to state category map + States *map[string]string `json:"states,omitempty"` + // Work Item type name + WorkItemTypeName *string `json:"workItemTypeName,omitempty"` +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 33400072..9cab5585 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -160,6 +160,7 @@ 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/test github.com/microsoft/azure-devops-go-api/azuredevops/v7/webapi +github.com/microsoft/azure-devops-go-api/azuredevops/v7/work github.com/microsoft/azure-devops-go-api/azuredevops/v7/workitemtracking # github.com/muesli/reflow v0.3.0 ## explicit; go 1.13