Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Added the Issue Archiving API #347

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

ctreminiom
Copy link
Owner

Resolves #339

@@ -0,0 +1,33 @@
package models

Check warning

Code scanning / Revive (reported by Codacy)

should have a package comment Warning

should have a package comment
@@ -0,0 +1,33 @@
package models

type IssueArchivalSyncResponseScheme struct {

Check warning

Code scanning / Revive (reported by Codacy)

exported type IssueArchivalSyncResponseScheme should have comment or be unexported Warning

exported type IssueArchivalSyncResponseScheme should have comment or be unexported
NumberOfIssuesUpdated int `json:"numberOfIssuesUpdated"`
}

type IssueArchivalSyncErrorScheme struct {

Check warning

Code scanning / Revive (reported by Codacy)

exported type IssueArchivalSyncErrorScheme should have comment or be unexported Warning

exported type IssueArchivalSyncErrorScheme should have comment or be unexported
UserDoesNotHavePermission *IssueArchivalErrorScheme `json:"userDoesNotHavePermission"`
}

type IssueArchivalErrorScheme struct {

Check warning

Code scanning / Revive (reported by Codacy)

exported type IssueArchivalErrorScheme should have comment or be unexported Warning

exported type IssueArchivalErrorScheme should have comment or be unexported

type IssueArchivalErrorScheme struct {
Count int `json:"count"`
IssueIdsOrKeys []string `json:"issueIdsOrKeys"`

Check warning

Code scanning / Revive (reported by Codacy)

struct field IssueIdsOrKeys should be IssueIDsOrKeys Warning

struct field IssueIdsOrKeys should be IssueIDsOrKeys
Reporters []string `json:"reporters"`
}

type DateRangeFilterRequestScheme struct {

Check warning

Code scanning / Revive (reported by Codacy)

exported type DateRangeFilterRequestScheme should have comment or be unexported Warning

exported type DateRangeFilterRequestScheme should have comment or be unexported
@@ -0,0 +1,13 @@
package jira

Check warning

Code scanning / Revive (reported by Codacy)

should have a package comment Warning

should have a package comment
)

type ArchiveService interface {
Preserve(ctx context.Context, issueIdsOrKeys []string) (result *models.IssueArchivalSyncResponseScheme, response *models.ResponseScheme, err error)

Check warning

Code scanning / Revive (reported by Codacy)

interface method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

interface method parameter issueIdsOrKeys should be issueIDsOrKeys
type ArchiveService interface {
Preserve(ctx context.Context, issueIdsOrKeys []string) (result *models.IssueArchivalSyncResponseScheme, response *models.ResponseScheme, err error)
PreserveByJQL(ctx context.Context, jql string) (taskID string, response *models.ResponseScheme, err error)
Restore(ctx context.Context, issueIdsOrKeys []string) (result *models.IssueArchivalSyncResponseScheme, response *models.ResponseScheme, err error)

Check warning

Code scanning / Revive (reported by Codacy)

interface method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

interface method parameter issueIdsOrKeys should be issueIDsOrKeys
@@ -0,0 +1,133 @@
package internal

Check warning

Code scanning / Revive (reported by Codacy)

should have a package comment Warning

should have a package comment
"path"
)

func NewIssueArchivalService(client service.Connector, version string) *IssueArchivalService {

Check warning

Code scanning / Revive (reported by Codacy)

exported function NewIssueArchivalService should have comment or be unexported Warning

exported function NewIssueArchivalService should have comment or be unexported
}
}

type IssueArchivalService struct {

Check warning

Code scanning / Revive (reported by Codacy)

exported type IssueArchivalService should have comment or be unexported Warning

exported type IssueArchivalService should have comment or be unexported
internalClient jira.ArchiveService
}

func (i *IssueArchivalService) Preserve(ctx context.Context, issueIdsOrKeys []string) (*model.IssueArchivalSyncResponseScheme, *model.ResponseScheme, error) {

Check warning

Code scanning / Revive (reported by Codacy)

exported method IssueArchivalService.Preserve should have comment or be unexported Warning

exported method IssueArchivalService.Preserve should have comment or be unexported
internalClient jira.ArchiveService
}

func (i *IssueArchivalService) Preserve(ctx context.Context, issueIdsOrKeys []string) (*model.IssueArchivalSyncResponseScheme, *model.ResponseScheme, error) {

Check warning

Code scanning / Revive (reported by Codacy)

method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

method parameter issueIdsOrKeys should be issueIDsOrKeys
return i.internalClient.PreserveByJQL(ctx, jql)
}

func (i *IssueArchivalService) Restore(ctx context.Context, issueIdsOrKeys []string) (*model.IssueArchivalSyncResponseScheme, *model.ResponseScheme, error) {

Check warning

Code scanning / Revive (reported by Codacy)

method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

method parameter issueIdsOrKeys should be issueIDsOrKeys
return i.internalClient.PreserveByJQL(ctx, jql)
}

func (i *IssueArchivalService) Restore(ctx context.Context, issueIdsOrKeys []string) (*model.IssueArchivalSyncResponseScheme, *model.ResponseScheme, error) {

Check warning

Code scanning / Revive (reported by Codacy)

exported method IssueArchivalService.Restore should have comment or be unexported Warning

exported method IssueArchivalService.Restore should have comment or be unexported
return i.internalClient.Restore(ctx, issueIdsOrKeys)
}

func (i *IssueArchivalService) Export(ctx context.Context, payload *model.IssueArchivalExportPayloadScheme) (string, *model.ResponseScheme, error) {

Check warning

Code scanning / Revive (reported by Codacy)

exported method IssueArchivalService.Export should have comment or be unexported Warning

exported method IssueArchivalService.Export should have comment or be unexported
version string
}

func (i *internalIssueArchivalImpl) Preserve(ctx context.Context, issueIdsOrKeys []string) (result *model.IssueArchivalSyncResponseScheme, response *model.ResponseScheme, err error) {

Check warning

Code scanning / Revive (reported by Codacy)

method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

method parameter issueIdsOrKeys should be issueIDsOrKeys
return path.Base(response.Bytes.String()), response, nil
}

func (i *internalIssueArchivalImpl) Restore(ctx context.Context, issueIdsOrKeys []string) (result *model.IssueArchivalSyncResponseScheme, response *model.ResponseScheme, err error) {

Check warning

Code scanning / Revive (reported by Codacy)

method parameter issueIdsOrKeys should be issueIDsOrKeys Warning

method parameter issueIdsOrKeys should be issueIDsOrKeys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Issue Archiving Support in Go API
1 participant