-
Notifications
You must be signed in to change notification settings - Fork 37
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
base: main
Are you sure you want to change the base?
Conversation
Resolves #339
@@ -0,0 +1,33 @@ | |||
package models |
Check warning
Code scanning / Revive (reported by Codacy)
should have a package comment Warning
@@ -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
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
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
|
||
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
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
@@ -0,0 +1,13 @@ | |||
package jira |
Check warning
Code scanning / Revive (reported by Codacy)
should have a package comment Warning
) | ||
|
||
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
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
Resolves #339
@@ -0,0 +1,133 @@ | |||
package internal |
Check warning
Code scanning / Revive (reported by Codacy)
should have a package comment Warning
"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
} | ||
} | ||
|
||
type IssueArchivalService struct { |
Check warning
Code scanning / Revive (reported by Codacy)
exported type IssueArchivalService should have comment or be unexported Warning
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
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
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
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
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
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
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
Resolves #339