Compare commits
1 Commits
gitea-api-
...
status_ser
| Author | SHA256 | Date | |
|---|---|---|---|
| e8b6066bae |
@@ -1,33 +0,0 @@
|
||||
name: go-generate-check
|
||||
on:
|
||||
push:
|
||||
branches: ['main']
|
||||
paths:
|
||||
- '**.go'
|
||||
- '**.mod'
|
||||
- '**.sum'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.go'
|
||||
- '**.mod'
|
||||
- '**.sum'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
go-generate-check:
|
||||
name: go-generate-check
|
||||
container:
|
||||
image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest
|
||||
steps:
|
||||
- run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} .
|
||||
- run: git fetch origin ${{ gitea.ref }}
|
||||
- run: git checkout FETCH_HEAD
|
||||
- run: go generate -C common
|
||||
- run: go generate -C workflow-pr
|
||||
- run: git add -N .; git diff
|
||||
- run: |
|
||||
status=$(git status --short)
|
||||
if [[ -n "$status" ]]; then
|
||||
echo -e "$status"
|
||||
echo "Please commit the differences from running: go generate"
|
||||
false
|
||||
fi
|
||||
@@ -1,24 +0,0 @@
|
||||
name: go-generate-push
|
||||
on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
go-generate-push:
|
||||
name: go-generate-push
|
||||
container:
|
||||
image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest
|
||||
steps:
|
||||
- run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} .
|
||||
- run: git fetch origin ${{ gitea.ref }}
|
||||
- run: git checkout FETCH_HEAD
|
||||
- run: go generate -C common
|
||||
- run: go generate -C workflow-pr
|
||||
- run: |
|
||||
host=${{ gitea.server_url }}
|
||||
host=${host#https://}
|
||||
echo $host
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.GITEA_TOKEN }}@$host/${{ gitea.repository }}"
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "gitea_noreply@opensuse.org"
|
||||
- run: 'git status --short; git status --porcelain=2|grep --quiet -v . || ( git add .;git commit -m "CI run result of: go generate"; git push origin HEAD:${{ gitea.ref }} )'
|
||||
- run: git log -p FETCH_HEAD...HEAD
|
||||
- run: git log --numstat FETCH_HEAD...HEAD
|
||||
@@ -1,33 +0,0 @@
|
||||
name: go-vendor-check
|
||||
on:
|
||||
push:
|
||||
branches: ['main']
|
||||
paths:
|
||||
- '**.mod'
|
||||
- '**.sum'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.mod'
|
||||
- '**.sum'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
go-generate-check:
|
||||
name: go-vendor-check
|
||||
container:
|
||||
image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest
|
||||
steps:
|
||||
- run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} .
|
||||
- run: git fetch origin ${{ gitea.ref }}
|
||||
- run: git checkout FETCH_HEAD
|
||||
- run: go mod download
|
||||
- run: go mod vendor
|
||||
- run: go mod verify
|
||||
- run: git add -N .; git diff
|
||||
- run: go mod tidy -diff || true
|
||||
- run: |
|
||||
status=$(git status --short)
|
||||
if [[ -n "$status" ]]; then
|
||||
echo -e "$status"
|
||||
echo "Please commit the differences from running: go generate"
|
||||
false
|
||||
fi
|
||||
@@ -1,26 +0,0 @@
|
||||
name: go-generate-push
|
||||
on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
go-generate-push:
|
||||
name: go-generate-push
|
||||
container:
|
||||
image: registry.opensuse.org/devel/factory/git-workflow/containers/opensuse/bci/golang-extended:latest
|
||||
steps:
|
||||
- run: git clone --no-checkout --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} .
|
||||
- run: git fetch origin ${{ gitea.ref }}
|
||||
- run: git checkout FETCH_HEAD
|
||||
- run: go mod download
|
||||
- run: go mod vendor
|
||||
- run: go mod verify
|
||||
- run: |
|
||||
host=${{ gitea.server_url }}
|
||||
host=${host#https://}
|
||||
echo $host
|
||||
git remote set-url origin "https://x-access-token:${{ secrets.GITEA_TOKEN }}@$host/${{ gitea.repository }}"
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "gitea_noreply@opensuse.org"
|
||||
- run: 'git status --short; git status --porcelain=2|grep --quiet -v . || ( git add .;git commit -m "CI run result of: go mod vendor"; git push origin HEAD:${{ gitea.ref }} )'
|
||||
- run: go mod tidy -diff || true
|
||||
- run: git log -p FETCH_HEAD...HEAD
|
||||
- run: git log --numstat FETCH_HEAD...HEAD
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
mock
|
||||
node_modules
|
||||
*.obscpio
|
||||
autogits-tmp.tar.zst
|
||||
*.osc
|
||||
*.conf
|
||||
|
||||
19
README.md
19
README.md
@@ -5,15 +5,11 @@ The bots that drive Git Workflow for package management
|
||||
|
||||
* devel-importer -- helper to import an OBS devel project into a Gitea organization
|
||||
* gitea-events-rabbitmq-publisher -- takes all events from a Gitea organization (webhook) and publishes it on a RabbitMQ instance
|
||||
* gitea-status-proxy -- allows bots without code owner permission to set Gitea's commit status
|
||||
* group-review -- group review proxy
|
||||
* hujson -- translates JWCC (json with commas and comments) to Standard JSON
|
||||
* obs-forward-bot -- forwards PR as OBS sr (TODO)
|
||||
* obs-staging-bot -- build bot for a PR
|
||||
* obs-status-service -- report build status of an OBS project as an SVG
|
||||
* workflow-pr -- keeps PR to _ObsPrj consistent with a PR to a package update
|
||||
* workflow-direct -- update _ObsPrj based on direct pushes and repo creations/removals from organization
|
||||
* staging-utils -- review tooling for PR (TODO)
|
||||
* staging-utils -- review tooling for PR
|
||||
- list PR
|
||||
- merge PR
|
||||
- split PR
|
||||
@@ -23,18 +19,7 @@ The bots that drive Git Workflow for package management
|
||||
Bugs
|
||||
----
|
||||
|
||||
Report bugs to issue tracker at https://src.opensuse.org/git-workflow/autogits
|
||||
Report bugs to issue tracker at https://src.opensuse.org/adamm/autogits
|
||||
|
||||
|
||||
Build Status
|
||||
------------
|
||||
|
||||
Devel project build status (`main` branch):
|
||||
|
||||

|
||||
|
||||
`staging` branch build status:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
15
_service
Normal file
15
_service
Normal file
@@ -0,0 +1,15 @@
|
||||
<services>
|
||||
<!-- workaround, go_modules needs a tar and obs_scm doesn't take file://. -->
|
||||
<service name="roast" mode="manual">
|
||||
<param name="target">.</param>
|
||||
<param name="reproducible">true</param>
|
||||
<param name="outfile">autogits-tmp.tar.zst</param>
|
||||
<param name="exclude">autogits-tmp.tar.zst</param>
|
||||
</service>
|
||||
<service name="go_modules" mode="manual">
|
||||
<param name="basename">./</param>
|
||||
<param name="compression">zst</param>
|
||||
<param name="vendorname">vendor</param>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
239
autogits.spec
239
autogits.spec
@@ -17,14 +17,15 @@
|
||||
|
||||
|
||||
Name: autogits
|
||||
Version: 1
|
||||
Version: 0
|
||||
Release: 0
|
||||
Summary: GitWorkflow utilities
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://src.opensuse.org/adamm/autogits
|
||||
BuildRequires: git
|
||||
Source1: vendor.tar.zst
|
||||
BuildRequires: golang-packaging
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: go
|
||||
BuildRequires: zstd
|
||||
%{?systemd_ordering}
|
||||
|
||||
%description
|
||||
@@ -32,268 +33,160 @@ Git Workflow tooling and utilities enabling automated handing of OBS projects
|
||||
as git repositories
|
||||
|
||||
|
||||
%package devel-importer
|
||||
Summary: Imports devel projects from obs to git
|
||||
|
||||
%description -n autogits-devel-importer
|
||||
Command-line tool to import devel projects from obs to git
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: Common documentation files
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n autogits-doc
|
||||
Common documentation files
|
||||
|
||||
|
||||
%package gitea-events-rabbitmq-publisher
|
||||
%package -n gitea-events-rabbitmq-publisher
|
||||
Summary: Publishes Gitea webhook data via RabbitMQ
|
||||
|
||||
%description gitea-events-rabbitmq-publisher
|
||||
%description -n gitea-events-rabbitmq-publisher
|
||||
Listens on an HTTP socket and publishes Gitea events on a RabbitMQ instance
|
||||
with a topic
|
||||
<scope>.src.$organization.$webhook_type.[$webhook_action_type]
|
||||
|
||||
|
||||
%package gitea-status-proxy
|
||||
Summary: Proxy for setting commit status in Gitea
|
||||
%package -n doc
|
||||
Summary: Common documentation files
|
||||
|
||||
%description gitea-status-proxy
|
||||
Setting commit status requires code write access token. This proxy
|
||||
is middleware that delegates status setting without access to other APIs
|
||||
%description -n doc
|
||||
Common documentation files
|
||||
|
||||
%package group-review
|
||||
|
||||
%package -n devel-importer
|
||||
Summary: Imports devel projects from obs to git
|
||||
|
||||
%description -n devel-importer
|
||||
Command-line tool to import devel projects from obs to git
|
||||
|
||||
|
||||
%package -n group-review
|
||||
Summary: Reviews of groups defined in ProjectGit
|
||||
|
||||
%description group-review
|
||||
%description -n group-review
|
||||
Is used to handle reviews associated with groups defined in the
|
||||
ProjectGit.
|
||||
|
||||
|
||||
%package obs-forward-bot
|
||||
Summary: obs-forward-bot
|
||||
|
||||
%description obs-forward-bot
|
||||
|
||||
|
||||
%package obs-staging-bot
|
||||
%package -n obs-staging-bot
|
||||
Summary: Build a PR against a ProjectGit, if review is requested
|
||||
|
||||
%description obs-staging-bot
|
||||
%description -n obs-staging-bot
|
||||
Build a PR against a ProjectGit, if review is requested.
|
||||
|
||||
|
||||
%package obs-status-service
|
||||
%package -n obs-status-service
|
||||
Summary: Reports build status of OBS service as an easily to produce SVG
|
||||
|
||||
%description obs-status-service
|
||||
%description -n obs-status-service
|
||||
Reports build status of OBS service as an easily to produce SVG
|
||||
|
||||
|
||||
%package utils
|
||||
Summary: HuJSON to JSON parser
|
||||
Provides: hujson
|
||||
Provides: /usr/bin/hujson
|
||||
|
||||
%description utils
|
||||
HuJSON to JSON parser, using stdin -> stdout pipe
|
||||
|
||||
|
||||
%package workflow-direct
|
||||
%package -n workflow-direct
|
||||
Summary: Keep ProjectGit in sync for a devel project
|
||||
Requires: openssh-clients
|
||||
Requires: git-core
|
||||
|
||||
%description workflow-direct
|
||||
%description -n workflow-direct
|
||||
Keep ProjectGit in sync with packages in the organization of a devel project
|
||||
|
||||
|
||||
%package workflow-pr
|
||||
%package -n workflow-pr
|
||||
Summary: Keeps ProjectGit PR in-sync with a PackageGit PR
|
||||
Requires: openssh-clients
|
||||
Requires: git-core
|
||||
|
||||
%description workflow-pr
|
||||
%description -n workflow-pr
|
||||
Keeps ProjectGit PR in-sync with a PackageGit PR
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
cp -r /home/abuild/rpmbuild/SOURCES/* ./
|
||||
tar x --zstd -f %{SOURCE1}
|
||||
|
||||
%build
|
||||
go build \
|
||||
-C devel-importer \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C utils/hujson \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C gitea-events-rabbitmq-publisher \
|
||||
-mod=vendor \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C gitea_status_proxy \
|
||||
-C devel-importer \
|
||||
-mod=vendor \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C group-review \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C obs-forward-bot \
|
||||
-mod=vendor \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C obs-staging-bot \
|
||||
-mod=vendor \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C obs-status-service \
|
||||
-mod=vendor \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C workflow-direct \
|
||||
-buildmode=pie
|
||||
go build \
|
||||
-C workflow-pr \
|
||||
-buildmode=pie
|
||||
|
||||
%check
|
||||
go test -C common -v
|
||||
go test -C group-review -v
|
||||
go test -C obs-staging-bot -v
|
||||
go test -C obs-status-service -v
|
||||
go test -C workflow-direct -v
|
||||
# TODO build fails
|
||||
#go test -C workflow-pr -v
|
||||
#go build \
|
||||
# -C workflow-direct \
|
||||
# -mod=vendor \
|
||||
# -buildmode=pie
|
||||
#go build \
|
||||
# -C workflow-pr \
|
||||
# -mod=vendor \
|
||||
# -buildmode=pie
|
||||
|
||||
%install
|
||||
install -D -m0755 devel-importer/devel-importer %{buildroot}%{_bindir}/devel-importer
|
||||
install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir}/gitea-events-rabbitmq-publisher
|
||||
install -D -m0644 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
||||
install -D -m0755 gitea_status_proxy/gitea_status_proxy %{buildroot}%{_bindir}/gitea_status_proxy
|
||||
install -D -m0755 devel-importer/devel-importer %{buildroot}%{_bindir}/devel-importer
|
||||
install -D -m0755 group-review/group-review %{buildroot}%{_bindir}/group-review
|
||||
install -D -m0644 systemd/group-review@.service %{buildroot}%{_unitdir}/group-review@.service
|
||||
install -D -m0755 obs-forward-bot/obs-forward-bot %{buildroot}%{_bindir}/obs-forward-bot
|
||||
install -D -m0755 obs-staging-bot/obs-staging-bot %{buildroot}%{_bindir}/obs-staging-bot
|
||||
install -D -m0644 systemd/obs-staging-bot.service %{buildroot}%{_unitdir}/obs-staging-bot.service
|
||||
install -D -m0755 obs-status-service/obs-status-service %{buildroot}%{_bindir}/obs-status-service
|
||||
install -D -m0644 systemd/obs-status-service.service %{buildroot}%{_unitdir}/obs-status-service.service
|
||||
install -D -m0755 workflow-direct/workflow-direct %{buildroot}%{_bindir}/workflow-direct
|
||||
install -D -m0644 systemd/workflow-direct@.service %{buildroot}%{_unitdir}/workflow-direct@.service
|
||||
install -D -m0755 workflow-pr/workflow-pr %{buildroot}%{_bindir}/workflow-pr
|
||||
install -D -m0755 utils/hujson/hujson %{buildroot}%{_bindir}/hujson
|
||||
#install -D -m0755 workflow-direct/workflow-direct %{buildroot}%{_bindir}/workflow-direct
|
||||
#install -D -m0755 workflow-pr/workflow-pr %{buildroot}%{_bindir}/workflow-pr
|
||||
|
||||
%pre gitea-events-rabbitmq-publisher
|
||||
%pre -n gitea-events-rabbitmq-publisher
|
||||
%service_add_pre gitea-events-rabbitmq-publisher.service
|
||||
|
||||
%post gitea-events-rabbitmq-publisher
|
||||
%post -n gitea-events-rabbitmq-publisher
|
||||
%service_add_post gitea-events-rabbitmq-publisher.service
|
||||
|
||||
%preun gitea-events-rabbitmq-publisher
|
||||
%preun -n gitea-events-rabbitmq-publisher
|
||||
%service_del_preun gitea-events-rabbitmq-publisher.service
|
||||
|
||||
%postun gitea-events-rabbitmq-publisher
|
||||
%postun -n gitea-events-rabbitmq-publisher
|
||||
%service_del_postun gitea-events-rabbitmq-publisher.service
|
||||
|
||||
%pre group-review
|
||||
%service_add_pre group-review@.service
|
||||
|
||||
%post group-review
|
||||
%service_add_post group-review@.service
|
||||
|
||||
%preun group-review
|
||||
%service_del_preun group-review@.service
|
||||
|
||||
%postun group-review
|
||||
%service_del_postun group-review@.service
|
||||
|
||||
%pre obs-staging-bot
|
||||
%service_add_pre obs-staging-bot.service
|
||||
|
||||
%post obs-staging-bot
|
||||
%service_add_post obs-staging-bot.service
|
||||
|
||||
%preun obs-staging-bot
|
||||
%service_del_preun obs-staging-bot.service
|
||||
|
||||
%postun obs-staging-bot
|
||||
%service_del_postun obs-staging-bot.service
|
||||
|
||||
%pre obs-status-service
|
||||
%service_add_pre obs-status-service.service
|
||||
|
||||
%post obs-status-service
|
||||
%service_add_post obs-status-service.service
|
||||
|
||||
%preun obs-status-service
|
||||
%service_del_preun obs-status-service.service
|
||||
|
||||
%postun obs-status-service
|
||||
%service_del_postun obs-status-service.service
|
||||
|
||||
%pre workflow-pr
|
||||
%service_add_pre workflow-direct@.service
|
||||
|
||||
%post workflow-pr
|
||||
%service_add_post workflow-direct@.service
|
||||
|
||||
%preun workflow-pr
|
||||
%service_del_preun workflow-direct@.service
|
||||
|
||||
%postun workflow-pr
|
||||
%service_del_postun workflow-direct@.service
|
||||
|
||||
%files devel-importer
|
||||
%license COPYING
|
||||
%doc devel-importer/README.md
|
||||
%{_bindir}/devel-importer
|
||||
|
||||
%files doc
|
||||
%license COPYING
|
||||
%doc doc/README.md
|
||||
%doc doc/workflows.md
|
||||
|
||||
%files gitea-events-rabbitmq-publisher
|
||||
%files -n gitea-events-rabbitmq-publisher
|
||||
%license COPYING
|
||||
%doc gitea-events-rabbitmq-publisher/README.md
|
||||
%{_bindir}/gitea-events-rabbitmq-publisher
|
||||
%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
||||
|
||||
%files gitea-status-proxy
|
||||
%files -n doc
|
||||
%license COPYING
|
||||
%{_bindir}/gitea_status_proxy
|
||||
%doc doc/README.md
|
||||
%doc doc/workflows.md
|
||||
|
||||
%files group-review
|
||||
%files -n devel-importer
|
||||
%license COPYING
|
||||
%doc devel-importer/README.md
|
||||
%{_bindir}/devel-importer
|
||||
|
||||
%files -n group-review
|
||||
%license COPYING
|
||||
%doc group-review/README.md
|
||||
%{_bindir}/group-review
|
||||
%{_unitdir}/group-review@.service
|
||||
|
||||
%files obs-forward-bot
|
||||
%license COPYING
|
||||
%{_bindir}/obs-forward-bot
|
||||
|
||||
%files obs-staging-bot
|
||||
%files -n obs-staging-bot
|
||||
%license COPYING
|
||||
%doc obs-staging-bot/README.md
|
||||
%{_bindir}/obs-staging-bot
|
||||
%{_unitdir}/obs-staging-bot.service
|
||||
|
||||
%files obs-status-service
|
||||
%files -n obs-status-service
|
||||
%license COPYING
|
||||
%doc obs-status-service/README.md
|
||||
%{_bindir}/obs-status-service
|
||||
%{_unitdir}/obs-status-service.service
|
||||
|
||||
%files utils
|
||||
%license COPYING
|
||||
%{_bindir}/hujson
|
||||
|
||||
%files workflow-direct
|
||||
%files -n workflow-direct
|
||||
%license COPYING
|
||||
%doc workflow-direct/README.md
|
||||
%{_bindir}/workflow-direct
|
||||
%{_unitdir}/workflow-direct@.service
|
||||
#%{_bindir}/workflow-direct
|
||||
|
||||
%files workflow-pr
|
||||
%files -n workflow-pr
|
||||
%license COPYING
|
||||
%doc workflow-pr/README.md
|
||||
%{_bindir}/workflow-pr
|
||||
#%{_bindir}/workflow-pr
|
||||
|
||||
|
||||
3920
common/api.json
3920
common/api.json
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const PrPattern = "PR: %s/%s!%d"
|
||||
const PrPattern = "PR: %s/%s#%d"
|
||||
|
||||
type BasicPR struct {
|
||||
Org, Repo string
|
||||
@@ -36,14 +36,10 @@ func parsePrLine(line string) (BasicPR, error) {
|
||||
return ret, errors.New("missing / separator")
|
||||
}
|
||||
|
||||
repo := strings.SplitN(org[1], "!", 2)
|
||||
repo := strings.SplitN(org[1], "#", 2)
|
||||
ret.Repo = repo[0]
|
||||
if len(repo) != 2 {
|
||||
repo = strings.SplitN(org[1], "#", 2)
|
||||
ret.Repo = repo[0]
|
||||
}
|
||||
if len(repo) != 2 {
|
||||
return ret, errors.New("Missing ! or # separator")
|
||||
return ret, errors.New("Missing # separator")
|
||||
}
|
||||
|
||||
// Gitea requires that each org and repo be [A-Za-z0-9_-]+
|
||||
|
||||
@@ -14,7 +14,6 @@ func newStringScanner(s string) *bufio.Scanner {
|
||||
}
|
||||
|
||||
func TestAssociatedPRScanner(t *testing.T) {
|
||||
common.SetTestLogger(t)
|
||||
testTable := []struct {
|
||||
name string
|
||||
input string
|
||||
@@ -35,7 +34,7 @@ func TestAssociatedPRScanner(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"Multiple PRs",
|
||||
"Some header of the issue\n\nFollowed by some description\nPR: test/foo#4\n\nPR: test/goo!5\n",
|
||||
"Some header of the issue\n\nFollowed by some description\nPR: test/foo#4\n\nPR: test/goo#5\n",
|
||||
[]common.BasicPR{
|
||||
{Org: "test", Repo: "foo", Num: 4},
|
||||
{Org: "test", Repo: "goo", Num: 5},
|
||||
@@ -96,7 +95,6 @@ func TestAssociatedPRScanner(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAppendingPRsToDescription(t *testing.T) {
|
||||
common.SetTestLogger(t)
|
||||
testTable := []struct {
|
||||
name string
|
||||
desc string
|
||||
@@ -109,7 +107,7 @@ func TestAppendingPRsToDescription(t *testing.T) {
|
||||
[]common.BasicPR{
|
||||
{Org: "a", Repo: "b", Num: 100},
|
||||
},
|
||||
"something\n\nPR: a/b!100",
|
||||
"something\n\nPR: a/b#100",
|
||||
},
|
||||
{
|
||||
"Append multiple PR to end of description",
|
||||
@@ -121,7 +119,7 @@ func TestAppendingPRsToDescription(t *testing.T) {
|
||||
{Org: "b", Repo: "b", Num: 100},
|
||||
{Org: "c", Repo: "b", Num: 100},
|
||||
},
|
||||
"something\n\nPR: a1/b!100\nPR: a1/c!100\nPR: a1/c!101\nPR: b/b!100\nPR: c/b!100",
|
||||
"something\n\nPR: a1/b#100\nPR: a1/c#100\nPR: a1/c#101\nPR: b/b#100\nPR: c/b#100",
|
||||
},
|
||||
{
|
||||
"Append multiple sorted PR to end of description and remove dups",
|
||||
@@ -135,7 +133,7 @@ func TestAppendingPRsToDescription(t *testing.T) {
|
||||
{Org: "a1", Repo: "c", Num: 101},
|
||||
{Org: "a1", Repo: "b", Num: 100},
|
||||
},
|
||||
"something\n\nPR: a1/b!100\nPR: a1/c!100\nPR: a1/c!101\nPR: b/b!100\nPR: c/b!100",
|
||||
"something\n\nPR: a1/b#100\nPR: a1/c#100\nPR: a1/c#101\nPR: b/b#100\nPR: c/b#100",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import (
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/tailscale/hujson"
|
||||
@@ -36,9 +35,6 @@ import (
|
||||
const (
|
||||
ProjectConfigFile = "workflow.config"
|
||||
StagingConfigFile = "staging.config"
|
||||
|
||||
Permission_ForceMerge = "force-merge"
|
||||
Permission_Group = "release-engineering"
|
||||
)
|
||||
|
||||
type ConfigFile struct {
|
||||
@@ -47,53 +43,26 @@ type ConfigFile struct {
|
||||
|
||||
type ReviewGroup struct {
|
||||
Name string
|
||||
Silent bool // will not request reviews from group members
|
||||
Reviewers []string
|
||||
}
|
||||
|
||||
type QAConfig struct {
|
||||
Name string
|
||||
Origin string
|
||||
BuildDisableRepos []string // which repos to build disable in the new project
|
||||
}
|
||||
|
||||
type Permissions struct {
|
||||
Permission string
|
||||
Members []string
|
||||
}
|
||||
|
||||
const (
|
||||
Label_StagingAuto = "staging/Auto"
|
||||
Label_ReviewPending = "review/Pending"
|
||||
Label_ReviewDone = "review/Done"
|
||||
Label_NewRepository = "new/New Repository"
|
||||
)
|
||||
|
||||
func LabelKey(tag_value string) string {
|
||||
// capitalize first letter and remove /
|
||||
if len(tag_value) == 0 {
|
||||
return ""
|
||||
}
|
||||
return strings.ToUpper(tag_value[0:1]) + strings.ReplaceAll(tag_value[1:], "/", "")
|
||||
}
|
||||
|
||||
type AutogitConfig struct {
|
||||
Workflows []string // [pr, direct, test]
|
||||
Organization string
|
||||
GitProjectName string // Organization/GitProjectName.git is PrjGit
|
||||
Branch string // branch name of PkgGit that aligns with PrjGit submodules
|
||||
Reviewers []string // only used by `pr` workflow
|
||||
Permissions []*Permissions // only used by `pr` workflow
|
||||
ReviewGroups []*ReviewGroup
|
||||
GitProjectName string // Organization/GitProjectName.git is PrjGit
|
||||
Branch string // branch name of PkgGit that aligns with PrjGit submodules
|
||||
Reviewers []string // only used by `pr` workflow
|
||||
ReviewGroups []ReviewGroup
|
||||
Committers []string // group in addition to Reviewers and Maintainers that can order the bot around, mostly as helper for factory-maintainers
|
||||
Subdirs []string // list of directories to sort submodules into. Needed b/c _manifest cannot list non-existent directories
|
||||
|
||||
Labels map[string]string // list of tags, if not default, to apply
|
||||
|
||||
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
|
||||
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
|
||||
@@ -207,8 +176,6 @@ func (configs AutogitConfigs) GetPrjGitConfig(org, repo, branch string) *Autogit
|
||||
if c.GitProjectName == prjgit {
|
||||
return c
|
||||
}
|
||||
}
|
||||
for _, c := range configs {
|
||||
if c.Organization == org && c.Branch == branch {
|
||||
return c
|
||||
}
|
||||
@@ -217,27 +184,6 @@ func (configs AutogitConfigs) GetPrjGitConfig(org, repo, branch string) *Autogit
|
||||
return nil
|
||||
}
|
||||
|
||||
func (config *AutogitConfig) HasPermission(user, permission string) bool {
|
||||
if config == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, p := range config.Permissions {
|
||||
if p.Permission == permission {
|
||||
if slices.Contains(p.Members, user) {
|
||||
return true
|
||||
}
|
||||
|
||||
for _, m := range p.Members {
|
||||
if members, err := config.GetReviewGroupMembers(m); err == nil && slices.Contains(members, user) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (config *AutogitConfig) GetReviewGroupMembers(reviewer string) ([]string, error) {
|
||||
for _, g := range config.ReviewGroups {
|
||||
if g.Name == reviewer {
|
||||
@@ -248,19 +194,10 @@ func (config *AutogitConfig) GetReviewGroupMembers(reviewer string) ([]string, e
|
||||
return nil, errors.New("User " + reviewer + " not found as group reviewer for " + config.GitProjectName)
|
||||
}
|
||||
|
||||
func (config *AutogitConfig) GetReviewGroup(reviewer string) (*ReviewGroup, error) {
|
||||
for _, g := range config.ReviewGroups {
|
||||
if g.Name == reviewer {
|
||||
return g, nil
|
||||
}
|
||||
}
|
||||
return nil, errors.New("User " + reviewer + " not found as group reviewer for " + config.GitProjectName)
|
||||
}
|
||||
|
||||
func (config *AutogitConfig) GetPrjGit() (string, string, string) {
|
||||
org := config.Organization
|
||||
repo := DefaultGitPrj
|
||||
branch := ""
|
||||
branch := "master"
|
||||
|
||||
a := strings.Split(config.GitProjectName, "/")
|
||||
if len(a[0]) > 0 {
|
||||
@@ -284,9 +221,6 @@ func (config *AutogitConfig) GetPrjGit() (string, string, string) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(branch) == 0 {
|
||||
panic("branch for project is undefined. Should not happend." + org + "/" + repo)
|
||||
}
|
||||
return org, repo, branch
|
||||
}
|
||||
|
||||
@@ -294,14 +228,6 @@ func (config *AutogitConfig) GetRemoteBranch() string {
|
||||
return "origin_" + config.Branch
|
||||
}
|
||||
|
||||
func (config *AutogitConfig) Label(label string) string {
|
||||
if t, found := config.Labels[LabelKey(label)]; found {
|
||||
return t
|
||||
}
|
||||
|
||||
return label
|
||||
}
|
||||
|
||||
type StagingConfig struct {
|
||||
ObsProject string
|
||||
RebuildAll bool
|
||||
@@ -314,9 +240,6 @@ type StagingConfig struct {
|
||||
|
||||
func ParseStagingConfig(data []byte) (*StagingConfig, error) {
|
||||
var staging StagingConfig
|
||||
if len(data) == 0 {
|
||||
return nil, errors.New("non-existent config file.")
|
||||
}
|
||||
data, err := hujson.Standardize(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -4,72 +4,12 @@ import (
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"go.uber.org/mock/gomock"
|
||||
"src.opensuse.org/autogits/common"
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
mock_common "src.opensuse.org/autogits/common/mock"
|
||||
)
|
||||
|
||||
func TestLabelKey(t *testing.T) {
|
||||
tests := map[string]string{
|
||||
"": "",
|
||||
"foo": "Foo",
|
||||
"foo/bar": "Foobar",
|
||||
"foo/Bar": "FooBar",
|
||||
}
|
||||
|
||||
for k, v := range tests {
|
||||
if c := common.LabelKey(k); c != v {
|
||||
t.Error("expected", v, "got", c, "input", k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigLabelParser(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
json string
|
||||
label_value string
|
||||
}{
|
||||
{
|
||||
name: "empty",
|
||||
json: "{}",
|
||||
label_value: "path/String",
|
||||
},
|
||||
{
|
||||
name: "defined",
|
||||
json: `{"Labels": {"foo": "bar", "PathString": "moo/Label"}}`,
|
||||
label_value: "moo/Label",
|
||||
},
|
||||
{
|
||||
name: "undefined",
|
||||
json: `{"Labels": {"foo": "bar", "NotPathString": "moo/Label"}}`,
|
||||
label_value: "path/String",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
repo := models.Repository{
|
||||
DefaultBranch: "master",
|
||||
}
|
||||
|
||||
ctl := NewController(t)
|
||||
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
||||
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.json), "abc", nil)
|
||||
gitea.EXPECT().GetRepository("foo", "bar").Return(&repo, nil)
|
||||
|
||||
config, err := common.ReadWorkflowConfig(gitea, "foo/bar")
|
||||
if err != nil || config == nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if l := config.Label("path/String"); l != test.label_value {
|
||||
t.Error("Expecting", test.label_value, "got", l)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestProjectConfigMatcher(t *testing.T) {
|
||||
configs := common.AutogitConfigs{
|
||||
{
|
||||
@@ -81,15 +21,6 @@ func TestProjectConfigMatcher(t *testing.T) {
|
||||
Branch: "main",
|
||||
GitProjectName: "test/prjgit#main",
|
||||
},
|
||||
{
|
||||
Organization: "test",
|
||||
Branch: "main",
|
||||
GitProjectName: "test/bar#never_match",
|
||||
},
|
||||
{
|
||||
Organization: "test",
|
||||
GitProjectName: "test/bar#main",
|
||||
},
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
@@ -119,20 +50,6 @@ func TestProjectConfigMatcher(t *testing.T) {
|
||||
branch: "main",
|
||||
config: 1,
|
||||
},
|
||||
{
|
||||
name: "prjgit only match",
|
||||
org: "test",
|
||||
repo: "bar",
|
||||
branch: "main",
|
||||
config: 3,
|
||||
},
|
||||
{
|
||||
name: "non-default branch match",
|
||||
org: "test",
|
||||
repo: "bar",
|
||||
branch: "something_main",
|
||||
config: -1,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
@@ -175,7 +92,7 @@ func TestConfigWorkflowParser(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
ctl := NewController(t)
|
||||
ctl := gomock.NewController(t)
|
||||
gitea := mock_common.NewMockGiteaFileContentAndRepoFetcher(ctl)
|
||||
gitea.EXPECT().GetRepositoryFileContent("foo", "bar", "", "workflow.config").Return([]byte(test.config_json), "abc", nil)
|
||||
gitea.EXPECT().GetRepository("foo", "bar").Return(&test.repo, nil)
|
||||
@@ -188,15 +105,10 @@ func TestConfigWorkflowParser(t *testing.T) {
|
||||
if config.ManualMergeOnly != false {
|
||||
t.Fatal("This should be false")
|
||||
}
|
||||
|
||||
if config.Label("foobar") != "foobar" {
|
||||
t.Fatal("undefined label should return default value")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: should test ReadWorkflowConfig as it will always set prjgit completely
|
||||
func TestProjectGitParser(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -207,21 +119,20 @@ func TestProjectGitParser(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "repo only",
|
||||
prjgit: "repo.git#master",
|
||||
prjgit: "repo.git",
|
||||
org: "org",
|
||||
branch: "br",
|
||||
res: [3]string{"org", "repo.git", "master"},
|
||||
},
|
||||
{
|
||||
name: "default",
|
||||
org: "org",
|
||||
prjgit: "org/_ObsPrj#master",
|
||||
res: [3]string{"org", common.DefaultGitPrj, "master"},
|
||||
name: "default",
|
||||
org: "org",
|
||||
res: [3]string{"org", common.DefaultGitPrj, "master"},
|
||||
},
|
||||
{
|
||||
name: "repo with branch",
|
||||
org: "org2",
|
||||
prjgit: "org2/repo.git#somebranch",
|
||||
prjgit: "repo.git#somebranch",
|
||||
res: [3]string{"org2", "repo.git", "somebranch"},
|
||||
},
|
||||
{
|
||||
@@ -238,25 +149,25 @@ func TestProjectGitParser(t *testing.T) {
|
||||
{
|
||||
name: "repo org and empty branch",
|
||||
org: "org3",
|
||||
prjgit: "oorg/foo.bar#master",
|
||||
prjgit: "oorg/foo.bar#",
|
||||
res: [3]string{"oorg", "foo.bar", "master"},
|
||||
},
|
||||
{
|
||||
name: "only branch defined",
|
||||
org: "org3",
|
||||
prjgit: "org3/_ObsPrj#mybranch",
|
||||
prjgit: "#mybranch",
|
||||
res: [3]string{"org3", "_ObsPrj", "mybranch"},
|
||||
},
|
||||
{
|
||||
name: "only org and branch defined",
|
||||
org: "org3",
|
||||
prjgit: "org1/_ObsPrj#mybranch",
|
||||
prjgit: "org1/#mybranch",
|
||||
res: [3]string{"org1", "_ObsPrj", "mybranch"},
|
||||
},
|
||||
{
|
||||
name: "empty org and repo",
|
||||
org: "org3",
|
||||
prjgit: "org3/repo#master",
|
||||
prjgit: "/repo#",
|
||||
res: [3]string{"org3", "repo", "master"},
|
||||
},
|
||||
}
|
||||
@@ -277,67 +188,3 @@ func TestProjectGitParser(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigPermissions(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
permission string
|
||||
user string
|
||||
config *common.AutogitConfig
|
||||
result bool
|
||||
}{
|
||||
{
|
||||
name: "NoPermissions",
|
||||
permission: common.Permission_ForceMerge,
|
||||
},
|
||||
{
|
||||
name: "NoPermissions",
|
||||
permission: common.Permission_Group,
|
||||
},
|
||||
{
|
||||
name: "Regular permission ForcePush",
|
||||
permission: common.Permission_ForceMerge,
|
||||
result: true,
|
||||
user: "user",
|
||||
config: &common.AutogitConfig{
|
||||
Permissions: []*common.Permissions{
|
||||
&common.Permissions{
|
||||
Permission: common.Permission_ForceMerge,
|
||||
Members: []string{"user"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "User is part of a group",
|
||||
permission: common.Permission_ForceMerge,
|
||||
result: true,
|
||||
user: "user",
|
||||
config: &common.AutogitConfig{
|
||||
Permissions: []*common.Permissions{
|
||||
&common.Permissions{
|
||||
Permission: common.Permission_ForceMerge,
|
||||
Members: []string{"group"},
|
||||
},
|
||||
},
|
||||
ReviewGroups: []*common.ReviewGroup{
|
||||
&common.ReviewGroup{
|
||||
Name: "group",
|
||||
Reviewers: []string{"some", "members", "including", "user"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if r := test.config.HasPermission(test.user, test.permission); r != test.result {
|
||||
t.Error("Expecting", test.result, "but got opposite")
|
||||
}
|
||||
if r := test.config.HasPermission(test.user+test.user, test.permission); r {
|
||||
t.Error("Expecting false for fake user, but got opposite")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1731,246 +1731,3 @@ const requestedReviewJSON = `{
|
||||
"commit_id": "",
|
||||
"review": null
|
||||
}`
|
||||
|
||||
const requestStatusJSON=`{
|
||||
"commit": {
|
||||
"id": "e637d86cbbdd438edbf60148e28f9d75a74d51b27b01f75610f247cd18394c8e",
|
||||
"message": "Update nodejs-common.changes\n",
|
||||
"url": "https://src.opensuse.org/autogits/nodejs-common/commit/e637d86cbbdd438edbf60148e28f9d75a74d51b27b01f75610f247cd18394c8e",
|
||||
"author": {
|
||||
"name": "Adam Majer",
|
||||
"email": "adamm@noreply.src.opensuse.org",
|
||||
"username": "adamm"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Adam Majer",
|
||||
"email": "adamm@noreply.src.opensuse.org",
|
||||
"username": "adamm"
|
||||
},
|
||||
"verification": null,
|
||||
"timestamp": "2025-09-16T12:41:02+02:00",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"nodejs-common.changes"
|
||||
]
|
||||
},
|
||||
"context": "test",
|
||||
"created_at": "2025-09-16T10:50:32Z",
|
||||
"description": "",
|
||||
"id": 21663,
|
||||
"repository": {
|
||||
"id": 90520,
|
||||
"owner": {
|
||||
"id": 983,
|
||||
"login": "autogits",
|
||||
"login_name": "",
|
||||
"source_id": 0,
|
||||
"full_name": "",
|
||||
"email": "",
|
||||
"avatar_url": "https://src.opensuse.org/avatars/80a61ef3a14c3c22f0b8b1885d1a75d4",
|
||||
"html_url": "https://src.opensuse.org/autogits",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "0001-01-01T00:00:00Z",
|
||||
"created": "2024-06-20T09:46:37+02:00",
|
||||
"restricted": false,
|
||||
"active": false,
|
||||
"prohibit_login": false,
|
||||
"location": "",
|
||||
"website": "",
|
||||
"description": "",
|
||||
"visibility": "public",
|
||||
"followers_count": 0,
|
||||
"following_count": 0,
|
||||
"starred_repos_count": 0,
|
||||
"username": "autogits"
|
||||
},
|
||||
"name": "nodejs-common",
|
||||
"full_name": "autogits/nodejs-common",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": true,
|
||||
"template": false,
|
||||
"parent": {
|
||||
"id": 62649,
|
||||
"owner": {
|
||||
"id": 64,
|
||||
"login": "pool",
|
||||
"login_name": "",
|
||||
"source_id": 0,
|
||||
"full_name": "",
|
||||
"email": "",
|
||||
"avatar_url": "https://src.opensuse.org/avatars/b10a8c0bede9eb4ea771b04db3149f28",
|
||||
"html_url": "https://src.opensuse.org/pool",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "0001-01-01T00:00:00Z",
|
||||
"created": "2023-03-01T14:41:17+01:00",
|
||||
"restricted": false,
|
||||
"active": false,
|
||||
"prohibit_login": false,
|
||||
"location": "",
|
||||
"website": "",
|
||||
"description": "",
|
||||
"visibility": "public",
|
||||
"followers_count": 2,
|
||||
"following_count": 0,
|
||||
"starred_repos_count": 0,
|
||||
"username": "pool"
|
||||
},
|
||||
"name": "nodejs-common",
|
||||
"full_name": "pool/nodejs-common",
|
||||
"description": "",
|
||||
"empty": false,
|
||||
"private": false,
|
||||
"fork": false,
|
||||
"template": false,
|
||||
"mirror": false,
|
||||
"size": 134,
|
||||
"language": "",
|
||||
"languages_url": "https://src.opensuse.org/api/v1/repos/pool/nodejs-common/languages",
|
||||
"html_url": "https://src.opensuse.org/pool/nodejs-common",
|
||||
"url": "https://src.opensuse.org/api/v1/repos/pool/nodejs-common",
|
||||
"link": "",
|
||||
"ssh_url": "gitea@src.opensuse.org:pool/nodejs-common.git",
|
||||
"clone_url": "https://src.opensuse.org/pool/nodejs-common.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 3,
|
||||
"watchers_count": 12,
|
||||
"open_issues_count": 0,
|
||||
"open_pr_counter": 0,
|
||||
"release_counter": 0,
|
||||
"default_branch": "factory",
|
||||
"archived": false,
|
||||
"created_at": "2024-06-17T17:08:45+02:00",
|
||||
"updated_at": "2025-08-21T21:58:31+02:00",
|
||||
"archived_at": "1970-01-01T01:00:00+01:00",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": true,
|
||||
"internal_tracker": {
|
||||
"enable_time_tracker": false,
|
||||
"allow_only_contributors_to_track_time": true,
|
||||
"enable_issue_dependencies": true
|
||||
},
|
||||
"has_wiki": false,
|
||||
"has_pull_requests": true,
|
||||
"has_projects": false,
|
||||
"projects_mode": "all",
|
||||
"has_releases": false,
|
||||
"has_packages": false,
|
||||
"has_actions": false,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"allow_fast_forward_only_merge": true,
|
||||
"allow_rebase_update": true,
|
||||
"allow_manual_merge": true,
|
||||
"autodetect_manual_merge": true,
|
||||
"default_delete_branch_after_merge": false,
|
||||
"default_merge_style": "merge",
|
||||
"default_allow_maintainer_edit": false,
|
||||
"avatar_url": "",
|
||||
"internal": false,
|
||||
"mirror_interval": "",
|
||||
"object_format_name": "sha256",
|
||||
"mirror_updated": "0001-01-01T00:00:00Z",
|
||||
"topics": [],
|
||||
"licenses": []
|
||||
},
|
||||
"mirror": false,
|
||||
"size": 143,
|
||||
"language": "",
|
||||
"languages_url": "https://src.opensuse.org/api/v1/repos/autogits/nodejs-common/languages",
|
||||
"html_url": "https://src.opensuse.org/autogits/nodejs-common",
|
||||
"url": "https://src.opensuse.org/api/v1/repos/autogits/nodejs-common",
|
||||
"link": "",
|
||||
"ssh_url": "gitea@src.opensuse.org:autogits/nodejs-common.git",
|
||||
"clone_url": "https://src.opensuse.org/autogits/nodejs-common.git",
|
||||
"original_url": "",
|
||||
"website": "",
|
||||
"stars_count": 0,
|
||||
"forks_count": 1,
|
||||
"watchers_count": 4,
|
||||
"open_issues_count": 0,
|
||||
"open_pr_counter": 1,
|
||||
"release_counter": 0,
|
||||
"default_branch": "factory",
|
||||
"archived": false,
|
||||
"created_at": "2024-07-01T13:29:03+02:00",
|
||||
"updated_at": "2025-09-16T12:41:03+02:00",
|
||||
"archived_at": "1970-01-01T01:00:00+01:00",
|
||||
"permissions": {
|
||||
"admin": true,
|
||||
"push": true,
|
||||
"pull": true
|
||||
},
|
||||
"has_issues": false,
|
||||
"has_wiki": false,
|
||||
"has_pull_requests": true,
|
||||
"has_projects": false,
|
||||
"projects_mode": "all",
|
||||
"has_releases": false,
|
||||
"has_packages": false,
|
||||
"has_actions": false,
|
||||
"ignore_whitespace_conflicts": false,
|
||||
"allow_merge_commits": true,
|
||||
"allow_rebase": true,
|
||||
"allow_rebase_explicit": true,
|
||||
"allow_squash_merge": true,
|
||||
"allow_fast_forward_only_merge": true,
|
||||
"allow_rebase_update": true,
|
||||
"allow_manual_merge": true,
|
||||
"autodetect_manual_merge": true,
|
||||
"default_delete_branch_after_merge": false,
|
||||
"default_merge_style": "merge",
|
||||
"default_allow_maintainer_edit": false,
|
||||
"avatar_url": "",
|
||||
"internal": false,
|
||||
"mirror_interval": "",
|
||||
"object_format_name": "sha256",
|
||||
"mirror_updated": "0001-01-01T00:00:00Z",
|
||||
"topics": [],
|
||||
"licenses": [
|
||||
"MIT"
|
||||
]
|
||||
},
|
||||
"sender": {
|
||||
"id": 129,
|
||||
"login": "adamm",
|
||||
"login_name": "",
|
||||
"source_id": 0,
|
||||
"full_name": "Adam Majer",
|
||||
"email": "adamm@noreply.src.opensuse.org",
|
||||
"avatar_url": "https://src.opensuse.org/avatars/3e8917bfbf04293f7c20c28cacd83dae2ba9b78a6c6a9a1bedf14c683d8a3763",
|
||||
"html_url": "https://src.opensuse.org/adamm",
|
||||
"language": "",
|
||||
"is_admin": false,
|
||||
"last_login": "0001-01-01T00:00:00Z",
|
||||
"created": "2023-07-21T16:43:48+02:00",
|
||||
"restricted": false,
|
||||
"active": false,
|
||||
"prohibit_login": false,
|
||||
"location": "",
|
||||
"website": "",
|
||||
"description": "",
|
||||
"visibility": "public",
|
||||
"followers_count": 1,
|
||||
"following_count": 0,
|
||||
"starred_repos_count": 0,
|
||||
"username": "adamm"
|
||||
},
|
||||
"sha": "e637d86cbbdd438edbf60148e28f9d75a74d51b27b01f75610f247cd18394c8e",
|
||||
"state": "pending",
|
||||
"target_url": "https://src.opensuse.org/",
|
||||
"updated_at": "2025-09-16T10:50:32Z"
|
||||
}`
|
||||
|
||||
@@ -40,11 +40,6 @@ type GitSubmoduleLister interface {
|
||||
GitSubmoduleCommitId(cwd, packageName, commitId string) (subCommitId string, valid bool)
|
||||
}
|
||||
|
||||
type GitDirectoryLister interface {
|
||||
GitDirectoryList(gitPath, commitId string) (dirlist map[string]string, err error)
|
||||
GitDirectoryContentList(gitPath, commitId string) (dirlist map[string]string, err error)
|
||||
}
|
||||
|
||||
type GitStatusLister interface {
|
||||
GitStatus(cwd string) ([]GitStatusData, error)
|
||||
}
|
||||
@@ -66,14 +61,12 @@ type Git interface {
|
||||
io.Closer
|
||||
|
||||
GitSubmoduleLister
|
||||
GitDirectoryLister
|
||||
GitStatusLister
|
||||
|
||||
GitExecWithOutputOrPanic(cwd string, params ...string) string
|
||||
GitExecOrPanic(cwd string, params ...string)
|
||||
GitExec(cwd string, params ...string) error
|
||||
GitExecWithOutput(cwd string, params ...string) (string, error)
|
||||
GitExecQuietOrPanic(cwd string, params ...string)
|
||||
|
||||
GitDiffLister
|
||||
}
|
||||
@@ -83,8 +76,7 @@ type GitHandlerImpl struct {
|
||||
GitCommiter string
|
||||
GitEmail string
|
||||
|
||||
lock *sync.Mutex
|
||||
quiet bool
|
||||
lock *sync.Mutex
|
||||
}
|
||||
|
||||
func (s *GitHandlerImpl) GetPath() string {
|
||||
@@ -219,7 +211,7 @@ func (e *GitHandlerImpl) GitClone(repo, branch, remoteUrl string) (string, error
|
||||
return "", fmt.Errorf("Cannot parse remote URL: %w", err)
|
||||
}
|
||||
remoteBranch := "HEAD"
|
||||
if len(branch) == 0 && remoteUrlComp != nil && remoteUrlComp.Commit != "HEAD" {
|
||||
if len(branch) == 0 && remoteUrlComp != nil {
|
||||
branch = remoteUrlComp.Commit
|
||||
remoteBranch = branch
|
||||
} else if len(branch) > 0 {
|
||||
@@ -248,55 +240,46 @@ func (e *GitHandlerImpl) GitClone(repo, branch, remoteUrl string) (string, error
|
||||
|
||||
// check if we have submodule to deinit
|
||||
if list, _ := e.GitSubmoduleList(repo, "HEAD"); len(list) > 0 {
|
||||
e.GitExecQuietOrPanic(repo, "submodule", "deinit", "--all", "--force")
|
||||
e.GitExecOrPanic(repo, "submodule", "deinit", "--all", "--force")
|
||||
}
|
||||
|
||||
e.GitExecOrPanic(repo, "fetch", "--prune", remoteName, remoteBranch)
|
||||
}
|
||||
/*
|
||||
refsBytes, err := os.ReadFile(path.Join(e.GitPath, repo, ".git/refs/remotes", remoteName, "HEAD"))
|
||||
if err != nil {
|
||||
LogError("Cannot read HEAD of remote", remoteName)
|
||||
return remoteName, fmt.Errorf("Cannot read HEAD of remote %s", remoteName)
|
||||
}
|
||||
|
||||
refs := string(refsBytes)
|
||||
if refs[0:5] != "ref: " {
|
||||
LogError("Unexpected format of remote HEAD ref:", refs)
|
||||
return remoteName, fmt.Errorf("Unexpected format of remote HEAD ref: %s", refs)
|
||||
}
|
||||
|
||||
if len(branch) == 0 || branch == "HEAD" {
|
||||
remoteRef = strings.TrimSpace(refs[5:])
|
||||
branch = remoteRef[strings.LastIndex(remoteRef, "/")+1:]
|
||||
LogDebug("remoteRef", remoteRef)
|
||||
LogDebug("branch", branch)
|
||||
}
|
||||
*/
|
||||
args := []string{"fetch", "--prune", remoteName}
|
||||
if len(branch) > 0 {
|
||||
args = append(args, branch)
|
||||
refsBytes, err := os.ReadFile(path.Join(e.GitPath, repo, ".git/refs/remotes", remoteName, "HEAD"))
|
||||
if err != nil {
|
||||
LogError("Cannot read HEAD of remote", remoteName)
|
||||
return remoteName, fmt.Errorf("Cannot read HEAD of remote %s", remoteName)
|
||||
}
|
||||
|
||||
refs := string(refsBytes)
|
||||
if refs[0:5] != "ref: " {
|
||||
LogError("Unexpected format of remote HEAD ref:", refs)
|
||||
return remoteName, fmt.Errorf("Unexpected format of remote HEAD ref: %s", refs)
|
||||
}
|
||||
|
||||
if len(branch) == 0 || branch == "HEAD" {
|
||||
remoteRef = strings.TrimSpace(refs[5:])
|
||||
branch = remoteRef[strings.LastIndex(remoteRef, "/")+1:]
|
||||
LogDebug("remoteRef", remoteRef)
|
||||
LogDebug("branch", branch)
|
||||
}
|
||||
|
||||
args := []string{"fetch", "--prune", remoteName, branch}
|
||||
if strings.TrimSpace(e.GitExecWithOutputOrPanic(repo, "rev-parse", "--is-shallow-repository")) == "true" {
|
||||
args = slices.Insert(args, 1, "--unshallow")
|
||||
}
|
||||
e.GitExecOrPanic(repo, args...)
|
||||
return remoteName, e.GitExec(repo, "checkout", "-f", "--track", "-B", branch, remoteRef)
|
||||
return remoteName, e.GitExec(repo, "checkout", "--track", "-B", branch, remoteRef)
|
||||
}
|
||||
|
||||
func (e *GitHandlerImpl) GitBranchHead(gitDir, branchName string) (string, error) {
|
||||
id, err := e.GitExecWithOutput(gitDir, "show-ref", "--heads", "--hash", branchName)
|
||||
id, err := e.GitExecWithOutput(gitDir, "show-ref", "--hash", "--verify", "refs/heads/"+branchName)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Can't find default branch: %s", branchName)
|
||||
}
|
||||
|
||||
id = strings.TrimSpace(SplitLines(id)[0])
|
||||
if len(id) < 10 {
|
||||
return "", fmt.Errorf("Can't find branch: %s", branchName)
|
||||
}
|
||||
|
||||
return id, nil
|
||||
return strings.TrimSpace(id), nil
|
||||
}
|
||||
|
||||
func (e *GitHandlerImpl) GitRemoteHead(gitDir, remote, branchName string) (string, error) {
|
||||
@@ -355,10 +338,6 @@ var ExtraGitParams []string
|
||||
|
||||
func (e *GitHandlerImpl) GitExecWithOutput(cwd string, params ...string) (string, error) {
|
||||
cmd := exec.Command("/usr/bin/git", params...)
|
||||
var identityFile string
|
||||
if i := os.Getenv("AUTOGITS_IDENTITY_FILE"); len(i) > 0 {
|
||||
identityFile = " -i " + i
|
||||
}
|
||||
cmd.Env = []string{
|
||||
"GIT_CEILING_DIRECTORIES=" + e.GitPath,
|
||||
"GIT_CONFIG_GLOBAL=/dev/null",
|
||||
@@ -366,8 +345,7 @@ func (e *GitHandlerImpl) GitExecWithOutput(cwd string, params ...string) (string
|
||||
"GIT_COMMITTER_NAME=" + e.GitCommiter,
|
||||
"EMAIL=not@exist@src.opensuse.org",
|
||||
"GIT_LFS_SKIP_SMUDGE=1",
|
||||
"GIT_LFS_SKIP_PUSH=1",
|
||||
"GIT_SSH_COMMAND=/usr/bin/ssh -o StrictHostKeyChecking=yes" + identityFile,
|
||||
"GIT_SSH_COMMAND=/usr/bin/ssh -o StrictHostKeyChecking=yes",
|
||||
}
|
||||
if len(ExtraGitParams) > 0 {
|
||||
cmd.Env = append(cmd.Env, ExtraGitParams...)
|
||||
@@ -377,9 +355,7 @@ func (e *GitHandlerImpl) GitExecWithOutput(cwd string, params ...string) (string
|
||||
|
||||
LogDebug("git execute @", cwd, ":", cmd.Args)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if !e.quiet {
|
||||
LogDebug(string(out))
|
||||
}
|
||||
LogDebug(string(out))
|
||||
if err != nil {
|
||||
LogError("git", cmd.Args, " error:", err)
|
||||
return "", fmt.Errorf("error executing: git %#v \n%s\n err: %w", cmd.Args, out, err)
|
||||
@@ -388,13 +364,6 @@ func (e *GitHandlerImpl) GitExecWithOutput(cwd string, params ...string) (string
|
||||
return string(out), nil
|
||||
}
|
||||
|
||||
func (e *GitHandlerImpl) GitExecQuietOrPanic(cwd string, params ...string) {
|
||||
e.quiet = true
|
||||
e.GitExecOrPanic(cwd, params...)
|
||||
e.quiet = false
|
||||
return
|
||||
}
|
||||
|
||||
type ChanIO struct {
|
||||
ch chan byte
|
||||
}
|
||||
@@ -792,156 +761,6 @@ func (e *GitHandlerImpl) GitCatFile(cwd, commitId, filename string) (data []byte
|
||||
return
|
||||
}
|
||||
|
||||
// return (directory) -> (hash) map for all submodules
|
||||
func (e *GitHandlerImpl) GitDirectoryList(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 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.isTree() {
|
||||
directoryList[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 (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
|
||||
func (e *GitHandlerImpl) GitSubmoduleList(gitPath, commitId string) (submoduleList map[string]string, err error) {
|
||||
var done sync.Mutex
|
||||
|
||||
@@ -24,14 +24,12 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGitClone(t *testing.T) {
|
||||
SetTestLogger(t)
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@@ -95,59 +93,7 @@ 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) {
|
||||
SetTestLogger(t)
|
||||
t.Run("tree message with size 56", func(t *testing.T) {
|
||||
const hdr = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f98 tree 56\x00"
|
||||
|
||||
@@ -226,7 +172,6 @@ func TestGitMsgParsing(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGitCommitParsing(t *testing.T) {
|
||||
SetTestLogger(t)
|
||||
t.Run("parse valid commit message", func(t *testing.T) {
|
||||
const commitData = "f40888ea4515fe2e8eea617a16f5f50a45f652d894de3ad181d58de3aafb8f99 commit 253\000" +
|
||||
`tree e20033df9f18780756ba4a96dbc7eb1a626253961039cb674156f266ba7a4e53
|
||||
@@ -437,7 +382,6 @@ dummy change, don't merge
|
||||
}
|
||||
|
||||
func TestCommitTreeParsing(t *testing.T) {
|
||||
SetTestLogger(t)
|
||||
gitDir := t.TempDir()
|
||||
testDir, _ := os.Getwd()
|
||||
var commitId string
|
||||
@@ -448,7 +392,6 @@ func TestCommitTreeParsing(t *testing.T) {
|
||||
commitId = commitId + strings.TrimSpace(string(data))
|
||||
return len(data), nil
|
||||
})
|
||||
cmd.Stderr = os.Stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
@@ -546,7 +489,6 @@ func TestCommitTreeParsing(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGitStatusParse(t *testing.T) {
|
||||
SetTestLogger(t)
|
||||
testData := []struct {
|
||||
name string
|
||||
data []byte
|
||||
@@ -653,67 +595,3 @@ 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 of the user to whom a badge is to be added
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -92,8 +92,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
AdminCronList(params *AdminCronListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AdminCronListOK, error)
|
||||
@@ -134,16 +132,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -381,45 +369,6 @@ func (a *Client) AdminCreateRepo(params *AdminCreateRepoParams, authInfo runtime
|
||||
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
|
||||
*/
|
||||
@@ -1200,201 +1149,6 @@ func (a *Client) AdminUnadoptedList(params *AdminUnadoptedListParams, authInfo r
|
||||
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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
|
||||
@@ -68,7 +68,7 @@ type AdminCreateOrgParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user who will own the created organization
|
||||
username of the user that will own the created organization
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ type AdminCreatePublicKeyParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user who is to receive a public key
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ type AdminCreateRepoParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user who will own the created repository
|
||||
username of the user. This user will own the created repository
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
// 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 of the user whose badge is to be deleted
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ type AdminDeleteUserParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to delete
|
||||
username of user to delete
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ type AdminDeleteUserPublicKeyParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose public key is to be deleted
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ type AdminEditUserParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose data is to be edited
|
||||
username of user to edit
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -74,14 +74,6 @@ type AdminListHooksParams struct {
|
||||
*/
|
||||
Page *int64
|
||||
|
||||
/* Type.
|
||||
|
||||
system, default or both kinds of webhooks
|
||||
|
||||
Default: "system"
|
||||
*/
|
||||
Type *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
@@ -99,18 +91,7 @@ func (o *AdminListHooksParams) WithDefaults() *AdminListHooksParams {
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *AdminListHooksParams) SetDefaults() {
|
||||
var (
|
||||
typeVarDefault = string("system")
|
||||
)
|
||||
|
||||
val := AdminListHooksParams{
|
||||
Type: &typeVarDefault,
|
||||
}
|
||||
|
||||
val.timeout = o.timeout
|
||||
val.Context = o.Context
|
||||
val.HTTPClient = o.HTTPClient
|
||||
*o = val
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the admin list hooks params
|
||||
@@ -168,17 +149,6 @@ func (o *AdminListHooksParams) SetPage(page *int64) {
|
||||
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
|
||||
func (o *AdminListHooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
@@ -221,23 +191,6 @@ 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 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ type AdminListUserBadgesParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose badges are to be listed
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ type AdminRenameUserParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
current username of the user
|
||||
existing username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ type AdminSearchUsersParams struct {
|
||||
|
||||
/* LoginName.
|
||||
|
||||
identifier of the user, provided by the external authenticator
|
||||
user's login name to search for
|
||||
*/
|
||||
LoginName *string
|
||||
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,368 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
// 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.
|
||||
|
||||
username of the user to subscribe the issue to
|
||||
user to subscribe
|
||||
*/
|
||||
User string
|
||||
|
||||
|
||||
@@ -209,8 +209,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
IssuePostIssueReaction(params *IssuePostIssueReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IssuePostIssueReactionOK, *IssuePostIssueReactionCreated, error)
|
||||
@@ -235,8 +233,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
PinIssue(params *PinIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PinIssueNoContent, error)
|
||||
@@ -2279,45 +2275,6 @@ func (a *Client) IssueListLabels(params *IssueListLabelsParams, authInfo runtime
|
||||
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
|
||||
*/
|
||||
@@ -2788,45 +2745,6 @@ func (a *Client) IssueTrackedTimes(params *IssueTrackedTimesParams, authInfo run
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -42,12 +42,6 @@ func (o *IssueCreateIssueAttachmentReader) ReadResponse(response runtime.ClientR
|
||||
return nil, err
|
||||
}
|
||||
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:
|
||||
result := NewIssueCreateIssueAttachmentUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
@@ -279,78 +273,6 @@ func (o *IssueCreateIssueAttachmentNotFound) readResponse(response runtime.Clien
|
||||
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
|
||||
func NewIssueCreateIssueAttachmentUnprocessableEntity() *IssueCreateIssueAttachmentUnprocessableEntity {
|
||||
return &IssueCreateIssueAttachmentUnprocessableEntity{}
|
||||
|
||||
@@ -48,12 +48,6 @@ func (o *IssueCreateIssueCommentAttachmentReader) ReadResponse(response runtime.
|
||||
return nil, err
|
||||
}
|
||||
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:
|
||||
result := NewIssueCreateIssueCommentAttachmentUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
@@ -357,78 +351,6 @@ func (o *IssueCreateIssueCommentAttachmentNotFound) readResponse(response runtim
|
||||
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
|
||||
func NewIssueCreateIssueCommentAttachmentUnprocessableEntity() *IssueCreateIssueCommentAttachmentUnprocessableEntity {
|
||||
return &IssueCreateIssueCommentAttachmentUnprocessableEntity{}
|
||||
|
||||
@@ -225,7 +225,7 @@ func NewIssueDeleteStopWatchConflict() *IssueDeleteStopWatchConflict {
|
||||
/*
|
||||
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 {
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ type IssueDeleteSubscriptionParams struct {
|
||||
|
||||
/* User.
|
||||
|
||||
username of the user to unsubscribe from an issue
|
||||
user witch unsubscribe
|
||||
*/
|
||||
User string
|
||||
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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.
|
||||
|
||||
Cannot stop a non-existent stopwatch
|
||||
Cannot stop a non existent stopwatch
|
||||
*/
|
||||
type IssueStopStopWatchConflict struct {
|
||||
}
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
// 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,8 +115,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
ListGitignoresTemplates(params *ListGitignoresTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListGitignoresTemplatesOK, error)
|
||||
@@ -329,45 +327,6 @@ func (a *Client) GetSigningKey(params *GetSigningKeyParams, authInfo runtime.Cli
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -26,20 +26,20 @@ func (o *CreateOrgVariableReader) ReadResponse(response runtime.ClientResponse,
|
||||
return nil, err
|
||||
}
|
||||
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:
|
||||
result := NewCreateOrgVariableBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 409:
|
||||
result := NewCreateOrgVariableConflict()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewCreateOrgVariableInternalServerError()
|
||||
case 404:
|
||||
result := NewCreateOrgVariableNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func NewCreateOrgVariableCreated() *CreateOrgVariableCreated {
|
||||
/*
|
||||
CreateOrgVariableCreated describes a response with status code 201, with default header values.
|
||||
|
||||
successfully created the org-level variable
|
||||
response when creating an org-level variable
|
||||
*/
|
||||
type CreateOrgVariableCreated struct {
|
||||
}
|
||||
@@ -105,6 +105,62 @@ func (o *CreateOrgVariableCreated) readResponse(response runtime.ClientResponse,
|
||||
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
|
||||
func NewCreateOrgVariableBadRequest() *CreateOrgVariableBadRequest {
|
||||
return &CreateOrgVariableBadRequest{}
|
||||
@@ -177,130 +233,58 @@ func (o *CreateOrgVariableBadRequest) readResponse(response runtime.ClientRespon
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewCreateOrgVariableConflict creates a CreateOrgVariableConflict with default headers values
|
||||
func NewCreateOrgVariableConflict() *CreateOrgVariableConflict {
|
||||
return &CreateOrgVariableConflict{}
|
||||
// NewCreateOrgVariableNotFound creates a CreateOrgVariableNotFound with default headers values
|
||||
func NewCreateOrgVariableNotFound() *CreateOrgVariableNotFound {
|
||||
return &CreateOrgVariableNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
CreateOrgVariableConflict describes a response with status code 409, with default header values.
|
||||
CreateOrgVariableNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
variable name already exists.
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type CreateOrgVariableConflict struct {
|
||||
type CreateOrgVariableNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this create org variable conflict response has a 2xx status code
|
||||
func (o *CreateOrgVariableConflict) IsSuccess() bool {
|
||||
// IsSuccess returns true when this create org variable not found response has a 2xx status code
|
||||
func (o *CreateOrgVariableNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this create org variable conflict response has a 3xx status code
|
||||
func (o *CreateOrgVariableConflict) IsRedirect() bool {
|
||||
// IsRedirect returns true when this create org variable not found response has a 3xx status code
|
||||
func (o *CreateOrgVariableNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this create org variable conflict response has a 4xx status code
|
||||
func (o *CreateOrgVariableConflict) IsClientError() bool {
|
||||
// IsClientError returns true when this create org variable not found response has a 4xx status code
|
||||
func (o *CreateOrgVariableNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this create org variable conflict response has a 5xx status code
|
||||
func (o *CreateOrgVariableConflict) IsServerError() bool {
|
||||
// IsServerError returns true when this create org variable not found response has a 5xx status code
|
||||
func (o *CreateOrgVariableNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this create org variable conflict response a status code equal to that given
|
||||
func (o *CreateOrgVariableConflict) IsCode(code int) bool {
|
||||
return code == 409
|
||||
// IsCode returns true when this create org variable not found response a status code equal to that given
|
||||
func (o *CreateOrgVariableNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the create org variable conflict response
|
||||
func (o *CreateOrgVariableConflict) Code() int {
|
||||
return 409
|
||||
// Code gets the status code for the create org variable not found response
|
||||
func (o *CreateOrgVariableNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *CreateOrgVariableConflict) Error() string {
|
||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableConflict", 409)
|
||||
func (o *CreateOrgVariableNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *CreateOrgVariableConflict) String() string {
|
||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableConflict", 409)
|
||||
func (o *CreateOrgVariableNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /orgs/{org}/actions/variables/{variablename}][%d] createOrgVariableNotFound", 404)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
func (o *CreateOrgVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,254 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,390 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,246 +0,0 @@
|
||||
// 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 of the user to add to a team
|
||||
username of the user to add
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrgConcealMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose membership is to be concealed
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
// 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 of the user to remove from the organization
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrgGetUserPermissionsParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose permissions are to be obtained
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrgIsMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to check for an organization membership
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrgIsPublicMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to check for a public organization membership
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ type OrgListTeamMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose data is to be listed
|
||||
username of the member to list
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ type OrgListUserOrgsParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose organizations are to be listed
|
||||
username of user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrgPublicizeMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user whose membership is to be publicized
|
||||
username of the user
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ type OrgRemoveTeamMemberParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to remove from a team
|
||||
username of the user to remove
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ type OrganizationBlockUserParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to block
|
||||
user to block
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrganizationCheckUserBlockParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to check
|
||||
user to check
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -104,26 +104,16 @@ type ClientService interface {
|
||||
|
||||
CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgRepoDeprecatedCreated, error)
|
||||
|
||||
CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, error)
|
||||
|
||||
DeleteOrgRunner(params *DeleteOrgRunnerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgRunnerNoContent, error)
|
||||
CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error)
|
||||
|
||||
DeleteOrgSecret(params *DeleteOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrgSecretNoContent, 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)
|
||||
|
||||
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)
|
||||
|
||||
OrgAddTeamRepository(params *OrgAddTeamRepositoryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgAddTeamRepositoryNoContent, error)
|
||||
@@ -136,8 +126,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
OrgDelete(params *OrgDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*OrgDeleteNoContent, error)
|
||||
@@ -224,8 +212,6 @@ type ClientService interface {
|
||||
|
||||
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)
|
||||
|
||||
UpdateOrgSecret(params *UpdateOrgSecretParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOrgSecretCreated, *UpdateOrgSecretNoContent, error)
|
||||
@@ -316,7 +302,7 @@ func (a *Client) CreateOrgRepoDeprecated(params *CreateOrgRepoDeprecatedParams,
|
||||
/*
|
||||
CreateOrgVariable creates an org level variable
|
||||
*/
|
||||
func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, error) {
|
||||
func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrgVariableCreated, *CreateOrgVariableNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewCreateOrgVariableParams()
|
||||
@@ -340,54 +326,16 @@ func (a *Client) CreateOrgVariable(params *CreateOrgVariableParams, authInfo run
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, nil, err
|
||||
}
|
||||
success, ok := result.(*CreateOrgVariableCreated)
|
||||
if ok {
|
||||
return success, nil
|
||||
switch value := result.(type) {
|
||||
case *CreateOrgVariableCreated:
|
||||
return value, nil, 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
|
||||
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)
|
||||
msg := fmt.Sprintf("unexpected success response for organization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
@@ -472,84 +420,6 @@ func (a *Client) DeleteOrgVariable(params *DeleteOrgVariableParams, authInfo run
|
||||
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
|
||||
*/
|
||||
@@ -628,84 +498,6 @@ func (a *Client) GetOrgVariablesList(params *GetOrgVariablesListParams, authInfo
|
||||
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
|
||||
*/
|
||||
@@ -940,45 +732,6 @@ func (a *Client) OrgCreateLabel(params *OrgCreateLabelParams, authInfo runtime.C
|
||||
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
|
||||
*/
|
||||
@@ -2658,45 +2411,6 @@ func (a *Client) OrganizationUnblockUser(params *OrganizationUnblockUserParams,
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -69,7 +69,7 @@ type OrganizationUnblockUserParams struct {
|
||||
|
||||
/* Username.
|
||||
|
||||
username of the user to unblock
|
||||
user to unblock
|
||||
*/
|
||||
Username string
|
||||
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,244 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,264 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
// 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,20 +102,12 @@ func WithAcceptTextHTML(r *runtime.ClientOperation) {
|
||||
type ClientService interface {
|
||||
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)
|
||||
|
||||
LinkPackage(params *LinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*LinkPackageCreated, 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)
|
||||
|
||||
UnlinkPackage(params *UnlinkPackageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnlinkPackageCreated, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
@@ -158,45 +150,6 @@ func (a *Client) DeletePackage(params *DeletePackageParams, authInfo runtime.Cli
|
||||
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
|
||||
*/
|
||||
@@ -236,45 +189,6 @@ func (a *Client) GetPackage(params *GetPackageParams, authInfo runtime.ClientAut
|
||||
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
|
||||
*/
|
||||
@@ -314,45 +228,6 @@ func (a *Client) ListPackageFiles(params *ListPackageFilesParams, authInfo runti
|
||||
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
|
||||
*/
|
||||
@@ -392,45 +267,6 @@ func (a *Client) ListPackages(params *ListPackagesParams, authInfo runtime.Clien
|
||||
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
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,384 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,384 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,446 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user