Compare commits
52 Commits
gitpkgs
...
gitea-api-
| Author | SHA256 | Date | |
|---|---|---|---|
| c6aa9ea392 | |||
| a97603b5a7 | |||
| ed63b37baa | |||
| 9b3d6e9a66 | |||
| f47da62481 | |||
| 79e5345ac6 | |||
| 4790ee3096 | |||
| 7d85c014d6 | |||
| 05aaf56cb7 | |||
| 74491cb9cf | |||
| 9775320411 | |||
| 790540d6c5 | |||
| 990f71677b | |||
| 514725fb0b | |||
| ea69dcd19f | |||
| 055de8c9eb | |||
| a13f57e464 | |||
| b147fc7622 | |||
| fc7fb4d49f | |||
| 40eeb25336 | |||
| 68a142046c | |||
| 240d79a4d6 | |||
| 21a8670674 | |||
| d2e9abde6e | |||
| a4f677690a | |||
| 70460813f5 | |||
| 0651fe01d4 | |||
| e03fd0bdcf | |||
| c6ee055cb4 | |||
| 58e5547a91 | |||
| c2709e1894 | |||
| 7790e5f301 | |||
| 2620aa3ddd | |||
| 59a47cd542 | |||
| a0c51657d4 | |||
| 877e93c9bf | |||
| 51403713be | |||
| f959684540 | |||
| 18f7ed658a | |||
| c05fa236d1 | |||
| c866303696 | |||
| e806d6ad0d | |||
| abf8aa58fc | |||
| 4f132ec154 | |||
| 86a7fd072e | |||
| 5f5e7d98b5 | |||
| e8738c9585 | |||
| 2f18adaa67 | |||
| b7f5c97de1 | |||
| 09001ce01b | |||
| 37c9cc7a57 | |||
| 362e481a09 |
@@ -23,7 +23,6 @@ jobs:
|
|||||||
- run: git checkout FETCH_HEAD
|
- run: git checkout FETCH_HEAD
|
||||||
- run: go generate -C common
|
- run: go generate -C common
|
||||||
- run: go generate -C workflow-pr
|
- run: go generate -C workflow-pr
|
||||||
- run: go generate -C workflow-pr/interfaces
|
|
||||||
- run: git add -N .; git diff
|
- run: git add -N .; git diff
|
||||||
- run: |
|
- run: |
|
||||||
status=$(git status --short)
|
status=$(git status --short)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ jobs:
|
|||||||
- run: git checkout FETCH_HEAD
|
- run: git checkout FETCH_HEAD
|
||||||
- run: go generate -C common
|
- run: go generate -C common
|
||||||
- run: go generate -C workflow-pr
|
- run: go generate -C workflow-pr
|
||||||
- run: go generate -C workflow-pr/interfaces
|
|
||||||
- run: |
|
- run: |
|
||||||
host=${{ gitea.server_url }}
|
host=${{ gitea.server_url }}
|
||||||
host=${host#https://}
|
host=${host#https://}
|
||||||
|
|||||||
3938
common/api.json
3938
common/api.json
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ func newStringScanner(s string) *bufio.Scanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAssociatedPRScanner(t *testing.T) {
|
func TestAssociatedPRScanner(t *testing.T) {
|
||||||
|
common.SetTestLogger(t)
|
||||||
testTable := []struct {
|
testTable := []struct {
|
||||||
name string
|
name string
|
||||||
input string
|
input string
|
||||||
@@ -95,6 +96,7 @@ func TestAssociatedPRScanner(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAppendingPRsToDescription(t *testing.T) {
|
func TestAppendingPRsToDescription(t *testing.T) {
|
||||||
|
common.SetTestLogger(t)
|
||||||
testTable := []struct {
|
testTable := []struct {
|
||||||
name string
|
name string
|
||||||
desc string
|
desc string
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ const (
|
|||||||
Label_StagingAuto = "staging/Auto"
|
Label_StagingAuto = "staging/Auto"
|
||||||
Label_ReviewPending = "review/Pending"
|
Label_ReviewPending = "review/Pending"
|
||||||
Label_ReviewDone = "review/Done"
|
Label_ReviewDone = "review/Done"
|
||||||
|
Label_NewRepository = "new/New Repository"
|
||||||
)
|
)
|
||||||
|
|
||||||
func LabelKey(tag_value string) string {
|
func LabelKey(tag_value string) string {
|
||||||
@@ -92,6 +93,7 @@ type AutogitConfig struct {
|
|||||||
NoProjectGitPR bool // do not automatically create project git PRs, just assign reviewers and assume somethign else creates the ProjectGit PR
|
NoProjectGitPR bool // do not automatically create project git PRs, just assign reviewers and assume somethign else creates the ProjectGit PR
|
||||||
ManualMergeOnly bool // only merge with "Merge OK" comment by Project Maintainers and/or Package Maintainers and/or reviewers
|
ManualMergeOnly bool // only merge with "Merge OK" comment by Project Maintainers and/or Package Maintainers and/or reviewers
|
||||||
ManualMergeProject bool // require merge of ProjectGit PRs with "Merge OK" by ProjectMaintainers and/or reviewers
|
ManualMergeProject bool // require merge of ProjectGit PRs with "Merge OK" by ProjectMaintainers and/or reviewers
|
||||||
|
ReviewRequired bool // always require a maintainer review, even if maintainer submits it. Only ignored if no other package or project reviewers
|
||||||
}
|
}
|
||||||
|
|
||||||
type AutogitConfigs []*AutogitConfig
|
type AutogitConfigs []*AutogitConfig
|
||||||
@@ -293,9 +295,9 @@ func (config *AutogitConfig) GetRemoteBranch() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (config *AutogitConfig) Label(label string) string {
|
func (config *AutogitConfig) Label(label string) string {
|
||||||
if t, found := config.Labels[LabelKey(label)]; found {
|
if t, found := config.Labels[LabelKey(label)]; found {
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
return label
|
return label
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"go.uber.org/mock/gomock"
|
|
||||||
"src.opensuse.org/autogits/common"
|
"src.opensuse.org/autogits/common"
|
||||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
mock_common "src.opensuse.org/autogits/common/mock"
|
mock_common "src.opensuse.org/autogits/common/mock"
|
||||||
@@ -54,7 +53,7 @@ func TestConfigLabelParser(t *testing.T) {
|
|||||||
DefaultBranch: "master",
|
DefaultBranch: "master",
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl := gomock.NewController(t)
|
ctl := NewController(t)
|
||||||
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
||||||
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.json), "abc", nil)
|
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.json), "abc", nil)
|
||||||
gitea.EXPECT().GetRepository("foo", "bar").Return(&repo, nil)
|
gitea.EXPECT().GetRepository("foo", "bar").Return(&repo, nil)
|
||||||
@@ -176,7 +175,7 @@ func TestConfigWorkflowParser(t *testing.T) {
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
ctl := gomock.NewController(t)
|
ctl := NewController(t)
|
||||||
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
||||||
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.config_json), "abc", nil)
|
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.config_json), "abc", nil)
|
||||||
gitea.EXPECT().GetRepository("foo", "bar").Return(&test.repo, nil)
|
gitea.EXPECT().GetRepository("foo", "bar").Return(&test.repo, nil)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ type GitSubmoduleLister interface {
|
|||||||
|
|
||||||
type GitDirectoryLister interface {
|
type GitDirectoryLister interface {
|
||||||
GitDirectoryList(gitPath, commitId string) (dirlist map[string]string, err error)
|
GitDirectoryList(gitPath, commitId string) (dirlist map[string]string, err error)
|
||||||
|
GitDirectoryContentList(gitPath, commitId string) (dirlist map[string]string, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type GitStatusLister interface {
|
type GitStatusLister interface {
|
||||||
@@ -272,7 +273,11 @@ func (e *GitHandlerImpl) GitClone(repo, branch, remoteUrl string) (string, error
|
|||||||
LogDebug("branch", branch)
|
LogDebug("branch", branch)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
args := []string{"fetch", "--prune", remoteName, branch}
|
args := []string{"fetch", "--prune", remoteName}
|
||||||
|
if len(branch) > 0 {
|
||||||
|
args = append(args, branch)
|
||||||
|
}
|
||||||
|
|
||||||
if strings.TrimSpace(e.GitExecWithOutputOrPanic(repo, "rev-parse", "--is-shallow-repository")) == "true" {
|
if strings.TrimSpace(e.GitExecWithOutputOrPanic(repo, "rev-parse", "--is-shallow-repository")) == "true" {
|
||||||
args = slices.Insert(args, 1, "--unshallow")
|
args = slices.Insert(args, 1, "--unshallow")
|
||||||
}
|
}
|
||||||
@@ -787,7 +792,7 @@ func (e *GitHandlerImpl) GitCatFile(cwd, commitId, filename string) (data []byte
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// return (filename) -> (hash) map for all submodules
|
// return (directory) -> (hash) map for all submodules
|
||||||
func (e *GitHandlerImpl) GitDirectoryList(gitPath, commitId string) (directoryList map[string]string, err error) {
|
func (e *GitHandlerImpl) GitDirectoryList(gitPath, commitId string) (directoryList map[string]string, err error) {
|
||||||
var done sync.Mutex
|
var done sync.Mutex
|
||||||
directoryList = make(map[string]string)
|
directoryList = make(map[string]string)
|
||||||
@@ -861,6 +866,82 @@ func (e *GitHandlerImpl) GitDirectoryList(gitPath, commitId string) (directoryLi
|
|||||||
return directoryList, err
|
return directoryList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return (directory) -> (hash) map for all submodules
|
||||||
|
func (e *GitHandlerImpl) GitDirectoryContentList(gitPath, commitId string) (directoryList map[string]string, err error) {
|
||||||
|
var done sync.Mutex
|
||||||
|
directoryList = make(map[string]string)
|
||||||
|
|
||||||
|
done.Lock()
|
||||||
|
data_in, data_out := ChanIO{make(chan byte)}, ChanIO{make(chan byte)}
|
||||||
|
|
||||||
|
LogDebug("Getting directory content for:", commitId)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
defer done.Unlock()
|
||||||
|
defer close(data_out.ch)
|
||||||
|
|
||||||
|
data_out.Write([]byte(commitId))
|
||||||
|
data_out.ch <- '\x00'
|
||||||
|
var c GitCommit
|
||||||
|
c, err = parseGitCommit(data_in.ch)
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("Error parsing git commit. Err: %w", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
trees := make(map[string]string)
|
||||||
|
trees[""] = c.Tree
|
||||||
|
|
||||||
|
for len(trees) > 0 {
|
||||||
|
for p, tree := range trees {
|
||||||
|
delete(trees, p)
|
||||||
|
|
||||||
|
data_out.Write([]byte(tree))
|
||||||
|
data_out.ch <- '\x00'
|
||||||
|
var tree GitTree
|
||||||
|
tree, err = parseGitTree(data_in.ch)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
err = fmt.Errorf("Error parsing git tree: %w", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, te := range tree.items {
|
||||||
|
if te.isBlob() || te.isSubmodule() {
|
||||||
|
directoryList[p+te.name] = te.hash
|
||||||
|
} else if te.isTree() {
|
||||||
|
trees[p+te.name] = te.hash
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
cmd := exec.Command("/usr/bin/git", "cat-file", "--batch", "-Z")
|
||||||
|
cmd.Env = []string{
|
||||||
|
"GIT_CEILING_DIRECTORIES=" + e.GitPath,
|
||||||
|
"GIT_LFS_SKIP_SMUDGE=1",
|
||||||
|
"GIT_CONFIG_GLOBAL=/dev/null",
|
||||||
|
}
|
||||||
|
cmd.Dir = filepath.Join(e.GitPath, gitPath)
|
||||||
|
cmd.Stdout = &data_in
|
||||||
|
cmd.Stdin = &data_out
|
||||||
|
cmd.Stderr = writeFunc(func(data []byte) (int, error) {
|
||||||
|
LogError(string(data))
|
||||||
|
return len(data), nil
|
||||||
|
})
|
||||||
|
LogDebug("command run:", cmd.Args)
|
||||||
|
if e := cmd.Run(); e != nil {
|
||||||
|
LogError(e)
|
||||||
|
close(data_in.ch)
|
||||||
|
close(data_out.ch)
|
||||||
|
return directoryList, e
|
||||||
|
}
|
||||||
|
|
||||||
|
done.Lock()
|
||||||
|
return directoryList, err
|
||||||
|
}
|
||||||
|
|
||||||
// return (filename) -> (hash) map for all submodules
|
// return (filename) -> (hash) map for all submodules
|
||||||
func (e *GitHandlerImpl) GitSubmoduleList(gitPath, commitId string) (submoduleList map[string]string, err error) {
|
func (e *GitHandlerImpl) GitSubmoduleList(gitPath, commitId string) (submoduleList map[string]string, err error) {
|
||||||
var done sync.Mutex
|
var done sync.Mutex
|
||||||
|
|||||||
@@ -24,12 +24,14 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGitClone(t *testing.T) {
|
func TestGitClone(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|
||||||
@@ -93,7 +95,59 @@ func TestGitClone(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGitCloneCommitID(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
|
execPath, err := os.Getwd()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
d := t.TempDir()
|
||||||
|
if err := os.Chdir(d); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer os.Chdir(execPath)
|
||||||
|
cmd := exec.Command(path.Join(execPath, "test_repo_setup.sh"))
|
||||||
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
|
t.Log(string(out))
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gh, err := AllocateGitWorkTree(d, "Test", "test@example.com")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
g, err := gh.CreateGitHandler("org")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a commit ID from pkgA
|
||||||
|
remoteUrl := "file://" + d + "/pkgA"
|
||||||
|
out, err := exec.Command("git", "-C", path.Join(d, "pkgA"), "rev-parse", "main").Output()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
commitID := strings.TrimSpace(string(out))
|
||||||
|
|
||||||
|
repo := "pkgAcloneCommitID"
|
||||||
|
if _, err := g.GitClone(repo, commitID, remoteUrl); err != nil {
|
||||||
|
t.Skip("TODO: Add GitClone CommitID support")
|
||||||
|
t.Fatalf("GitClone failed with commit ID: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify we are at the right commit
|
||||||
|
head, err := g.GitBranchHead(repo, commitID)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("GitBranchHead failed: %v", err)
|
||||||
|
}
|
||||||
|
if head != commitID {
|
||||||
|
t.Errorf("Expected head %s, got %s", commitID, head)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGitMsgParsing(t *testing.T) {
|
func TestGitMsgParsing(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
t.Run("tree message with size 56", func(t *testing.T) {
|
t.Run("tree message with size 56", func(t *testing.T) {
|
||||||
const hdr = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f98 tree 56\x00"
|
const hdr = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f98 tree 56\x00"
|
||||||
|
|
||||||
@@ -172,6 +226,7 @@ func TestGitMsgParsing(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGitCommitParsing(t *testing.T) {
|
func TestGitCommitParsing(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
t.Run("parse valid commit message", func(t *testing.T) {
|
t.Run("parse valid commit message", func(t *testing.T) {
|
||||||
const commitData = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f99 commit 253\000" +
|
const commitData = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f99 commit 253\000" +
|
||||||
`tree e20033df9f18780756ba4a96dbc7eb1a626253961039cb674156f266ba7a4e53
|
`tree e20033df9f18780756ba4a96dbc7eb1a626253961039cb674156f266ba7a4e53
|
||||||
@@ -382,6 +437,7 @@ dummy change, don't merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCommitTreeParsing(t *testing.T) {
|
func TestCommitTreeParsing(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
gitDir := t.TempDir()
|
gitDir := t.TempDir()
|
||||||
testDir, _ := os.Getwd()
|
testDir, _ := os.Getwd()
|
||||||
var commitId string
|
var commitId string
|
||||||
@@ -490,6 +546,7 @@ func TestCommitTreeParsing(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGitStatusParse(t *testing.T) {
|
func TestGitStatusParse(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
testData := []struct {
|
testData := []struct {
|
||||||
name string
|
name string
|
||||||
data []byte
|
data []byte
|
||||||
@@ -596,3 +653,67 @@ func TestGitStatusParse(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGitDirectoryListRepro(t *testing.T) {
|
||||||
|
SetTestLogger(t)
|
||||||
|
d := t.TempDir()
|
||||||
|
|
||||||
|
// Setup a mock environment for GitHandlerImpl
|
||||||
|
gh, err := AllocateGitWorkTree(d, "Test", "test@example.com")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
org := "repo-org"
|
||||||
|
repoName := "test-repo"
|
||||||
|
repoPath := filepath.Join(d, org, repoName)
|
||||||
|
err = os.MkdirAll(repoPath, 0755)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
runGit := func(args ...string) {
|
||||||
|
cmd := exec.Command("git", args...)
|
||||||
|
cmd.Dir = repoPath
|
||||||
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
|
t.Fatalf("git %v failed: %v\n%s", args, err, out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runGit("init", "-b", "main", "--object-format=sha256")
|
||||||
|
runGit("config", "user.email", "test@example.com")
|
||||||
|
runGit("config", "user.name", "test")
|
||||||
|
|
||||||
|
// Create a directory and a file
|
||||||
|
err = os.Mkdir(filepath.Join(repoPath, "subdir"), 0755)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = os.WriteFile(filepath.Join(repoPath, "subdir", "file.txt"), []byte("hello"), 0644)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
runGit("add", "subdir/file.txt")
|
||||||
|
runGit("commit", "-m", "add subdir")
|
||||||
|
|
||||||
|
// Now create the handler
|
||||||
|
g, err := gh.CreateGitHandler(org)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call GitDirectoryList
|
||||||
|
dirs, err := g.GitDirectoryList(repoName, "HEAD")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Logf("Directories found: %v", dirs)
|
||||||
|
|
||||||
|
if len(dirs) == 0 {
|
||||||
|
t.Error("No directories found, but 'subdir' should be there")
|
||||||
|
}
|
||||||
|
if _, ok := dirs["subdir"]; !ok {
|
||||||
|
t.Errorf("Expected 'subdir' in directory list, got %v", dirs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminAddUserBadgesParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user to whom a badge is to be added
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRepoCreated, error)
|
AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRepoCreated, error)
|
||||||
|
|
||||||
|
AdminCreateRunnerRegistrationToken(params *AdminCreateRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRunnerRegistrationTokenOK, error)
|
||||||
|
|
||||||
AdminCreateUser(params *AdminCreateUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateUserCreated, error)
|
AdminCreateUser(params *AdminCreateUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateUserCreated, error)
|
||||||
|
|
||||||
AdminCronList(params *AdminCronListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronListOK, error)
|
AdminCronList(params *AdminCronListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronListOK, error)
|
||||||
@@ -132,6 +134,16 @@ type ClientService interface {
|
|||||||
|
|
||||||
AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminUnadoptedListOK, error)
|
AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminUnadoptedListOK, error)
|
||||||
|
|
||||||
|
DeleteAdminRunner(params *DeleteAdminRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAdminRunnerNoContent, error)
|
||||||
|
|
||||||
|
GetAdminRunner(params *GetAdminRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAdminRunnerOK, error)
|
||||||
|
|
||||||
|
GetAdminRunners(params *GetAdminRunnersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAdminRunnersOK, error)
|
||||||
|
|
||||||
|
ListAdminWorkflowJobs(params *ListAdminWorkflowJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAdminWorkflowJobsOK, error)
|
||||||
|
|
||||||
|
ListAdminWorkflowRuns(params *ListAdminWorkflowRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAdminWorkflowRunsOK, error)
|
||||||
|
|
||||||
SetTransport(transport runtime.ClientTransport)
|
SetTransport(transport runtime.ClientTransport)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,6 +381,45 @@ func (a *Client) AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
AdminCreateRunnerRegistrationToken gets an global actions runner registration token
|
||||||
|
*/
|
||||||
|
func (a *Client) AdminCreateRunnerRegistrationToken(params *AdminCreateRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCreateRunnerRegistrationTokenOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewAdminCreateRunnerRegistrationTokenParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "adminCreateRunnerRegistrationToken",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/admin/actions/runners/registration-token",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &AdminCreateRunnerRegistrationTokenReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*AdminCreateRunnerRegistrationTokenOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for adminCreateRunnerRegistrationToken: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
AdminCreateUser creates a user
|
AdminCreateUser creates a user
|
||||||
*/
|
*/
|
||||||
@@ -1149,6 +1200,201 @@ func (a *Client) AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo r
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteAdminRunner deletes an global runner
|
||||||
|
*/
|
||||||
|
func (a *Client) DeleteAdminRunner(params *DeleteAdminRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAdminRunnerNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewDeleteAdminRunnerParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "deleteAdminRunner",
|
||||||
|
Method: "DELETE",
|
||||||
|
PathPattern: "/admin/actions/runners/{runner_id}",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &DeleteAdminRunnerReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*DeleteAdminRunnerNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for deleteAdminRunner: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunner gets an global runner
|
||||||
|
*/
|
||||||
|
func (a *Client) GetAdminRunner(params *GetAdminRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAdminRunnerOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetAdminRunnerParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getAdminRunner",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/admin/actions/runners/{runner_id}",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetAdminRunnerReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetAdminRunnerOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getAdminRunner: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunners gets all runners
|
||||||
|
*/
|
||||||
|
func (a *Client) GetAdminRunners(params *GetAdminRunnersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAdminRunnersOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetAdminRunnersParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getAdminRunners",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/admin/actions/runners",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetAdminRunnersReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetAdminRunnersOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getAdminRunners: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowJobs lists all jobs
|
||||||
|
*/
|
||||||
|
func (a *Client) ListAdminWorkflowJobs(params *ListAdminWorkflowJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAdminWorkflowJobsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewListAdminWorkflowJobsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "listAdminWorkflowJobs",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/admin/actions/jobs",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &ListAdminWorkflowJobsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*ListAdminWorkflowJobsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for listAdminWorkflowJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowRuns lists all runs
|
||||||
|
*/
|
||||||
|
func (a *Client) ListAdminWorkflowRuns(params *ListAdminWorkflowRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAdminWorkflowRunsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewListAdminWorkflowRunsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "listAdminWorkflowRuns",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/admin/actions/runs",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &ListAdminWorkflowRunsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*ListAdminWorkflowRunsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for listAdminWorkflowRuns: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
// SetTransport changes the transport on the client
|
// SetTransport changes the transport on the client
|
||||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||||
a.transport = transport
|
a.transport = transport
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminCreateOrgParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user that will own the created organization
|
username of the user who will own the created organization
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminCreatePublicKeyParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user who is to receive a public key
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminCreateRepoParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user. This user will own the created repository
|
username of the user who will own the created repository
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewAdminCreateRunnerRegistrationTokenParams creates a new AdminCreateRunnerRegistrationTokenParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewAdminCreateRunnerRegistrationTokenParams() *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
return &AdminCreateRunnerRegistrationTokenParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAdminCreateRunnerRegistrationTokenParamsWithTimeout creates a new AdminCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewAdminCreateRunnerRegistrationTokenParamsWithTimeout(timeout time.Duration) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
return &AdminCreateRunnerRegistrationTokenParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAdminCreateRunnerRegistrationTokenParamsWithContext creates a new AdminCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewAdminCreateRunnerRegistrationTokenParamsWithContext(ctx context.Context) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
return &AdminCreateRunnerRegistrationTokenParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAdminCreateRunnerRegistrationTokenParamsWithHTTPClient creates a new AdminCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewAdminCreateRunnerRegistrationTokenParamsWithHTTPClient(client *http.Client) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
return &AdminCreateRunnerRegistrationTokenParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
AdminCreateRunnerRegistrationTokenParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the admin create runner registration token operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type AdminCreateRunnerRegistrationTokenParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the admin create runner registration token params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) WithDefaults() *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the admin create runner registration token params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) WithTimeout(timeout time.Duration) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) WithContext(ctx context.Context) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) WithHTTPClient(client *http.Client) *AdminCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the admin create runner registration token params
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AdminCreateRunnerRegistrationTokenReader is a Reader for the AdminCreateRunnerRegistrationToken structure.
|
||||||
|
type AdminCreateRunnerRegistrationTokenReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewAdminCreateRunnerRegistrationTokenOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /admin/actions/runners/registration-token] adminCreateRunnerRegistrationToken", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAdminCreateRunnerRegistrationTokenOK creates a AdminCreateRunnerRegistrationTokenOK with default headers values
|
||||||
|
func NewAdminCreateRunnerRegistrationTokenOK() *AdminCreateRunnerRegistrationTokenOK {
|
||||||
|
return &AdminCreateRunnerRegistrationTokenOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
AdminCreateRunnerRegistrationTokenOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
RegistrationToken is response related to registration token
|
||||||
|
*/
|
||||||
|
type AdminCreateRunnerRegistrationTokenOK struct {
|
||||||
|
Token string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this admin create runner registration token o k response has a 2xx status code
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this admin create runner registration token o k response has a 3xx status code
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this admin create runner registration token o k response has a 4xx status code
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this admin create runner registration token o k response has a 5xx status code
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this admin create runner registration token o k response a status code equal to that given
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the admin create runner registration token o k response
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /admin/actions/runners/registration-token][%d] adminCreateRunnerRegistrationTokenOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) String() string {
|
||||||
|
return fmt.Sprintf("[POST /admin/actions/runners/registration-token][%d] adminCreateRunnerRegistrationTokenOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *AdminCreateRunnerRegistrationTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header token
|
||||||
|
hdrToken := response.GetHeader("token")
|
||||||
|
|
||||||
|
if hdrToken != "" {
|
||||||
|
o.Token = hdrToken
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -68,7 +68,7 @@ type AdminDeleteUserBadgesParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user whose badge is to be deleted
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ type AdminDeleteUserParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user to delete
|
username of the user to delete
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type AdminDeleteUserPublicKeyParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user whose public key is to be deleted
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminEditUserParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user to edit
|
username of the user whose data is to be edited
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,14 @@ type AdminListHooksParams struct {
|
|||||||
*/
|
*/
|
||||||
Page *int64
|
Page *int64
|
||||||
|
|
||||||
|
/* Type.
|
||||||
|
|
||||||
|
system, default or both kinds of webhooks
|
||||||
|
|
||||||
|
Default: "system"
|
||||||
|
*/
|
||||||
|
Type *string
|
||||||
|
|
||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
Context context.Context
|
Context context.Context
|
||||||
HTTPClient *http.Client
|
HTTPClient *http.Client
|
||||||
@@ -91,7 +99,18 @@ func (o *AdminListHooksParams) WithDefaults() *AdminListHooksParams {
|
|||||||
//
|
//
|
||||||
// All values with no default are reset to their zero value.
|
// All values with no default are reset to their zero value.
|
||||||
func (o *AdminListHooksParams) SetDefaults() {
|
func (o *AdminListHooksParams) SetDefaults() {
|
||||||
// no default values defined for this parameter
|
var (
|
||||||
|
typeVarDefault = string("system")
|
||||||
|
)
|
||||||
|
|
||||||
|
val := AdminListHooksParams{
|
||||||
|
Type: &typeVarDefault,
|
||||||
|
}
|
||||||
|
|
||||||
|
val.timeout = o.timeout
|
||||||
|
val.Context = o.Context
|
||||||
|
val.HTTPClient = o.HTTPClient
|
||||||
|
*o = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTimeout adds the timeout to the admin list hooks params
|
// WithTimeout adds the timeout to the admin list hooks params
|
||||||
@@ -149,6 +168,17 @@ func (o *AdminListHooksParams) SetPage(page *int64) {
|
|||||||
o.Page = page
|
o.Page = page
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithType adds the typeVar to the admin list hooks params
|
||||||
|
func (o *AdminListHooksParams) WithType(typeVar *string) *AdminListHooksParams {
|
||||||
|
o.SetType(typeVar)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetType adds the type to the admin list hooks params
|
||||||
|
func (o *AdminListHooksParams) SetType(typeVar *string) {
|
||||||
|
o.Type = typeVar
|
||||||
|
}
|
||||||
|
|
||||||
// WriteToRequest writes these params to a swagger request
|
// WriteToRequest writes these params to a swagger request
|
||||||
func (o *AdminListHooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
func (o *AdminListHooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
@@ -191,6 +221,23 @@ func (o *AdminListHooksParams) WriteToRequest(r runtime.ClientRequest, reg strfm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.Type != nil {
|
||||||
|
|
||||||
|
// query param type
|
||||||
|
var qrType string
|
||||||
|
|
||||||
|
if o.Type != nil {
|
||||||
|
qrType = *o.Type
|
||||||
|
}
|
||||||
|
qType := qrType
|
||||||
|
if qType != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("type", qType); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(res) > 0 {
|
if len(res) > 0 {
|
||||||
return errors.CompositeValidationError(res...)
|
return errors.CompositeValidationError(res...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ type AdminListUserBadgesParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user whose badges are to be listed
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ type AdminRenameUserParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
existing username of user
|
current username of the user
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ type AdminSearchUsersParams struct {
|
|||||||
|
|
||||||
/* LoginName.
|
/* LoginName.
|
||||||
|
|
||||||
user's login name to search for
|
identifier of the user, provided by the external authenticator
|
||||||
*/
|
*/
|
||||||
LoginName *string
|
LoginName *string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerParams creates a new DeleteAdminRunnerParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewDeleteAdminRunnerParams() *DeleteAdminRunnerParams {
|
||||||
|
return &DeleteAdminRunnerParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerParamsWithTimeout creates a new DeleteAdminRunnerParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewDeleteAdminRunnerParamsWithTimeout(timeout time.Duration) *DeleteAdminRunnerParams {
|
||||||
|
return &DeleteAdminRunnerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerParamsWithContext creates a new DeleteAdminRunnerParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewDeleteAdminRunnerParamsWithContext(ctx context.Context) *DeleteAdminRunnerParams {
|
||||||
|
return &DeleteAdminRunnerParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerParamsWithHTTPClient creates a new DeleteAdminRunnerParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewDeleteAdminRunnerParamsWithHTTPClient(client *http.Client) *DeleteAdminRunnerParams {
|
||||||
|
return &DeleteAdminRunnerParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteAdminRunnerParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the delete admin runner operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type DeleteAdminRunnerParams struct {
|
||||||
|
|
||||||
|
/* RunnerID.
|
||||||
|
|
||||||
|
id of the runner
|
||||||
|
*/
|
||||||
|
RunnerID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the delete admin runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteAdminRunnerParams) WithDefaults() *DeleteAdminRunnerParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the delete admin runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteAdminRunnerParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) WithTimeout(timeout time.Duration) *DeleteAdminRunnerParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) WithContext(ctx context.Context) *DeleteAdminRunnerParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) WithHTTPClient(client *http.Client) *DeleteAdminRunnerParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRunnerID adds the runnerID to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) WithRunnerID(runnerID string) *DeleteAdminRunnerParams {
|
||||||
|
o.SetRunnerID(runnerID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRunnerID adds the runnerId to the delete admin runner params
|
||||||
|
func (o *DeleteAdminRunnerParams) SetRunnerID(runnerID string) {
|
||||||
|
o.RunnerID = runnerID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *DeleteAdminRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param runner_id
|
||||||
|
if err := r.SetPathParam("runner_id", o.RunnerID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeleteAdminRunnerReader is a Reader for the DeleteAdminRunner structure.
|
||||||
|
type DeleteAdminRunnerReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *DeleteAdminRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewDeleteAdminRunnerNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewDeleteAdminRunnerBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewDeleteAdminRunnerNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[DELETE /admin/actions/runners/{runner_id}] deleteAdminRunner", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerNoContent creates a DeleteAdminRunnerNoContent with default headers values
|
||||||
|
func NewDeleteAdminRunnerNoContent() *DeleteAdminRunnerNoContent {
|
||||||
|
return &DeleteAdminRunnerNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteAdminRunnerNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
runner has been deleted
|
||||||
|
*/
|
||||||
|
type DeleteAdminRunnerNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete admin runner no content response has a 2xx status code
|
||||||
|
func (o *DeleteAdminRunnerNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete admin runner no content response has a 3xx status code
|
||||||
|
func (o *DeleteAdminRunnerNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete admin runner no content response has a 4xx status code
|
||||||
|
func (o *DeleteAdminRunnerNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete admin runner no content response has a 5xx status code
|
||||||
|
func (o *DeleteAdminRunnerNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete admin runner no content response a status code equal to that given
|
||||||
|
func (o *DeleteAdminRunnerNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete admin runner no content response
|
||||||
|
func (o *DeleteAdminRunnerNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerBadRequest creates a DeleteAdminRunnerBadRequest with default headers values
|
||||||
|
func NewDeleteAdminRunnerBadRequest() *DeleteAdminRunnerBadRequest {
|
||||||
|
return &DeleteAdminRunnerBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteAdminRunnerBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type DeleteAdminRunnerBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete admin runner bad request response has a 2xx status code
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete admin runner bad request response has a 3xx status code
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete admin runner bad request response has a 4xx status code
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete admin runner bad request response has a 5xx status code
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete admin runner bad request response a status code equal to that given
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete admin runner bad request response
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteAdminRunnerNotFound creates a DeleteAdminRunnerNotFound with default headers values
|
||||||
|
func NewDeleteAdminRunnerNotFound() *DeleteAdminRunnerNotFound {
|
||||||
|
return &DeleteAdminRunnerNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteAdminRunnerNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type DeleteAdminRunnerNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete admin runner not found response has a 2xx status code
|
||||||
|
func (o *DeleteAdminRunnerNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete admin runner not found response has a 3xx status code
|
||||||
|
func (o *DeleteAdminRunnerNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete admin runner not found response has a 4xx status code
|
||||||
|
func (o *DeleteAdminRunnerNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete admin runner not found response has a 5xx status code
|
||||||
|
func (o *DeleteAdminRunnerNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete admin runner not found response a status code equal to that given
|
||||||
|
func (o *DeleteAdminRunnerNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete admin runner not found response
|
||||||
|
func (o *DeleteAdminRunnerNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /admin/actions/runners/{runner_id}][%d] deleteAdminRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteAdminRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetAdminRunnerParams creates a new GetAdminRunnerParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetAdminRunnerParams() *GetAdminRunnerParams {
|
||||||
|
return &GetAdminRunnerParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerParamsWithTimeout creates a new GetAdminRunnerParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetAdminRunnerParamsWithTimeout(timeout time.Duration) *GetAdminRunnerParams {
|
||||||
|
return &GetAdminRunnerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerParamsWithContext creates a new GetAdminRunnerParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetAdminRunnerParamsWithContext(ctx context.Context) *GetAdminRunnerParams {
|
||||||
|
return &GetAdminRunnerParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerParamsWithHTTPClient creates a new GetAdminRunnerParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetAdminRunnerParamsWithHTTPClient(client *http.Client) *GetAdminRunnerParams {
|
||||||
|
return &GetAdminRunnerParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnerParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get admin runner operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetAdminRunnerParams struct {
|
||||||
|
|
||||||
|
/* RunnerID.
|
||||||
|
|
||||||
|
id of the runner
|
||||||
|
*/
|
||||||
|
RunnerID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get admin runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetAdminRunnerParams) WithDefaults() *GetAdminRunnerParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get admin runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetAdminRunnerParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) WithTimeout(timeout time.Duration) *GetAdminRunnerParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) WithContext(ctx context.Context) *GetAdminRunnerParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) WithHTTPClient(client *http.Client) *GetAdminRunnerParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRunnerID adds the runnerID to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) WithRunnerID(runnerID string) *GetAdminRunnerParams {
|
||||||
|
o.SetRunnerID(runnerID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRunnerID adds the runnerId to the get admin runner params
|
||||||
|
func (o *GetAdminRunnerParams) SetRunnerID(runnerID string) {
|
||||||
|
o.RunnerID = runnerID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetAdminRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param runner_id
|
||||||
|
if err := r.SetPathParam("runner_id", o.RunnerID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetAdminRunnerReader is a Reader for the GetAdminRunner structure.
|
||||||
|
type GetAdminRunnerReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetAdminRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetAdminRunnerOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetAdminRunnerBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetAdminRunnerNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /admin/actions/runners/{runner_id}] getAdminRunner", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerOK creates a GetAdminRunnerOK with default headers values
|
||||||
|
func NewGetAdminRunnerOK() *GetAdminRunnerOK {
|
||||||
|
return &GetAdminRunnerOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnerOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionRunner represents a Runner
|
||||||
|
*/
|
||||||
|
type GetAdminRunnerOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runner o k response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnerOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runner o k response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnerOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runner o k response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnerOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runner o k response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnerOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runner o k response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnerOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runner o k response
|
||||||
|
func (o *GetAdminRunnerOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerOK) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerOK) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerBadRequest creates a GetAdminRunnerBadRequest with default headers values
|
||||||
|
func NewGetAdminRunnerBadRequest() *GetAdminRunnerBadRequest {
|
||||||
|
return &GetAdminRunnerBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnerBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetAdminRunnerBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runner bad request response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnerBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runner bad request response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnerBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runner bad request response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnerBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runner bad request response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnerBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runner bad request response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnerBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runner bad request response
|
||||||
|
func (o *GetAdminRunnerBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnerNotFound creates a GetAdminRunnerNotFound with default headers values
|
||||||
|
func NewGetAdminRunnerNotFound() *GetAdminRunnerNotFound {
|
||||||
|
return &GetAdminRunnerNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnerNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetAdminRunnerNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runner not found response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnerNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runner not found response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnerNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runner not found response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnerNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runner not found response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnerNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runner not found response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnerNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runner not found response
|
||||||
|
func (o *GetAdminRunnerNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners/{runner_id}][%d] getAdminRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetAdminRunnersParams creates a new GetAdminRunnersParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetAdminRunnersParams() *GetAdminRunnersParams {
|
||||||
|
return &GetAdminRunnersParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersParamsWithTimeout creates a new GetAdminRunnersParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetAdminRunnersParamsWithTimeout(timeout time.Duration) *GetAdminRunnersParams {
|
||||||
|
return &GetAdminRunnersParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersParamsWithContext creates a new GetAdminRunnersParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetAdminRunnersParamsWithContext(ctx context.Context) *GetAdminRunnersParams {
|
||||||
|
return &GetAdminRunnersParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersParamsWithHTTPClient creates a new GetAdminRunnersParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetAdminRunnersParamsWithHTTPClient(client *http.Client) *GetAdminRunnersParams {
|
||||||
|
return &GetAdminRunnersParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnersParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get admin runners operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetAdminRunnersParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get admin runners params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetAdminRunnersParams) WithDefaults() *GetAdminRunnersParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get admin runners params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetAdminRunnersParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) WithTimeout(timeout time.Duration) *GetAdminRunnersParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) WithContext(ctx context.Context) *GetAdminRunnersParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) WithHTTPClient(client *http.Client) *GetAdminRunnersParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get admin runners params
|
||||||
|
func (o *GetAdminRunnersParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetAdminRunnersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetAdminRunnersReader is a Reader for the GetAdminRunners structure.
|
||||||
|
type GetAdminRunnersReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetAdminRunnersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetAdminRunnersOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetAdminRunnersBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetAdminRunnersNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /admin/actions/runners] getAdminRunners", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersOK creates a GetAdminRunnersOK with default headers values
|
||||||
|
func NewGetAdminRunnersOK() *GetAdminRunnersOK {
|
||||||
|
return &GetAdminRunnersOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnersOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionRunnersResponse returns Runners
|
||||||
|
*/
|
||||||
|
type GetAdminRunnersOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runners o k response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnersOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runners o k response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnersOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runners o k response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnersOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runners o k response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnersOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runners o k response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnersOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runners o k response
|
||||||
|
func (o *GetAdminRunnersOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersOK) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersOK) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersBadRequest creates a GetAdminRunnersBadRequest with default headers values
|
||||||
|
func NewGetAdminRunnersBadRequest() *GetAdminRunnersBadRequest {
|
||||||
|
return &GetAdminRunnersBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnersBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetAdminRunnersBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runners bad request response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnersBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runners bad request response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnersBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runners bad request response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnersBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runners bad request response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnersBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runners bad request response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnersBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runners bad request response
|
||||||
|
func (o *GetAdminRunnersBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetAdminRunnersNotFound creates a GetAdminRunnersNotFound with default headers values
|
||||||
|
func NewGetAdminRunnersNotFound() *GetAdminRunnersNotFound {
|
||||||
|
return &GetAdminRunnersNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetAdminRunnersNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetAdminRunnersNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get admin runners not found response has a 2xx status code
|
||||||
|
func (o *GetAdminRunnersNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get admin runners not found response has a 3xx status code
|
||||||
|
func (o *GetAdminRunnersNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get admin runners not found response has a 4xx status code
|
||||||
|
func (o *GetAdminRunnersNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get admin runners not found response has a 5xx status code
|
||||||
|
func (o *GetAdminRunnersNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get admin runners not found response a status code equal to that given
|
||||||
|
func (o *GetAdminRunnersNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get admin runners not found response
|
||||||
|
func (o *GetAdminRunnersNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runners][%d] getAdminRunnersNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetAdminRunnersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,232 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsParams creates a new ListAdminWorkflowJobsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewListAdminWorkflowJobsParams() *ListAdminWorkflowJobsParams {
|
||||||
|
return &ListAdminWorkflowJobsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsParamsWithTimeout creates a new ListAdminWorkflowJobsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewListAdminWorkflowJobsParamsWithTimeout(timeout time.Duration) *ListAdminWorkflowJobsParams {
|
||||||
|
return &ListAdminWorkflowJobsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsParamsWithContext creates a new ListAdminWorkflowJobsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewListAdminWorkflowJobsParamsWithContext(ctx context.Context) *ListAdminWorkflowJobsParams {
|
||||||
|
return &ListAdminWorkflowJobsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsParamsWithHTTPClient creates a new ListAdminWorkflowJobsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewListAdminWorkflowJobsParamsWithHTTPClient(client *http.Client) *ListAdminWorkflowJobsParams {
|
||||||
|
return &ListAdminWorkflowJobsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowJobsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the list admin workflow jobs operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowJobsParams struct {
|
||||||
|
|
||||||
|
/* Limit.
|
||||||
|
|
||||||
|
page size of results
|
||||||
|
*/
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
/* Page.
|
||||||
|
|
||||||
|
page number of results to return (1-based)
|
||||||
|
*/
|
||||||
|
Page *int64
|
||||||
|
|
||||||
|
/* Status.
|
||||||
|
|
||||||
|
workflow status (pending, queued, in_progress, failure, success, skipped)
|
||||||
|
*/
|
||||||
|
Status *string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the list admin workflow jobs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithDefaults() *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the list admin workflow jobs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithTimeout(timeout time.Duration) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithContext(ctx context.Context) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithHTTPClient(client *http.Client) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithLimit(limit *int64) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPage adds the page to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithPage(page *int64) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetPage(page)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPage adds the page to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetPage(page *int64) {
|
||||||
|
o.Page = page
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatus adds the status to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WithStatus(status *string) *ListAdminWorkflowJobsParams {
|
||||||
|
o.SetStatus(status)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus adds the status to the list admin workflow jobs params
|
||||||
|
func (o *ListAdminWorkflowJobsParams) SetStatus(status *string) {
|
||||||
|
o.Status = status
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ListAdminWorkflowJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := swag.FormatInt64(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
|
||||||
|
// query param page
|
||||||
|
var qrPage int64
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
qrPage = *o.Page
|
||||||
|
}
|
||||||
|
qPage := swag.FormatInt64(qrPage)
|
||||||
|
if qPage != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
|
||||||
|
// query param status
|
||||||
|
var qrStatus string
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
qrStatus = *o.Status
|
||||||
|
}
|
||||||
|
qStatus := qrStatus
|
||||||
|
if qStatus != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("status", qStatus); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListAdminWorkflowJobsReader is a Reader for the ListAdminWorkflowJobs structure.
|
||||||
|
type ListAdminWorkflowJobsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ListAdminWorkflowJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewListAdminWorkflowJobsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewListAdminWorkflowJobsBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewListAdminWorkflowJobsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /admin/actions/jobs] listAdminWorkflowJobs", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsOK creates a ListAdminWorkflowJobsOK with default headers values
|
||||||
|
func NewListAdminWorkflowJobsOK() *ListAdminWorkflowJobsOK {
|
||||||
|
return &ListAdminWorkflowJobsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowJobsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
WorkflowJobsList
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowJobsOK struct {
|
||||||
|
Payload *models.ActionWorkflowJobsResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow jobs o k response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow jobs o k response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow jobs o k response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow jobs o k response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow jobs o k response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowJobsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow jobs o k response
|
||||||
|
func (o *ListAdminWorkflowJobsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsOK) GetPayload() *models.ActionWorkflowJobsResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflowJobsResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsBadRequest creates a ListAdminWorkflowJobsBadRequest with default headers values
|
||||||
|
func NewListAdminWorkflowJobsBadRequest() *ListAdminWorkflowJobsBadRequest {
|
||||||
|
return &ListAdminWorkflowJobsBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowJobsBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowJobsBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow jobs bad request response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow jobs bad request response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow jobs bad request response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow jobs bad request response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow jobs bad request response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow jobs bad request response
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowJobsNotFound creates a ListAdminWorkflowJobsNotFound with default headers values
|
||||||
|
func NewListAdminWorkflowJobsNotFound() *ListAdminWorkflowJobsNotFound {
|
||||||
|
return &ListAdminWorkflowJobsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowJobsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowJobsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow jobs not found response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow jobs not found response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow jobs not found response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow jobs not found response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow jobs not found response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow jobs not found response
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/jobs][%d] listAdminWorkflowJobsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,368 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsParams creates a new ListAdminWorkflowRunsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewListAdminWorkflowRunsParams() *ListAdminWorkflowRunsParams {
|
||||||
|
return &ListAdminWorkflowRunsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsParamsWithTimeout creates a new ListAdminWorkflowRunsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewListAdminWorkflowRunsParamsWithTimeout(timeout time.Duration) *ListAdminWorkflowRunsParams {
|
||||||
|
return &ListAdminWorkflowRunsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsParamsWithContext creates a new ListAdminWorkflowRunsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewListAdminWorkflowRunsParamsWithContext(ctx context.Context) *ListAdminWorkflowRunsParams {
|
||||||
|
return &ListAdminWorkflowRunsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsParamsWithHTTPClient creates a new ListAdminWorkflowRunsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewListAdminWorkflowRunsParamsWithHTTPClient(client *http.Client) *ListAdminWorkflowRunsParams {
|
||||||
|
return &ListAdminWorkflowRunsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowRunsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the list admin workflow runs operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowRunsParams struct {
|
||||||
|
|
||||||
|
/* Actor.
|
||||||
|
|
||||||
|
triggered by user
|
||||||
|
*/
|
||||||
|
Actor *string
|
||||||
|
|
||||||
|
/* Branch.
|
||||||
|
|
||||||
|
workflow branch
|
||||||
|
*/
|
||||||
|
Branch *string
|
||||||
|
|
||||||
|
/* Event.
|
||||||
|
|
||||||
|
workflow event name
|
||||||
|
*/
|
||||||
|
Event *string
|
||||||
|
|
||||||
|
/* HeadSha.
|
||||||
|
|
||||||
|
triggering sha of the workflow run
|
||||||
|
*/
|
||||||
|
HeadSha *string
|
||||||
|
|
||||||
|
/* Limit.
|
||||||
|
|
||||||
|
page size of results
|
||||||
|
*/
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
/* Page.
|
||||||
|
|
||||||
|
page number of results to return (1-based)
|
||||||
|
*/
|
||||||
|
Page *int64
|
||||||
|
|
||||||
|
/* Status.
|
||||||
|
|
||||||
|
workflow status (pending, queued, in_progress, failure, success, skipped)
|
||||||
|
*/
|
||||||
|
Status *string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the list admin workflow runs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithDefaults() *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the list admin workflow runs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithTimeout(timeout time.Duration) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithContext(ctx context.Context) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithHTTPClient(client *http.Client) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithActor adds the actor to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithActor(actor *string) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetActor(actor)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetActor adds the actor to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetActor(actor *string) {
|
||||||
|
o.Actor = actor
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBranch adds the branch to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithBranch(branch *string) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetBranch(branch)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBranch adds the branch to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetBranch(branch *string) {
|
||||||
|
o.Branch = branch
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithEvent adds the event to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithEvent(event *string) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetEvent(event)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetEvent adds the event to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetEvent(event *string) {
|
||||||
|
o.Event = event
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHeadSha adds the headSha to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithHeadSha(headSha *string) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetHeadSha(headSha)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHeadSha adds the headSha to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetHeadSha(headSha *string) {
|
||||||
|
o.HeadSha = headSha
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithLimit(limit *int64) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPage adds the page to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithPage(page *int64) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetPage(page)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPage adds the page to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetPage(page *int64) {
|
||||||
|
o.Page = page
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatus adds the status to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WithStatus(status *string) *ListAdminWorkflowRunsParams {
|
||||||
|
o.SetStatus(status)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus adds the status to the list admin workflow runs params
|
||||||
|
func (o *ListAdminWorkflowRunsParams) SetStatus(status *string) {
|
||||||
|
o.Status = status
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ListAdminWorkflowRunsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.Actor != nil {
|
||||||
|
|
||||||
|
// query param actor
|
||||||
|
var qrActor string
|
||||||
|
|
||||||
|
if o.Actor != nil {
|
||||||
|
qrActor = *o.Actor
|
||||||
|
}
|
||||||
|
qActor := qrActor
|
||||||
|
if qActor != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("actor", qActor); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Branch != nil {
|
||||||
|
|
||||||
|
// query param branch
|
||||||
|
var qrBranch string
|
||||||
|
|
||||||
|
if o.Branch != nil {
|
||||||
|
qrBranch = *o.Branch
|
||||||
|
}
|
||||||
|
qBranch := qrBranch
|
||||||
|
if qBranch != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("branch", qBranch); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Event != nil {
|
||||||
|
|
||||||
|
// query param event
|
||||||
|
var qrEvent string
|
||||||
|
|
||||||
|
if o.Event != nil {
|
||||||
|
qrEvent = *o.Event
|
||||||
|
}
|
||||||
|
qEvent := qrEvent
|
||||||
|
if qEvent != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("event", qEvent); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.HeadSha != nil {
|
||||||
|
|
||||||
|
// query param head_sha
|
||||||
|
var qrHeadSha string
|
||||||
|
|
||||||
|
if o.HeadSha != nil {
|
||||||
|
qrHeadSha = *o.HeadSha
|
||||||
|
}
|
||||||
|
qHeadSha := qrHeadSha
|
||||||
|
if qHeadSha != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("head_sha", qHeadSha); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := swag.FormatInt64(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
|
||||||
|
// query param page
|
||||||
|
var qrPage int64
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
qrPage = *o.Page
|
||||||
|
}
|
||||||
|
qPage := swag.FormatInt64(qrPage)
|
||||||
|
if qPage != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
|
||||||
|
// query param status
|
||||||
|
var qrStatus string
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
qrStatus = *o.Status
|
||||||
|
}
|
||||||
|
qStatus := qrStatus
|
||||||
|
if qStatus != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("status", qStatus); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package admin
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListAdminWorkflowRunsReader is a Reader for the ListAdminWorkflowRuns structure.
|
||||||
|
type ListAdminWorkflowRunsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ListAdminWorkflowRunsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewListAdminWorkflowRunsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewListAdminWorkflowRunsBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewListAdminWorkflowRunsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /admin/actions/runs] listAdminWorkflowRuns", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsOK creates a ListAdminWorkflowRunsOK with default headers values
|
||||||
|
func NewListAdminWorkflowRunsOK() *ListAdminWorkflowRunsOK {
|
||||||
|
return &ListAdminWorkflowRunsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowRunsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
WorkflowRunsList
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowRunsOK struct {
|
||||||
|
Payload *models.ActionWorkflowRunsResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow runs o k response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow runs o k response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow runs o k response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow runs o k response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow runs o k response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowRunsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow runs o k response
|
||||||
|
func (o *ListAdminWorkflowRunsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsOK) GetPayload() *models.ActionWorkflowRunsResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflowRunsResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsBadRequest creates a ListAdminWorkflowRunsBadRequest with default headers values
|
||||||
|
func NewListAdminWorkflowRunsBadRequest() *ListAdminWorkflowRunsBadRequest {
|
||||||
|
return &ListAdminWorkflowRunsBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowRunsBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowRunsBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow runs bad request response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow runs bad request response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow runs bad request response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow runs bad request response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow runs bad request response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow runs bad request response
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListAdminWorkflowRunsNotFound creates a ListAdminWorkflowRunsNotFound with default headers values
|
||||||
|
func NewListAdminWorkflowRunsNotFound() *ListAdminWorkflowRunsNotFound {
|
||||||
|
return &ListAdminWorkflowRunsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListAdminWorkflowRunsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ListAdminWorkflowRunsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list admin workflow runs not found response has a 2xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list admin workflow runs not found response has a 3xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list admin workflow runs not found response has a 4xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list admin workflow runs not found response has a 5xx status code
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list admin workflow runs not found response a status code equal to that given
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list admin workflow runs not found response
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /admin/actions/runs][%d] listAdminWorkflowRunsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListAdminWorkflowRunsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -84,7 +84,7 @@ type IssueAddSubscriptionParams struct {
|
|||||||
|
|
||||||
/* User.
|
/* User.
|
||||||
|
|
||||||
user to subscribe
|
username of the user to subscribe the issue to
|
||||||
*/
|
*/
|
||||||
User string
|
User string
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
IssueListLabels(params *IssueListLabelsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueListLabelsOK, error)
|
IssueListLabels(params *IssueListLabelsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueListLabelsOK, error)
|
||||||
|
|
||||||
|
IssueLockIssue(params *IssueLockIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueLockIssueNoContent, error)
|
||||||
|
|
||||||
IssuePostCommentReaction(params *IssuePostCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssuePostCommentReactionOK, *IssuePostCommentReactionCreated, error)
|
IssuePostCommentReaction(params *IssuePostCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssuePostCommentReactionOK, *IssuePostCommentReactionCreated, error)
|
||||||
|
|
||||||
IssuePostIssueReaction(params *IssuePostIssueReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssuePostIssueReactionOK, *IssuePostIssueReactionCreated, error)
|
IssuePostIssueReaction(params *IssuePostIssueReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssuePostIssueReactionOK, *IssuePostIssueReactionCreated, error)
|
||||||
@@ -233,6 +235,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
IssueTrackedTimes(params *IssueTrackedTimesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueTrackedTimesOK, error)
|
IssueTrackedTimes(params *IssueTrackedTimesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueTrackedTimesOK, error)
|
||||||
|
|
||||||
|
IssueUnlockIssue(params *IssueUnlockIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueUnlockIssueNoContent, error)
|
||||||
|
|
||||||
MoveIssuePin(params *MoveIssuePinParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MoveIssuePinNoContent, error)
|
MoveIssuePin(params *MoveIssuePinParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MoveIssuePinNoContent, error)
|
||||||
|
|
||||||
PinIssue(params *PinIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PinIssueNoContent, error)
|
PinIssue(params *PinIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PinIssueNoContent, error)
|
||||||
@@ -2275,6 +2279,45 @@ func (a *Client) IssueListLabels(params *IssueListLabelsParams, authInfo runtime
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueLockIssue locks an issue
|
||||||
|
*/
|
||||||
|
func (a *Client) IssueLockIssue(params *IssueLockIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueLockIssueNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewIssueLockIssueParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "issueLockIssue",
|
||||||
|
Method: "PUT",
|
||||||
|
PathPattern: "/repos/{owner}/{repo}/issues/{index}/lock",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &IssueLockIssueReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*IssueLockIssueNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for issueLockIssue: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IssuePostCommentReaction adds a reaction to a comment of an issue
|
IssuePostCommentReaction adds a reaction to a comment of an issue
|
||||||
*/
|
*/
|
||||||
@@ -2745,6 +2788,45 @@ func (a *Client) IssueTrackedTimes(params *IssueTrackedTimesParams, authInfo run
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueUnlockIssue unlocks an issue
|
||||||
|
*/
|
||||||
|
func (a *Client) IssueUnlockIssue(params *IssueUnlockIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssueUnlockIssueNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewIssueUnlockIssueParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "issueUnlockIssue",
|
||||||
|
Method: "DELETE",
|
||||||
|
PathPattern: "/repos/{owner}/{repo}/issues/{index}/lock",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &IssueUnlockIssueReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*IssueUnlockIssueNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for issueUnlockIssue: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MoveIssuePin moves the pin to the given position
|
MoveIssuePin moves the pin to the given position
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ func (o *IssueCreateIssueAttachmentReader) ReadResponse(response runtime.ClientR
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
|
case 413:
|
||||||
|
result := NewIssueCreateIssueAttachmentRequestEntityTooLarge()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
case 422:
|
case 422:
|
||||||
result := NewIssueCreateIssueAttachmentUnprocessableEntity()
|
result := NewIssueCreateIssueAttachmentUnprocessableEntity()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
@@ -273,6 +279,78 @@ func (o *IssueCreateIssueAttachmentNotFound) readResponse(response runtime.Clien
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewIssueCreateIssueAttachmentRequestEntityTooLarge creates a IssueCreateIssueAttachmentRequestEntityTooLarge with default headers values
|
||||||
|
func NewIssueCreateIssueAttachmentRequestEntityTooLarge() *IssueCreateIssueAttachmentRequestEntityTooLarge {
|
||||||
|
return &IssueCreateIssueAttachmentRequestEntityTooLarge{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueCreateIssueAttachmentRequestEntityTooLarge describes a response with status code 413, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type IssueCreateIssueAttachmentRequestEntityTooLarge struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue create issue attachment request entity too large response has a 2xx status code
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue create issue attachment request entity too large response has a 3xx status code
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue create issue attachment request entity too large response has a 4xx status code
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue create issue attachment request entity too large response has a 5xx status code
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue create issue attachment request entity too large response a status code equal to that given
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) IsCode(code int) bool {
|
||||||
|
return code == 413
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue create issue attachment request entity too large response
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) Code() int {
|
||||||
|
return 413
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/{index}/assets][%d] issueCreateIssueAttachmentRequestEntityTooLarge", 413)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/{index}/assets][%d] issueCreateIssueAttachmentRequestEntityTooLarge", 413)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueAttachmentRequestEntityTooLarge) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// NewIssueCreateIssueAttachmentUnprocessableEntity creates a IssueCreateIssueAttachmentUnprocessableEntity with default headers values
|
// NewIssueCreateIssueAttachmentUnprocessableEntity creates a IssueCreateIssueAttachmentUnprocessableEntity with default headers values
|
||||||
func NewIssueCreateIssueAttachmentUnprocessableEntity() *IssueCreateIssueAttachmentUnprocessableEntity {
|
func NewIssueCreateIssueAttachmentUnprocessableEntity() *IssueCreateIssueAttachmentUnprocessableEntity {
|
||||||
return &IssueCreateIssueAttachmentUnprocessableEntity{}
|
return &IssueCreateIssueAttachmentUnprocessableEntity{}
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ func (o *IssueCreateIssueCommentAttachmentReader) ReadResponse(response runtime.
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
|
case 413:
|
||||||
|
result := NewIssueCreateIssueCommentAttachmentRequestEntityTooLarge()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
case 422:
|
case 422:
|
||||||
result := NewIssueCreateIssueCommentAttachmentUnprocessableEntity()
|
result := NewIssueCreateIssueCommentAttachmentUnprocessableEntity()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
@@ -351,6 +357,78 @@ func (o *IssueCreateIssueCommentAttachmentNotFound) readResponse(response runtim
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewIssueCreateIssueCommentAttachmentRequestEntityTooLarge creates a IssueCreateIssueCommentAttachmentRequestEntityTooLarge with default headers values
|
||||||
|
func NewIssueCreateIssueCommentAttachmentRequestEntityTooLarge() *IssueCreateIssueCommentAttachmentRequestEntityTooLarge {
|
||||||
|
return &IssueCreateIssueCommentAttachmentRequestEntityTooLarge{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueCreateIssueCommentAttachmentRequestEntityTooLarge describes a response with status code 413, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type IssueCreateIssueCommentAttachmentRequestEntityTooLarge struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue create issue comment attachment request entity too large response has a 2xx status code
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue create issue comment attachment request entity too large response has a 3xx status code
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue create issue comment attachment request entity too large response has a 4xx status code
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue create issue comment attachment request entity too large response has a 5xx status code
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue create issue comment attachment request entity too large response a status code equal to that given
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) IsCode(code int) bool {
|
||||||
|
return code == 413
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue create issue comment attachment request entity too large response
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) Code() int {
|
||||||
|
return 413
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/assets][%d] issueCreateIssueCommentAttachmentRequestEntityTooLarge", 413)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/assets][%d] issueCreateIssueCommentAttachmentRequestEntityTooLarge", 413)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueCreateIssueCommentAttachmentRequestEntityTooLarge) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// NewIssueCreateIssueCommentAttachmentUnprocessableEntity creates a IssueCreateIssueCommentAttachmentUnprocessableEntity with default headers values
|
// NewIssueCreateIssueCommentAttachmentUnprocessableEntity creates a IssueCreateIssueCommentAttachmentUnprocessableEntity with default headers values
|
||||||
func NewIssueCreateIssueCommentAttachmentUnprocessableEntity() *IssueCreateIssueCommentAttachmentUnprocessableEntity {
|
func NewIssueCreateIssueCommentAttachmentUnprocessableEntity() *IssueCreateIssueCommentAttachmentUnprocessableEntity {
|
||||||
return &IssueCreateIssueCommentAttachmentUnprocessableEntity{}
|
return &IssueCreateIssueCommentAttachmentUnprocessableEntity{}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ func NewIssueDeleteStopWatchConflict() *IssueDeleteStopWatchConflict {
|
|||||||
/*
|
/*
|
||||||
IssueDeleteStopWatchConflict describes a response with status code 409, with default header values.
|
IssueDeleteStopWatchConflict describes a response with status code 409, with default header values.
|
||||||
|
|
||||||
Cannot cancel a non existent stopwatch
|
Cannot cancel a non-existent stopwatch
|
||||||
*/
|
*/
|
||||||
type IssueDeleteStopWatchConflict struct {
|
type IssueDeleteStopWatchConflict struct {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ type IssueDeleteSubscriptionParams struct {
|
|||||||
|
|
||||||
/* User.
|
/* User.
|
||||||
|
|
||||||
user witch unsubscribe
|
username of the user to unsubscribe from an issue
|
||||||
*/
|
*/
|
||||||
User string
|
User string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,219 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package issue
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewIssueLockIssueParams creates a new IssueLockIssueParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewIssueLockIssueParams() *IssueLockIssueParams {
|
||||||
|
return &IssueLockIssueParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueParamsWithTimeout creates a new IssueLockIssueParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewIssueLockIssueParamsWithTimeout(timeout time.Duration) *IssueLockIssueParams {
|
||||||
|
return &IssueLockIssueParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueParamsWithContext creates a new IssueLockIssueParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewIssueLockIssueParamsWithContext(ctx context.Context) *IssueLockIssueParams {
|
||||||
|
return &IssueLockIssueParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueParamsWithHTTPClient creates a new IssueLockIssueParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewIssueLockIssueParamsWithHTTPClient(client *http.Client) *IssueLockIssueParams {
|
||||||
|
return &IssueLockIssueParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueLockIssueParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the issue lock issue operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type IssueLockIssueParams struct {
|
||||||
|
|
||||||
|
// Body.
|
||||||
|
Body *models.LockIssueOption
|
||||||
|
|
||||||
|
/* Index.
|
||||||
|
|
||||||
|
index of the issue
|
||||||
|
|
||||||
|
Format: int64
|
||||||
|
*/
|
||||||
|
Index int64
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the issue lock issue params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *IssueLockIssueParams) WithDefaults() *IssueLockIssueParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the issue lock issue params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *IssueLockIssueParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithTimeout(timeout time.Duration) *IssueLockIssueParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithContext(ctx context.Context) *IssueLockIssueParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithHTTPClient(client *http.Client) *IssueLockIssueParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBody adds the body to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithBody(body *models.LockIssueOption) *IssueLockIssueParams {
|
||||||
|
o.SetBody(body)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBody adds the body to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetBody(body *models.LockIssueOption) {
|
||||||
|
o.Body = body
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithIndex adds the index to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithIndex(index int64) *IssueLockIssueParams {
|
||||||
|
o.SetIndex(index)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetIndex adds the index to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetIndex(index int64) {
|
||||||
|
o.Index = index
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithOwner(owner string) *IssueLockIssueParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) WithRepo(repo string) *IssueLockIssueParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the issue lock issue params
|
||||||
|
func (o *IssueLockIssueParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *IssueLockIssueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.Body != nil {
|
||||||
|
if err := r.SetBodyParam(o.Body); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param index
|
||||||
|
if err := r.SetPathParam("index", swag.FormatInt64(o.Index)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package issue
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IssueLockIssueReader is a Reader for the IssueLockIssue structure.
|
||||||
|
type IssueLockIssueReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *IssueLockIssueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewIssueLockIssueNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 403:
|
||||||
|
result := NewIssueLockIssueForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewIssueLockIssueNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[PUT /repos/{owner}/{repo}/issues/{index}/lock] issueLockIssue", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueNoContent creates a IssueLockIssueNoContent with default headers values
|
||||||
|
func NewIssueLockIssueNoContent() *IssueLockIssueNoContent {
|
||||||
|
return &IssueLockIssueNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueLockIssueNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
APIEmpty is an empty response
|
||||||
|
*/
|
||||||
|
type IssueLockIssueNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue lock issue no content response has a 2xx status code
|
||||||
|
func (o *IssueLockIssueNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue lock issue no content response has a 3xx status code
|
||||||
|
func (o *IssueLockIssueNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue lock issue no content response has a 4xx status code
|
||||||
|
func (o *IssueLockIssueNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue lock issue no content response has a 5xx status code
|
||||||
|
func (o *IssueLockIssueNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue lock issue no content response a status code equal to that given
|
||||||
|
func (o *IssueLockIssueNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue lock issue no content response
|
||||||
|
func (o *IssueLockIssueNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueForbidden creates a IssueLockIssueForbidden with default headers values
|
||||||
|
func NewIssueLockIssueForbidden() *IssueLockIssueForbidden {
|
||||||
|
return &IssueLockIssueForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueLockIssueForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type IssueLockIssueForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue lock issue forbidden response has a 2xx status code
|
||||||
|
func (o *IssueLockIssueForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue lock issue forbidden response has a 3xx status code
|
||||||
|
func (o *IssueLockIssueForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue lock issue forbidden response has a 4xx status code
|
||||||
|
func (o *IssueLockIssueForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue lock issue forbidden response has a 5xx status code
|
||||||
|
func (o *IssueLockIssueForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue lock issue forbidden response a status code equal to that given
|
||||||
|
func (o *IssueLockIssueForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue lock issue forbidden response
|
||||||
|
func (o *IssueLockIssueForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueLockIssueNotFound creates a IssueLockIssueNotFound with default headers values
|
||||||
|
func NewIssueLockIssueNotFound() *IssueLockIssueNotFound {
|
||||||
|
return &IssueLockIssueNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueLockIssueNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type IssueLockIssueNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue lock issue not found response has a 2xx status code
|
||||||
|
func (o *IssueLockIssueNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue lock issue not found response has a 3xx status code
|
||||||
|
func (o *IssueLockIssueNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue lock issue not found response has a 4xx status code
|
||||||
|
func (o *IssueLockIssueNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue lock issue not found response has a 5xx status code
|
||||||
|
func (o *IssueLockIssueNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue lock issue not found response a status code equal to that given
|
||||||
|
func (o *IssueLockIssueNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue lock issue not found response
|
||||||
|
func (o *IssueLockIssueNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/lock][%d] issueLockIssueNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueLockIssueNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -225,7 +225,7 @@ func NewIssueStopStopWatchConflict() *IssueStopStopWatchConflict {
|
|||||||
/*
|
/*
|
||||||
IssueStopStopWatchConflict describes a response with status code 409, with default header values.
|
IssueStopStopWatchConflict describes a response with status code 409, with default header values.
|
||||||
|
|
||||||
Cannot stop a non existent stopwatch
|
Cannot stop a non-existent stopwatch
|
||||||
*/
|
*/
|
||||||
type IssueStopStopWatchConflict struct {
|
type IssueStopStopWatchConflict struct {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,198 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package issue
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueParams creates a new IssueUnlockIssueParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewIssueUnlockIssueParams() *IssueUnlockIssueParams {
|
||||||
|
return &IssueUnlockIssueParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueParamsWithTimeout creates a new IssueUnlockIssueParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewIssueUnlockIssueParamsWithTimeout(timeout time.Duration) *IssueUnlockIssueParams {
|
||||||
|
return &IssueUnlockIssueParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueParamsWithContext creates a new IssueUnlockIssueParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewIssueUnlockIssueParamsWithContext(ctx context.Context) *IssueUnlockIssueParams {
|
||||||
|
return &IssueUnlockIssueParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueParamsWithHTTPClient creates a new IssueUnlockIssueParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewIssueUnlockIssueParamsWithHTTPClient(client *http.Client) *IssueUnlockIssueParams {
|
||||||
|
return &IssueUnlockIssueParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueUnlockIssueParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the issue unlock issue operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type IssueUnlockIssueParams struct {
|
||||||
|
|
||||||
|
/* Index.
|
||||||
|
|
||||||
|
index of the issue
|
||||||
|
|
||||||
|
Format: int64
|
||||||
|
*/
|
||||||
|
Index int64
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the issue unlock issue params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *IssueUnlockIssueParams) WithDefaults() *IssueUnlockIssueParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the issue unlock issue params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *IssueUnlockIssueParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithTimeout(timeout time.Duration) *IssueUnlockIssueParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithContext(ctx context.Context) *IssueUnlockIssueParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithHTTPClient(client *http.Client) *IssueUnlockIssueParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithIndex adds the index to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithIndex(index int64) *IssueUnlockIssueParams {
|
||||||
|
o.SetIndex(index)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetIndex adds the index to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetIndex(index int64) {
|
||||||
|
o.Index = index
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithOwner(owner string) *IssueUnlockIssueParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) WithRepo(repo string) *IssueUnlockIssueParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the issue unlock issue params
|
||||||
|
func (o *IssueUnlockIssueParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *IssueUnlockIssueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param index
|
||||||
|
if err := r.SetPathParam("index", swag.FormatInt64(o.Index)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package issue
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IssueUnlockIssueReader is a Reader for the IssueUnlockIssue structure.
|
||||||
|
type IssueUnlockIssueReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *IssueUnlockIssueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewIssueUnlockIssueNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 403:
|
||||||
|
result := NewIssueUnlockIssueForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewIssueUnlockIssueNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[DELETE /repos/{owner}/{repo}/issues/{index}/lock] issueUnlockIssue", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueNoContent creates a IssueUnlockIssueNoContent with default headers values
|
||||||
|
func NewIssueUnlockIssueNoContent() *IssueUnlockIssueNoContent {
|
||||||
|
return &IssueUnlockIssueNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueUnlockIssueNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
APIEmpty is an empty response
|
||||||
|
*/
|
||||||
|
type IssueUnlockIssueNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue unlock issue no content response has a 2xx status code
|
||||||
|
func (o *IssueUnlockIssueNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue unlock issue no content response has a 3xx status code
|
||||||
|
func (o *IssueUnlockIssueNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue unlock issue no content response has a 4xx status code
|
||||||
|
func (o *IssueUnlockIssueNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue unlock issue no content response has a 5xx status code
|
||||||
|
func (o *IssueUnlockIssueNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue unlock issue no content response a status code equal to that given
|
||||||
|
func (o *IssueUnlockIssueNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue unlock issue no content response
|
||||||
|
func (o *IssueUnlockIssueNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueForbidden creates a IssueUnlockIssueForbidden with default headers values
|
||||||
|
func NewIssueUnlockIssueForbidden() *IssueUnlockIssueForbidden {
|
||||||
|
return &IssueUnlockIssueForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueUnlockIssueForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type IssueUnlockIssueForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue unlock issue forbidden response has a 2xx status code
|
||||||
|
func (o *IssueUnlockIssueForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue unlock issue forbidden response has a 3xx status code
|
||||||
|
func (o *IssueUnlockIssueForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue unlock issue forbidden response has a 4xx status code
|
||||||
|
func (o *IssueUnlockIssueForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue unlock issue forbidden response has a 5xx status code
|
||||||
|
func (o *IssueUnlockIssueForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue unlock issue forbidden response a status code equal to that given
|
||||||
|
func (o *IssueUnlockIssueForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue unlock issue forbidden response
|
||||||
|
func (o *IssueUnlockIssueForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewIssueUnlockIssueNotFound creates a IssueUnlockIssueNotFound with default headers values
|
||||||
|
func NewIssueUnlockIssueNotFound() *IssueUnlockIssueNotFound {
|
||||||
|
return &IssueUnlockIssueNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
IssueUnlockIssueNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type IssueUnlockIssueNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this issue unlock issue not found response has a 2xx status code
|
||||||
|
func (o *IssueUnlockIssueNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this issue unlock issue not found response has a 3xx status code
|
||||||
|
func (o *IssueUnlockIssueNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this issue unlock issue not found response has a 4xx status code
|
||||||
|
func (o *IssueUnlockIssueNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this issue unlock issue not found response has a 5xx status code
|
||||||
|
func (o *IssueUnlockIssueNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this issue unlock issue not found response a status code equal to that given
|
||||||
|
func (o *IssueUnlockIssueNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the issue unlock issue not found response
|
||||||
|
func (o *IssueUnlockIssueNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/lock][%d] issueUnlockIssueNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *IssueUnlockIssueNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package miscellaneous
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetSigningKeySSHParams creates a new GetSigningKeySSHParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetSigningKeySSHParams() *GetSigningKeySSHParams {
|
||||||
|
return &GetSigningKeySSHParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSigningKeySSHParamsWithTimeout creates a new GetSigningKeySSHParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetSigningKeySSHParamsWithTimeout(timeout time.Duration) *GetSigningKeySSHParams {
|
||||||
|
return &GetSigningKeySSHParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSigningKeySSHParamsWithContext creates a new GetSigningKeySSHParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetSigningKeySSHParamsWithContext(ctx context.Context) *GetSigningKeySSHParams {
|
||||||
|
return &GetSigningKeySSHParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSigningKeySSHParamsWithHTTPClient creates a new GetSigningKeySSHParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetSigningKeySSHParamsWithHTTPClient(client *http.Client) *GetSigningKeySSHParams {
|
||||||
|
return &GetSigningKeySSHParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetSigningKeySSHParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get signing key SSH operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetSigningKeySSHParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get signing key SSH params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetSigningKeySSHParams) WithDefaults() *GetSigningKeySSHParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get signing key SSH params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetSigningKeySSHParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) WithTimeout(timeout time.Duration) *GetSigningKeySSHParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) WithContext(ctx context.Context) *GetSigningKeySSHParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) WithHTTPClient(client *http.Client) *GetSigningKeySSHParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get signing key SSH params
|
||||||
|
func (o *GetSigningKeySSHParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetSigningKeySSHParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package miscellaneous
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetSigningKeySSHReader is a Reader for the GetSigningKeySSH structure.
|
||||||
|
type GetSigningKeySSHReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetSigningKeySSHReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetSigningKeySSHOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /signing-key.pub] getSigningKeySSH", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSigningKeySSHOK creates a GetSigningKeySSHOK with default headers values
|
||||||
|
func NewGetSigningKeySSHOK() *GetSigningKeySSHOK {
|
||||||
|
return &GetSigningKeySSHOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetSigningKeySSHOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ssh public key
|
||||||
|
*/
|
||||||
|
type GetSigningKeySSHOK struct {
|
||||||
|
Payload string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get signing key Ssh o k response has a 2xx status code
|
||||||
|
func (o *GetSigningKeySSHOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get signing key Ssh o k response has a 3xx status code
|
||||||
|
func (o *GetSigningKeySSHOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get signing key Ssh o k response has a 4xx status code
|
||||||
|
func (o *GetSigningKeySSHOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get signing key Ssh o k response has a 5xx status code
|
||||||
|
func (o *GetSigningKeySSHOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get signing key Ssh o k response a status code equal to that given
|
||||||
|
func (o *GetSigningKeySSHOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get signing key Ssh o k response
|
||||||
|
func (o *GetSigningKeySSHOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSigningKeySSHOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /signing-key.pub][%d] getSigningKeySshOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSigningKeySSHOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /signing-key.pub][%d] getSigningKeySshOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSigningKeySSHOK) GetPayload() string {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSigningKeySSHOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -115,6 +115,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
GetSigningKey(params *GetSigningKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSigningKeyOK, error)
|
GetSigningKey(params *GetSigningKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSigningKeyOK, error)
|
||||||
|
|
||||||
|
GetSigningKeySSH(params *GetSigningKeySSHParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSigningKeySSHOK, error)
|
||||||
|
|
||||||
GetVersion(params *GetVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVersionOK, error)
|
GetVersion(params *GetVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVersionOK, error)
|
||||||
|
|
||||||
ListGitignoresTemplates(params *ListGitignoresTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListGitignoresTemplatesOK, error)
|
ListGitignoresTemplates(params *ListGitignoresTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListGitignoresTemplatesOK, error)
|
||||||
@@ -327,6 +329,45 @@ func (a *Client) GetSigningKey(params *GetSigningKeyParams, authInfo runtime.Cli
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetSigningKeySSH gets default signing key pub
|
||||||
|
*/
|
||||||
|
func (a *Client) GetSigningKeySSH(params *GetSigningKeySSHParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSigningKeySSHOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetSigningKeySSHParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getSigningKeySSH",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/signing-key.pub",
|
||||||
|
ProducesMediaTypes: []string{"text/plain"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetSigningKeySSHReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetSigningKeySSHOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getSigningKeySSH: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GetVersion returns the version of the gitea application
|
GetVersion returns the version of the gitea application
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,20 +26,20 @@ func (o *CreateOrgVariableReader) ReadResponse(response runtime.ClientResponse,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
case 204:
|
|
||||||
result := NewCreateOrgVariableNoContent()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
case 400:
|
case 400:
|
||||||
result := NewCreateOrgVariableBadRequest()
|
result := NewCreateOrgVariableBadRequest()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
case 404:
|
case 409:
|
||||||
result := NewCreateOrgVariableNotFound()
|
result := NewCreateOrgVariableConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewCreateOrgVariableInternalServerError()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ func NewCreateOrgVariableCreated() *CreateOrgVariableCreated {
|
|||||||
/*
|
/*
|
||||||
CreateOrgVariableCreated describes a response with status code 201, with default header values.
|
CreateOrgVariableCreated describes a response with status code 201, with default header values.
|
||||||
|
|
||||||
response when creating an org-level variable
|
successfully created the org-level variable
|
||||||
*/
|
*/
|
||||||
type CreateOrgVariableCreated struct {
|
type CreateOrgVariableCreated struct {
|
||||||
}
|
}
|
||||||
@@ -105,62 +105,6 @@ func (o *CreateOrgVariableCreated) readResponse(response runtime.ClientResponse,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCreateOrgVariableNoContent creates a CreateOrgVariableNoContent with default headers values
|
|
||||||
func NewCreateOrgVariableNoContent() *CreateOrgVariableNoContent {
|
|
||||||
return &CreateOrgVariableNoContent{}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
CreateOrgVariableNoContent describes a response with status code 204, with default header values.
|
|
||||||
|
|
||||||
response when creating an org-level variable
|
|
||||||
*/
|
|
||||||
type CreateOrgVariableNoContent struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this create org variable no content response has a 2xx status code
|
|
||||||
func (o *CreateOrgVariableNoContent) IsSuccess() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this create org variable no content response has a 3xx status code
|
|
||||||
func (o *CreateOrgVariableNoContent) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this create org variable no content response has a 4xx status code
|
|
||||||
func (o *CreateOrgVariableNoContent) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this create org variable no content response has a 5xx status code
|
|
||||||
func (o *CreateOrgVariableNoContent) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this create org variable no content response a status code equal to that given
|
|
||||||
func (o *CreateOrgVariableNoContent) IsCode(code int) bool {
|
|
||||||
return code == 204
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the create org variable no content response
|
|
||||||
func (o *CreateOrgVariableNoContent) Code() int {
|
|
||||||
return 204
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateOrgVariableNoContent) Error() string {
|
|
||||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNoContent", 204)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateOrgVariableNoContent) String() string {
|
|
||||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNoContent", 204)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateOrgVariableNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewCreateOrgVariableBadRequest creates a CreateOrgVariableBadRequest with default headers values
|
// NewCreateOrgVariableBadRequest creates a CreateOrgVariableBadRequest with default headers values
|
||||||
func NewCreateOrgVariableBadRequest() *CreateOrgVariableBadRequest {
|
func NewCreateOrgVariableBadRequest() *CreateOrgVariableBadRequest {
|
||||||
return &CreateOrgVariableBadRequest{}
|
return &CreateOrgVariableBadRequest{}
|
||||||
@@ -233,58 +177,130 @@ func (o *CreateOrgVariableBadRequest) readResponse(response runtime.ClientRespon
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCreateOrgVariableNotFound creates a CreateOrgVariableNotFound with default headers values
|
// NewCreateOrgVariableConflict creates a CreateOrgVariableConflict with default headers values
|
||||||
func NewCreateOrgVariableNotFound() *CreateOrgVariableNotFound {
|
func NewCreateOrgVariableConflict() *CreateOrgVariableConflict {
|
||||||
return &CreateOrgVariableNotFound{}
|
return &CreateOrgVariableConflict{}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CreateOrgVariableNotFound describes a response with status code 404, with default header values.
|
CreateOrgVariableConflict describes a response with status code 409, with default header values.
|
||||||
|
|
||||||
APINotFound is a not found empty response
|
variable name already exists.
|
||||||
*/
|
*/
|
||||||
type CreateOrgVariableNotFound struct {
|
type CreateOrgVariableConflict struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsSuccess returns true when this create org variable not found response has a 2xx status code
|
// IsSuccess returns true when this create org variable conflict response has a 2xx status code
|
||||||
func (o *CreateOrgVariableNotFound) IsSuccess() bool {
|
func (o *CreateOrgVariableConflict) IsSuccess() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRedirect returns true when this create org variable not found response has a 3xx status code
|
// IsRedirect returns true when this create org variable conflict response has a 3xx status code
|
||||||
func (o *CreateOrgVariableNotFound) IsRedirect() bool {
|
func (o *CreateOrgVariableConflict) IsRedirect() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsClientError returns true when this create org variable not found response has a 4xx status code
|
// IsClientError returns true when this create org variable conflict response has a 4xx status code
|
||||||
func (o *CreateOrgVariableNotFound) IsClientError() bool {
|
func (o *CreateOrgVariableConflict) IsClientError() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsServerError returns true when this create org variable not found response has a 5xx status code
|
// IsServerError returns true when this create org variable conflict response has a 5xx status code
|
||||||
func (o *CreateOrgVariableNotFound) IsServerError() bool {
|
func (o *CreateOrgVariableConflict) IsServerError() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsCode returns true when this create org variable not found response a status code equal to that given
|
// IsCode returns true when this create org variable conflict response a status code equal to that given
|
||||||
func (o *CreateOrgVariableNotFound) IsCode(code int) bool {
|
func (o *CreateOrgVariableConflict) IsCode(code int) bool {
|
||||||
return code == 404
|
return code == 409
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code gets the status code for the create org variable not found response
|
// Code gets the status code for the create org variable conflict response
|
||||||
func (o *CreateOrgVariableNotFound) Code() int {
|
func (o *CreateOrgVariableConflict) Code() int {
|
||||||
return 404
|
return 409
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateOrgVariableNotFound) Error() string {
|
func (o *CreateOrgVariableConflict) Error() string {
|
||||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNotFound", 404)
|
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableConflict", 409)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateOrgVariableNotFound) String() string {
|
func (o *CreateOrgVariableConflict) String() string {
|
||||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNotFound", 404)
|
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableConflict", 409)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateOrgVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
func (o *CreateOrgVariableConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateOrgVariableInternalServerError creates a CreateOrgVariableInternalServerError with default headers values
|
||||||
|
func NewCreateOrgVariableInternalServerError() *CreateOrgVariableInternalServerError {
|
||||||
|
return &CreateOrgVariableInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateOrgVariableInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type CreateOrgVariableInternalServerError struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this create org variable internal server error response has a 2xx status code
|
||||||
|
func (o *CreateOrgVariableInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this create org variable internal server error response has a 3xx status code
|
||||||
|
func (o *CreateOrgVariableInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this create org variable internal server error response has a 4xx status code
|
||||||
|
func (o *CreateOrgVariableInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this create org variable internal server error response has a 5xx status code
|
||||||
|
func (o *CreateOrgVariableInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this create org variable internal server error response a status code equal to that given
|
||||||
|
func (o *CreateOrgVariableInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the create org variable internal server error response
|
||||||
|
func (o *CreateOrgVariableInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateOrgVariableInternalServerError) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateOrgVariableInternalServerError) String() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateOrgVariableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,173 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerParams creates a new DeleteOrgRunnerParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewDeleteOrgRunnerParams() *DeleteOrgRunnerParams {
|
||||||
|
return &DeleteOrgRunnerParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerParamsWithTimeout creates a new DeleteOrgRunnerParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewDeleteOrgRunnerParamsWithTimeout(timeout time.Duration) *DeleteOrgRunnerParams {
|
||||||
|
return &DeleteOrgRunnerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerParamsWithContext creates a new DeleteOrgRunnerParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewDeleteOrgRunnerParamsWithContext(ctx context.Context) *DeleteOrgRunnerParams {
|
||||||
|
return &DeleteOrgRunnerParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerParamsWithHTTPClient creates a new DeleteOrgRunnerParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewDeleteOrgRunnerParamsWithHTTPClient(client *http.Client) *DeleteOrgRunnerParams {
|
||||||
|
return &DeleteOrgRunnerParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteOrgRunnerParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the delete org runner operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type DeleteOrgRunnerParams struct {
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
/* RunnerID.
|
||||||
|
|
||||||
|
id of the runner
|
||||||
|
*/
|
||||||
|
RunnerID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the delete org runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteOrgRunnerParams) WithDefaults() *DeleteOrgRunnerParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the delete org runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteOrgRunnerParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) WithTimeout(timeout time.Duration) *DeleteOrgRunnerParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) WithContext(ctx context.Context) *DeleteOrgRunnerParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) WithHTTPClient(client *http.Client) *DeleteOrgRunnerParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) WithOrg(org string) *DeleteOrgRunnerParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRunnerID adds the runnerID to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) WithRunnerID(runnerID string) *DeleteOrgRunnerParams {
|
||||||
|
o.SetRunnerID(runnerID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRunnerID adds the runnerId to the delete org runner params
|
||||||
|
func (o *DeleteOrgRunnerParams) SetRunnerID(runnerID string) {
|
||||||
|
o.RunnerID = runnerID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *DeleteOrgRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param runner_id
|
||||||
|
if err := r.SetPathParam("runner_id", o.RunnerID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeleteOrgRunnerReader is a Reader for the DeleteOrgRunner structure.
|
||||||
|
type DeleteOrgRunnerReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *DeleteOrgRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewDeleteOrgRunnerNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewDeleteOrgRunnerBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewDeleteOrgRunnerNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[DELETE /orgs/{org}/actions/runners/{runner_id}] deleteOrgRunner", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerNoContent creates a DeleteOrgRunnerNoContent with default headers values
|
||||||
|
func NewDeleteOrgRunnerNoContent() *DeleteOrgRunnerNoContent {
|
||||||
|
return &DeleteOrgRunnerNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteOrgRunnerNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
runner has been deleted
|
||||||
|
*/
|
||||||
|
type DeleteOrgRunnerNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete org runner no content response has a 2xx status code
|
||||||
|
func (o *DeleteOrgRunnerNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete org runner no content response has a 3xx status code
|
||||||
|
func (o *DeleteOrgRunnerNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete org runner no content response has a 4xx status code
|
||||||
|
func (o *DeleteOrgRunnerNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete org runner no content response has a 5xx status code
|
||||||
|
func (o *DeleteOrgRunnerNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete org runner no content response a status code equal to that given
|
||||||
|
func (o *DeleteOrgRunnerNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete org runner no content response
|
||||||
|
func (o *DeleteOrgRunnerNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerBadRequest creates a DeleteOrgRunnerBadRequest with default headers values
|
||||||
|
func NewDeleteOrgRunnerBadRequest() *DeleteOrgRunnerBadRequest {
|
||||||
|
return &DeleteOrgRunnerBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteOrgRunnerBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type DeleteOrgRunnerBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete org runner bad request response has a 2xx status code
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete org runner bad request response has a 3xx status code
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete org runner bad request response has a 4xx status code
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete org runner bad request response has a 5xx status code
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete org runner bad request response a status code equal to that given
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete org runner bad request response
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteOrgRunnerNotFound creates a DeleteOrgRunnerNotFound with default headers values
|
||||||
|
func NewDeleteOrgRunnerNotFound() *DeleteOrgRunnerNotFound {
|
||||||
|
return &DeleteOrgRunnerNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteOrgRunnerNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type DeleteOrgRunnerNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete org runner not found response has a 2xx status code
|
||||||
|
func (o *DeleteOrgRunnerNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete org runner not found response has a 3xx status code
|
||||||
|
func (o *DeleteOrgRunnerNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete org runner not found response has a 4xx status code
|
||||||
|
func (o *DeleteOrgRunnerNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete org runner not found response has a 5xx status code
|
||||||
|
func (o *DeleteOrgRunnerNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete org runner not found response a status code equal to that given
|
||||||
|
func (o *DeleteOrgRunnerNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete org runner not found response
|
||||||
|
func (o *DeleteOrgRunnerNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /orgs/{org}/actions/runners/{runner_id}][%d] deleteOrgRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteOrgRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetOrgRunnerParams creates a new GetOrgRunnerParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetOrgRunnerParams() *GetOrgRunnerParams {
|
||||||
|
return &GetOrgRunnerParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerParamsWithTimeout creates a new GetOrgRunnerParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetOrgRunnerParamsWithTimeout(timeout time.Duration) *GetOrgRunnerParams {
|
||||||
|
return &GetOrgRunnerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerParamsWithContext creates a new GetOrgRunnerParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetOrgRunnerParamsWithContext(ctx context.Context) *GetOrgRunnerParams {
|
||||||
|
return &GetOrgRunnerParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerParamsWithHTTPClient creates a new GetOrgRunnerParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetOrgRunnerParamsWithHTTPClient(client *http.Client) *GetOrgRunnerParams {
|
||||||
|
return &GetOrgRunnerParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnerParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get org runner operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetOrgRunnerParams struct {
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
/* RunnerID.
|
||||||
|
|
||||||
|
id of the runner
|
||||||
|
*/
|
||||||
|
RunnerID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get org runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgRunnerParams) WithDefaults() *GetOrgRunnerParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get org runner params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgRunnerParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) WithTimeout(timeout time.Duration) *GetOrgRunnerParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) WithContext(ctx context.Context) *GetOrgRunnerParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) WithHTTPClient(client *http.Client) *GetOrgRunnerParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) WithOrg(org string) *GetOrgRunnerParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRunnerID adds the runnerID to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) WithRunnerID(runnerID string) *GetOrgRunnerParams {
|
||||||
|
o.SetRunnerID(runnerID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRunnerID adds the runnerId to the get org runner params
|
||||||
|
func (o *GetOrgRunnerParams) SetRunnerID(runnerID string) {
|
||||||
|
o.RunnerID = runnerID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetOrgRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param runner_id
|
||||||
|
if err := r.SetPathParam("runner_id", o.RunnerID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOrgRunnerReader is a Reader for the GetOrgRunner structure.
|
||||||
|
type GetOrgRunnerReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetOrgRunnerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetOrgRunnerOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetOrgRunnerBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetOrgRunnerNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /orgs/{org}/actions/runners/{runner_id}] getOrgRunner", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerOK creates a GetOrgRunnerOK with default headers values
|
||||||
|
func NewGetOrgRunnerOK() *GetOrgRunnerOK {
|
||||||
|
return &GetOrgRunnerOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnerOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionRunner represents a Runner
|
||||||
|
*/
|
||||||
|
type GetOrgRunnerOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runner o k response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnerOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runner o k response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnerOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runner o k response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnerOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runner o k response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnerOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runner o k response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnerOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runner o k response
|
||||||
|
func (o *GetOrgRunnerOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerOK) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerOK) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerBadRequest creates a GetOrgRunnerBadRequest with default headers values
|
||||||
|
func NewGetOrgRunnerBadRequest() *GetOrgRunnerBadRequest {
|
||||||
|
return &GetOrgRunnerBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnerBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetOrgRunnerBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runner bad request response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnerBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runner bad request response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnerBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runner bad request response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnerBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runner bad request response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnerBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runner bad request response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnerBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runner bad request response
|
||||||
|
func (o *GetOrgRunnerBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnerNotFound creates a GetOrgRunnerNotFound with default headers values
|
||||||
|
func NewGetOrgRunnerNotFound() *GetOrgRunnerNotFound {
|
||||||
|
return &GetOrgRunnerNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnerNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetOrgRunnerNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runner not found response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnerNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runner not found response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnerNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runner not found response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnerNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runner not found response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnerNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runner not found response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnerNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runner not found response
|
||||||
|
func (o *GetOrgRunnerNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners/{runner_id}][%d] getOrgRunnerNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetOrgRunnersParams creates a new GetOrgRunnersParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetOrgRunnersParams() *GetOrgRunnersParams {
|
||||||
|
return &GetOrgRunnersParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersParamsWithTimeout creates a new GetOrgRunnersParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetOrgRunnersParamsWithTimeout(timeout time.Duration) *GetOrgRunnersParams {
|
||||||
|
return &GetOrgRunnersParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersParamsWithContext creates a new GetOrgRunnersParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetOrgRunnersParamsWithContext(ctx context.Context) *GetOrgRunnersParams {
|
||||||
|
return &GetOrgRunnersParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersParamsWithHTTPClient creates a new GetOrgRunnersParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetOrgRunnersParamsWithHTTPClient(client *http.Client) *GetOrgRunnersParams {
|
||||||
|
return &GetOrgRunnersParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnersParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get org runners operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetOrgRunnersParams struct {
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get org runners params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgRunnersParams) WithDefaults() *GetOrgRunnersParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get org runners params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgRunnersParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) WithTimeout(timeout time.Duration) *GetOrgRunnersParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) WithContext(ctx context.Context) *GetOrgRunnersParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) WithHTTPClient(client *http.Client) *GetOrgRunnersParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) WithOrg(org string) *GetOrgRunnersParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the get org runners params
|
||||||
|
func (o *GetOrgRunnersParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetOrgRunnersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOrgRunnersReader is a Reader for the GetOrgRunners structure.
|
||||||
|
type GetOrgRunnersReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetOrgRunnersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetOrgRunnersOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetOrgRunnersBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetOrgRunnersNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /orgs/{org}/actions/runners] getOrgRunners", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersOK creates a GetOrgRunnersOK with default headers values
|
||||||
|
func NewGetOrgRunnersOK() *GetOrgRunnersOK {
|
||||||
|
return &GetOrgRunnersOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnersOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionRunnersResponse returns Runners
|
||||||
|
*/
|
||||||
|
type GetOrgRunnersOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runners o k response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnersOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runners o k response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnersOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runners o k response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnersOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runners o k response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnersOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runners o k response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnersOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runners o k response
|
||||||
|
func (o *GetOrgRunnersOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersOK) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersOK) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersBadRequest creates a GetOrgRunnersBadRequest with default headers values
|
||||||
|
func NewGetOrgRunnersBadRequest() *GetOrgRunnersBadRequest {
|
||||||
|
return &GetOrgRunnersBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnersBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetOrgRunnersBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runners bad request response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnersBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runners bad request response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnersBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runners bad request response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnersBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runners bad request response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnersBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runners bad request response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnersBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runners bad request response
|
||||||
|
func (o *GetOrgRunnersBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgRunnersNotFound creates a GetOrgRunnersNotFound with default headers values
|
||||||
|
func NewGetOrgRunnersNotFound() *GetOrgRunnersNotFound {
|
||||||
|
return &GetOrgRunnersNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunnersNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetOrgRunnersNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org runners not found response has a 2xx status code
|
||||||
|
func (o *GetOrgRunnersNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org runners not found response has a 3xx status code
|
||||||
|
func (o *GetOrgRunnersNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org runners not found response has a 4xx status code
|
||||||
|
func (o *GetOrgRunnersNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org runners not found response has a 5xx status code
|
||||||
|
func (o *GetOrgRunnersNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org runners not found response a status code equal to that given
|
||||||
|
func (o *GetOrgRunnersNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org runners not found response
|
||||||
|
func (o *GetOrgRunnersNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runners][%d] getOrgRunnersNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgRunnersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,254 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsParams creates a new GetOrgWorkflowJobsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetOrgWorkflowJobsParams() *GetOrgWorkflowJobsParams {
|
||||||
|
return &GetOrgWorkflowJobsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsParamsWithTimeout creates a new GetOrgWorkflowJobsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetOrgWorkflowJobsParamsWithTimeout(timeout time.Duration) *GetOrgWorkflowJobsParams {
|
||||||
|
return &GetOrgWorkflowJobsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsParamsWithContext creates a new GetOrgWorkflowJobsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetOrgWorkflowJobsParamsWithContext(ctx context.Context) *GetOrgWorkflowJobsParams {
|
||||||
|
return &GetOrgWorkflowJobsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsParamsWithHTTPClient creates a new GetOrgWorkflowJobsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetOrgWorkflowJobsParamsWithHTTPClient(client *http.Client) *GetOrgWorkflowJobsParams {
|
||||||
|
return &GetOrgWorkflowJobsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowJobsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get org workflow jobs operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowJobsParams struct {
|
||||||
|
|
||||||
|
/* Limit.
|
||||||
|
|
||||||
|
page size of results
|
||||||
|
*/
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
/* Page.
|
||||||
|
|
||||||
|
page number of results to return (1-based)
|
||||||
|
*/
|
||||||
|
Page *int64
|
||||||
|
|
||||||
|
/* Status.
|
||||||
|
|
||||||
|
workflow status (pending, queued, in_progress, failure, success, skipped)
|
||||||
|
*/
|
||||||
|
Status *string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get org workflow jobs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithDefaults() *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get org workflow jobs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithTimeout(timeout time.Duration) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithContext(ctx context.Context) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithHTTPClient(client *http.Client) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithLimit(limit *int64) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithOrg(org string) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPage adds the page to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithPage(page *int64) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetPage(page)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPage adds the page to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetPage(page *int64) {
|
||||||
|
o.Page = page
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatus adds the status to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WithStatus(status *string) *GetOrgWorkflowJobsParams {
|
||||||
|
o.SetStatus(status)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus adds the status to the get org workflow jobs params
|
||||||
|
func (o *GetOrgWorkflowJobsParams) SetStatus(status *string) {
|
||||||
|
o.Status = status
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetOrgWorkflowJobsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := swag.FormatInt64(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
|
||||||
|
// query param page
|
||||||
|
var qrPage int64
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
qrPage = *o.Page
|
||||||
|
}
|
||||||
|
qPage := swag.FormatInt64(qrPage)
|
||||||
|
if qPage != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
|
||||||
|
// query param status
|
||||||
|
var qrStatus string
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
qrStatus = *o.Status
|
||||||
|
}
|
||||||
|
qStatus := qrStatus
|
||||||
|
if qStatus != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("status", qStatus); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOrgWorkflowJobsReader is a Reader for the GetOrgWorkflowJobs structure.
|
||||||
|
type GetOrgWorkflowJobsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetOrgWorkflowJobsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetOrgWorkflowJobsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetOrgWorkflowJobsBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetOrgWorkflowJobsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /orgs/{org}/actions/jobs] getOrgWorkflowJobs", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsOK creates a GetOrgWorkflowJobsOK with default headers values
|
||||||
|
func NewGetOrgWorkflowJobsOK() *GetOrgWorkflowJobsOK {
|
||||||
|
return &GetOrgWorkflowJobsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowJobsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
WorkflowJobsList
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowJobsOK struct {
|
||||||
|
Payload *models.ActionWorkflowJobsResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow jobs o k response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow jobs o k response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow jobs o k response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow jobs o k response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow jobs o k response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowJobsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow jobs o k response
|
||||||
|
func (o *GetOrgWorkflowJobsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsOK) GetPayload() *models.ActionWorkflowJobsResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflowJobsResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsBadRequest creates a GetOrgWorkflowJobsBadRequest with default headers values
|
||||||
|
func NewGetOrgWorkflowJobsBadRequest() *GetOrgWorkflowJobsBadRequest {
|
||||||
|
return &GetOrgWorkflowJobsBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowJobsBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowJobsBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow jobs bad request response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow jobs bad request response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow jobs bad request response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow jobs bad request response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow jobs bad request response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow jobs bad request response
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowJobsNotFound creates a GetOrgWorkflowJobsNotFound with default headers values
|
||||||
|
func NewGetOrgWorkflowJobsNotFound() *GetOrgWorkflowJobsNotFound {
|
||||||
|
return &GetOrgWorkflowJobsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowJobsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowJobsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow jobs not found response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow jobs not found response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow jobs not found response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow jobs not found response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow jobs not found response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow jobs not found response
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/jobs][%d] getOrgWorkflowJobsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,390 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsParams creates a new GetOrgWorkflowRunsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetOrgWorkflowRunsParams() *GetOrgWorkflowRunsParams {
|
||||||
|
return &GetOrgWorkflowRunsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsParamsWithTimeout creates a new GetOrgWorkflowRunsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetOrgWorkflowRunsParamsWithTimeout(timeout time.Duration) *GetOrgWorkflowRunsParams {
|
||||||
|
return &GetOrgWorkflowRunsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsParamsWithContext creates a new GetOrgWorkflowRunsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetOrgWorkflowRunsParamsWithContext(ctx context.Context) *GetOrgWorkflowRunsParams {
|
||||||
|
return &GetOrgWorkflowRunsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsParamsWithHTTPClient creates a new GetOrgWorkflowRunsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetOrgWorkflowRunsParamsWithHTTPClient(client *http.Client) *GetOrgWorkflowRunsParams {
|
||||||
|
return &GetOrgWorkflowRunsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowRunsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get org workflow runs operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowRunsParams struct {
|
||||||
|
|
||||||
|
/* Actor.
|
||||||
|
|
||||||
|
triggered by user
|
||||||
|
*/
|
||||||
|
Actor *string
|
||||||
|
|
||||||
|
/* Branch.
|
||||||
|
|
||||||
|
workflow branch
|
||||||
|
*/
|
||||||
|
Branch *string
|
||||||
|
|
||||||
|
/* Event.
|
||||||
|
|
||||||
|
workflow event name
|
||||||
|
*/
|
||||||
|
Event *string
|
||||||
|
|
||||||
|
/* HeadSha.
|
||||||
|
|
||||||
|
triggering sha of the workflow run
|
||||||
|
*/
|
||||||
|
HeadSha *string
|
||||||
|
|
||||||
|
/* Limit.
|
||||||
|
|
||||||
|
page size of results
|
||||||
|
*/
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
/* Page.
|
||||||
|
|
||||||
|
page number of results to return (1-based)
|
||||||
|
*/
|
||||||
|
Page *int64
|
||||||
|
|
||||||
|
/* Status.
|
||||||
|
|
||||||
|
workflow status (pending, queued, in_progress, failure, success, skipped)
|
||||||
|
*/
|
||||||
|
Status *string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get org workflow runs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithDefaults() *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get org workflow runs params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithTimeout(timeout time.Duration) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithContext(ctx context.Context) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithHTTPClient(client *http.Client) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithActor adds the actor to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithActor(actor *string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetActor(actor)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetActor adds the actor to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetActor(actor *string) {
|
||||||
|
o.Actor = actor
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBranch adds the branch to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithBranch(branch *string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetBranch(branch)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBranch adds the branch to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetBranch(branch *string) {
|
||||||
|
o.Branch = branch
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithEvent adds the event to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithEvent(event *string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetEvent(event)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetEvent adds the event to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetEvent(event *string) {
|
||||||
|
o.Event = event
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHeadSha adds the headSha to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithHeadSha(headSha *string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetHeadSha(headSha)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHeadSha adds the headSha to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetHeadSha(headSha *string) {
|
||||||
|
o.HeadSha = headSha
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithLimit(limit *int64) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithOrg(org string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPage adds the page to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithPage(page *int64) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetPage(page)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPage adds the page to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetPage(page *int64) {
|
||||||
|
o.Page = page
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatus adds the status to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WithStatus(status *string) *GetOrgWorkflowRunsParams {
|
||||||
|
o.SetStatus(status)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus adds the status to the get org workflow runs params
|
||||||
|
func (o *GetOrgWorkflowRunsParams) SetStatus(status *string) {
|
||||||
|
o.Status = status
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetOrgWorkflowRunsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.Actor != nil {
|
||||||
|
|
||||||
|
// query param actor
|
||||||
|
var qrActor string
|
||||||
|
|
||||||
|
if o.Actor != nil {
|
||||||
|
qrActor = *o.Actor
|
||||||
|
}
|
||||||
|
qActor := qrActor
|
||||||
|
if qActor != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("actor", qActor); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Branch != nil {
|
||||||
|
|
||||||
|
// query param branch
|
||||||
|
var qrBranch string
|
||||||
|
|
||||||
|
if o.Branch != nil {
|
||||||
|
qrBranch = *o.Branch
|
||||||
|
}
|
||||||
|
qBranch := qrBranch
|
||||||
|
if qBranch != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("branch", qBranch); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Event != nil {
|
||||||
|
|
||||||
|
// query param event
|
||||||
|
var qrEvent string
|
||||||
|
|
||||||
|
if o.Event != nil {
|
||||||
|
qrEvent = *o.Event
|
||||||
|
}
|
||||||
|
qEvent := qrEvent
|
||||||
|
if qEvent != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("event", qEvent); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.HeadSha != nil {
|
||||||
|
|
||||||
|
// query param head_sha
|
||||||
|
var qrHeadSha string
|
||||||
|
|
||||||
|
if o.HeadSha != nil {
|
||||||
|
qrHeadSha = *o.HeadSha
|
||||||
|
}
|
||||||
|
qHeadSha := qrHeadSha
|
||||||
|
if qHeadSha != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("head_sha", qHeadSha); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := swag.FormatInt64(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
|
||||||
|
// query param page
|
||||||
|
var qrPage int64
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
qrPage = *o.Page
|
||||||
|
}
|
||||||
|
qPage := swag.FormatInt64(qrPage)
|
||||||
|
if qPage != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
|
||||||
|
// query param status
|
||||||
|
var qrStatus string
|
||||||
|
|
||||||
|
if o.Status != nil {
|
||||||
|
qrStatus = *o.Status
|
||||||
|
}
|
||||||
|
qStatus := qrStatus
|
||||||
|
if qStatus != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("status", qStatus); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetOrgWorkflowRunsReader is a Reader for the GetOrgWorkflowRuns structure.
|
||||||
|
type GetOrgWorkflowRunsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetOrgWorkflowRunsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetOrgWorkflowRunsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewGetOrgWorkflowRunsBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetOrgWorkflowRunsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /orgs/{org}/actions/runs] getOrgWorkflowRuns", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsOK creates a GetOrgWorkflowRunsOK with default headers values
|
||||||
|
func NewGetOrgWorkflowRunsOK() *GetOrgWorkflowRunsOK {
|
||||||
|
return &GetOrgWorkflowRunsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowRunsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
WorkflowRunsList
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowRunsOK struct {
|
||||||
|
Payload *models.ActionWorkflowRunsResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow runs o k response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow runs o k response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow runs o k response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow runs o k response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow runs o k response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowRunsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow runs o k response
|
||||||
|
func (o *GetOrgWorkflowRunsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsOK) GetPayload() *models.ActionWorkflowRunsResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflowRunsResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsBadRequest creates a GetOrgWorkflowRunsBadRequest with default headers values
|
||||||
|
func NewGetOrgWorkflowRunsBadRequest() *GetOrgWorkflowRunsBadRequest {
|
||||||
|
return &GetOrgWorkflowRunsBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowRunsBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowRunsBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow runs bad request response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow runs bad request response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow runs bad request response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow runs bad request response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow runs bad request response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow runs bad request response
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetOrgWorkflowRunsNotFound creates a GetOrgWorkflowRunsNotFound with default headers values
|
||||||
|
func NewGetOrgWorkflowRunsNotFound() *GetOrgWorkflowRunsNotFound {
|
||||||
|
return &GetOrgWorkflowRunsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowRunsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetOrgWorkflowRunsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get org workflow runs not found response has a 2xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get org workflow runs not found response has a 3xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get org workflow runs not found response has a 4xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get org workflow runs not found response has a 5xx status code
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get org workflow runs not found response a status code equal to that given
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get org workflow runs not found response
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /orgs/{org}/actions/runs][%d] getOrgWorkflowRunsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetOrgWorkflowRunsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -72,7 +72,7 @@ type OrgAddTeamMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user to add
|
username of the user to add to a team
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrgConcealMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user whose membership is to be concealed
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewOrgCreateRunnerRegistrationTokenParams creates a new OrgCreateRunnerRegistrationTokenParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewOrgCreateRunnerRegistrationTokenParams() *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
return &OrgCreateRunnerRegistrationTokenParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewOrgCreateRunnerRegistrationTokenParamsWithTimeout creates a new OrgCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewOrgCreateRunnerRegistrationTokenParamsWithTimeout(timeout time.Duration) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
return &OrgCreateRunnerRegistrationTokenParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewOrgCreateRunnerRegistrationTokenParamsWithContext creates a new OrgCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewOrgCreateRunnerRegistrationTokenParamsWithContext(ctx context.Context) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
return &OrgCreateRunnerRegistrationTokenParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewOrgCreateRunnerRegistrationTokenParamsWithHTTPClient creates a new OrgCreateRunnerRegistrationTokenParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewOrgCreateRunnerRegistrationTokenParamsWithHTTPClient(client *http.Client) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
return &OrgCreateRunnerRegistrationTokenParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
OrgCreateRunnerRegistrationTokenParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the org create runner registration token operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type OrgCreateRunnerRegistrationTokenParams struct {
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
name of the organization
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the org create runner registration token params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WithDefaults() *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the org create runner registration token params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WithTimeout(timeout time.Duration) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WithContext(ctx context.Context) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WithHTTPClient(client *http.Client) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WithOrg(org string) *OrgCreateRunnerRegistrationTokenParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the org create runner registration token params
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// OrgCreateRunnerRegistrationTokenReader is a Reader for the OrgCreateRunnerRegistrationToken structure.
|
||||||
|
type OrgCreateRunnerRegistrationTokenReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewOrgCreateRunnerRegistrationTokenOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /orgs/{org}/actions/runners/registration-token] orgCreateRunnerRegistrationToken", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewOrgCreateRunnerRegistrationTokenOK creates a OrgCreateRunnerRegistrationTokenOK with default headers values
|
||||||
|
func NewOrgCreateRunnerRegistrationTokenOK() *OrgCreateRunnerRegistrationTokenOK {
|
||||||
|
return &OrgCreateRunnerRegistrationTokenOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
OrgCreateRunnerRegistrationTokenOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
RegistrationToken is response related to registration token
|
||||||
|
*/
|
||||||
|
type OrgCreateRunnerRegistrationTokenOK struct {
|
||||||
|
Token string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this org create runner registration token o k response has a 2xx status code
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this org create runner registration token o k response has a 3xx status code
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this org create runner registration token o k response has a 4xx status code
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this org create runner registration token o k response has a 5xx status code
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this org create runner registration token o k response a status code equal to that given
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the org create runner registration token o k response
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/actions/runners/registration-token][%d] orgCreateRunnerRegistrationTokenOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) String() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/actions/runners/registration-token][%d] orgCreateRunnerRegistrationTokenOK", 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *OrgCreateRunnerRegistrationTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header token
|
||||||
|
hdrToken := response.GetHeader("token")
|
||||||
|
|
||||||
|
if hdrToken != "" {
|
||||||
|
o.Token = hdrToken
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -69,7 +69,7 @@ type OrgDeleteMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user to remove from the organization
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrgGetUserPermissionsParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user whose permissions are to be obtained
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrgIsMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user to check for an organization membership
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrgIsPublicMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user to check for a public organization membership
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type OrgListTeamMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the member to list
|
username of the user whose data is to be listed
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ type OrgListUserOrgsParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of user
|
username of the user whose organizations are to be listed
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrgPublicizeMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user
|
username of the user whose membership is to be publicized
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type OrgRemoveTeamMemberParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
username of the user to remove
|
username of the user to remove from a team
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ type OrganizationBlockUserParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
user to block
|
username of the user to block
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrganizationCheckUserBlockParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
user to check
|
username of the user to check
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -104,16 +104,26 @@ type ClientService interface {
|
|||||||
|
|
||||||
CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoDeprecatedCreated, error)
|
CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoDeprecatedCreated, error)
|
||||||
|
|
||||||
CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error)
|
CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, error)
|
||||||
|
|
||||||
|
DeleteOrgRunner(params *DeleteOrgRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgRunnerNoContent, error)
|
||||||
|
|
||||||
DeleteOrgSecret(params *DeleteOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgSecretNoContent, error)
|
DeleteOrgSecret(params *DeleteOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgSecretNoContent, error)
|
||||||
|
|
||||||
DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgVariableOK, *DeleteOrgVariableCreated, *DeleteOrgVariableNoContent, error)
|
DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgVariableOK, *DeleteOrgVariableCreated, *DeleteOrgVariableNoContent, error)
|
||||||
|
|
||||||
|
GetOrgRunner(params *GetOrgRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgRunnerOK, error)
|
||||||
|
|
||||||
|
GetOrgRunners(params *GetOrgRunnersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgRunnersOK, error)
|
||||||
|
|
||||||
GetOrgVariable(params *GetOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariableOK, error)
|
GetOrgVariable(params *GetOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariableOK, error)
|
||||||
|
|
||||||
GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariablesListOK, error)
|
GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgVariablesListOK, error)
|
||||||
|
|
||||||
|
GetOrgWorkflowJobs(params *GetOrgWorkflowJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgWorkflowJobsOK, error)
|
||||||
|
|
||||||
|
GetOrgWorkflowRuns(params *GetOrgWorkflowRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgWorkflowRunsOK, error)
|
||||||
|
|
||||||
OrgAddTeamMember(params *OrgAddTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamMemberNoContent, error)
|
OrgAddTeamMember(params *OrgAddTeamMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamMemberNoContent, error)
|
||||||
|
|
||||||
OrgAddTeamRepository(params *OrgAddTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamRepositoryNoContent, error)
|
OrgAddTeamRepository(params *OrgAddTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamRepositoryNoContent, error)
|
||||||
@@ -126,6 +136,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateLabelCreated, error)
|
OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateLabelCreated, error)
|
||||||
|
|
||||||
|
OrgCreateRunnerRegistrationToken(params *OrgCreateRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateRunnerRegistrationTokenOK, error)
|
||||||
|
|
||||||
OrgCreateTeam(params *OrgCreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateTeamCreated, error)
|
OrgCreateTeam(params *OrgCreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateTeamCreated, error)
|
||||||
|
|
||||||
OrgDelete(params *OrgDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteNoContent, error)
|
OrgDelete(params *OrgDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteNoContent, error)
|
||||||
@@ -212,6 +224,8 @@ type ClientService interface {
|
|||||||
|
|
||||||
OrganizationUnblockUser(params *OrganizationUnblockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationUnblockUserNoContent, error)
|
OrganizationUnblockUser(params *OrganizationUnblockUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrganizationUnblockUserNoContent, error)
|
||||||
|
|
||||||
|
RenameOrg(params *RenameOrgParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RenameOrgNoContent, error)
|
||||||
|
|
||||||
TeamSearch(params *TeamSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TeamSearchOK, error)
|
TeamSearch(params *TeamSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TeamSearchOK, error)
|
||||||
|
|
||||||
UpdateOrgSecret(params *UpdateOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgSecretCreated, *UpdateOrgSecretNoContent, error)
|
UpdateOrgSecret(params *UpdateOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgSecretCreated, *UpdateOrgSecretNoContent, error)
|
||||||
@@ -302,7 +316,7 @@ func (a *Client) CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams,
|
|||||||
/*
|
/*
|
||||||
CreateOrgVariable creates an org level variable
|
CreateOrgVariable creates an org level variable
|
||||||
*/
|
*/
|
||||||
func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error) {
|
func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, error) {
|
||||||
// TODO: Validate the params before sending
|
// TODO: Validate the params before sending
|
||||||
if params == nil {
|
if params == nil {
|
||||||
params = NewCreateOrgVariableParams()
|
params = NewCreateOrgVariableParams()
|
||||||
@@ -326,16 +340,54 @@ func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo run
|
|||||||
|
|
||||||
result, err := a.transport.Submit(op)
|
result, err := a.transport.Submit(op)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
switch value := result.(type) {
|
success, ok := result.(*CreateOrgVariableCreated)
|
||||||
case *CreateOrgVariableCreated:
|
if ok {
|
||||||
return value, nil, nil
|
return success, nil
|
||||||
case *CreateOrgVariableNoContent:
|
|
||||||
return nil, value, nil
|
|
||||||
}
|
}
|
||||||
|
// unexpected success response
|
||||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
msg := fmt.Sprintf("unexpected success response for createOrgVariable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteOrgRunner deletes an org level runner
|
||||||
|
*/
|
||||||
|
func (a *Client) DeleteOrgRunner(params *DeleteOrgRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgRunnerNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewDeleteOrgRunnerParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "deleteOrgRunner",
|
||||||
|
Method: "DELETE",
|
||||||
|
PathPattern: "/orgs/{org}/actions/runners/{runner_id}",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &DeleteOrgRunnerReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*DeleteOrgRunnerNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for deleteOrgRunner: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,6 +472,84 @@ func (a *Client) DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo run
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunner gets an org level runner
|
||||||
|
*/
|
||||||
|
func (a *Client) GetOrgRunner(params *GetOrgRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgRunnerOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetOrgRunnerParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getOrgRunner",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/orgs/{org}/actions/runners/{runner_id}",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetOrgRunnerReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetOrgRunnerOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getOrgRunner: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgRunners gets org level runners
|
||||||
|
*/
|
||||||
|
func (a *Client) GetOrgRunners(params *GetOrgRunnersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgRunnersOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetOrgRunnersParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getOrgRunners",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/orgs/{org}/actions/runners",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetOrgRunnersReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetOrgRunnersOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getOrgRunners: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GetOrgVariable gets an org level variable
|
GetOrgVariable gets an org level variable
|
||||||
*/
|
*/
|
||||||
@@ -498,6 +628,84 @@ func (a *Client) GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowJobs gets org level workflow jobs
|
||||||
|
*/
|
||||||
|
func (a *Client) GetOrgWorkflowJobs(params *GetOrgWorkflowJobsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgWorkflowJobsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetOrgWorkflowJobsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getOrgWorkflowJobs",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/orgs/{org}/actions/jobs",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetOrgWorkflowJobsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetOrgWorkflowJobsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getOrgWorkflowJobs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetOrgWorkflowRuns gets org level workflow runs
|
||||||
|
*/
|
||||||
|
func (a *Client) GetOrgWorkflowRuns(params *GetOrgWorkflowRunsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrgWorkflowRunsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetOrgWorkflowRunsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getOrgWorkflowRuns",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/orgs/{org}/actions/runs",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetOrgWorkflowRunsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetOrgWorkflowRunsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getOrgWorkflowRuns: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OrgAddTeamMember adds a team member
|
OrgAddTeamMember adds a team member
|
||||||
*/
|
*/
|
||||||
@@ -732,6 +940,45 @@ func (a *Client) OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.C
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
OrgCreateRunnerRegistrationToken gets an organization s actions runner registration token
|
||||||
|
*/
|
||||||
|
func (a *Client) OrgCreateRunnerRegistrationToken(params *OrgCreateRunnerRegistrationTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgCreateRunnerRegistrationTokenOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewOrgCreateRunnerRegistrationTokenParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "orgCreateRunnerRegistrationToken",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/orgs/{org}/actions/runners/registration-token",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &OrgCreateRunnerRegistrationTokenReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*OrgCreateRunnerRegistrationTokenOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for orgCreateRunnerRegistrationToken: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
OrgCreateTeam creates a team
|
OrgCreateTeam creates a team
|
||||||
*/
|
*/
|
||||||
@@ -2411,6 +2658,45 @@ func (a *Client) OrganizationUnblockUser(params *OrganizationUnblockUserParams,
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RenameOrg renames an organization
|
||||||
|
*/
|
||||||
|
func (a *Client) RenameOrg(params *RenameOrgParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RenameOrgNoContent, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewRenameOrgParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "renameOrg",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/orgs/{org}/rename",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &RenameOrgReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*RenameOrgNoContent)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for renameOrg: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TeamSearch searches for teams within an organization
|
TeamSearch searches for teams within an organization
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ type OrganizationUnblockUserParams struct {
|
|||||||
|
|
||||||
/* Username.
|
/* Username.
|
||||||
|
|
||||||
user to unblock
|
username of the user to unblock
|
||||||
*/
|
*/
|
||||||
Username string
|
Username string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewRenameOrgParams creates a new RenameOrgParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewRenameOrgParams() *RenameOrgParams {
|
||||||
|
return &RenameOrgParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgParamsWithTimeout creates a new RenameOrgParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewRenameOrgParamsWithTimeout(timeout time.Duration) *RenameOrgParams {
|
||||||
|
return &RenameOrgParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgParamsWithContext creates a new RenameOrgParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewRenameOrgParamsWithContext(ctx context.Context) *RenameOrgParams {
|
||||||
|
return &RenameOrgParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgParamsWithHTTPClient creates a new RenameOrgParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewRenameOrgParamsWithHTTPClient(client *http.Client) *RenameOrgParams {
|
||||||
|
return &RenameOrgParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RenameOrgParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the rename org operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type RenameOrgParams struct {
|
||||||
|
|
||||||
|
// Body.
|
||||||
|
Body *models.RenameOrgOption
|
||||||
|
|
||||||
|
/* Org.
|
||||||
|
|
||||||
|
existing org name
|
||||||
|
*/
|
||||||
|
Org string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the rename org params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *RenameOrgParams) WithDefaults() *RenameOrgParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the rename org params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *RenameOrgParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the rename org params
|
||||||
|
func (o *RenameOrgParams) WithTimeout(timeout time.Duration) *RenameOrgParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the rename org params
|
||||||
|
func (o *RenameOrgParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the rename org params
|
||||||
|
func (o *RenameOrgParams) WithContext(ctx context.Context) *RenameOrgParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the rename org params
|
||||||
|
func (o *RenameOrgParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the rename org params
|
||||||
|
func (o *RenameOrgParams) WithHTTPClient(client *http.Client) *RenameOrgParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the rename org params
|
||||||
|
func (o *RenameOrgParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBody adds the body to the rename org params
|
||||||
|
func (o *RenameOrgParams) WithBody(body *models.RenameOrgOption) *RenameOrgParams {
|
||||||
|
o.SetBody(body)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBody adds the body to the rename org params
|
||||||
|
func (o *RenameOrgParams) SetBody(body *models.RenameOrgOption) {
|
||||||
|
o.Body = body
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOrg adds the org to the rename org params
|
||||||
|
func (o *RenameOrgParams) WithOrg(org string) *RenameOrgParams {
|
||||||
|
o.SetOrg(org)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOrg adds the org to the rename org params
|
||||||
|
func (o *RenameOrgParams) SetOrg(org string) {
|
||||||
|
o.Org = org
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *RenameOrgParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.Body != nil {
|
||||||
|
if err := r.SetBodyParam(o.Body); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param org
|
||||||
|
if err := r.SetPathParam("org", o.Org); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,244 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package organization
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RenameOrgReader is a Reader for the RenameOrg structure.
|
||||||
|
type RenameOrgReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *RenameOrgReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewRenameOrgNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 403:
|
||||||
|
result := NewRenameOrgForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewRenameOrgUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /orgs/{org}/rename] renameOrg", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgNoContent creates a RenameOrgNoContent with default headers values
|
||||||
|
func NewRenameOrgNoContent() *RenameOrgNoContent {
|
||||||
|
return &RenameOrgNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RenameOrgNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
APIEmpty is an empty response
|
||||||
|
*/
|
||||||
|
type RenameOrgNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this rename org no content response has a 2xx status code
|
||||||
|
func (o *RenameOrgNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this rename org no content response has a 3xx status code
|
||||||
|
func (o *RenameOrgNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this rename org no content response has a 4xx status code
|
||||||
|
func (o *RenameOrgNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this rename org no content response has a 5xx status code
|
||||||
|
func (o *RenameOrgNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this rename org no content response a status code equal to that given
|
||||||
|
func (o *RenameOrgNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the rename org no content response
|
||||||
|
func (o *RenameOrgNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgForbidden creates a RenameOrgForbidden with default headers values
|
||||||
|
func NewRenameOrgForbidden() *RenameOrgForbidden {
|
||||||
|
return &RenameOrgForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RenameOrgForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type RenameOrgForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this rename org forbidden response has a 2xx status code
|
||||||
|
func (o *RenameOrgForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this rename org forbidden response has a 3xx status code
|
||||||
|
func (o *RenameOrgForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this rename org forbidden response has a 4xx status code
|
||||||
|
func (o *RenameOrgForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this rename org forbidden response has a 5xx status code
|
||||||
|
func (o *RenameOrgForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this rename org forbidden response a status code equal to that given
|
||||||
|
func (o *RenameOrgForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the rename org forbidden response
|
||||||
|
func (o *RenameOrgForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRenameOrgUnprocessableEntity creates a RenameOrgUnprocessableEntity with default headers values
|
||||||
|
func NewRenameOrgUnprocessableEntity() *RenameOrgUnprocessableEntity {
|
||||||
|
return &RenameOrgUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
RenameOrgUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type RenameOrgUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this rename org unprocessable entity response has a 2xx status code
|
||||||
|
func (o *RenameOrgUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this rename org unprocessable entity response has a 3xx status code
|
||||||
|
func (o *RenameOrgUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this rename org unprocessable entity response has a 4xx status code
|
||||||
|
func (o *RenameOrgUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this rename org unprocessable entity response has a 5xx status code
|
||||||
|
func (o *RenameOrgUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this rename org unprocessable entity response a status code equal to that given
|
||||||
|
func (o *RenameOrgUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the rename org unprocessable entity response
|
||||||
|
func (o *RenameOrgUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[POST /orgs/{org}/rename][%d] renameOrgUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *RenameOrgUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionParams creates a new GetLatestPackageVersionParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewGetLatestPackageVersionParams() *GetLatestPackageVersionParams {
|
||||||
|
return &GetLatestPackageVersionParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionParamsWithTimeout creates a new GetLatestPackageVersionParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetLatestPackageVersionParamsWithTimeout(timeout time.Duration) *GetLatestPackageVersionParams {
|
||||||
|
return &GetLatestPackageVersionParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionParamsWithContext creates a new GetLatestPackageVersionParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewGetLatestPackageVersionParamsWithContext(ctx context.Context) *GetLatestPackageVersionParams {
|
||||||
|
return &GetLatestPackageVersionParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionParamsWithHTTPClient creates a new GetLatestPackageVersionParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetLatestPackageVersionParamsWithHTTPClient(client *http.Client) *GetLatestPackageVersionParams {
|
||||||
|
return &GetLatestPackageVersionParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetLatestPackageVersionParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get latest package version operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetLatestPackageVersionParams struct {
|
||||||
|
|
||||||
|
/* Name.
|
||||||
|
|
||||||
|
name of the package
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the package
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Type.
|
||||||
|
|
||||||
|
type of the package
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get latest package version params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetLatestPackageVersionParams) WithDefaults() *GetLatestPackageVersionParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get latest package version params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetLatestPackageVersionParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithTimeout(timeout time.Duration) *GetLatestPackageVersionParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithContext(ctx context.Context) *GetLatestPackageVersionParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithHTTPClient(client *http.Client) *GetLatestPackageVersionParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithName adds the name to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithName(name string) *GetLatestPackageVersionParams {
|
||||||
|
o.SetName(name)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetName adds the name to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetName(name string) {
|
||||||
|
o.Name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithOwner(owner string) *GetLatestPackageVersionParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithType adds the typeVar to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) WithType(typeVar string) *GetLatestPackageVersionParams {
|
||||||
|
o.SetType(typeVar)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetType adds the type to the get latest package version params
|
||||||
|
func (o *GetLatestPackageVersionParams) SetType(typeVar string) {
|
||||||
|
o.Type = typeVar
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *GetLatestPackageVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param name
|
||||||
|
if err := r.SetPathParam("name", o.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param type
|
||||||
|
if err := r.SetPathParam("type", o.Type); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetLatestPackageVersionReader is a Reader for the GetLatestPackageVersion structure.
|
||||||
|
type GetLatestPackageVersionReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetLatestPackageVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetLatestPackageVersionOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 404:
|
||||||
|
result := NewGetLatestPackageVersionNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /packages/{owner}/{type}/{name}/-/latest] getLatestPackageVersion", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionOK creates a GetLatestPackageVersionOK with default headers values
|
||||||
|
func NewGetLatestPackageVersionOK() *GetLatestPackageVersionOK {
|
||||||
|
return &GetLatestPackageVersionOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetLatestPackageVersionOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
Package
|
||||||
|
*/
|
||||||
|
type GetLatestPackageVersionOK struct {
|
||||||
|
Payload *models.Package
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get latest package version o k response has a 2xx status code
|
||||||
|
func (o *GetLatestPackageVersionOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get latest package version o k response has a 3xx status code
|
||||||
|
func (o *GetLatestPackageVersionOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get latest package version o k response has a 4xx status code
|
||||||
|
func (o *GetLatestPackageVersionOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get latest package version o k response has a 5xx status code
|
||||||
|
func (o *GetLatestPackageVersionOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get latest package version o k response a status code equal to that given
|
||||||
|
func (o *GetLatestPackageVersionOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get latest package version o k response
|
||||||
|
func (o *GetLatestPackageVersionOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}/-/latest][%d] getLatestPackageVersionOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}/-/latest][%d] getLatestPackageVersionOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionOK) GetPayload() *models.Package {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.Package)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetLatestPackageVersionNotFound creates a GetLatestPackageVersionNotFound with default headers values
|
||||||
|
func NewGetLatestPackageVersionNotFound() *GetLatestPackageVersionNotFound {
|
||||||
|
return &GetLatestPackageVersionNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetLatestPackageVersionNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type GetLatestPackageVersionNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get latest package version not found response has a 2xx status code
|
||||||
|
func (o *GetLatestPackageVersionNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get latest package version not found response has a 3xx status code
|
||||||
|
func (o *GetLatestPackageVersionNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get latest package version not found response has a 4xx status code
|
||||||
|
func (o *GetLatestPackageVersionNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get latest package version not found response has a 5xx status code
|
||||||
|
func (o *GetLatestPackageVersionNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get latest package version not found response a status code equal to that given
|
||||||
|
func (o *GetLatestPackageVersionNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get latest package version not found response
|
||||||
|
func (o *GetLatestPackageVersionNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}/-/latest][%d] getLatestPackageVersionNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}/-/latest][%d] getLatestPackageVersionNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetLatestPackageVersionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewLinkPackageParams creates a new LinkPackageParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewLinkPackageParams() *LinkPackageParams {
|
||||||
|
return &LinkPackageParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLinkPackageParamsWithTimeout creates a new LinkPackageParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewLinkPackageParamsWithTimeout(timeout time.Duration) *LinkPackageParams {
|
||||||
|
return &LinkPackageParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLinkPackageParamsWithContext creates a new LinkPackageParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewLinkPackageParamsWithContext(ctx context.Context) *LinkPackageParams {
|
||||||
|
return &LinkPackageParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLinkPackageParamsWithHTTPClient creates a new LinkPackageParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewLinkPackageParamsWithHTTPClient(client *http.Client) *LinkPackageParams {
|
||||||
|
return &LinkPackageParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
LinkPackageParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the link package operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type LinkPackageParams struct {
|
||||||
|
|
||||||
|
/* Name.
|
||||||
|
|
||||||
|
name of the package
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the package
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* RepoName.
|
||||||
|
|
||||||
|
name of the repository to link.
|
||||||
|
*/
|
||||||
|
RepoName string
|
||||||
|
|
||||||
|
/* Type.
|
||||||
|
|
||||||
|
type of the package
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the link package params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *LinkPackageParams) WithDefaults() *LinkPackageParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the link package params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *LinkPackageParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the link package params
|
||||||
|
func (o *LinkPackageParams) WithTimeout(timeout time.Duration) *LinkPackageParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the link package params
|
||||||
|
func (o *LinkPackageParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the link package params
|
||||||
|
func (o *LinkPackageParams) WithContext(ctx context.Context) *LinkPackageParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the link package params
|
||||||
|
func (o *LinkPackageParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the link package params
|
||||||
|
func (o *LinkPackageParams) WithHTTPClient(client *http.Client) *LinkPackageParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the link package params
|
||||||
|
func (o *LinkPackageParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithName adds the name to the link package params
|
||||||
|
func (o *LinkPackageParams) WithName(name string) *LinkPackageParams {
|
||||||
|
o.SetName(name)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetName adds the name to the link package params
|
||||||
|
func (o *LinkPackageParams) SetName(name string) {
|
||||||
|
o.Name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the link package params
|
||||||
|
func (o *LinkPackageParams) WithOwner(owner string) *LinkPackageParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the link package params
|
||||||
|
func (o *LinkPackageParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepoName adds the repoName to the link package params
|
||||||
|
func (o *LinkPackageParams) WithRepoName(repoName string) *LinkPackageParams {
|
||||||
|
o.SetRepoName(repoName)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepoName adds the repoName to the link package params
|
||||||
|
func (o *LinkPackageParams) SetRepoName(repoName string) {
|
||||||
|
o.RepoName = repoName
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithType adds the typeVar to the link package params
|
||||||
|
func (o *LinkPackageParams) WithType(typeVar string) *LinkPackageParams {
|
||||||
|
o.SetType(typeVar)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetType adds the type to the link package params
|
||||||
|
func (o *LinkPackageParams) SetType(typeVar string) {
|
||||||
|
o.Type = typeVar
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *LinkPackageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param name
|
||||||
|
if err := r.SetPathParam("name", o.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo_name
|
||||||
|
if err := r.SetPathParam("repo_name", o.RepoName); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param type
|
||||||
|
if err := r.SetPathParam("type", o.Type); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// LinkPackageReader is a Reader for the LinkPackage structure.
|
||||||
|
type LinkPackageReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *LinkPackageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 201:
|
||||||
|
result := NewLinkPackageCreated()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 404:
|
||||||
|
result := NewLinkPackageNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /packages/{owner}/{type}/{name}/-/link/{repo_name}] linkPackage", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLinkPackageCreated creates a LinkPackageCreated with default headers values
|
||||||
|
func NewLinkPackageCreated() *LinkPackageCreated {
|
||||||
|
return &LinkPackageCreated{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
LinkPackageCreated describes a response with status code 201, with default header values.
|
||||||
|
|
||||||
|
APIEmpty is an empty response
|
||||||
|
*/
|
||||||
|
type LinkPackageCreated struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this link package created response has a 2xx status code
|
||||||
|
func (o *LinkPackageCreated) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this link package created response has a 3xx status code
|
||||||
|
func (o *LinkPackageCreated) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this link package created response has a 4xx status code
|
||||||
|
func (o *LinkPackageCreated) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this link package created response has a 5xx status code
|
||||||
|
func (o *LinkPackageCreated) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this link package created response a status code equal to that given
|
||||||
|
func (o *LinkPackageCreated) IsCode(code int) bool {
|
||||||
|
return code == 201
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the link package created response
|
||||||
|
func (o *LinkPackageCreated) Code() int {
|
||||||
|
return 201
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageCreated) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/link/{repo_name}][%d] linkPackageCreated", 201)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageCreated) String() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/link/{repo_name}][%d] linkPackageCreated", 201)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewLinkPackageNotFound creates a LinkPackageNotFound with default headers values
|
||||||
|
func NewLinkPackageNotFound() *LinkPackageNotFound {
|
||||||
|
return &LinkPackageNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
LinkPackageNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type LinkPackageNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this link package not found response has a 2xx status code
|
||||||
|
func (o *LinkPackageNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this link package not found response has a 3xx status code
|
||||||
|
func (o *LinkPackageNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this link package not found response has a 4xx status code
|
||||||
|
func (o *LinkPackageNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this link package not found response has a 5xx status code
|
||||||
|
func (o *LinkPackageNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this link package not found response a status code equal to that given
|
||||||
|
func (o *LinkPackageNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the link package not found response
|
||||||
|
func (o *LinkPackageNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/link/{repo_name}][%d] linkPackageNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/link/{repo_name}][%d] linkPackageNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *LinkPackageNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,264 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewListPackageVersionsParams creates a new ListPackageVersionsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewListPackageVersionsParams() *ListPackageVersionsParams {
|
||||||
|
return &ListPackageVersionsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListPackageVersionsParamsWithTimeout creates a new ListPackageVersionsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewListPackageVersionsParamsWithTimeout(timeout time.Duration) *ListPackageVersionsParams {
|
||||||
|
return &ListPackageVersionsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListPackageVersionsParamsWithContext creates a new ListPackageVersionsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewListPackageVersionsParamsWithContext(ctx context.Context) *ListPackageVersionsParams {
|
||||||
|
return &ListPackageVersionsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListPackageVersionsParamsWithHTTPClient creates a new ListPackageVersionsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewListPackageVersionsParamsWithHTTPClient(client *http.Client) *ListPackageVersionsParams {
|
||||||
|
return &ListPackageVersionsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListPackageVersionsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the list package versions operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ListPackageVersionsParams struct {
|
||||||
|
|
||||||
|
/* Limit.
|
||||||
|
|
||||||
|
page size of results
|
||||||
|
*/
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
/* Name.
|
||||||
|
|
||||||
|
name of the package
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the package
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Page.
|
||||||
|
|
||||||
|
page number of results to return (1-based)
|
||||||
|
*/
|
||||||
|
Page *int64
|
||||||
|
|
||||||
|
/* Type.
|
||||||
|
|
||||||
|
type of the package
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the list package versions params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListPackageVersionsParams) WithDefaults() *ListPackageVersionsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the list package versions params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ListPackageVersionsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithTimeout(timeout time.Duration) *ListPackageVersionsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithContext(ctx context.Context) *ListPackageVersionsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithHTTPClient(client *http.Client) *ListPackageVersionsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithLimit(limit *int64) *ListPackageVersionsParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithName adds the name to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithName(name string) *ListPackageVersionsParams {
|
||||||
|
o.SetName(name)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetName adds the name to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetName(name string) {
|
||||||
|
o.Name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithOwner(owner string) *ListPackageVersionsParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPage adds the page to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithPage(page *int64) *ListPackageVersionsParams {
|
||||||
|
o.SetPage(page)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPage adds the page to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetPage(page *int64) {
|
||||||
|
o.Page = page
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithType adds the typeVar to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) WithType(typeVar string) *ListPackageVersionsParams {
|
||||||
|
o.SetType(typeVar)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetType adds the type to the list package versions params
|
||||||
|
func (o *ListPackageVersionsParams) SetType(typeVar string) {
|
||||||
|
o.Type = typeVar
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ListPackageVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := swag.FormatInt64(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param name
|
||||||
|
if err := r.SetPathParam("name", o.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
|
||||||
|
// query param page
|
||||||
|
var qrPage int64
|
||||||
|
|
||||||
|
if o.Page != nil {
|
||||||
|
qrPage = *o.Page
|
||||||
|
}
|
||||||
|
qPage := swag.FormatInt64(qrPage)
|
||||||
|
if qPage != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("page", qPage); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param type
|
||||||
|
if err := r.SetPathParam("type", o.Type); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListPackageVersionsReader is a Reader for the ListPackageVersions structure.
|
||||||
|
type ListPackageVersionsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ListPackageVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewListPackageVersionsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 404:
|
||||||
|
result := NewListPackageVersionsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /packages/{owner}/{type}/{name}] listPackageVersions", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListPackageVersionsOK creates a ListPackageVersionsOK with default headers values
|
||||||
|
func NewListPackageVersionsOK() *ListPackageVersionsOK {
|
||||||
|
return &ListPackageVersionsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListPackageVersionsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
PackageList
|
||||||
|
*/
|
||||||
|
type ListPackageVersionsOK struct {
|
||||||
|
Payload []*models.Package
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list package versions o k response has a 2xx status code
|
||||||
|
func (o *ListPackageVersionsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list package versions o k response has a 3xx status code
|
||||||
|
func (o *ListPackageVersionsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list package versions o k response has a 4xx status code
|
||||||
|
func (o *ListPackageVersionsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list package versions o k response has a 5xx status code
|
||||||
|
func (o *ListPackageVersionsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list package versions o k response a status code equal to that given
|
||||||
|
func (o *ListPackageVersionsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list package versions o k response
|
||||||
|
func (o *ListPackageVersionsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}][%d] listPackageVersionsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}][%d] listPackageVersionsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsOK) GetPayload() []*models.Package {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewListPackageVersionsNotFound creates a ListPackageVersionsNotFound with default headers values
|
||||||
|
func NewListPackageVersionsNotFound() *ListPackageVersionsNotFound {
|
||||||
|
return &ListPackageVersionsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListPackageVersionsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ListPackageVersionsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this list package versions not found response has a 2xx status code
|
||||||
|
func (o *ListPackageVersionsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this list package versions not found response has a 3xx status code
|
||||||
|
func (o *ListPackageVersionsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this list package versions not found response has a 4xx status code
|
||||||
|
func (o *ListPackageVersionsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this list package versions not found response has a 5xx status code
|
||||||
|
func (o *ListPackageVersionsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this list package versions not found response a status code equal to that given
|
||||||
|
func (o *ListPackageVersionsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the list package versions not found response
|
||||||
|
func (o *ListPackageVersionsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}][%d] listPackageVersionsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /packages/{owner}/{type}/{name}][%d] listPackageVersionsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ListPackageVersionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -102,12 +102,20 @@ func WithAcceptTextHTML(r *runtime.ClientOperation) {
|
|||||||
type ClientService interface {
|
type ClientService interface {
|
||||||
DeletePackage(params *DeletePackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePackageNoContent, error)
|
DeletePackage(params *DeletePackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePackageNoContent, error)
|
||||||
|
|
||||||
|
GetLatestPackageVersion(params *GetLatestPackageVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLatestPackageVersionOK, error)
|
||||||
|
|
||||||
GetPackage(params *GetPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPackageOK, error)
|
GetPackage(params *GetPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPackageOK, error)
|
||||||
|
|
||||||
|
LinkPackage(params *LinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LinkPackageCreated, error)
|
||||||
|
|
||||||
ListPackageFiles(params *ListPackageFilesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackageFilesOK, error)
|
ListPackageFiles(params *ListPackageFilesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackageFilesOK, error)
|
||||||
|
|
||||||
|
ListPackageVersions(params *ListPackageVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackageVersionsOK, error)
|
||||||
|
|
||||||
ListPackages(params *ListPackagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackagesOK, error)
|
ListPackages(params *ListPackagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackagesOK, error)
|
||||||
|
|
||||||
|
UnlinkPackage(params *UnlinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnlinkPackageCreated, error)
|
||||||
|
|
||||||
SetTransport(transport runtime.ClientTransport)
|
SetTransport(transport runtime.ClientTransport)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +158,45 @@ func (a *Client) DeletePackage(params *DeletePackageParams, authInfo runtime.Cli
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetLatestPackageVersion gets the latest version of a package
|
||||||
|
*/
|
||||||
|
func (a *Client) GetLatestPackageVersion(params *GetLatestPackageVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLatestPackageVersionOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetLatestPackageVersionParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getLatestPackageVersion",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/packages/{owner}/{type}/{name}/-/latest",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetLatestPackageVersionReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*GetLatestPackageVersionOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for getLatestPackageVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GetPackage gets a package
|
GetPackage gets a package
|
||||||
*/
|
*/
|
||||||
@@ -189,6 +236,45 @@ func (a *Client) GetPackage(params *GetPackageParams, authInfo runtime.ClientAut
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
LinkPackage links a package to a repository
|
||||||
|
*/
|
||||||
|
func (a *Client) LinkPackage(params *LinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LinkPackageCreated, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewLinkPackageParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "linkPackage",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/packages/{owner}/{type}/{name}/-/link/{repo_name}",
|
||||||
|
ProducesMediaTypes: []string{"application/json", "text/html"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &LinkPackageReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*LinkPackageCreated)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for linkPackage: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ListPackageFiles gets all files of a package
|
ListPackageFiles gets all files of a package
|
||||||
*/
|
*/
|
||||||
@@ -228,6 +314,45 @@ func (a *Client) ListPackageFiles(params *ListPackageFilesParams, authInfo runti
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListPackageVersions gets all versions of a package
|
||||||
|
*/
|
||||||
|
func (a *Client) ListPackageVersions(params *ListPackageVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPackageVersionsOK, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewListPackageVersionsParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "listPackageVersions",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/packages/{owner}/{type}/{name}",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &ListPackageVersionsReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*ListPackageVersionsOK)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for listPackageVersions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ListPackages gets all packages of an owner
|
ListPackages gets all packages of an owner
|
||||||
*/
|
*/
|
||||||
@@ -267,6 +392,45 @@ func (a *Client) ListPackages(params *ListPackagesParams, authInfo runtime.Clien
|
|||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
UnlinkPackage unlinks a package from a repository
|
||||||
|
*/
|
||||||
|
func (a *Client) UnlinkPackage(params *UnlinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnlinkPackageCreated, error) {
|
||||||
|
// TODO: Validate the params before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewUnlinkPackageParams()
|
||||||
|
}
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "unlinkPackage",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/packages/{owner}/{type}/{name}/-/unlink",
|
||||||
|
ProducesMediaTypes: []string{"application/json", "text/html"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||||
|
Schemes: []string{"http", "https"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &UnlinkPackageReader{formats: a.formats},
|
||||||
|
AuthInfo: authInfo,
|
||||||
|
Context: params.Context,
|
||||||
|
Client: params.HTTPClient,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(op)
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := a.transport.Submit(op)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
success, ok := result.(*UnlinkPackageCreated)
|
||||||
|
if ok {
|
||||||
|
return success, nil
|
||||||
|
}
|
||||||
|
// unexpected success response
|
||||||
|
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||||
|
msg := fmt.Sprintf("unexpected success response for unlinkPackage: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
// SetTransport changes the transport on the client
|
// SetTransport changes the transport on the client
|
||||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||||
a.transport = transport
|
a.transport = transport
|
||||||
|
|||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewUnlinkPackageParams creates a new UnlinkPackageParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewUnlinkPackageParams() *UnlinkPackageParams {
|
||||||
|
return &UnlinkPackageParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUnlinkPackageParamsWithTimeout creates a new UnlinkPackageParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewUnlinkPackageParamsWithTimeout(timeout time.Duration) *UnlinkPackageParams {
|
||||||
|
return &UnlinkPackageParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUnlinkPackageParamsWithContext creates a new UnlinkPackageParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewUnlinkPackageParamsWithContext(ctx context.Context) *UnlinkPackageParams {
|
||||||
|
return &UnlinkPackageParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUnlinkPackageParamsWithHTTPClient creates a new UnlinkPackageParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewUnlinkPackageParamsWithHTTPClient(client *http.Client) *UnlinkPackageParams {
|
||||||
|
return &UnlinkPackageParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
UnlinkPackageParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the unlink package operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type UnlinkPackageParams struct {
|
||||||
|
|
||||||
|
/* Name.
|
||||||
|
|
||||||
|
name of the package
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the package
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Type.
|
||||||
|
|
||||||
|
type of the package
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the unlink package params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *UnlinkPackageParams) WithDefaults() *UnlinkPackageParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the unlink package params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *UnlinkPackageParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithTimeout(timeout time.Duration) *UnlinkPackageParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithContext(ctx context.Context) *UnlinkPackageParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithHTTPClient(client *http.Client) *UnlinkPackageParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithName adds the name to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithName(name string) *UnlinkPackageParams {
|
||||||
|
o.SetName(name)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetName adds the name to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetName(name string) {
|
||||||
|
o.Name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithOwner(owner string) *UnlinkPackageParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithType adds the typeVar to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) WithType(typeVar string) *UnlinkPackageParams {
|
||||||
|
o.SetType(typeVar)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetType adds the type to the unlink package params
|
||||||
|
func (o *UnlinkPackageParams) SetType(typeVar string) {
|
||||||
|
o.Type = typeVar
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *UnlinkPackageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param name
|
||||||
|
if err := r.SetPathParam("name", o.Name); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param type
|
||||||
|
if err := r.SetPathParam("type", o.Type); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package package_operations
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UnlinkPackageReader is a Reader for the UnlinkPackage structure.
|
||||||
|
type UnlinkPackageReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *UnlinkPackageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 201:
|
||||||
|
result := NewUnlinkPackageCreated()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 404:
|
||||||
|
result := NewUnlinkPackageNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /packages/{owner}/{type}/{name}/-/unlink] unlinkPackage", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUnlinkPackageCreated creates a UnlinkPackageCreated with default headers values
|
||||||
|
func NewUnlinkPackageCreated() *UnlinkPackageCreated {
|
||||||
|
return &UnlinkPackageCreated{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
UnlinkPackageCreated describes a response with status code 201, with default header values.
|
||||||
|
|
||||||
|
APIEmpty is an empty response
|
||||||
|
*/
|
||||||
|
type UnlinkPackageCreated struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this unlink package created response has a 2xx status code
|
||||||
|
func (o *UnlinkPackageCreated) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this unlink package created response has a 3xx status code
|
||||||
|
func (o *UnlinkPackageCreated) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this unlink package created response has a 4xx status code
|
||||||
|
func (o *UnlinkPackageCreated) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this unlink package created response has a 5xx status code
|
||||||
|
func (o *UnlinkPackageCreated) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this unlink package created response a status code equal to that given
|
||||||
|
func (o *UnlinkPackageCreated) IsCode(code int) bool {
|
||||||
|
return code == 201
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the unlink package created response
|
||||||
|
func (o *UnlinkPackageCreated) Code() int {
|
||||||
|
return 201
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageCreated) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/unlink][%d] unlinkPackageCreated", 201)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageCreated) String() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/unlink][%d] unlinkPackageCreated", 201)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUnlinkPackageNotFound creates a UnlinkPackageNotFound with default headers values
|
||||||
|
func NewUnlinkPackageNotFound() *UnlinkPackageNotFound {
|
||||||
|
return &UnlinkPackageNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
UnlinkPackageNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type UnlinkPackageNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this unlink package not found response has a 2xx status code
|
||||||
|
func (o *UnlinkPackageNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this unlink package not found response has a 3xx status code
|
||||||
|
func (o *UnlinkPackageNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this unlink package not found response has a 4xx status code
|
||||||
|
func (o *UnlinkPackageNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this unlink package not found response has a 5xx status code
|
||||||
|
func (o *UnlinkPackageNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this unlink package not found response a status code equal to that given
|
||||||
|
func (o *UnlinkPackageNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the unlink package not found response
|
||||||
|
func (o *UnlinkPackageNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/unlink][%d] unlinkPackageNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[POST /packages/{owner}/{type}/{name}/-/unlink][%d] unlinkPackageNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UnlinkPackageNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowParams creates a new ActionsDisableWorkflowParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewActionsDisableWorkflowParams() *ActionsDisableWorkflowParams {
|
||||||
|
return &ActionsDisableWorkflowParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowParamsWithTimeout creates a new ActionsDisableWorkflowParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewActionsDisableWorkflowParamsWithTimeout(timeout time.Duration) *ActionsDisableWorkflowParams {
|
||||||
|
return &ActionsDisableWorkflowParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowParamsWithContext creates a new ActionsDisableWorkflowParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewActionsDisableWorkflowParamsWithContext(ctx context.Context) *ActionsDisableWorkflowParams {
|
||||||
|
return &ActionsDisableWorkflowParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowParamsWithHTTPClient creates a new ActionsDisableWorkflowParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewActionsDisableWorkflowParamsWithHTTPClient(client *http.Client) *ActionsDisableWorkflowParams {
|
||||||
|
return &ActionsDisableWorkflowParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the actions disable workflow operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowParams struct {
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
/* WorkflowID.
|
||||||
|
|
||||||
|
id of the workflow
|
||||||
|
*/
|
||||||
|
WorkflowID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the actions disable workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithDefaults() *ActionsDisableWorkflowParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the actions disable workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithTimeout(timeout time.Duration) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithContext(ctx context.Context) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithHTTPClient(client *http.Client) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithOwner(owner string) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithRepo(repo string) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithWorkflowID adds the workflowID to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) WithWorkflowID(workflowID string) *ActionsDisableWorkflowParams {
|
||||||
|
o.SetWorkflowID(workflowID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWorkflowID adds the workflowId to the actions disable workflow params
|
||||||
|
func (o *ActionsDisableWorkflowParams) SetWorkflowID(workflowID string) {
|
||||||
|
o.WorkflowID = workflowID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ActionsDisableWorkflowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param workflow_id
|
||||||
|
if err := r.SetPathParam("workflow_id", o.WorkflowID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,384 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ActionsDisableWorkflowReader is a Reader for the ActionsDisableWorkflow structure.
|
||||||
|
type ActionsDisableWorkflowReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ActionsDisableWorkflowReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewActionsDisableWorkflowNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewActionsDisableWorkflowBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewActionsDisableWorkflowForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewActionsDisableWorkflowNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewActionsDisableWorkflowUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable] ActionsDisableWorkflow", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowNoContent creates a ActionsDisableWorkflowNoContent with default headers values
|
||||||
|
func NewActionsDisableWorkflowNoContent() *ActionsDisableWorkflowNoContent {
|
||||||
|
return &ActionsDisableWorkflowNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
No Content
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions disable workflow no content response has a 2xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions disable workflow no content response has a 3xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions disable workflow no content response has a 4xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions disable workflow no content response has a 5xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions disable workflow no content response a status code equal to that given
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions disable workflow no content response
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowBadRequest creates a ActionsDisableWorkflowBadRequest with default headers values
|
||||||
|
func NewActionsDisableWorkflowBadRequest() *ActionsDisableWorkflowBadRequest {
|
||||||
|
return &ActionsDisableWorkflowBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions disable workflow bad request response has a 2xx status code
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions disable workflow bad request response has a 3xx status code
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions disable workflow bad request response has a 4xx status code
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions disable workflow bad request response has a 5xx status code
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions disable workflow bad request response a status code equal to that given
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions disable workflow bad request response
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowForbidden creates a ActionsDisableWorkflowForbidden with default headers values
|
||||||
|
func NewActionsDisableWorkflowForbidden() *ActionsDisableWorkflowForbidden {
|
||||||
|
return &ActionsDisableWorkflowForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions disable workflow forbidden response has a 2xx status code
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions disable workflow forbidden response has a 3xx status code
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions disable workflow forbidden response has a 4xx status code
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions disable workflow forbidden response has a 5xx status code
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions disable workflow forbidden response a status code equal to that given
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions disable workflow forbidden response
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowNotFound creates a ActionsDisableWorkflowNotFound with default headers values
|
||||||
|
func NewActionsDisableWorkflowNotFound() *ActionsDisableWorkflowNotFound {
|
||||||
|
return &ActionsDisableWorkflowNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions disable workflow not found response has a 2xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions disable workflow not found response has a 3xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions disable workflow not found response has a 4xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions disable workflow not found response has a 5xx status code
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions disable workflow not found response a status code equal to that given
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions disable workflow not found response
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDisableWorkflowUnprocessableEntity creates a ActionsDisableWorkflowUnprocessableEntity with default headers values
|
||||||
|
func NewActionsDisableWorkflowUnprocessableEntity() *ActionsDisableWorkflowUnprocessableEntity {
|
||||||
|
return &ActionsDisableWorkflowUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDisableWorkflowUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type ActionsDisableWorkflowUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions disable workflow unprocessable entity response has a 2xx status code
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions disable workflow unprocessable entity response has a 3xx status code
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions disable workflow unprocessable entity response has a 4xx status code
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions disable workflow unprocessable entity response has a 5xx status code
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions disable workflow unprocessable entity response a status code equal to that given
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions disable workflow unprocessable entity response
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable][%d] actionsDisableWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDisableWorkflowUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,216 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowParams creates a new ActionsDispatchWorkflowParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewActionsDispatchWorkflowParams() *ActionsDispatchWorkflowParams {
|
||||||
|
return &ActionsDispatchWorkflowParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowParamsWithTimeout creates a new ActionsDispatchWorkflowParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewActionsDispatchWorkflowParamsWithTimeout(timeout time.Duration) *ActionsDispatchWorkflowParams {
|
||||||
|
return &ActionsDispatchWorkflowParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowParamsWithContext creates a new ActionsDispatchWorkflowParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewActionsDispatchWorkflowParamsWithContext(ctx context.Context) *ActionsDispatchWorkflowParams {
|
||||||
|
return &ActionsDispatchWorkflowParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowParamsWithHTTPClient creates a new ActionsDispatchWorkflowParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewActionsDispatchWorkflowParamsWithHTTPClient(client *http.Client) *ActionsDispatchWorkflowParams {
|
||||||
|
return &ActionsDispatchWorkflowParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the actions dispatch workflow operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowParams struct {
|
||||||
|
|
||||||
|
// Body.
|
||||||
|
Body *models.CreateActionWorkflowDispatch
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
/* WorkflowID.
|
||||||
|
|
||||||
|
id of the workflow
|
||||||
|
*/
|
||||||
|
WorkflowID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the actions dispatch workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithDefaults() *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the actions dispatch workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithTimeout(timeout time.Duration) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithContext(ctx context.Context) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithHTTPClient(client *http.Client) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBody adds the body to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithBody(body *models.CreateActionWorkflowDispatch) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetBody(body)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBody adds the body to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetBody(body *models.CreateActionWorkflowDispatch) {
|
||||||
|
o.Body = body
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithOwner(owner string) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithRepo(repo string) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithWorkflowID adds the workflowID to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WithWorkflowID(workflowID string) *ActionsDispatchWorkflowParams {
|
||||||
|
o.SetWorkflowID(workflowID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWorkflowID adds the workflowId to the actions dispatch workflow params
|
||||||
|
func (o *ActionsDispatchWorkflowParams) SetWorkflowID(workflowID string) {
|
||||||
|
o.WorkflowID = workflowID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ActionsDispatchWorkflowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.Body != nil {
|
||||||
|
if err := r.SetBodyParam(o.Body); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param workflow_id
|
||||||
|
if err := r.SetPathParam("workflow_id", o.WorkflowID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,384 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ActionsDispatchWorkflowReader is a Reader for the ActionsDispatchWorkflow structure.
|
||||||
|
type ActionsDispatchWorkflowReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ActionsDispatchWorkflowReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewActionsDispatchWorkflowNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewActionsDispatchWorkflowBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewActionsDispatchWorkflowForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewActionsDispatchWorkflowNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewActionsDispatchWorkflowUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches] ActionsDispatchWorkflow", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowNoContent creates a ActionsDispatchWorkflowNoContent with default headers values
|
||||||
|
func NewActionsDispatchWorkflowNoContent() *ActionsDispatchWorkflowNoContent {
|
||||||
|
return &ActionsDispatchWorkflowNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
No Content
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions dispatch workflow no content response has a 2xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions dispatch workflow no content response has a 3xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions dispatch workflow no content response has a 4xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions dispatch workflow no content response has a 5xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions dispatch workflow no content response a status code equal to that given
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions dispatch workflow no content response
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowBadRequest creates a ActionsDispatchWorkflowBadRequest with default headers values
|
||||||
|
func NewActionsDispatchWorkflowBadRequest() *ActionsDispatchWorkflowBadRequest {
|
||||||
|
return &ActionsDispatchWorkflowBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions dispatch workflow bad request response has a 2xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions dispatch workflow bad request response has a 3xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions dispatch workflow bad request response has a 4xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions dispatch workflow bad request response has a 5xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions dispatch workflow bad request response a status code equal to that given
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions dispatch workflow bad request response
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowForbidden creates a ActionsDispatchWorkflowForbidden with default headers values
|
||||||
|
func NewActionsDispatchWorkflowForbidden() *ActionsDispatchWorkflowForbidden {
|
||||||
|
return &ActionsDispatchWorkflowForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions dispatch workflow forbidden response has a 2xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions dispatch workflow forbidden response has a 3xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions dispatch workflow forbidden response has a 4xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions dispatch workflow forbidden response has a 5xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions dispatch workflow forbidden response a status code equal to that given
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions dispatch workflow forbidden response
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowNotFound creates a ActionsDispatchWorkflowNotFound with default headers values
|
||||||
|
func NewActionsDispatchWorkflowNotFound() *ActionsDispatchWorkflowNotFound {
|
||||||
|
return &ActionsDispatchWorkflowNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions dispatch workflow not found response has a 2xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions dispatch workflow not found response has a 3xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions dispatch workflow not found response has a 4xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions dispatch workflow not found response has a 5xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions dispatch workflow not found response a status code equal to that given
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions dispatch workflow not found response
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsDispatchWorkflowUnprocessableEntity creates a ActionsDispatchWorkflowUnprocessableEntity with default headers values
|
||||||
|
func NewActionsDispatchWorkflowUnprocessableEntity() *ActionsDispatchWorkflowUnprocessableEntity {
|
||||||
|
return &ActionsDispatchWorkflowUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsDispatchWorkflowUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type ActionsDispatchWorkflowUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions dispatch workflow unprocessable entity response has a 2xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions dispatch workflow unprocessable entity response has a 3xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions dispatch workflow unprocessable entity response has a 4xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions dispatch workflow unprocessable entity response has a 5xx status code
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions dispatch workflow unprocessable entity response a status code equal to that given
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions dispatch workflow unprocessable entity response
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches][%d] actionsDispatchWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsDispatchWorkflowUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowParams creates a new ActionsEnableWorkflowParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewActionsEnableWorkflowParams() *ActionsEnableWorkflowParams {
|
||||||
|
return &ActionsEnableWorkflowParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowParamsWithTimeout creates a new ActionsEnableWorkflowParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewActionsEnableWorkflowParamsWithTimeout(timeout time.Duration) *ActionsEnableWorkflowParams {
|
||||||
|
return &ActionsEnableWorkflowParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowParamsWithContext creates a new ActionsEnableWorkflowParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewActionsEnableWorkflowParamsWithContext(ctx context.Context) *ActionsEnableWorkflowParams {
|
||||||
|
return &ActionsEnableWorkflowParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowParamsWithHTTPClient creates a new ActionsEnableWorkflowParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewActionsEnableWorkflowParamsWithHTTPClient(client *http.Client) *ActionsEnableWorkflowParams {
|
||||||
|
return &ActionsEnableWorkflowParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the actions enable workflow operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowParams struct {
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
/* WorkflowID.
|
||||||
|
|
||||||
|
id of the workflow
|
||||||
|
*/
|
||||||
|
WorkflowID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the actions enable workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithDefaults() *ActionsEnableWorkflowParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the actions enable workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithTimeout(timeout time.Duration) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithContext(ctx context.Context) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithHTTPClient(client *http.Client) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithOwner(owner string) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithRepo(repo string) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithWorkflowID adds the workflowID to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) WithWorkflowID(workflowID string) *ActionsEnableWorkflowParams {
|
||||||
|
o.SetWorkflowID(workflowID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWorkflowID adds the workflowId to the actions enable workflow params
|
||||||
|
func (o *ActionsEnableWorkflowParams) SetWorkflowID(workflowID string) {
|
||||||
|
o.WorkflowID = workflowID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ActionsEnableWorkflowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param workflow_id
|
||||||
|
if err := r.SetPathParam("workflow_id", o.WorkflowID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,446 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ActionsEnableWorkflowReader is a Reader for the ActionsEnableWorkflow structure.
|
||||||
|
type ActionsEnableWorkflowReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ActionsEnableWorkflowReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewActionsEnableWorkflowNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewActionsEnableWorkflowBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewActionsEnableWorkflowForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewActionsEnableWorkflowNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 409:
|
||||||
|
result := NewActionsEnableWorkflowConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewActionsEnableWorkflowUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable] ActionsEnableWorkflow", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowNoContent creates a ActionsEnableWorkflowNoContent with default headers values
|
||||||
|
func NewActionsEnableWorkflowNoContent() *ActionsEnableWorkflowNoContent {
|
||||||
|
return &ActionsEnableWorkflowNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
No Content
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow no content response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow no content response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow no content response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow no content response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow no content response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow no content response
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowBadRequest creates a ActionsEnableWorkflowBadRequest with default headers values
|
||||||
|
func NewActionsEnableWorkflowBadRequest() *ActionsEnableWorkflowBadRequest {
|
||||||
|
return &ActionsEnableWorkflowBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow bad request response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow bad request response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow bad request response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow bad request response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow bad request response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow bad request response
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowForbidden creates a ActionsEnableWorkflowForbidden with default headers values
|
||||||
|
func NewActionsEnableWorkflowForbidden() *ActionsEnableWorkflowForbidden {
|
||||||
|
return &ActionsEnableWorkflowForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow forbidden response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow forbidden response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow forbidden response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow forbidden response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow forbidden response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow forbidden response
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowNotFound creates a ActionsEnableWorkflowNotFound with default headers values
|
||||||
|
func NewActionsEnableWorkflowNotFound() *ActionsEnableWorkflowNotFound {
|
||||||
|
return &ActionsEnableWorkflowNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow not found response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow not found response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow not found response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow not found response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow not found response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow not found response
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowConflict creates a ActionsEnableWorkflowConflict with default headers values
|
||||||
|
func NewActionsEnableWorkflowConflict() *ActionsEnableWorkflowConflict {
|
||||||
|
return &ActionsEnableWorkflowConflict{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowConflict describes a response with status code 409, with default header values.
|
||||||
|
|
||||||
|
APIConflict is a conflict empty response
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowConflict struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow conflict response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowConflict) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow conflict response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowConflict) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow conflict response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowConflict) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow conflict response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowConflict) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow conflict response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowConflict) IsCode(code int) bool {
|
||||||
|
return code == 409
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow conflict response
|
||||||
|
func (o *ActionsEnableWorkflowConflict) Code() int {
|
||||||
|
return 409
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowConflict) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowConflict", 409)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowConflict) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowConflict", 409)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsEnableWorkflowUnprocessableEntity creates a ActionsEnableWorkflowUnprocessableEntity with default headers values
|
||||||
|
func NewActionsEnableWorkflowUnprocessableEntity() *ActionsEnableWorkflowUnprocessableEntity {
|
||||||
|
return &ActionsEnableWorkflowUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsEnableWorkflowUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type ActionsEnableWorkflowUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions enable workflow unprocessable entity response has a 2xx status code
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions enable workflow unprocessable entity response has a 3xx status code
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions enable workflow unprocessable entity response has a 4xx status code
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions enable workflow unprocessable entity response has a 5xx status code
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions enable workflow unprocessable entity response a status code equal to that given
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions enable workflow unprocessable entity response
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable][%d] actionsEnableWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsEnableWorkflowUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowParams creates a new ActionsGetWorkflowParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewActionsGetWorkflowParams() *ActionsGetWorkflowParams {
|
||||||
|
return &ActionsGetWorkflowParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowParamsWithTimeout creates a new ActionsGetWorkflowParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewActionsGetWorkflowParamsWithTimeout(timeout time.Duration) *ActionsGetWorkflowParams {
|
||||||
|
return &ActionsGetWorkflowParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowParamsWithContext creates a new ActionsGetWorkflowParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewActionsGetWorkflowParamsWithContext(ctx context.Context) *ActionsGetWorkflowParams {
|
||||||
|
return &ActionsGetWorkflowParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowParamsWithHTTPClient creates a new ActionsGetWorkflowParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewActionsGetWorkflowParamsWithHTTPClient(client *http.Client) *ActionsGetWorkflowParams {
|
||||||
|
return &ActionsGetWorkflowParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the actions get workflow operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowParams struct {
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
/* WorkflowID.
|
||||||
|
|
||||||
|
id of the workflow
|
||||||
|
*/
|
||||||
|
WorkflowID string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the actions get workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsGetWorkflowParams) WithDefaults() *ActionsGetWorkflowParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the actions get workflow params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsGetWorkflowParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithTimeout(timeout time.Duration) *ActionsGetWorkflowParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithContext(ctx context.Context) *ActionsGetWorkflowParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithHTTPClient(client *http.Client) *ActionsGetWorkflowParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithOwner(owner string) *ActionsGetWorkflowParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithRepo(repo string) *ActionsGetWorkflowParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithWorkflowID adds the workflowID to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) WithWorkflowID(workflowID string) *ActionsGetWorkflowParams {
|
||||||
|
o.SetWorkflowID(workflowID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWorkflowID adds the workflowId to the actions get workflow params
|
||||||
|
func (o *ActionsGetWorkflowParams) SetWorkflowID(workflowID string) {
|
||||||
|
o.WorkflowID = workflowID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ActionsGetWorkflowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param workflow_id
|
||||||
|
if err := r.SetPathParam("workflow_id", o.WorkflowID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,480 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ActionsGetWorkflowReader is a Reader for the ActionsGetWorkflow structure.
|
||||||
|
type ActionsGetWorkflowReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ActionsGetWorkflowReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewActionsGetWorkflowOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewActionsGetWorkflowBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewActionsGetWorkflowForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewActionsGetWorkflowNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewActionsGetWorkflowUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewActionsGetWorkflowInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}] ActionsGetWorkflow", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowOK creates a ActionsGetWorkflowOK with default headers values
|
||||||
|
func NewActionsGetWorkflowOK() *ActionsGetWorkflowOK {
|
||||||
|
return &ActionsGetWorkflowOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionWorkflow
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowOK struct {
|
||||||
|
Payload *models.ActionWorkflow
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow o k response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow o k response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow o k response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow o k response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow o k response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow o k response
|
||||||
|
func (o *ActionsGetWorkflowOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowOK) GetPayload() *models.ActionWorkflow {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflow)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowBadRequest creates a ActionsGetWorkflowBadRequest with default headers values
|
||||||
|
func NewActionsGetWorkflowBadRequest() *ActionsGetWorkflowBadRequest {
|
||||||
|
return &ActionsGetWorkflowBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow bad request response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow bad request response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow bad request response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow bad request response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow bad request response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow bad request response
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowForbidden creates a ActionsGetWorkflowForbidden with default headers values
|
||||||
|
func NewActionsGetWorkflowForbidden() *ActionsGetWorkflowForbidden {
|
||||||
|
return &ActionsGetWorkflowForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow forbidden response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow forbidden response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow forbidden response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow forbidden response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow forbidden response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow forbidden response
|
||||||
|
func (o *ActionsGetWorkflowForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowNotFound creates a ActionsGetWorkflowNotFound with default headers values
|
||||||
|
func NewActionsGetWorkflowNotFound() *ActionsGetWorkflowNotFound {
|
||||||
|
return &ActionsGetWorkflowNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow not found response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow not found response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow not found response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow not found response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow not found response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow not found response
|
||||||
|
func (o *ActionsGetWorkflowNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowUnprocessableEntity creates a ActionsGetWorkflowUnprocessableEntity with default headers values
|
||||||
|
func NewActionsGetWorkflowUnprocessableEntity() *ActionsGetWorkflowUnprocessableEntity {
|
||||||
|
return &ActionsGetWorkflowUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow unprocessable entity response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow unprocessable entity response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow unprocessable entity response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow unprocessable entity response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow unprocessable entity response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow unprocessable entity response
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsGetWorkflowInternalServerError creates a ActionsGetWorkflowInternalServerError with default headers values
|
||||||
|
func NewActionsGetWorkflowInternalServerError() *ActionsGetWorkflowInternalServerError {
|
||||||
|
return &ActionsGetWorkflowInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsGetWorkflowInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsGetWorkflowInternalServerError struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions get workflow internal server error response has a 2xx status code
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions get workflow internal server error response has a 3xx status code
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions get workflow internal server error response has a 4xx status code
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions get workflow internal server error response has a 5xx status code
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions get workflow internal server error response a status code equal to that given
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions get workflow internal server error response
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}][%d] actionsGetWorkflowInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsGetWorkflowInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsParams creates a new ActionsListRepositoryWorkflowsParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewActionsListRepositoryWorkflowsParams() *ActionsListRepositoryWorkflowsParams {
|
||||||
|
return &ActionsListRepositoryWorkflowsParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsParamsWithTimeout creates a new ActionsListRepositoryWorkflowsParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewActionsListRepositoryWorkflowsParamsWithTimeout(timeout time.Duration) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
return &ActionsListRepositoryWorkflowsParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsParamsWithContext creates a new ActionsListRepositoryWorkflowsParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewActionsListRepositoryWorkflowsParamsWithContext(ctx context.Context) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
return &ActionsListRepositoryWorkflowsParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsParamsWithHTTPClient creates a new ActionsListRepositoryWorkflowsParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewActionsListRepositoryWorkflowsParamsWithHTTPClient(client *http.Client) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
return &ActionsListRepositoryWorkflowsParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the actions list repository workflows operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsParams struct {
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repo
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the actions list repository workflows params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithDefaults() *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the actions list repository workflows params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithTimeout(timeout time.Duration) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithContext(ctx context.Context) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithHTTPClient(client *http.Client) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithOwner(owner string) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WithRepo(repo string) *ActionsListRepositoryWorkflowsParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the actions list repository workflows params
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *ActionsListRepositoryWorkflowsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,480 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ActionsListRepositoryWorkflowsReader is a Reader for the ActionsListRepositoryWorkflows structure.
|
||||||
|
type ActionsListRepositoryWorkflowsReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *ActionsListRepositoryWorkflowsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewActionsListRepositoryWorkflowsOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewActionsListRepositoryWorkflowsBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewActionsListRepositoryWorkflowsForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewActionsListRepositoryWorkflowsNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewActionsListRepositoryWorkflowsUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewActionsListRepositoryWorkflowsInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/actions/workflows] ActionsListRepositoryWorkflows", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsOK creates a ActionsListRepositoryWorkflowsOK with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsOK() *ActionsListRepositoryWorkflowsOK {
|
||||||
|
return &ActionsListRepositoryWorkflowsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsOK describes a response with status code 200, with default header values.
|
||||||
|
|
||||||
|
ActionWorkflowList
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsOK struct {
|
||||||
|
Payload *models.ActionWorkflowResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows o k response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows o k response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows o k response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows o k response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows o k response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows o k response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) GetPayload() *models.ActionWorkflowResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(models.ActionWorkflowResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsBadRequest creates a ActionsListRepositoryWorkflowsBadRequest with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsBadRequest() *ActionsListRepositoryWorkflowsBadRequest {
|
||||||
|
return &ActionsListRepositoryWorkflowsBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows bad request response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows bad request response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows bad request response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows bad request response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows bad request response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows bad request response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsForbidden creates a ActionsListRepositoryWorkflowsForbidden with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsForbidden() *ActionsListRepositoryWorkflowsForbidden {
|
||||||
|
return &ActionsListRepositoryWorkflowsForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsForbidden describes a response with status code 403, with default header values.
|
||||||
|
|
||||||
|
APIForbiddenError is a forbidden error response
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsForbidden struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows forbidden response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows forbidden response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows forbidden response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows forbidden response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows forbidden response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows forbidden response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsForbidden", 403)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsNotFound creates a ActionsListRepositoryWorkflowsNotFound with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsNotFound() *ActionsListRepositoryWorkflowsNotFound {
|
||||||
|
return &ActionsListRepositoryWorkflowsNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows not found response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows not found response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows not found response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows not found response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows not found response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows not found response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsUnprocessableEntity creates a ActionsListRepositoryWorkflowsUnprocessableEntity with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsUnprocessableEntity() *ActionsListRepositoryWorkflowsUnprocessableEntity {
|
||||||
|
return &ActionsListRepositoryWorkflowsUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
|
||||||
|
APIValidationError is error format response related to input validation
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsUnprocessableEntity struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows unprocessable entity response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows unprocessable entity response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows unprocessable entity response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows unprocessable entity response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows unprocessable entity response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows unprocessable entity response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsUnprocessableEntity", 422)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewActionsListRepositoryWorkflowsInternalServerError creates a ActionsListRepositoryWorkflowsInternalServerError with default headers values
|
||||||
|
func NewActionsListRepositoryWorkflowsInternalServerError() *ActionsListRepositoryWorkflowsInternalServerError {
|
||||||
|
return &ActionsListRepositoryWorkflowsInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ActionsListRepositoryWorkflowsInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type ActionsListRepositoryWorkflowsInternalServerError struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this actions list repository workflows internal server error response has a 2xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this actions list repository workflows internal server error response has a 3xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this actions list repository workflows internal server error response has a 4xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this actions list repository workflows internal server error response has a 5xx status code
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this actions list repository workflows internal server error response a status code equal to that given
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the actions list repository workflows internal server error response
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) Error() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) String() string {
|
||||||
|
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/workflows][%d] actionsListRepositoryWorkflowsInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *ActionsListRepositoryWorkflowsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -68,7 +68,7 @@ type CreateRepoVariableParams struct {
|
|||||||
|
|
||||||
/* Owner.
|
/* Owner.
|
||||||
|
|
||||||
name of the owner
|
owner of the repo
|
||||||
*/
|
*/
|
||||||
Owner string
|
Owner string
|
||||||
|
|
||||||
|
|||||||
@@ -26,20 +26,20 @@ func (o *CreateRepoVariableReader) ReadResponse(response runtime.ClientResponse,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
case 204:
|
|
||||||
result := NewCreateRepoVariableNoContent()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
case 400:
|
case 400:
|
||||||
result := NewCreateRepoVariableBadRequest()
|
result := NewCreateRepoVariableBadRequest()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return nil, result
|
return nil, result
|
||||||
case 404:
|
case 409:
|
||||||
result := NewCreateRepoVariableNotFound()
|
result := NewCreateRepoVariableConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewCreateRepoVariableInternalServerError()
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -105,62 +105,6 @@ func (o *CreateRepoVariableCreated) readResponse(response runtime.ClientResponse
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCreateRepoVariableNoContent creates a CreateRepoVariableNoContent with default headers values
|
|
||||||
func NewCreateRepoVariableNoContent() *CreateRepoVariableNoContent {
|
|
||||||
return &CreateRepoVariableNoContent{}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
CreateRepoVariableNoContent describes a response with status code 204, with default header values.
|
|
||||||
|
|
||||||
response when creating a repo-level variable
|
|
||||||
*/
|
|
||||||
type CreateRepoVariableNoContent struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this create repo variable no content response has a 2xx status code
|
|
||||||
func (o *CreateRepoVariableNoContent) IsSuccess() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this create repo variable no content response has a 3xx status code
|
|
||||||
func (o *CreateRepoVariableNoContent) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this create repo variable no content response has a 4xx status code
|
|
||||||
func (o *CreateRepoVariableNoContent) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this create repo variable no content response has a 5xx status code
|
|
||||||
func (o *CreateRepoVariableNoContent) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this create repo variable no content response a status code equal to that given
|
|
||||||
func (o *CreateRepoVariableNoContent) IsCode(code int) bool {
|
|
||||||
return code == 204
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the create repo variable no content response
|
|
||||||
func (o *CreateRepoVariableNoContent) Code() int {
|
|
||||||
return 204
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateRepoVariableNoContent) Error() string {
|
|
||||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNoContent", 204)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateRepoVariableNoContent) String() string {
|
|
||||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNoContent", 204)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *CreateRepoVariableNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewCreateRepoVariableBadRequest creates a CreateRepoVariableBadRequest with default headers values
|
// NewCreateRepoVariableBadRequest creates a CreateRepoVariableBadRequest with default headers values
|
||||||
func NewCreateRepoVariableBadRequest() *CreateRepoVariableBadRequest {
|
func NewCreateRepoVariableBadRequest() *CreateRepoVariableBadRequest {
|
||||||
return &CreateRepoVariableBadRequest{}
|
return &CreateRepoVariableBadRequest{}
|
||||||
@@ -233,58 +177,130 @@ func (o *CreateRepoVariableBadRequest) readResponse(response runtime.ClientRespo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCreateRepoVariableNotFound creates a CreateRepoVariableNotFound with default headers values
|
// NewCreateRepoVariableConflict creates a CreateRepoVariableConflict with default headers values
|
||||||
func NewCreateRepoVariableNotFound() *CreateRepoVariableNotFound {
|
func NewCreateRepoVariableConflict() *CreateRepoVariableConflict {
|
||||||
return &CreateRepoVariableNotFound{}
|
return &CreateRepoVariableConflict{}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CreateRepoVariableNotFound describes a response with status code 404, with default header values.
|
CreateRepoVariableConflict describes a response with status code 409, with default header values.
|
||||||
|
|
||||||
APINotFound is a not found empty response
|
variable name already exists.
|
||||||
*/
|
*/
|
||||||
type CreateRepoVariableNotFound struct {
|
type CreateRepoVariableConflict struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsSuccess returns true when this create repo variable not found response has a 2xx status code
|
// IsSuccess returns true when this create repo variable conflict response has a 2xx status code
|
||||||
func (o *CreateRepoVariableNotFound) IsSuccess() bool {
|
func (o *CreateRepoVariableConflict) IsSuccess() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRedirect returns true when this create repo variable not found response has a 3xx status code
|
// IsRedirect returns true when this create repo variable conflict response has a 3xx status code
|
||||||
func (o *CreateRepoVariableNotFound) IsRedirect() bool {
|
func (o *CreateRepoVariableConflict) IsRedirect() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsClientError returns true when this create repo variable not found response has a 4xx status code
|
// IsClientError returns true when this create repo variable conflict response has a 4xx status code
|
||||||
func (o *CreateRepoVariableNotFound) IsClientError() bool {
|
func (o *CreateRepoVariableConflict) IsClientError() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsServerError returns true when this create repo variable not found response has a 5xx status code
|
// IsServerError returns true when this create repo variable conflict response has a 5xx status code
|
||||||
func (o *CreateRepoVariableNotFound) IsServerError() bool {
|
func (o *CreateRepoVariableConflict) IsServerError() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsCode returns true when this create repo variable not found response a status code equal to that given
|
// IsCode returns true when this create repo variable conflict response a status code equal to that given
|
||||||
func (o *CreateRepoVariableNotFound) IsCode(code int) bool {
|
func (o *CreateRepoVariableConflict) IsCode(code int) bool {
|
||||||
return code == 404
|
return code == 409
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code gets the status code for the create repo variable not found response
|
// Code gets the status code for the create repo variable conflict response
|
||||||
func (o *CreateRepoVariableNotFound) Code() int {
|
func (o *CreateRepoVariableConflict) Code() int {
|
||||||
return 404
|
return 409
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateRepoVariableNotFound) Error() string {
|
func (o *CreateRepoVariableConflict) Error() string {
|
||||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNotFound", 404)
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableConflict", 409)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateRepoVariableNotFound) String() string {
|
func (o *CreateRepoVariableConflict) String() string {
|
||||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNotFound", 404)
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableConflict", 409)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CreateRepoVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
func (o *CreateRepoVariableConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCreateRepoVariableInternalServerError creates a CreateRepoVariableInternalServerError with default headers values
|
||||||
|
func NewCreateRepoVariableInternalServerError() *CreateRepoVariableInternalServerError {
|
||||||
|
return &CreateRepoVariableInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
CreateRepoVariableInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type CreateRepoVariableInternalServerError struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this create repo variable internal server error response has a 2xx status code
|
||||||
|
func (o *CreateRepoVariableInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this create repo variable internal server error response has a 3xx status code
|
||||||
|
func (o *CreateRepoVariableInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this create repo variable internal server error response has a 4xx status code
|
||||||
|
func (o *CreateRepoVariableInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this create repo variable internal server error response has a 5xx status code
|
||||||
|
func (o *CreateRepoVariableInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this create repo variable internal server error response a status code equal to that given
|
||||||
|
func (o *CreateRepoVariableInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the create repo variable internal server error response
|
||||||
|
func (o *CreateRepoVariableInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateRepoVariableInternalServerError) Error() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateRepoVariableInternalServerError) String() string {
|
||||||
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableInternalServerError", 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *CreateRepoVariableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,196 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteActionRunParams creates a new DeleteActionRunParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewDeleteActionRunParams() *DeleteActionRunParams {
|
||||||
|
return &DeleteActionRunParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunParamsWithTimeout creates a new DeleteActionRunParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewDeleteActionRunParamsWithTimeout(timeout time.Duration) *DeleteActionRunParams {
|
||||||
|
return &DeleteActionRunParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunParamsWithContext creates a new DeleteActionRunParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewDeleteActionRunParamsWithContext(ctx context.Context) *DeleteActionRunParams {
|
||||||
|
return &DeleteActionRunParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunParamsWithHTTPClient creates a new DeleteActionRunParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewDeleteActionRunParamsWithHTTPClient(client *http.Client) *DeleteActionRunParams {
|
||||||
|
return &DeleteActionRunParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteActionRunParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the delete action run operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type DeleteActionRunParams struct {
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repository
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
/* Run.
|
||||||
|
|
||||||
|
runid of the workflow run
|
||||||
|
*/
|
||||||
|
Run int64
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the delete action run params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteActionRunParams) WithDefaults() *DeleteActionRunParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the delete action run params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteActionRunParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithTimeout(timeout time.Duration) *DeleteActionRunParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithContext(ctx context.Context) *DeleteActionRunParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithHTTPClient(client *http.Client) *DeleteActionRunParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithOwner(owner string) *DeleteActionRunParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithRepo(repo string) *DeleteActionRunParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRun adds the run to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) WithRun(run int64) *DeleteActionRunParams {
|
||||||
|
o.SetRun(run)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRun adds the run to the delete action run params
|
||||||
|
func (o *DeleteActionRunParams) SetRun(run int64) {
|
||||||
|
o.Run = run
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *DeleteActionRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param run
|
||||||
|
if err := r.SetPathParam("run", swag.FormatInt64(o.Run)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeleteActionRunReader is a Reader for the DeleteActionRun structure.
|
||||||
|
type DeleteActionRunReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *DeleteActionRunReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 204:
|
||||||
|
result := NewDeleteActionRunNoContent()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 400:
|
||||||
|
result := NewDeleteActionRunBadRequest()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewDeleteActionRunNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[DELETE /repos/{owner}/{repo}/actions/runs/{run}] deleteActionRun", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunNoContent creates a DeleteActionRunNoContent with default headers values
|
||||||
|
func NewDeleteActionRunNoContent() *DeleteActionRunNoContent {
|
||||||
|
return &DeleteActionRunNoContent{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteActionRunNoContent describes a response with status code 204, with default header values.
|
||||||
|
|
||||||
|
No Content
|
||||||
|
*/
|
||||||
|
type DeleteActionRunNoContent struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete action run no content response has a 2xx status code
|
||||||
|
func (o *DeleteActionRunNoContent) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete action run no content response has a 3xx status code
|
||||||
|
func (o *DeleteActionRunNoContent) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete action run no content response has a 4xx status code
|
||||||
|
func (o *DeleteActionRunNoContent) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete action run no content response has a 5xx status code
|
||||||
|
func (o *DeleteActionRunNoContent) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete action run no content response a status code equal to that given
|
||||||
|
func (o *DeleteActionRunNoContent) IsCode(code int) bool {
|
||||||
|
return code == 204
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete action run no content response
|
||||||
|
func (o *DeleteActionRunNoContent) Code() int {
|
||||||
|
return 204
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNoContent) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNoContent) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunNoContent", 204)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunBadRequest creates a DeleteActionRunBadRequest with default headers values
|
||||||
|
func NewDeleteActionRunBadRequest() *DeleteActionRunBadRequest {
|
||||||
|
return &DeleteActionRunBadRequest{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteActionRunBadRequest describes a response with status code 400, with default header values.
|
||||||
|
|
||||||
|
APIError is error format response
|
||||||
|
*/
|
||||||
|
type DeleteActionRunBadRequest struct {
|
||||||
|
Message string
|
||||||
|
URL string
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete action run bad request response has a 2xx status code
|
||||||
|
func (o *DeleteActionRunBadRequest) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete action run bad request response has a 3xx status code
|
||||||
|
func (o *DeleteActionRunBadRequest) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete action run bad request response has a 4xx status code
|
||||||
|
func (o *DeleteActionRunBadRequest) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete action run bad request response has a 5xx status code
|
||||||
|
func (o *DeleteActionRunBadRequest) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete action run bad request response a status code equal to that given
|
||||||
|
func (o *DeleteActionRunBadRequest) IsCode(code int) bool {
|
||||||
|
return code == 400
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete action run bad request response
|
||||||
|
func (o *DeleteActionRunBadRequest) Code() int {
|
||||||
|
return 400
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunBadRequest) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunBadRequest) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunBadRequest", 400)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
// hydrates response header message
|
||||||
|
hdrMessage := response.GetHeader("message")
|
||||||
|
|
||||||
|
if hdrMessage != "" {
|
||||||
|
o.Message = hdrMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// hydrates response header url
|
||||||
|
hdrURL := response.GetHeader("url")
|
||||||
|
|
||||||
|
if hdrURL != "" {
|
||||||
|
o.URL = hdrURL
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteActionRunNotFound creates a DeleteActionRunNotFound with default headers values
|
||||||
|
func NewDeleteActionRunNotFound() *DeleteActionRunNotFound {
|
||||||
|
return &DeleteActionRunNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteActionRunNotFound describes a response with status code 404, with default header values.
|
||||||
|
|
||||||
|
APINotFound is a not found empty response
|
||||||
|
*/
|
||||||
|
type DeleteActionRunNotFound struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this delete action run not found response has a 2xx status code
|
||||||
|
func (o *DeleteActionRunNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this delete action run not found response has a 3xx status code
|
||||||
|
func (o *DeleteActionRunNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this delete action run not found response has a 4xx status code
|
||||||
|
func (o *DeleteActionRunNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this delete action run not found response has a 5xx status code
|
||||||
|
func (o *DeleteActionRunNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this delete action run not found response a status code equal to that given
|
||||||
|
func (o *DeleteActionRunNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the delete action run not found response
|
||||||
|
func (o *DeleteActionRunNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNotFound) Error() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNotFound) String() string {
|
||||||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/actions/runs/{run}][%d] deleteActionRunNotFound", 404)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *DeleteActionRunNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
package repository
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteArtifactParams creates a new DeleteArtifactParams object,
|
||||||
|
// with the default timeout for this client.
|
||||||
|
//
|
||||||
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||||
|
//
|
||||||
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||||
|
func NewDeleteArtifactParams() *DeleteArtifactParams {
|
||||||
|
return &DeleteArtifactParams{
|
||||||
|
timeout: cr.DefaultTimeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteArtifactParamsWithTimeout creates a new DeleteArtifactParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewDeleteArtifactParamsWithTimeout(timeout time.Duration) *DeleteArtifactParams {
|
||||||
|
return &DeleteArtifactParams{
|
||||||
|
timeout: timeout,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteArtifactParamsWithContext creates a new DeleteArtifactParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
func NewDeleteArtifactParamsWithContext(ctx context.Context) *DeleteArtifactParams {
|
||||||
|
return &DeleteArtifactParams{
|
||||||
|
Context: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteArtifactParamsWithHTTPClient creates a new DeleteArtifactParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewDeleteArtifactParamsWithHTTPClient(client *http.Client) *DeleteArtifactParams {
|
||||||
|
return &DeleteArtifactParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
DeleteArtifactParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the delete artifact operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type DeleteArtifactParams struct {
|
||||||
|
|
||||||
|
/* ArtifactID.
|
||||||
|
|
||||||
|
id of the artifact
|
||||||
|
*/
|
||||||
|
ArtifactID string
|
||||||
|
|
||||||
|
/* Owner.
|
||||||
|
|
||||||
|
owner of the repo
|
||||||
|
*/
|
||||||
|
Owner string
|
||||||
|
|
||||||
|
/* Repo.
|
||||||
|
|
||||||
|
name of the repository
|
||||||
|
*/
|
||||||
|
Repo string
|
||||||
|
|
||||||
|
timeout time.Duration
|
||||||
|
Context context.Context
|
||||||
|
HTTPClient *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the delete artifact params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteArtifactParams) WithDefaults() *DeleteArtifactParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the delete artifact params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *DeleteArtifactParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithTimeout(timeout time.Duration) *DeleteArtifactParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithContext(ctx context.Context) *DeleteArtifactParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetContext(ctx context.Context) {
|
||||||
|
o.Context = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithHTTPClient(client *http.Client) *DeleteArtifactParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithArtifactID adds the artifactID to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithArtifactID(artifactID string) *DeleteArtifactParams {
|
||||||
|
o.SetArtifactID(artifactID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetArtifactID adds the artifactId to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetArtifactID(artifactID string) {
|
||||||
|
o.ArtifactID = artifactID
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOwner adds the owner to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithOwner(owner string) *DeleteArtifactParams {
|
||||||
|
o.SetOwner(owner)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOwner adds the owner to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetOwner(owner string) {
|
||||||
|
o.Owner = owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRepo adds the repo to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) WithRepo(repo string) *DeleteArtifactParams {
|
||||||
|
o.SetRepo(repo)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRepo adds the repo to the delete artifact params
|
||||||
|
func (o *DeleteArtifactParams) SetRepo(repo string) {
|
||||||
|
o.Repo = repo
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a swagger request
|
||||||
|
func (o *DeleteArtifactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// path param artifact_id
|
||||||
|
if err := r.SetPathParam("artifact_id", o.ArtifactID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param owner
|
||||||
|
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// path param repo
|
||||||
|
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user