common: update gitea APIs
This commit is contained in:
@@ -3,11 +3,13 @@ all: build
|
||||
api.json::
|
||||
curl -o api.json https://src.opensuse.org/swagger.v1.json
|
||||
|
||||
gitea-generated/client/gitea_api_client.go:: api.json
|
||||
gitea-generated/client/gitea_api_client.go: api.json
|
||||
[ -d gitea-generated ] || mkdir gitea-generated
|
||||
podman run --rm -v $$(pwd):/api ghcr.io/go-swagger/go-swagger generate client -f /api/api.json -t /api/gitea-generated
|
||||
podman run --rm -v $$(pwd)/..:/api ghcr.io/go-swagger/go-swagger generate client -f /api/common/api.json -t /api/common/gitea-generated
|
||||
|
||||
api: gitea-generated/client/gitea_api_client.go mock_gitea_utils.go
|
||||
swagger: gitea-generated/client/gitea_api_client.go
|
||||
|
||||
api:
|
||||
go generate
|
||||
|
||||
build: api
|
||||
|
1150
common/api.json
1150
common/api.json
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,12 @@ func (o *IssueEditIssueAttachmentReader) ReadResponse(response runtime.ClientRes
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewIssueEditIssueAttachmentUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 423:
|
||||
result := NewIssueEditIssueAttachmentLocked()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
@@ -189,6 +195,78 @@ func (o *IssueEditIssueAttachmentNotFound) readResponse(response runtime.ClientR
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewIssueEditIssueAttachmentUnprocessableEntity creates a IssueEditIssueAttachmentUnprocessableEntity with default headers values
|
||||
func NewIssueEditIssueAttachmentUnprocessableEntity() *IssueEditIssueAttachmentUnprocessableEntity {
|
||||
return &IssueEditIssueAttachmentUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
IssueEditIssueAttachmentUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type IssueEditIssueAttachmentUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this issue edit issue attachment unprocessable entity response has a 2xx status code
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this issue edit issue attachment unprocessable entity response has a 3xx status code
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this issue edit issue attachment unprocessable entity response has a 4xx status code
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this issue edit issue attachment unprocessable entity response has a 5xx status code
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this issue edit issue attachment unprocessable entity response a status code equal to that given
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the issue edit issue attachment unprocessable entity response
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueEditIssueAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueEditIssueAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueAttachmentUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewIssueEditIssueAttachmentLocked creates a IssueEditIssueAttachmentLocked with default headers values
|
||||
func NewIssueEditIssueAttachmentLocked() *IssueEditIssueAttachmentLocked {
|
||||
return &IssueEditIssueAttachmentLocked{}
|
||||
|
@@ -36,6 +36,12 @@ func (o *IssueEditIssueCommentAttachmentReader) ReadResponse(response runtime.Cl
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewIssueEditIssueCommentAttachmentUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 423:
|
||||
result := NewIssueEditIssueCommentAttachmentLocked()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
@@ -189,6 +195,78 @@ func (o *IssueEditIssueCommentAttachmentNotFound) readResponse(response runtime.
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewIssueEditIssueCommentAttachmentUnprocessableEntity creates a IssueEditIssueCommentAttachmentUnprocessableEntity with default headers values
|
||||
func NewIssueEditIssueCommentAttachmentUnprocessableEntity() *IssueEditIssueCommentAttachmentUnprocessableEntity {
|
||||
return &IssueEditIssueCommentAttachmentUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
IssueEditIssueCommentAttachmentUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type IssueEditIssueCommentAttachmentUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this issue edit issue comment attachment unprocessable entity response has a 2xx status code
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this issue edit issue comment attachment unprocessable entity response has a 3xx status code
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this issue edit issue comment attachment unprocessable entity response has a 4xx status code
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this issue edit issue comment attachment unprocessable entity response has a 5xx status code
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this issue edit issue comment attachment unprocessable entity response a status code equal to that given
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the issue edit issue comment attachment unprocessable entity response
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}][%d] issueEditIssueCommentAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}][%d] issueEditIssueCommentAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueEditIssueCommentAttachmentUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewIssueEditIssueCommentAttachmentLocked creates a IssueEditIssueCommentAttachmentLocked with default headers values
|
||||
func NewIssueEditIssueCommentAttachmentLocked() *IssueEditIssueCommentAttachmentLocked {
|
||||
return &IssueEditIssueCommentAttachmentLocked{}
|
||||
|
@@ -64,13 +64,13 @@ type IssueSearchIssuesParams struct {
|
||||
|
||||
/* Assigned.
|
||||
|
||||
filter (issues / pulls) assigned to you, default is false
|
||||
Filter issues or pulls assigned to the authenticated user
|
||||
*/
|
||||
Assigned *bool
|
||||
|
||||
/* Before.
|
||||
|
||||
Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
|
||||
Only show issues updated before the given time (RFC 3339 format)
|
||||
|
||||
Format: date-time
|
||||
*/
|
||||
@@ -78,49 +78,51 @@ type IssueSearchIssuesParams struct {
|
||||
|
||||
/* Created.
|
||||
|
||||
filter (issues / pulls) created by you, default is false
|
||||
Filter issues or pulls created by the authenticated user
|
||||
*/
|
||||
Created *bool
|
||||
|
||||
/* Labels.
|
||||
|
||||
comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded
|
||||
Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded.
|
||||
*/
|
||||
Labels *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
page size of results
|
||||
Number of items per page
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Mentioned.
|
||||
|
||||
filter (issues / pulls) mentioning you, default is false
|
||||
Filter issues or pulls mentioning the authenticated user
|
||||
*/
|
||||
Mentioned *bool
|
||||
|
||||
/* Milestones.
|
||||
|
||||
comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded
|
||||
Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded.
|
||||
*/
|
||||
Milestones *string
|
||||
|
||||
/* Owner.
|
||||
|
||||
filter by owner
|
||||
Filter by repository owner
|
||||
*/
|
||||
Owner *string
|
||||
|
||||
/* Page.
|
||||
|
||||
page number of results to return (1-based)
|
||||
Page number of results to return (1-based)
|
||||
|
||||
Default: 1
|
||||
*/
|
||||
Page *int64
|
||||
|
||||
/* PriorityRepoID.
|
||||
|
||||
repository to prioritize in the results
|
||||
Repository ID to prioritize in the results
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
@@ -128,25 +130,25 @@ type IssueSearchIssuesParams struct {
|
||||
|
||||
/* Q.
|
||||
|
||||
search string
|
||||
Search string
|
||||
*/
|
||||
Q *string
|
||||
|
||||
/* ReviewRequested.
|
||||
|
||||
filter pulls requesting your review, default is false
|
||||
Filter pull requests where the authenticated user's review was requested
|
||||
*/
|
||||
ReviewRequested *bool
|
||||
|
||||
/* Reviewed.
|
||||
|
||||
filter pulls reviewed by you, default is false
|
||||
Filter pull requests reviewed by the authenticated user
|
||||
*/
|
||||
Reviewed *bool
|
||||
|
||||
/* Since.
|
||||
|
||||
Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
|
||||
Only show issues updated after the given time (RFC 3339 format)
|
||||
|
||||
Format: date-time
|
||||
*/
|
||||
@@ -154,19 +156,21 @@ type IssueSearchIssuesParams struct {
|
||||
|
||||
/* State.
|
||||
|
||||
whether issue is open or closed
|
||||
State of the issue
|
||||
|
||||
Default: "open"
|
||||
*/
|
||||
State *string
|
||||
|
||||
/* Team.
|
||||
|
||||
filter by team (requires organization owner parameter to be provided)
|
||||
Filter by team (requires organization owner parameter)
|
||||
*/
|
||||
Team *string
|
||||
|
||||
/* Type.
|
||||
|
||||
filter by type (issues / pulls) if set
|
||||
Filter by issue type
|
||||
*/
|
||||
Type *string
|
||||
|
||||
@@ -187,7 +191,36 @@ func (o *IssueSearchIssuesParams) WithDefaults() *IssueSearchIssuesParams {
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *IssueSearchIssuesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
var (
|
||||
assignedDefault = bool(false)
|
||||
|
||||
createdDefault = bool(false)
|
||||
|
||||
mentionedDefault = bool(false)
|
||||
|
||||
pageDefault = int64(1)
|
||||
|
||||
reviewRequestedDefault = bool(false)
|
||||
|
||||
reviewedDefault = bool(false)
|
||||
|
||||
stateDefault = string("open")
|
||||
)
|
||||
|
||||
val := IssueSearchIssuesParams{
|
||||
Assigned: &assignedDefault,
|
||||
Created: &createdDefault,
|
||||
Mentioned: &mentionedDefault,
|
||||
Page: &pageDefault,
|
||||
ReviewRequested: &reviewRequestedDefault,
|
||||
Reviewed: &reviewedDefault,
|
||||
State: &stateDefault,
|
||||
}
|
||||
|
||||
val.timeout = o.timeout
|
||||
val.Context = o.Context
|
||||
val.HTTPClient = o.HTTPClient
|
||||
*o = val
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the issue search issues params
|
||||
|
@@ -30,6 +30,18 @@ func (o *IssueSearchIssuesReader) ReadResponse(response runtime.ClientResponse,
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 400:
|
||||
result := NewIssueSearchIssuesBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewIssueSearchIssuesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/issues/search] issueSearchIssues", response, response.Code())
|
||||
}
|
||||
@@ -102,3 +114,147 @@ func (o *IssueSearchIssuesOK) readResponse(response runtime.ClientResponse, cons
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewIssueSearchIssuesBadRequest creates a IssueSearchIssuesBadRequest with default headers values
|
||||
func NewIssueSearchIssuesBadRequest() *IssueSearchIssuesBadRequest {
|
||||
return &IssueSearchIssuesBadRequest{}
|
||||
}
|
||||
|
||||
/*
|
||||
IssueSearchIssuesBadRequest describes a response with status code 400, with default header values.
|
||||
|
||||
APIError is error format response
|
||||
*/
|
||||
type IssueSearchIssuesBadRequest struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this issue search issues bad request response has a 2xx status code
|
||||
func (o *IssueSearchIssuesBadRequest) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this issue search issues bad request response has a 3xx status code
|
||||
func (o *IssueSearchIssuesBadRequest) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this issue search issues bad request response has a 4xx status code
|
||||
func (o *IssueSearchIssuesBadRequest) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this issue search issues bad request response has a 5xx status code
|
||||
func (o *IssueSearchIssuesBadRequest) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this issue search issues bad request response a status code equal to that given
|
||||
func (o *IssueSearchIssuesBadRequest) IsCode(code int) bool {
|
||||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the issue search issues bad request response
|
||||
func (o *IssueSearchIssuesBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesBadRequest) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/issues/search][%d] issueSearchIssuesBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesBadRequest) String() string {
|
||||
return fmt.Sprintf("[GET /repos/issues/search][%d] issueSearchIssuesBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesBadRequest) 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
|
||||
}
|
||||
|
||||
// NewIssueSearchIssuesUnprocessableEntity creates a IssueSearchIssuesUnprocessableEntity with default headers values
|
||||
func NewIssueSearchIssuesUnprocessableEntity() *IssueSearchIssuesUnprocessableEntity {
|
||||
return &IssueSearchIssuesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
IssueSearchIssuesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type IssueSearchIssuesUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this issue search issues unprocessable entity response has a 2xx status code
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this issue search issues unprocessable entity response has a 3xx status code
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this issue search issues unprocessable entity response has a 4xx status code
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this issue search issues unprocessable entity response has a 5xx status code
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this issue search issues unprocessable entity response a status code equal to that given
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the issue search issues unprocessable entity response
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/issues/search][%d] issueSearchIssuesUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /repos/issues/search][%d] issueSearchIssuesUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *IssueSearchIssuesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@@ -0,0 +1,242 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewListActionTasksParams creates a new ListActionTasksParams 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 NewListActionTasksParams() *ListActionTasksParams {
|
||||
return &ListActionTasksParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewListActionTasksParamsWithTimeout creates a new ListActionTasksParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewListActionTasksParamsWithTimeout(timeout time.Duration) *ListActionTasksParams {
|
||||
return &ListActionTasksParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewListActionTasksParamsWithContext creates a new ListActionTasksParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewListActionTasksParamsWithContext(ctx context.Context) *ListActionTasksParams {
|
||||
return &ListActionTasksParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewListActionTasksParamsWithHTTPClient creates a new ListActionTasksParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewListActionTasksParamsWithHTTPClient(client *http.Client) *ListActionTasksParams {
|
||||
return &ListActionTasksParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the list action tasks operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type ListActionTasksParams struct {
|
||||
|
||||
/* Limit.
|
||||
|
||||
page size of results, default maximum page size is 50
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Owner.
|
||||
|
||||
owner of the repo
|
||||
*/
|
||||
Owner string
|
||||
|
||||
/* Page.
|
||||
|
||||
page number of results to return (1-based)
|
||||
*/
|
||||
Page *int64
|
||||
|
||||
/* Repo.
|
||||
|
||||
name of the repo
|
||||
*/
|
||||
Repo string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the list action tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *ListActionTasksParams) WithDefaults() *ListActionTasksParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the list action tasks params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *ListActionTasksParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithTimeout(timeout time.Duration) *ListActionTasksParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithContext(ctx context.Context) *ListActionTasksParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithHTTPClient(client *http.Client) *ListActionTasksParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithLimit(limit *int64) *ListActionTasksParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithOwner(owner string) *ListActionTasksParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithPage adds the page to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithPage(page *int64) *ListActionTasksParams {
|
||||
o.SetPage(page)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPage adds the page to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetPage(page *int64) {
|
||||
o.Page = page
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the list action tasks params
|
||||
func (o *ListActionTasksParams) WithRepo(repo string) *ListActionTasksParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the list action tasks params
|
||||
func (o *ListActionTasksParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *ListActionTasksParams) 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 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 repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,464 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// ListActionTasksReader is a Reader for the ListActionTasks structure.
|
||||
type ListActionTasksReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *ListActionTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewListActionTasksOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 400:
|
||||
result := NewListActionTasksBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewListActionTasksForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewListActionTasksNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 409:
|
||||
result := NewListActionTasksConflict()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewListActionTasksUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/actions/tasks] ListActionTasks", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewListActionTasksOK creates a ListActionTasksOK with default headers values
|
||||
func NewListActionTasksOK() *ListActionTasksOK {
|
||||
return &ListActionTasksOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksOK describes a response with status code 200, with default header values.
|
||||
|
||||
TasksList
|
||||
*/
|
||||
type ListActionTasksOK struct {
|
||||
Payload *models.ActionTaskResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks o k response has a 2xx status code
|
||||
func (o *ListActionTasksOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks o k response has a 3xx status code
|
||||
func (o *ListActionTasksOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks o k response has a 4xx status code
|
||||
func (o *ListActionTasksOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks o k response has a 5xx status code
|
||||
func (o *ListActionTasksOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks o k response a status code equal to that given
|
||||
func (o *ListActionTasksOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks o k response
|
||||
func (o *ListActionTasksOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *ListActionTasksOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksOK) GetPayload() *models.ActionTaskResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *ListActionTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.ActionTaskResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewListActionTasksBadRequest creates a ListActionTasksBadRequest with default headers values
|
||||
func NewListActionTasksBadRequest() *ListActionTasksBadRequest {
|
||||
return &ListActionTasksBadRequest{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksBadRequest describes a response with status code 400, with default header values.
|
||||
|
||||
APIError is error format response
|
||||
*/
|
||||
type ListActionTasksBadRequest struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks bad request response has a 2xx status code
|
||||
func (o *ListActionTasksBadRequest) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks bad request response has a 3xx status code
|
||||
func (o *ListActionTasksBadRequest) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks bad request response has a 4xx status code
|
||||
func (o *ListActionTasksBadRequest) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks bad request response has a 5xx status code
|
||||
func (o *ListActionTasksBadRequest) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks bad request response a status code equal to that given
|
||||
func (o *ListActionTasksBadRequest) IsCode(code int) bool {
|
||||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks bad request response
|
||||
func (o *ListActionTasksBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *ListActionTasksBadRequest) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksBadRequest) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksBadRequest) 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
|
||||
}
|
||||
|
||||
// NewListActionTasksForbidden creates a ListActionTasksForbidden with default headers values
|
||||
func NewListActionTasksForbidden() *ListActionTasksForbidden {
|
||||
return &ListActionTasksForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
APIForbiddenError is a forbidden error response
|
||||
*/
|
||||
type ListActionTasksForbidden struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks forbidden response has a 2xx status code
|
||||
func (o *ListActionTasksForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks forbidden response has a 3xx status code
|
||||
func (o *ListActionTasksForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks forbidden response has a 4xx status code
|
||||
func (o *ListActionTasksForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks forbidden response has a 5xx status code
|
||||
func (o *ListActionTasksForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks forbidden response a status code equal to that given
|
||||
func (o *ListActionTasksForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks forbidden response
|
||||
func (o *ListActionTasksForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *ListActionTasksForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksForbidden) 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
|
||||
}
|
||||
|
||||
// NewListActionTasksNotFound creates a ListActionTasksNotFound with default headers values
|
||||
func NewListActionTasksNotFound() *ListActionTasksNotFound {
|
||||
return &ListActionTasksNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type ListActionTasksNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks not found response has a 2xx status code
|
||||
func (o *ListActionTasksNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks not found response has a 3xx status code
|
||||
func (o *ListActionTasksNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks not found response has a 4xx status code
|
||||
func (o *ListActionTasksNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks not found response has a 5xx status code
|
||||
func (o *ListActionTasksNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks not found response a status code equal to that given
|
||||
func (o *ListActionTasksNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks not found response
|
||||
func (o *ListActionTasksNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *ListActionTasksNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewListActionTasksConflict creates a ListActionTasksConflict with default headers values
|
||||
func NewListActionTasksConflict() *ListActionTasksConflict {
|
||||
return &ListActionTasksConflict{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksConflict describes a response with status code 409, with default header values.
|
||||
|
||||
APIConflict is a conflict empty response
|
||||
*/
|
||||
type ListActionTasksConflict struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks conflict response has a 2xx status code
|
||||
func (o *ListActionTasksConflict) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks conflict response has a 3xx status code
|
||||
func (o *ListActionTasksConflict) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks conflict response has a 4xx status code
|
||||
func (o *ListActionTasksConflict) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks conflict response has a 5xx status code
|
||||
func (o *ListActionTasksConflict) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks conflict response a status code equal to that given
|
||||
func (o *ListActionTasksConflict) IsCode(code int) bool {
|
||||
return code == 409
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks conflict response
|
||||
func (o *ListActionTasksConflict) Code() int {
|
||||
return 409
|
||||
}
|
||||
|
||||
func (o *ListActionTasksConflict) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksConflict", 409)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksConflict) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksConflict", 409)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewListActionTasksUnprocessableEntity creates a ListActionTasksUnprocessableEntity with default headers values
|
||||
func NewListActionTasksUnprocessableEntity() *ListActionTasksUnprocessableEntity {
|
||||
return &ListActionTasksUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasksUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type ListActionTasksUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this list action tasks unprocessable entity response has a 2xx status code
|
||||
func (o *ListActionTasksUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this list action tasks unprocessable entity response has a 3xx status code
|
||||
func (o *ListActionTasksUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this list action tasks unprocessable entity response has a 4xx status code
|
||||
func (o *ListActionTasksUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this list action tasks unprocessable entity response has a 5xx status code
|
||||
func (o *ListActionTasksUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this list action tasks unprocessable entity response a status code equal to that given
|
||||
func (o *ListActionTasksUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the list action tasks unprocessable entity response
|
||||
func (o *ListActionTasksUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *ListActionTasksUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/tasks][%d] listActionTasksUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *ListActionTasksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,194 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewRepoCreateTagProtectionParams creates a new RepoCreateTagProtectionParams 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 NewRepoCreateTagProtectionParams() *RepoCreateTagProtectionParams {
|
||||
return &RepoCreateTagProtectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionParamsWithTimeout creates a new RepoCreateTagProtectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoCreateTagProtectionParamsWithTimeout(timeout time.Duration) *RepoCreateTagProtectionParams {
|
||||
return &RepoCreateTagProtectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionParamsWithContext creates a new RepoCreateTagProtectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoCreateTagProtectionParamsWithContext(ctx context.Context) *RepoCreateTagProtectionParams {
|
||||
return &RepoCreateTagProtectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionParamsWithHTTPClient creates a new RepoCreateTagProtectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoCreateTagProtectionParamsWithHTTPClient(client *http.Client) *RepoCreateTagProtectionParams {
|
||||
return &RepoCreateTagProtectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo create tag protection operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoCreateTagProtectionParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.CreateTagProtectionOption
|
||||
|
||||
/* 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 repo create tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoCreateTagProtectionParams) WithDefaults() *RepoCreateTagProtectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo create tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoCreateTagProtectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithTimeout(timeout time.Duration) *RepoCreateTagProtectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithContext(ctx context.Context) *RepoCreateTagProtectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithHTTPClient(client *http.Client) *RepoCreateTagProtectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithBody(body *models.CreateTagProtectionOption) *RepoCreateTagProtectionParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetBody(body *models.CreateTagProtectionOption) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithOwner(owner string) *RepoCreateTagProtectionParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) WithRepo(repo string) *RepoCreateTagProtectionParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo create tag protection params
|
||||
func (o *RepoCreateTagProtectionParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoCreateTagProtectionParams) 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
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,402 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// RepoCreateTagProtectionReader is a Reader for the RepoCreateTagProtection structure.
|
||||
type RepoCreateTagProtectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoCreateTagProtectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 201:
|
||||
result := NewRepoCreateTagProtectionCreated()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 403:
|
||||
result := NewRepoCreateTagProtectionForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewRepoCreateTagProtectionNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewRepoCreateTagProtectionUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 423:
|
||||
result := NewRepoCreateTagProtectionLocked()
|
||||
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}/tag_protections] repoCreateTagProtection", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionCreated creates a RepoCreateTagProtectionCreated with default headers values
|
||||
func NewRepoCreateTagProtectionCreated() *RepoCreateTagProtectionCreated {
|
||||
return &RepoCreateTagProtectionCreated{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionCreated describes a response with status code 201, with default header values.
|
||||
|
||||
TagProtection
|
||||
*/
|
||||
type RepoCreateTagProtectionCreated struct {
|
||||
Payload *models.TagProtection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo create tag protection created response has a 2xx status code
|
||||
func (o *RepoCreateTagProtectionCreated) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo create tag protection created response has a 3xx status code
|
||||
func (o *RepoCreateTagProtectionCreated) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo create tag protection created response has a 4xx status code
|
||||
func (o *RepoCreateTagProtectionCreated) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo create tag protection created response has a 5xx status code
|
||||
func (o *RepoCreateTagProtectionCreated) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo create tag protection created response a status code equal to that given
|
||||
func (o *RepoCreateTagProtectionCreated) IsCode(code int) bool {
|
||||
return code == 201
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo create tag protection created response
|
||||
func (o *RepoCreateTagProtectionCreated) Code() int {
|
||||
return 201
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionCreated) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionCreated %s", 201, payload)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionCreated) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionCreated %s", 201, payload)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionCreated) GetPayload() *models.TagProtection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.TagProtection)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionForbidden creates a RepoCreateTagProtectionForbidden with default headers values
|
||||
func NewRepoCreateTagProtectionForbidden() *RepoCreateTagProtectionForbidden {
|
||||
return &RepoCreateTagProtectionForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
APIForbiddenError is a forbidden error response
|
||||
*/
|
||||
type RepoCreateTagProtectionForbidden struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo create tag protection forbidden response has a 2xx status code
|
||||
func (o *RepoCreateTagProtectionForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo create tag protection forbidden response has a 3xx status code
|
||||
func (o *RepoCreateTagProtectionForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo create tag protection forbidden response has a 4xx status code
|
||||
func (o *RepoCreateTagProtectionForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo create tag protection forbidden response has a 5xx status code
|
||||
func (o *RepoCreateTagProtectionForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo create tag protection forbidden response a status code equal to that given
|
||||
func (o *RepoCreateTagProtectionForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo create tag protection forbidden response
|
||||
func (o *RepoCreateTagProtectionForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionForbidden) 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
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionNotFound creates a RepoCreateTagProtectionNotFound with default headers values
|
||||
func NewRepoCreateTagProtectionNotFound() *RepoCreateTagProtectionNotFound {
|
||||
return &RepoCreateTagProtectionNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoCreateTagProtectionNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo create tag protection not found response has a 2xx status code
|
||||
func (o *RepoCreateTagProtectionNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo create tag protection not found response has a 3xx status code
|
||||
func (o *RepoCreateTagProtectionNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo create tag protection not found response has a 4xx status code
|
||||
func (o *RepoCreateTagProtectionNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo create tag protection not found response has a 5xx status code
|
||||
func (o *RepoCreateTagProtectionNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo create tag protection not found response a status code equal to that given
|
||||
func (o *RepoCreateTagProtectionNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo create tag protection not found response
|
||||
func (o *RepoCreateTagProtectionNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionUnprocessableEntity creates a RepoCreateTagProtectionUnprocessableEntity with default headers values
|
||||
func NewRepoCreateTagProtectionUnprocessableEntity() *RepoCreateTagProtectionUnprocessableEntity {
|
||||
return &RepoCreateTagProtectionUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type RepoCreateTagProtectionUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo create tag protection unprocessable entity response has a 2xx status code
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo create tag protection unprocessable entity response has a 3xx status code
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo create tag protection unprocessable entity response has a 4xx status code
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo create tag protection unprocessable entity response has a 5xx status code
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo create tag protection unprocessable entity response a status code equal to that given
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo create tag protection unprocessable entity response
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewRepoCreateTagProtectionLocked creates a RepoCreateTagProtectionLocked with default headers values
|
||||
func NewRepoCreateTagProtectionLocked() *RepoCreateTagProtectionLocked {
|
||||
return &RepoCreateTagProtectionLocked{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtectionLocked describes a response with status code 423, with default header values.
|
||||
|
||||
APIRepoArchivedError is an error that is raised when an archived repo should be modified
|
||||
*/
|
||||
type RepoCreateTagProtectionLocked struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo create tag protection locked response has a 2xx status code
|
||||
func (o *RepoCreateTagProtectionLocked) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo create tag protection locked response has a 3xx status code
|
||||
func (o *RepoCreateTagProtectionLocked) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo create tag protection locked response has a 4xx status code
|
||||
func (o *RepoCreateTagProtectionLocked) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo create tag protection locked response has a 5xx status code
|
||||
func (o *RepoCreateTagProtectionLocked) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo create tag protection locked response a status code equal to that given
|
||||
func (o *RepoCreateTagProtectionLocked) IsCode(code int) bool {
|
||||
return code == 423
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo create tag protection locked response
|
||||
func (o *RepoCreateTagProtectionLocked) Code() int {
|
||||
return 423
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionLocked) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionLocked) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/tag_protections][%d] repoCreateTagProtectionLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoCreateTagProtectionLocked) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,196 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewRepoDeleteTagProtectionParams creates a new RepoDeleteTagProtectionParams 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 NewRepoDeleteTagProtectionParams() *RepoDeleteTagProtectionParams {
|
||||
return &RepoDeleteTagProtectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoDeleteTagProtectionParamsWithTimeout creates a new RepoDeleteTagProtectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoDeleteTagProtectionParamsWithTimeout(timeout time.Duration) *RepoDeleteTagProtectionParams {
|
||||
return &RepoDeleteTagProtectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoDeleteTagProtectionParamsWithContext creates a new RepoDeleteTagProtectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoDeleteTagProtectionParamsWithContext(ctx context.Context) *RepoDeleteTagProtectionParams {
|
||||
return &RepoDeleteTagProtectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoDeleteTagProtectionParamsWithHTTPClient creates a new RepoDeleteTagProtectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoDeleteTagProtectionParamsWithHTTPClient(client *http.Client) *RepoDeleteTagProtectionParams {
|
||||
return &RepoDeleteTagProtectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoDeleteTagProtectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo delete tag protection operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoDeleteTagProtectionParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
id of protected tag
|
||||
*/
|
||||
ID 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 repo delete tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoDeleteTagProtectionParams) WithDefaults() *RepoDeleteTagProtectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo delete tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoDeleteTagProtectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithTimeout(timeout time.Duration) *RepoDeleteTagProtectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithContext(ctx context.Context) *RepoDeleteTagProtectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithHTTPClient(client *http.Client) *RepoDeleteTagProtectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithID(id int64) *RepoDeleteTagProtectionParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithOwner(owner string) *RepoDeleteTagProtectionParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) WithRepo(repo string) *RepoDeleteTagProtectionParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo delete tag protection params
|
||||
func (o *RepoDeleteTagProtectionParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoDeleteTagProtectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,150 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RepoDeleteTagProtectionReader is a Reader for the RepoDeleteTagProtection structure.
|
||||
type RepoDeleteTagProtectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoDeleteTagProtectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewRepoDeleteTagProtectionNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 404:
|
||||
result := NewRepoDeleteTagProtectionNotFound()
|
||||
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}/tag_protections/{id}] repoDeleteTagProtection", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoDeleteTagProtectionNoContent creates a RepoDeleteTagProtectionNoContent with default headers values
|
||||
func NewRepoDeleteTagProtectionNoContent() *RepoDeleteTagProtectionNoContent {
|
||||
return &RepoDeleteTagProtectionNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoDeleteTagProtectionNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
APIEmpty is an empty response
|
||||
*/
|
||||
type RepoDeleteTagProtectionNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo delete tag protection no content response has a 2xx status code
|
||||
func (o *RepoDeleteTagProtectionNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo delete tag protection no content response has a 3xx status code
|
||||
func (o *RepoDeleteTagProtectionNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo delete tag protection no content response has a 4xx status code
|
||||
func (o *RepoDeleteTagProtectionNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo delete tag protection no content response has a 5xx status code
|
||||
func (o *RepoDeleteTagProtectionNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo delete tag protection no content response a status code equal to that given
|
||||
func (o *RepoDeleteTagProtectionNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo delete tag protection no content response
|
||||
func (o *RepoDeleteTagProtectionNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/tag_protections/{id}][%d] repoDeleteTagProtectionNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/tag_protections/{id}][%d] repoDeleteTagProtectionNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoDeleteTagProtectionNotFound creates a RepoDeleteTagProtectionNotFound with default headers values
|
||||
func NewRepoDeleteTagProtectionNotFound() *RepoDeleteTagProtectionNotFound {
|
||||
return &RepoDeleteTagProtectionNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoDeleteTagProtectionNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoDeleteTagProtectionNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo delete tag protection not found response has a 2xx status code
|
||||
func (o *RepoDeleteTagProtectionNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo delete tag protection not found response has a 3xx status code
|
||||
func (o *RepoDeleteTagProtectionNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo delete tag protection not found response has a 4xx status code
|
||||
func (o *RepoDeleteTagProtectionNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo delete tag protection not found response has a 5xx status code
|
||||
func (o *RepoDeleteTagProtectionNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo delete tag protection not found response a status code equal to that given
|
||||
func (o *RepoDeleteTagProtectionNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo delete tag protection not found response
|
||||
func (o *RepoDeleteTagProtectionNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/tag_protections/{id}][%d] repoDeleteTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/tag_protections/{id}][%d] repoDeleteTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoDeleteTagProtectionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
@@ -36,6 +36,12 @@ func (o *RepoEditReleaseAttachmentReader) ReadResponse(response runtime.ClientRe
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewRepoEditReleaseAttachmentUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[PATCH /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}] repoEditReleaseAttachment", response, response.Code())
|
||||
}
|
||||
@@ -166,3 +172,75 @@ func (o *RepoEditReleaseAttachmentNotFound) readResponse(response runtime.Client
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoEditReleaseAttachmentUnprocessableEntity creates a RepoEditReleaseAttachmentUnprocessableEntity with default headers values
|
||||
func NewRepoEditReleaseAttachmentUnprocessableEntity() *RepoEditReleaseAttachmentUnprocessableEntity {
|
||||
return &RepoEditReleaseAttachmentUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditReleaseAttachmentUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type RepoEditReleaseAttachmentUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo edit release attachment unprocessable entity response has a 2xx status code
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo edit release attachment unprocessable entity response has a 3xx status code
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo edit release attachment unprocessable entity response has a 4xx status code
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo edit release attachment unprocessable entity response has a 5xx status code
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo edit release attachment unprocessable entity response a status code equal to that given
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo edit release attachment unprocessable entity response
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}][%d] repoEditReleaseAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}][%d] repoEditReleaseAttachmentUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoEditReleaseAttachmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@@ -0,0 +1,217 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// NewRepoEditTagProtectionParams creates a new RepoEditTagProtectionParams 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 NewRepoEditTagProtectionParams() *RepoEditTagProtectionParams {
|
||||
return &RepoEditTagProtectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionParamsWithTimeout creates a new RepoEditTagProtectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoEditTagProtectionParamsWithTimeout(timeout time.Duration) *RepoEditTagProtectionParams {
|
||||
return &RepoEditTagProtectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionParamsWithContext creates a new RepoEditTagProtectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoEditTagProtectionParamsWithContext(ctx context.Context) *RepoEditTagProtectionParams {
|
||||
return &RepoEditTagProtectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionParamsWithHTTPClient creates a new RepoEditTagProtectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoEditTagProtectionParamsWithHTTPClient(client *http.Client) *RepoEditTagProtectionParams {
|
||||
return &RepoEditTagProtectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo edit tag protection operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoEditTagProtectionParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.EditTagProtectionOption
|
||||
|
||||
/* ID.
|
||||
|
||||
id of protected tag
|
||||
*/
|
||||
ID 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 repo edit tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoEditTagProtectionParams) WithDefaults() *RepoEditTagProtectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo edit tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoEditTagProtectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithTimeout(timeout time.Duration) *RepoEditTagProtectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithContext(ctx context.Context) *RepoEditTagProtectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithHTTPClient(client *http.Client) *RepoEditTagProtectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithBody(body *models.EditTagProtectionOption) *RepoEditTagProtectionParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetBody(body *models.EditTagProtectionOption) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithID(id int64) *RepoEditTagProtectionParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithOwner(owner string) *RepoEditTagProtectionParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) WithRepo(repo string) *RepoEditTagProtectionParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo edit tag protection params
|
||||
func (o *RepoEditTagProtectionParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoEditTagProtectionParams) 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 id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,324 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// RepoEditTagProtectionReader is a Reader for the RepoEditTagProtection structure.
|
||||
type RepoEditTagProtectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoEditTagProtectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewRepoEditTagProtectionOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 404:
|
||||
result := NewRepoEditTagProtectionNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewRepoEditTagProtectionUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 423:
|
||||
result := NewRepoEditTagProtectionLocked()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[PATCH /repos/{owner}/{repo}/tag_protections/{id}] repoEditTagProtection", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionOK creates a RepoEditTagProtectionOK with default headers values
|
||||
func NewRepoEditTagProtectionOK() *RepoEditTagProtectionOK {
|
||||
return &RepoEditTagProtectionOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtectionOK describes a response with status code 200, with default header values.
|
||||
|
||||
TagProtection
|
||||
*/
|
||||
type RepoEditTagProtectionOK struct {
|
||||
Payload *models.TagProtection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo edit tag protection o k response has a 2xx status code
|
||||
func (o *RepoEditTagProtectionOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo edit tag protection o k response has a 3xx status code
|
||||
func (o *RepoEditTagProtectionOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo edit tag protection o k response has a 4xx status code
|
||||
func (o *RepoEditTagProtectionOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo edit tag protection o k response has a 5xx status code
|
||||
func (o *RepoEditTagProtectionOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo edit tag protection o k response a status code equal to that given
|
||||
func (o *RepoEditTagProtectionOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo edit tag protection o k response
|
||||
func (o *RepoEditTagProtectionOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionOK) GetPayload() *models.TagProtection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.TagProtection)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionNotFound creates a RepoEditTagProtectionNotFound with default headers values
|
||||
func NewRepoEditTagProtectionNotFound() *RepoEditTagProtectionNotFound {
|
||||
return &RepoEditTagProtectionNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtectionNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoEditTagProtectionNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo edit tag protection not found response has a 2xx status code
|
||||
func (o *RepoEditTagProtectionNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo edit tag protection not found response has a 3xx status code
|
||||
func (o *RepoEditTagProtectionNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo edit tag protection not found response has a 4xx status code
|
||||
func (o *RepoEditTagProtectionNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo edit tag protection not found response has a 5xx status code
|
||||
func (o *RepoEditTagProtectionNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo edit tag protection not found response a status code equal to that given
|
||||
func (o *RepoEditTagProtectionNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo edit tag protection not found response
|
||||
func (o *RepoEditTagProtectionNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionNotFound) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionNotFound) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionUnprocessableEntity creates a RepoEditTagProtectionUnprocessableEntity with default headers values
|
||||
func NewRepoEditTagProtectionUnprocessableEntity() *RepoEditTagProtectionUnprocessableEntity {
|
||||
return &RepoEditTagProtectionUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtectionUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type RepoEditTagProtectionUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo edit tag protection unprocessable entity response has a 2xx status code
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo edit tag protection unprocessable entity response has a 3xx status code
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo edit tag protection unprocessable entity response has a 4xx status code
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo edit tag protection unprocessable entity response has a 5xx status code
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo edit tag protection unprocessable entity response a status code equal to that given
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo edit tag protection unprocessable entity response
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewRepoEditTagProtectionLocked creates a RepoEditTagProtectionLocked with default headers values
|
||||
func NewRepoEditTagProtectionLocked() *RepoEditTagProtectionLocked {
|
||||
return &RepoEditTagProtectionLocked{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtectionLocked describes a response with status code 423, with default header values.
|
||||
|
||||
APIRepoArchivedError is an error that is raised when an archived repo should be modified
|
||||
*/
|
||||
type RepoEditTagProtectionLocked struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo edit tag protection locked response has a 2xx status code
|
||||
func (o *RepoEditTagProtectionLocked) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo edit tag protection locked response has a 3xx status code
|
||||
func (o *RepoEditTagProtectionLocked) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo edit tag protection locked response has a 4xx status code
|
||||
func (o *RepoEditTagProtectionLocked) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo edit tag protection locked response has a 5xx status code
|
||||
func (o *RepoEditTagProtectionLocked) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo edit tag protection locked response a status code equal to that given
|
||||
func (o *RepoEditTagProtectionLocked) IsCode(code int) bool {
|
||||
return code == 423
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo edit tag protection locked response
|
||||
func (o *RepoEditTagProtectionLocked) Code() int {
|
||||
return 423
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionLocked) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionLocked) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/tag_protections/{id}][%d] repoEditTagProtectionLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoEditTagProtectionLocked) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewRepoGetLicensesParams creates a new RepoGetLicensesParams 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 NewRepoGetLicensesParams() *RepoGetLicensesParams {
|
||||
return &RepoGetLicensesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetLicensesParamsWithTimeout creates a new RepoGetLicensesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoGetLicensesParamsWithTimeout(timeout time.Duration) *RepoGetLicensesParams {
|
||||
return &RepoGetLicensesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetLicensesParamsWithContext creates a new RepoGetLicensesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoGetLicensesParamsWithContext(ctx context.Context) *RepoGetLicensesParams {
|
||||
return &RepoGetLicensesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetLicensesParamsWithHTTPClient creates a new RepoGetLicensesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoGetLicensesParamsWithHTTPClient(client *http.Client) *RepoGetLicensesParams {
|
||||
return &RepoGetLicensesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetLicensesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo get licenses operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoGetLicensesParams struct {
|
||||
|
||||
/* Owner.
|
||||
|
||||
owner of the repo
|
||||
*/
|
||||
Owner string
|
||||
|
||||
/* Repo.
|
||||
|
||||
name of the repo
|
||||
*/
|
||||
Repo string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the repo get licenses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoGetLicensesParams) WithDefaults() *RepoGetLicensesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo get licenses params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoGetLicensesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) WithTimeout(timeout time.Duration) *RepoGetLicensesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) WithContext(ctx context.Context) *RepoGetLicensesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) WithHTTPClient(client *http.Client) *RepoGetLicensesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) WithOwner(owner string) *RepoGetLicensesParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) WithRepo(repo string) *RepoGetLicensesParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo get licenses params
|
||||
func (o *RepoGetLicensesParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoGetLicensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,164 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// RepoGetLicensesReader is a Reader for the RepoGetLicenses structure.
|
||||
type RepoGetLicensesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoGetLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewRepoGetLicensesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 404:
|
||||
result := NewRepoGetLicensesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/licenses] repoGetLicenses", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetLicensesOK creates a RepoGetLicensesOK with default headers values
|
||||
func NewRepoGetLicensesOK() *RepoGetLicensesOK {
|
||||
return &RepoGetLicensesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetLicensesOK describes a response with status code 200, with default header values.
|
||||
|
||||
LicensesList
|
||||
*/
|
||||
type RepoGetLicensesOK struct {
|
||||
Payload []string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo get licenses o k response has a 2xx status code
|
||||
func (o *RepoGetLicensesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo get licenses o k response has a 3xx status code
|
||||
func (o *RepoGetLicensesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo get licenses o k response has a 4xx status code
|
||||
func (o *RepoGetLicensesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo get licenses o k response has a 5xx status code
|
||||
func (o *RepoGetLicensesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo get licenses o k response a status code equal to that given
|
||||
func (o *RepoGetLicensesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo get licenses o k response
|
||||
func (o *RepoGetLicensesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/licenses][%d] repoGetLicensesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/licenses][%d] repoGetLicensesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesOK) GetPayload() []string {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesOK) 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
|
||||
}
|
||||
|
||||
// NewRepoGetLicensesNotFound creates a RepoGetLicensesNotFound with default headers values
|
||||
func NewRepoGetLicensesNotFound() *RepoGetLicensesNotFound {
|
||||
return &RepoGetLicensesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetLicensesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoGetLicensesNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo get licenses not found response has a 2xx status code
|
||||
func (o *RepoGetLicensesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo get licenses not found response has a 3xx status code
|
||||
func (o *RepoGetLicensesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo get licenses not found response has a 4xx status code
|
||||
func (o *RepoGetLicensesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo get licenses not found response has a 5xx status code
|
||||
func (o *RepoGetLicensesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo get licenses not found response a status code equal to that given
|
||||
func (o *RepoGetLicensesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo get licenses not found response
|
||||
func (o *RepoGetLicensesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/licenses][%d] repoGetLicensesNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/licenses][%d] repoGetLicensesNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoGetLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
@@ -63,7 +63,7 @@ type RepoGetRawFileOrLFSParams struct {
|
||||
|
||||
/* Filepath.
|
||||
|
||||
filepath of the file to get
|
||||
path of the file to get, it should be "{ref}/{filepath}". If there is no ref could be inferred, it will be treated as the default branch
|
||||
*/
|
||||
Filepath string
|
||||
|
||||
@@ -75,7 +75,7 @@ type RepoGetRawFileOrLFSParams struct {
|
||||
|
||||
/* Ref.
|
||||
|
||||
The name of the commit/branch/tag. Default the repository’s default branch (usually master)
|
||||
The name of the commit/branch/tag. Default the repository’s default branch
|
||||
*/
|
||||
Ref *string
|
||||
|
||||
|
@@ -63,7 +63,7 @@ type RepoGetRawFileParams struct {
|
||||
|
||||
/* Filepath.
|
||||
|
||||
filepath of the file to get
|
||||
path of the file to get, it should be "{ref}/{filepath}". If there is no ref could be inferred, it will be treated as the default branch
|
||||
*/
|
||||
Filepath string
|
||||
|
||||
@@ -75,7 +75,7 @@ type RepoGetRawFileParams struct {
|
||||
|
||||
/* Ref.
|
||||
|
||||
The name of the commit/branch/tag. Default the repository’s default branch (usually master)
|
||||
The name of the commit/branch/tag. Default the repository’s default branch
|
||||
*/
|
||||
Ref *string
|
||||
|
||||
|
@@ -27,7 +27,7 @@ func (o *RepoGetRunnerRegistrationTokenReader) ReadResponse(response runtime.Cli
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/runners/registration-token] repoGetRunnerRegistrationToken", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/actions/runners/registration-token] repoGetRunnerRegistrationToken", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,11 +76,11 @@ func (o *RepoGetRunnerRegistrationTokenOK) Code() int {
|
||||
}
|
||||
|
||||
func (o *RepoGetRunnerRegistrationTokenOK) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/runners/registration-token][%d] repoGetRunnerRegistrationTokenOK", 200)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/runners/registration-token][%d] repoGetRunnerRegistrationTokenOK", 200)
|
||||
}
|
||||
|
||||
func (o *RepoGetRunnerRegistrationTokenOK) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/runners/registration-token][%d] repoGetRunnerRegistrationTokenOK", 200)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/actions/runners/registration-token][%d] repoGetRunnerRegistrationTokenOK", 200)
|
||||
}
|
||||
|
||||
func (o *RepoGetRunnerRegistrationTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
@@ -0,0 +1,196 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewRepoGetTagProtectionParams creates a new RepoGetTagProtectionParams 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 NewRepoGetTagProtectionParams() *RepoGetTagProtectionParams {
|
||||
return &RepoGetTagProtectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetTagProtectionParamsWithTimeout creates a new RepoGetTagProtectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoGetTagProtectionParamsWithTimeout(timeout time.Duration) *RepoGetTagProtectionParams {
|
||||
return &RepoGetTagProtectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetTagProtectionParamsWithContext creates a new RepoGetTagProtectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoGetTagProtectionParamsWithContext(ctx context.Context) *RepoGetTagProtectionParams {
|
||||
return &RepoGetTagProtectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetTagProtectionParamsWithHTTPClient creates a new RepoGetTagProtectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoGetTagProtectionParamsWithHTTPClient(client *http.Client) *RepoGetTagProtectionParams {
|
||||
return &RepoGetTagProtectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetTagProtectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo get tag protection operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoGetTagProtectionParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
id of the tag protect to get
|
||||
*/
|
||||
ID 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 repo get tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoGetTagProtectionParams) WithDefaults() *RepoGetTagProtectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo get tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoGetTagProtectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithTimeout(timeout time.Duration) *RepoGetTagProtectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithContext(ctx context.Context) *RepoGetTagProtectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithHTTPClient(client *http.Client) *RepoGetTagProtectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithID(id int64) *RepoGetTagProtectionParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithOwner(owner string) *RepoGetTagProtectionParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) WithRepo(repo string) *RepoGetTagProtectionParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo get tag protection params
|
||||
func (o *RepoGetTagProtectionParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoGetTagProtectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,168 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// RepoGetTagProtectionReader is a Reader for the RepoGetTagProtection structure.
|
||||
type RepoGetTagProtectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoGetTagProtectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewRepoGetTagProtectionOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 404:
|
||||
result := NewRepoGetTagProtectionNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/tag_protections/{id}] repoGetTagProtection", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoGetTagProtectionOK creates a RepoGetTagProtectionOK with default headers values
|
||||
func NewRepoGetTagProtectionOK() *RepoGetTagProtectionOK {
|
||||
return &RepoGetTagProtectionOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetTagProtectionOK describes a response with status code 200, with default header values.
|
||||
|
||||
TagProtection
|
||||
*/
|
||||
type RepoGetTagProtectionOK struct {
|
||||
Payload *models.TagProtection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo get tag protection o k response has a 2xx status code
|
||||
func (o *RepoGetTagProtectionOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo get tag protection o k response has a 3xx status code
|
||||
func (o *RepoGetTagProtectionOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo get tag protection o k response has a 4xx status code
|
||||
func (o *RepoGetTagProtectionOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo get tag protection o k response has a 5xx status code
|
||||
func (o *RepoGetTagProtectionOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo get tag protection o k response a status code equal to that given
|
||||
func (o *RepoGetTagProtectionOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo get tag protection o k response
|
||||
func (o *RepoGetTagProtectionOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections/{id}][%d] repoGetTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections/{id}][%d] repoGetTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionOK) GetPayload() *models.TagProtection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.TagProtection)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoGetTagProtectionNotFound creates a RepoGetTagProtectionNotFound with default headers values
|
||||
func NewRepoGetTagProtectionNotFound() *RepoGetTagProtectionNotFound {
|
||||
return &RepoGetTagProtectionNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetTagProtectionNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoGetTagProtectionNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo get tag protection not found response has a 2xx status code
|
||||
func (o *RepoGetTagProtectionNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo get tag protection not found response has a 3xx status code
|
||||
func (o *RepoGetTagProtectionNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo get tag protection not found response has a 4xx status code
|
||||
func (o *RepoGetTagProtectionNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo get tag protection not found response has a 5xx status code
|
||||
func (o *RepoGetTagProtectionNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo get tag protection not found response a status code equal to that given
|
||||
func (o *RepoGetTagProtectionNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo get tag protection not found response
|
||||
func (o *RepoGetTagProtectionNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections/{id}][%d] repoGetTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections/{id}][%d] repoGetTagProtectionNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoGetTagProtectionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
@@ -70,7 +70,7 @@ type RepoListPullRequestsParams struct {
|
||||
|
||||
/* Limit.
|
||||
|
||||
page size of results
|
||||
Page size of results
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
@@ -84,19 +84,27 @@ type RepoListPullRequestsParams struct {
|
||||
|
||||
/* Owner.
|
||||
|
||||
owner of the repo
|
||||
Owner of the repo
|
||||
*/
|
||||
Owner string
|
||||
|
||||
/* Page.
|
||||
|
||||
page number of results to return (1-based)
|
||||
Page number of results to return (1-based)
|
||||
|
||||
Default: 1
|
||||
*/
|
||||
Page *int64
|
||||
|
||||
/* Poster.
|
||||
|
||||
Filter by pull request author
|
||||
*/
|
||||
Poster *string
|
||||
|
||||
/* Repo.
|
||||
|
||||
name of the repo
|
||||
Name of the repo
|
||||
*/
|
||||
Repo string
|
||||
|
||||
@@ -108,7 +116,9 @@ type RepoListPullRequestsParams struct {
|
||||
|
||||
/* State.
|
||||
|
||||
State of pull request: open or closed (optional)
|
||||
State of pull request
|
||||
|
||||
Default: "open"
|
||||
*/
|
||||
State *string
|
||||
|
||||
@@ -129,7 +139,21 @@ func (o *RepoListPullRequestsParams) WithDefaults() *RepoListPullRequestsParams
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoListPullRequestsParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
var (
|
||||
pageDefault = int64(1)
|
||||
|
||||
stateDefault = string("open")
|
||||
)
|
||||
|
||||
val := RepoListPullRequestsParams{
|
||||
Page: &pageDefault,
|
||||
State: &stateDefault,
|
||||
}
|
||||
|
||||
val.timeout = o.timeout
|
||||
val.Context = o.Context
|
||||
val.HTTPClient = o.HTTPClient
|
||||
*o = val
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo list pull requests params
|
||||
@@ -220,6 +244,17 @@ func (o *RepoListPullRequestsParams) SetPage(page *int64) {
|
||||
o.Page = page
|
||||
}
|
||||
|
||||
// WithPoster adds the poster to the repo list pull requests params
|
||||
func (o *RepoListPullRequestsParams) WithPoster(poster *string) *RepoListPullRequestsParams {
|
||||
o.SetPoster(poster)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetPoster adds the poster to the repo list pull requests params
|
||||
func (o *RepoListPullRequestsParams) SetPoster(poster *string) {
|
||||
o.Poster = poster
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo list pull requests params
|
||||
func (o *RepoListPullRequestsParams) WithRepo(repo string) *RepoListPullRequestsParams {
|
||||
o.SetRepo(repo)
|
||||
@@ -328,6 +363,23 @@ func (o *RepoListPullRequestsParams) WriteToRequest(r runtime.ClientRequest, reg
|
||||
}
|
||||
}
|
||||
|
||||
if o.Poster != nil {
|
||||
|
||||
// query param poster
|
||||
var qrPoster string
|
||||
|
||||
if o.Poster != nil {
|
||||
qrPoster = *o.Poster
|
||||
}
|
||||
qPoster := qrPoster
|
||||
if qPoster != "" {
|
||||
|
||||
if err := r.SetQueryParam("poster", qPoster); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
|
@@ -36,6 +36,12 @@ func (o *RepoListPullRequestsReader) ReadResponse(response runtime.ClientRespons
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewRepoListPullRequestsInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/pulls] repoListPullRequests", response, response.Code())
|
||||
}
|
||||
@@ -164,3 +170,75 @@ func (o *RepoListPullRequestsNotFound) readResponse(response runtime.ClientRespo
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoListPullRequestsInternalServerError creates a RepoListPullRequestsInternalServerError with default headers values
|
||||
func NewRepoListPullRequestsInternalServerError() *RepoListPullRequestsInternalServerError {
|
||||
return &RepoListPullRequestsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoListPullRequestsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
APIError is error format response
|
||||
*/
|
||||
type RepoListPullRequestsInternalServerError struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo list pull requests internal server error response has a 2xx status code
|
||||
func (o *RepoListPullRequestsInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo list pull requests internal server error response has a 3xx status code
|
||||
func (o *RepoListPullRequestsInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo list pull requests internal server error response has a 4xx status code
|
||||
func (o *RepoListPullRequestsInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo list pull requests internal server error response has a 5xx status code
|
||||
func (o *RepoListPullRequestsInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo list pull requests internal server error response a status code equal to that given
|
||||
func (o *RepoListPullRequestsInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo list pull requests internal server error response
|
||||
func (o *RepoListPullRequestsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *RepoListPullRequestsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls][%d] repoListPullRequestsInternalServerError", 500)
|
||||
}
|
||||
|
||||
func (o *RepoListPullRequestsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls][%d] repoListPullRequestsInternalServerError", 500)
|
||||
}
|
||||
|
||||
func (o *RepoListPullRequestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewRepoListTagProtectionParams creates a new RepoListTagProtectionParams 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 NewRepoListTagProtectionParams() *RepoListTagProtectionParams {
|
||||
return &RepoListTagProtectionParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoListTagProtectionParamsWithTimeout creates a new RepoListTagProtectionParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoListTagProtectionParamsWithTimeout(timeout time.Duration) *RepoListTagProtectionParams {
|
||||
return &RepoListTagProtectionParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoListTagProtectionParamsWithContext creates a new RepoListTagProtectionParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoListTagProtectionParamsWithContext(ctx context.Context) *RepoListTagProtectionParams {
|
||||
return &RepoListTagProtectionParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoListTagProtectionParamsWithHTTPClient creates a new RepoListTagProtectionParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoListTagProtectionParamsWithHTTPClient(client *http.Client) *RepoListTagProtectionParams {
|
||||
return &RepoListTagProtectionParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoListTagProtectionParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo list tag protection operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoListTagProtectionParams struct {
|
||||
|
||||
/* Owner.
|
||||
|
||||
owner of the repo
|
||||
*/
|
||||
Owner string
|
||||
|
||||
/* Repo.
|
||||
|
||||
name of the repo
|
||||
*/
|
||||
Repo string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the repo list tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoListTagProtectionParams) WithDefaults() *RepoListTagProtectionParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo list tag protection params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoListTagProtectionParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) WithTimeout(timeout time.Duration) *RepoListTagProtectionParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) WithContext(ctx context.Context) *RepoListTagProtectionParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) WithHTTPClient(client *http.Client) *RepoListTagProtectionParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) WithOwner(owner string) *RepoListTagProtectionParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) WithRepo(repo string) *RepoListTagProtectionParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo list tag protection params
|
||||
func (o *RepoListTagProtectionParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoListTagProtectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,104 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// RepoListTagProtectionReader is a Reader for the RepoListTagProtection structure.
|
||||
type RepoListTagProtectionReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoListTagProtectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewRepoListTagProtectionOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/tag_protections] repoListTagProtection", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoListTagProtectionOK creates a RepoListTagProtectionOK with default headers values
|
||||
func NewRepoListTagProtectionOK() *RepoListTagProtectionOK {
|
||||
return &RepoListTagProtectionOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoListTagProtectionOK describes a response with status code 200, with default header values.
|
||||
|
||||
TagProtectionList
|
||||
*/
|
||||
type RepoListTagProtectionOK struct {
|
||||
Payload []*models.TagProtection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo list tag protection o k response has a 2xx status code
|
||||
func (o *RepoListTagProtectionOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo list tag protection o k response has a 3xx status code
|
||||
func (o *RepoListTagProtectionOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo list tag protection o k response has a 4xx status code
|
||||
func (o *RepoListTagProtectionOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo list tag protection o k response has a 5xx status code
|
||||
func (o *RepoListTagProtectionOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo list tag protection o k response a status code equal to that given
|
||||
func (o *RepoListTagProtectionOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo list tag protection o k response
|
||||
func (o *RepoListTagProtectionOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *RepoListTagProtectionOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections][%d] repoListTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoListTagProtectionOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /repos/{owner}/{repo}/tag_protections][%d] repoListTagProtectionOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoListTagProtectionOK) GetPayload() []*models.TagProtection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoListTagProtectionOK) 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
|
||||
}
|
@@ -0,0 +1,194 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewRepoMergeUpstreamParams creates a new RepoMergeUpstreamParams 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 NewRepoMergeUpstreamParams() *RepoMergeUpstreamParams {
|
||||
return &RepoMergeUpstreamParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamParamsWithTimeout creates a new RepoMergeUpstreamParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoMergeUpstreamParamsWithTimeout(timeout time.Duration) *RepoMergeUpstreamParams {
|
||||
return &RepoMergeUpstreamParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamParamsWithContext creates a new RepoMergeUpstreamParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoMergeUpstreamParamsWithContext(ctx context.Context) *RepoMergeUpstreamParams {
|
||||
return &RepoMergeUpstreamParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamParamsWithHTTPClient creates a new RepoMergeUpstreamParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoMergeUpstreamParamsWithHTTPClient(client *http.Client) *RepoMergeUpstreamParams {
|
||||
return &RepoMergeUpstreamParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMergeUpstreamParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo merge upstream operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoMergeUpstreamParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.MergeUpstreamRequest
|
||||
|
||||
/* 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 repo merge upstream params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoMergeUpstreamParams) WithDefaults() *RepoMergeUpstreamParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo merge upstream params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoMergeUpstreamParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithTimeout(timeout time.Duration) *RepoMergeUpstreamParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithContext(ctx context.Context) *RepoMergeUpstreamParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithHTTPClient(client *http.Client) *RepoMergeUpstreamParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithBody(body *models.MergeUpstreamRequest) *RepoMergeUpstreamParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetBody(body *models.MergeUpstreamRequest) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithOwner(owner string) *RepoMergeUpstreamParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) WithRepo(repo string) *RepoMergeUpstreamParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo merge upstream params
|
||||
func (o *RepoMergeUpstreamParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoMergeUpstreamParams) 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
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,246 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// RepoMergeUpstreamReader is a Reader for the RepoMergeUpstream structure.
|
||||
type RepoMergeUpstreamReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoMergeUpstreamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewRepoMergeUpstreamOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 400:
|
||||
result := NewRepoMergeUpstreamBadRequest()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewRepoMergeUpstreamNotFound()
|
||||
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}/merge-upstream] repoMergeUpstream", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamOK creates a RepoMergeUpstreamOK with default headers values
|
||||
func NewRepoMergeUpstreamOK() *RepoMergeUpstreamOK {
|
||||
return &RepoMergeUpstreamOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMergeUpstreamOK describes a response with status code 200, with default header values.
|
||||
|
||||
RepoMergeUpstreamOK repo merge upstream o k
|
||||
*/
|
||||
type RepoMergeUpstreamOK struct {
|
||||
Payload *models.MergeUpstreamResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo merge upstream o k response has a 2xx status code
|
||||
func (o *RepoMergeUpstreamOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo merge upstream o k response has a 3xx status code
|
||||
func (o *RepoMergeUpstreamOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo merge upstream o k response has a 4xx status code
|
||||
func (o *RepoMergeUpstreamOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo merge upstream o k response has a 5xx status code
|
||||
func (o *RepoMergeUpstreamOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo merge upstream o k response a status code equal to that given
|
||||
func (o *RepoMergeUpstreamOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo merge upstream o k response
|
||||
func (o *RepoMergeUpstreamOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamOK) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamOK) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamOK) GetPayload() *models.MergeUpstreamResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.MergeUpstreamResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamBadRequest creates a RepoMergeUpstreamBadRequest with default headers values
|
||||
func NewRepoMergeUpstreamBadRequest() *RepoMergeUpstreamBadRequest {
|
||||
return &RepoMergeUpstreamBadRequest{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMergeUpstreamBadRequest describes a response with status code 400, with default header values.
|
||||
|
||||
APIError is error format response
|
||||
*/
|
||||
type RepoMergeUpstreamBadRequest struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo merge upstream bad request response has a 2xx status code
|
||||
func (o *RepoMergeUpstreamBadRequest) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo merge upstream bad request response has a 3xx status code
|
||||
func (o *RepoMergeUpstreamBadRequest) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo merge upstream bad request response has a 4xx status code
|
||||
func (o *RepoMergeUpstreamBadRequest) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo merge upstream bad request response has a 5xx status code
|
||||
func (o *RepoMergeUpstreamBadRequest) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo merge upstream bad request response a status code equal to that given
|
||||
func (o *RepoMergeUpstreamBadRequest) IsCode(code int) bool {
|
||||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo merge upstream bad request response
|
||||
func (o *RepoMergeUpstreamBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamBadRequest) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamBadRequest) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamBadRequest", 400)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamBadRequest) 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
|
||||
}
|
||||
|
||||
// NewRepoMergeUpstreamNotFound creates a RepoMergeUpstreamNotFound with default headers values
|
||||
func NewRepoMergeUpstreamNotFound() *RepoMergeUpstreamNotFound {
|
||||
return &RepoMergeUpstreamNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMergeUpstreamNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoMergeUpstreamNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo merge upstream not found response has a 2xx status code
|
||||
func (o *RepoMergeUpstreamNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo merge upstream not found response has a 3xx status code
|
||||
func (o *RepoMergeUpstreamNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo merge upstream not found response has a 4xx status code
|
||||
func (o *RepoMergeUpstreamNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo merge upstream not found response has a 5xx status code
|
||||
func (o *RepoMergeUpstreamNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo merge upstream not found response a status code equal to that given
|
||||
func (o *RepoMergeUpstreamNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo merge upstream not found response
|
||||
func (o *RepoMergeUpstreamNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/merge-upstream][%d] repoMergeUpstreamNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoMergeUpstreamNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
@@ -132,7 +132,7 @@ type RepoSearchParams struct {
|
||||
|
||||
/* Sort.
|
||||
|
||||
sort repos by attribute. Supported values are "alpha", "created", "updated", "size", and "id". Default is "alpha"
|
||||
sort repos by attribute. Supported values are "alpha", "created", "updated", "size", "git_size", "lfs_size", "stars", "forks" and "id". Default is "alpha"
|
||||
*/
|
||||
Sort *string
|
||||
|
||||
|
@@ -0,0 +1,216 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package repository
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"src.opensuse.org/autogits/common/gitea-generated/models"
|
||||
)
|
||||
|
||||
// NewRepoUpdateBranchParams creates a new RepoUpdateBranchParams 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 NewRepoUpdateBranchParams() *RepoUpdateBranchParams {
|
||||
return &RepoUpdateBranchParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchParamsWithTimeout creates a new RepoUpdateBranchParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoUpdateBranchParamsWithTimeout(timeout time.Duration) *RepoUpdateBranchParams {
|
||||
return &RepoUpdateBranchParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchParamsWithContext creates a new RepoUpdateBranchParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoUpdateBranchParamsWithContext(ctx context.Context) *RepoUpdateBranchParams {
|
||||
return &RepoUpdateBranchParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchParamsWithHTTPClient creates a new RepoUpdateBranchParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoUpdateBranchParamsWithHTTPClient(client *http.Client) *RepoUpdateBranchParams {
|
||||
return &RepoUpdateBranchParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo update branch operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoUpdateBranchParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.UpdateBranchRepoOption
|
||||
|
||||
/* Branch.
|
||||
|
||||
name of the branch
|
||||
*/
|
||||
Branch string
|
||||
|
||||
/* 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 repo update branch params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoUpdateBranchParams) WithDefaults() *RepoUpdateBranchParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo update branch params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoUpdateBranchParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithTimeout(timeout time.Duration) *RepoUpdateBranchParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithContext(ctx context.Context) *RepoUpdateBranchParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithHTTPClient(client *http.Client) *RepoUpdateBranchParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithBody(body *models.UpdateBranchRepoOption) *RepoUpdateBranchParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetBody(body *models.UpdateBranchRepoOption) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithBranch adds the branch to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithBranch(branch string) *RepoUpdateBranchParams {
|
||||
o.SetBranch(branch)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBranch adds the branch to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetBranch(branch string) {
|
||||
o.Branch = branch
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithOwner(owner string) *RepoUpdateBranchParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) WithRepo(repo string) *RepoUpdateBranchParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo update branch params
|
||||
func (o *RepoUpdateBranchParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoUpdateBranchParams) 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 branch
|
||||
if err := r.SetPathParam("branch", o.Branch); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param owner
|
||||
if err := r.SetPathParam("owner", o.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param repo
|
||||
if err := r.SetPathParam("repo", o.Repo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,194 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesParams creates a new RepoUpdateBranchProtectionPrioriesParams 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 NewRepoUpdateBranchProtectionPrioriesParams() *RepoUpdateBranchProtectionPrioriesParams {
|
||||
return &RepoUpdateBranchProtectionPrioriesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesParamsWithTimeout creates a new RepoUpdateBranchProtectionPrioriesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewRepoUpdateBranchProtectionPrioriesParamsWithTimeout(timeout time.Duration) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
return &RepoUpdateBranchProtectionPrioriesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesParamsWithContext creates a new RepoUpdateBranchProtectionPrioriesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewRepoUpdateBranchProtectionPrioriesParamsWithContext(ctx context.Context) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
return &RepoUpdateBranchProtectionPrioriesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesParamsWithHTTPClient creates a new RepoUpdateBranchProtectionPrioriesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewRepoUpdateBranchProtectionPrioriesParamsWithHTTPClient(client *http.Client) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
return &RepoUpdateBranchProtectionPrioriesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPrioriesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the repo update branch protection priories operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type RepoUpdateBranchProtectionPrioriesParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.UpdateBranchProtectionPriories
|
||||
|
||||
/* 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 repo update branch protection priories params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithDefaults() *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the repo update branch protection priories params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithTimeout(timeout time.Duration) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithContext(ctx context.Context) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithHTTPClient(client *http.Client) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithBody(body *models.UpdateBranchProtectionPriories) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetBody(body *models.UpdateBranchProtectionPriories) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithOwner adds the owner to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithOwner(owner string) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetOwner(owner)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOwner adds the owner to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetOwner(owner string) {
|
||||
o.Owner = owner
|
||||
}
|
||||
|
||||
// WithRepo adds the repo to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) WithRepo(repo string) *RepoUpdateBranchProtectionPrioriesParams {
|
||||
o.SetRepo(repo)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRepo adds the repo to the repo update branch protection priories params
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) SetRepo(repo string) {
|
||||
o.Repo = repo
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *RepoUpdateBranchProtectionPrioriesParams) 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
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,306 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RepoUpdateBranchProtectionPrioriesReader is a Reader for the RepoUpdateBranchProtectionPriories structure.
|
||||
type RepoUpdateBranchProtectionPrioriesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoUpdateBranchProtectionPrioriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewRepoUpdateBranchProtectionPrioriesNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 404:
|
||||
result := NewRepoUpdateBranchProtectionPrioriesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewRepoUpdateBranchProtectionPrioriesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 423:
|
||||
result := NewRepoUpdateBranchProtectionPrioriesLocked()
|
||||
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}/branch_protections/priority] repoUpdateBranchProtectionPriories", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesNoContent creates a RepoUpdateBranchProtectionPrioriesNoContent with default headers values
|
||||
func NewRepoUpdateBranchProtectionPrioriesNoContent() *RepoUpdateBranchProtectionPrioriesNoContent {
|
||||
return &RepoUpdateBranchProtectionPrioriesNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPrioriesNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
APIEmpty is an empty response
|
||||
*/
|
||||
type RepoUpdateBranchProtectionPrioriesNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch protection priories no content response has a 2xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch protection priories no content response has a 3xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch protection priories no content response has a 4xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch protection priories no content response has a 5xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch protection priories no content response a status code equal to that given
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch protection priories no content response
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesNotFound creates a RepoUpdateBranchProtectionPrioriesNotFound with default headers values
|
||||
func NewRepoUpdateBranchProtectionPrioriesNotFound() *RepoUpdateBranchProtectionPrioriesNotFound {
|
||||
return &RepoUpdateBranchProtectionPrioriesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPrioriesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoUpdateBranchProtectionPrioriesNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch protection priories not found response has a 2xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch protection priories not found response has a 3xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch protection priories not found response has a 4xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch protection priories not found response has a 5xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch protection priories not found response a status code equal to that given
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch protection priories not found response
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesUnprocessableEntity creates a RepoUpdateBranchProtectionPrioriesUnprocessableEntity with default headers values
|
||||
func NewRepoUpdateBranchProtectionPrioriesUnprocessableEntity() *RepoUpdateBranchProtectionPrioriesUnprocessableEntity {
|
||||
return &RepoUpdateBranchProtectionPrioriesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPrioriesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type RepoUpdateBranchProtectionPrioriesUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch protection priories unprocessable entity response has a 2xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch protection priories unprocessable entity response has a 3xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch protection priories unprocessable entity response has a 4xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch protection priories unprocessable entity response has a 5xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch protection priories unprocessable entity response a status code equal to that given
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch protection priories unprocessable entity response
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesUnprocessableEntity) 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
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchProtectionPrioriesLocked creates a RepoUpdateBranchProtectionPrioriesLocked with default headers values
|
||||
func NewRepoUpdateBranchProtectionPrioriesLocked() *RepoUpdateBranchProtectionPrioriesLocked {
|
||||
return &RepoUpdateBranchProtectionPrioriesLocked{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPrioriesLocked describes a response with status code 423, with default header values.
|
||||
|
||||
APIRepoArchivedError is an error that is raised when an archived repo should be modified
|
||||
*/
|
||||
type RepoUpdateBranchProtectionPrioriesLocked struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch protection priories locked response has a 2xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch protection priories locked response has a 3xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch protection priories locked response has a 4xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch protection priories locked response has a 5xx status code
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch protection priories locked response a status code equal to that given
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) IsCode(code int) bool {
|
||||
return code == 423
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch protection priories locked response
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) Code() int {
|
||||
return 423
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) Error() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) String() string {
|
||||
return fmt.Sprintf("[POST /repos/{owner}/{repo}/branch_protections/priority][%d] repoUpdateBranchProtectionPrioriesLocked", 423)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchProtectionPrioriesLocked) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header message
|
||||
hdrMessage := response.GetHeader("message")
|
||||
|
||||
if hdrMessage != "" {
|
||||
o.Message = hdrMessage
|
||||
}
|
||||
|
||||
// hydrates response header url
|
||||
hdrURL := response.GetHeader("url")
|
||||
|
||||
if hdrURL != "" {
|
||||
o.URL = hdrURL
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,306 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RepoUpdateBranchReader is a Reader for the RepoUpdateBranch structure.
|
||||
type RepoUpdateBranchReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *RepoUpdateBranchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewRepoUpdateBranchNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 403:
|
||||
result := NewRepoUpdateBranchForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewRepoUpdateBranchNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewRepoUpdateBranchUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("[PATCH /repos/{owner}/{repo}/branches/{branch}] repoUpdateBranch", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchNoContent creates a RepoUpdateBranchNoContent with default headers values
|
||||
func NewRepoUpdateBranchNoContent() *RepoUpdateBranchNoContent {
|
||||
return &RepoUpdateBranchNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
APIEmpty is an empty response
|
||||
*/
|
||||
type RepoUpdateBranchNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch no content response has a 2xx status code
|
||||
func (o *RepoUpdateBranchNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch no content response has a 3xx status code
|
||||
func (o *RepoUpdateBranchNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch no content response has a 4xx status code
|
||||
func (o *RepoUpdateBranchNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch no content response has a 5xx status code
|
||||
func (o *RepoUpdateBranchNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch no content response a status code equal to that given
|
||||
func (o *RepoUpdateBranchNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch no content response
|
||||
func (o *RepoUpdateBranchNoContent) Code() int {
|
||||
return 204
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNoContent) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNoContent) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNoContent", 204)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchForbidden creates a RepoUpdateBranchForbidden with default headers values
|
||||
func NewRepoUpdateBranchForbidden() *RepoUpdateBranchForbidden {
|
||||
return &RepoUpdateBranchForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
APIForbiddenError is a forbidden error response
|
||||
*/
|
||||
type RepoUpdateBranchForbidden struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch forbidden response has a 2xx status code
|
||||
func (o *RepoUpdateBranchForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch forbidden response has a 3xx status code
|
||||
func (o *RepoUpdateBranchForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch forbidden response has a 4xx status code
|
||||
func (o *RepoUpdateBranchForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch forbidden response has a 5xx status code
|
||||
func (o *RepoUpdateBranchForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch forbidden response a status code equal to that given
|
||||
func (o *RepoUpdateBranchForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch forbidden response
|
||||
func (o *RepoUpdateBranchForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchForbidden) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchForbidden) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchForbidden", 403)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchForbidden) 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
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchNotFound creates a RepoUpdateBranchNotFound with default headers values
|
||||
func NewRepoUpdateBranchNotFound() *RepoUpdateBranchNotFound {
|
||||
return &RepoUpdateBranchNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
APINotFound is a not found empty response
|
||||
*/
|
||||
type RepoUpdateBranchNotFound struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch not found response has a 2xx status code
|
||||
func (o *RepoUpdateBranchNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch not found response has a 3xx status code
|
||||
func (o *RepoUpdateBranchNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch not found response has a 4xx status code
|
||||
func (o *RepoUpdateBranchNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch not found response has a 5xx status code
|
||||
func (o *RepoUpdateBranchNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch not found response a status code equal to that given
|
||||
func (o *RepoUpdateBranchNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch not found response
|
||||
func (o *RepoUpdateBranchNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNotFound) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNotFound) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNotFound", 404)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewRepoUpdateBranchUnprocessableEntity creates a RepoUpdateBranchUnprocessableEntity with default headers values
|
||||
func NewRepoUpdateBranchUnprocessableEntity() *RepoUpdateBranchUnprocessableEntity {
|
||||
return &RepoUpdateBranchUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
APIValidationError is error format response related to input validation
|
||||
*/
|
||||
type RepoUpdateBranchUnprocessableEntity struct {
|
||||
Message string
|
||||
URL string
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this repo update branch unprocessable entity response has a 2xx status code
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this repo update branch unprocessable entity response has a 3xx status code
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this repo update branch unprocessable entity response has a 4xx status code
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this repo update branch unprocessable entity response has a 5xx status code
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this repo update branch unprocessable entity response a status code equal to that given
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the repo update branch unprocessable entity response
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchUnprocessableEntity", 422)
|
||||
}
|
||||
|
||||
func (o *RepoUpdateBranchUnprocessableEntity) 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
|
||||
}
|
@@ -127,6 +127,8 @@ type ClientService interface {
|
||||
|
||||
GetTree(params *GetTreeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTreeOK, error)
|
||||
|
||||
ListActionTasks(params *ListActionTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListActionTasksOK, error)
|
||||
|
||||
AcceptRepoTransfer(params *AcceptRepoTransferParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AcceptRepoTransferAccepted, error)
|
||||
|
||||
CreateCurrentUserRepo(params *CreateCurrentUserRepoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCurrentUserRepoCreated, error)
|
||||
@@ -193,6 +195,8 @@ type ClientService interface {
|
||||
|
||||
RepoCreateTag(params *RepoCreateTagParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoCreateTagOK, error)
|
||||
|
||||
RepoCreateTagProtection(params *RepoCreateTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoCreateTagProtectionCreated, error)
|
||||
|
||||
RepoCreateWikiPage(params *RepoCreateWikiPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoCreateWikiPageCreated, error)
|
||||
|
||||
RepoDelete(params *RepoDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteNoContent, error)
|
||||
@@ -227,6 +231,8 @@ type ClientService interface {
|
||||
|
||||
RepoDeleteTag(params *RepoDeleteTagParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteTagNoContent, error)
|
||||
|
||||
RepoDeleteTagProtection(params *RepoDeleteTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteTagProtectionNoContent, error)
|
||||
|
||||
RepoDeleteTeam(params *RepoDeleteTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteTeamNoContent, error)
|
||||
|
||||
RepoDeleteTopic(params *RepoDeleteTopicParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteTopicNoContent, error)
|
||||
@@ -253,6 +259,8 @@ type ClientService interface {
|
||||
|
||||
RepoEditReleaseAttachment(params *RepoEditReleaseAttachmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoEditReleaseAttachmentCreated, error)
|
||||
|
||||
RepoEditTagProtection(params *RepoEditTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoEditTagProtectionOK, error)
|
||||
|
||||
RepoEditWikiPage(params *RepoEditWikiPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoEditWikiPageOK, error)
|
||||
|
||||
RepoGet(params *RepoGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetOK, error)
|
||||
@@ -293,6 +301,8 @@ type ClientService interface {
|
||||
|
||||
RepoGetLatestRelease(params *RepoGetLatestReleaseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetLatestReleaseOK, error)
|
||||
|
||||
RepoGetLicenses(params *RepoGetLicensesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetLicensesOK, error)
|
||||
|
||||
RepoGetNote(params *RepoGetNoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetNoteOK, error)
|
||||
|
||||
RepoGetPullRequest(params *RepoGetPullRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetPullRequestOK, error)
|
||||
@@ -329,6 +339,8 @@ type ClientService interface {
|
||||
|
||||
RepoGetTag(params *RepoGetTagParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetTagOK, error)
|
||||
|
||||
RepoGetTagProtection(params *RepoGetTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetTagProtectionOK, error)
|
||||
|
||||
RepoGetWikiPage(params *RepoGetWikiPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetWikiPageOK, error)
|
||||
|
||||
RepoGetWikiPageRevisions(params *RepoGetWikiPageRevisionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetWikiPageRevisionsOK, error)
|
||||
@@ -377,6 +389,8 @@ type ClientService interface {
|
||||
|
||||
RepoListSubscribers(params *RepoListSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoListSubscribersOK, error)
|
||||
|
||||
RepoListTagProtection(params *RepoListTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoListTagProtectionOK, error)
|
||||
|
||||
RepoListTags(params *RepoListTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoListTagsOK, error)
|
||||
|
||||
RepoListTeams(params *RepoListTeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoListTeamsOK, error)
|
||||
@@ -385,6 +399,8 @@ type ClientService interface {
|
||||
|
||||
RepoMergePullRequest(params *RepoMergePullRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoMergePullRequestOK, error)
|
||||
|
||||
RepoMergeUpstream(params *RepoMergeUpstreamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoMergeUpstreamOK, error)
|
||||
|
||||
RepoMigrate(params *RepoMigrateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoMigrateCreated, error)
|
||||
|
||||
RepoMirrorSync(params *RepoMirrorSyncParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoMirrorSyncOK, error)
|
||||
@@ -411,6 +427,10 @@ type ClientService interface {
|
||||
|
||||
RepoUpdateAvatar(params *RepoUpdateAvatarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateAvatarNoContent, error)
|
||||
|
||||
RepoUpdateBranch(params *RepoUpdateBranchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateBranchNoContent, error)
|
||||
|
||||
RepoUpdateBranchProtectionPriories(params *RepoUpdateBranchProtectionPrioriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateBranchProtectionPrioriesNoContent, error)
|
||||
|
||||
RepoUpdateFile(params *RepoUpdateFileParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateFileOK, error)
|
||||
|
||||
RepoUpdatePullRequest(params *RepoUpdatePullRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdatePullRequestOK, error)
|
||||
@@ -553,6 +573,45 @@ func (a *Client) GetTree(params *GetTreeParams, authInfo runtime.ClientAuthInfoW
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
ListActionTasks lists a repository s action tasks
|
||||
*/
|
||||
func (a *Client) ListActionTasks(params *ListActionTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListActionTasksOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewListActionTasksParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "ListActionTasks",
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/actions/tasks",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &ListActionTasksReader{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.(*ListActionTasksOK)
|
||||
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 ListActionTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
AcceptRepoTransfer accepts a repo transfer
|
||||
*/
|
||||
@@ -987,7 +1046,7 @@ func (a *Client) RejectRepoTransfer(params *RejectRepoTransferParams, authInfo r
|
||||
}
|
||||
|
||||
/*
|
||||
RepoAddCollaborator adds a collaborator to a repository
|
||||
RepoAddCollaborator adds or update a collaborator to a repository
|
||||
*/
|
||||
func (a *Client) RepoAddCollaborator(params *RepoAddCollaboratorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoAddCollaboratorNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
@@ -1844,6 +1903,45 @@ func (a *Client) RepoCreateTag(params *RepoCreateTagParams, authInfo runtime.Cli
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateTagProtection creates a tag protections for a repository
|
||||
*/
|
||||
func (a *Client) RepoCreateTagProtection(params *RepoCreateTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoCreateTagProtectionCreated, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoCreateTagProtectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoCreateTagProtection",
|
||||
Method: "POST",
|
||||
PathPattern: "/repos/{owner}/{repo}/tag_protections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoCreateTagProtectionReader{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.(*RepoCreateTagProtectionCreated)
|
||||
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 repoCreateTagProtection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoCreateWikiPage creates a wiki page
|
||||
*/
|
||||
@@ -2507,6 +2605,45 @@ func (a *Client) RepoDeleteTag(params *RepoDeleteTagParams, authInfo runtime.Cli
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoDeleteTagProtection deletes a specific tag protection for the repository
|
||||
*/
|
||||
func (a *Client) RepoDeleteTagProtection(params *RepoDeleteTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoDeleteTagProtectionNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoDeleteTagProtectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoDeleteTagProtection",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/repos/{owner}/{repo}/tag_protections/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoDeleteTagProtectionReader{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.(*RepoDeleteTagProtectionNoContent)
|
||||
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 repoDeleteTagProtection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoDeleteTeam deletes a team from a repository
|
||||
*/
|
||||
@@ -3014,6 +3151,45 @@ func (a *Client) RepoEditReleaseAttachment(params *RepoEditReleaseAttachmentPara
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditTagProtection edits a tag protections for a repository only fields that are set will be changed
|
||||
*/
|
||||
func (a *Client) RepoEditTagProtection(params *RepoEditTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoEditTagProtectionOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoEditTagProtectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoEditTagProtection",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/repos/{owner}/{repo}/tag_protections/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoEditTagProtectionReader{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.(*RepoEditTagProtectionOK)
|
||||
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 repoEditTagProtection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoEditWikiPage edits a wiki page
|
||||
*/
|
||||
@@ -3366,7 +3542,7 @@ func (a *Client) RepoGetCombinedStatusByRef(params *RepoGetCombinedStatusByRefPa
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetCommitPullRequest gets the pull request of the commit
|
||||
RepoGetCommitPullRequest gets the merged pull request of the commit
|
||||
*/
|
||||
func (a *Client) RepoGetCommitPullRequest(params *RepoGetCommitPullRequestParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetCommitPullRequestOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
@@ -3794,6 +3970,45 @@ func (a *Client) RepoGetLatestRelease(params *RepoGetLatestReleaseParams, authIn
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetLicenses gets repo licenses
|
||||
*/
|
||||
func (a *Client) RepoGetLicenses(params *RepoGetLicensesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetLicensesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoGetLicensesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoGetLicenses",
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/licenses",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoGetLicensesReader{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.(*RepoGetLicensesOK)
|
||||
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 repoGetLicenses: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetNote gets a note corresponding to a single commit from a repository
|
||||
*/
|
||||
@@ -4119,7 +4334,7 @@ func (a *Client) RepoGetRawFile(params *RepoGetRawFileParams, authInfo runtime.C
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/raw/{filepath}",
|
||||
ProducesMediaTypes: []string{"application/octet-stream"},
|
||||
ConsumesMediaTypes: []string{"application/octet-stream"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoGetRawFileReader{formats: a.formats, writer: writer},
|
||||
@@ -4390,7 +4605,7 @@ func (a *Client) RepoGetRunnerRegistrationToken(params *RepoGetRunnerRegistratio
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoGetRunnerRegistrationToken",
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/runners/registration-token",
|
||||
PathPattern: "/repos/{owner}/{repo}/actions/runners/registration-token",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
@@ -4496,6 +4711,45 @@ func (a *Client) RepoGetTag(params *RepoGetTagParams, authInfo runtime.ClientAut
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetTagProtection gets a specific tag protection for the repository
|
||||
*/
|
||||
func (a *Client) RepoGetTagProtection(params *RepoGetTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoGetTagProtectionOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoGetTagProtectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoGetTagProtection",
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/tag_protections/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoGetTagProtectionReader{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.(*RepoGetTagProtectionOK)
|
||||
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 repoGetTagProtection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoGetWikiPage gets a wiki page
|
||||
*/
|
||||
@@ -5432,6 +5686,45 @@ func (a *Client) RepoListSubscribers(params *RepoListSubscribersParams, authInfo
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoListTagProtection lists tag protections for a repository
|
||||
*/
|
||||
func (a *Client) RepoListTagProtection(params *RepoListTagProtectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoListTagProtectionOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoListTagProtectionParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoListTagProtection",
|
||||
Method: "GET",
|
||||
PathPattern: "/repos/{owner}/{repo}/tag_protections",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoListTagProtectionReader{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.(*RepoListTagProtectionOK)
|
||||
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 repoListTagProtection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoListTags lists a repository s tags
|
||||
*/
|
||||
@@ -5588,6 +5881,45 @@ func (a *Client) RepoMergePullRequest(params *RepoMergePullRequestParams, authIn
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMergeUpstream merges a branch from upstream
|
||||
*/
|
||||
func (a *Client) RepoMergeUpstream(params *RepoMergeUpstreamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoMergeUpstreamOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoMergeUpstreamParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoMergeUpstream",
|
||||
Method: "POST",
|
||||
PathPattern: "/repos/{owner}/{repo}/merge-upstream",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json", "text/plain"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoMergeUpstreamReader{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.(*RepoMergeUpstreamOK)
|
||||
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 repoMergeUpstream: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoMigrate migrates a remote git repository
|
||||
*/
|
||||
@@ -6095,6 +6427,84 @@ func (a *Client) RepoUpdateAvatar(params *RepoUpdateAvatarParams, authInfo runti
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranch updates a branch
|
||||
*/
|
||||
func (a *Client) RepoUpdateBranch(params *RepoUpdateBranchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateBranchNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoUpdateBranchParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoUpdateBranch",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/repos/{owner}/{repo}/branches/{branch}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoUpdateBranchReader{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.(*RepoUpdateBranchNoContent)
|
||||
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 repoUpdateBranch: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateBranchProtectionPriories updates the priorities of branch protections for a repository
|
||||
*/
|
||||
func (a *Client) RepoUpdateBranchProtectionPriories(params *RepoUpdateBranchProtectionPrioriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RepoUpdateBranchProtectionPrioriesNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewRepoUpdateBranchProtectionPrioriesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "repoUpdateBranchProtectionPriories",
|
||||
Method: "POST",
|
||||
PathPattern: "/repos/{owner}/{repo}/branch_protections/priority",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http", "https"},
|
||||
Params: params,
|
||||
Reader: &RepoUpdateBranchProtectionPrioriesReader{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.(*RepoUpdateBranchProtectionPrioriesNoContent)
|
||||
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 repoUpdateBranchProtectionPriories: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
RepoUpdateFile updates a file in a repository
|
||||
*/
|
||||
|
144
common/gitea-generated/models/action_task.go
Normal file
144
common/gitea-generated/models/action_task.go
Normal file
@@ -0,0 +1,144 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// ActionTask ActionTask represents a ActionTask
|
||||
//
|
||||
// swagger:model ActionTask
|
||||
type ActionTask struct {
|
||||
|
||||
// created at
|
||||
// Format: date-time
|
||||
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
|
||||
|
||||
// display title
|
||||
DisplayTitle string `json:"display_title,omitempty"`
|
||||
|
||||
// event
|
||||
Event string `json:"event,omitempty"`
|
||||
|
||||
// head branch
|
||||
HeadBranch string `json:"head_branch,omitempty"`
|
||||
|
||||
// head s h a
|
||||
HeadSHA string `json:"head_sha,omitempty"`
|
||||
|
||||
// ID
|
||||
ID int64 `json:"id,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// run number
|
||||
RunNumber int64 `json:"run_number,omitempty"`
|
||||
|
||||
// run started at
|
||||
// Format: date-time
|
||||
RunStartedAt strfmt.DateTime `json:"run_started_at,omitempty"`
|
||||
|
||||
// status
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
// URL
|
||||
URL string `json:"url,omitempty"`
|
||||
|
||||
// updated at
|
||||
// Format: date-time
|
||||
UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"`
|
||||
|
||||
// workflow ID
|
||||
WorkflowID string `json:"workflow_id,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this action task
|
||||
func (m *ActionTask) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateCreatedAt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateRunStartedAt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUpdatedAt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ActionTask) validateCreatedAt(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.CreatedAt) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ActionTask) validateRunStartedAt(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.RunStartedAt) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("run_started_at", "body", "date-time", m.RunStartedAt.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ActionTask) validateUpdatedAt(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.UpdatedAt) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this action task based on context it is used
|
||||
func (m *ActionTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ActionTask) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ActionTask) UnmarshalBinary(b []byte) error {
|
||||
var res ActionTask
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
124
common/gitea-generated/models/action_task_response.go
Normal file
124
common/gitea-generated/models/action_task_response.go
Normal file
@@ -0,0 +1,124 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// ActionTaskResponse ActionTaskResponse returns a ActionTask
|
||||
//
|
||||
// swagger:model ActionTaskResponse
|
||||
type ActionTaskResponse struct {
|
||||
|
||||
// entries
|
||||
Entries []*ActionTask `json:"workflow_runs"`
|
||||
|
||||
// total count
|
||||
TotalCount int64 `json:"total_count,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this action task response
|
||||
func (m *ActionTaskResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateEntries(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ActionTaskResponse) validateEntries(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Entries) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Entries); i++ {
|
||||
if swag.IsZero(m.Entries[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Entries[i] != nil {
|
||||
if err := m.Entries[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("workflow_runs" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("workflow_runs" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this action task response based on the context it is used
|
||||
func (m *ActionTaskResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateEntries(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ActionTaskResponse) contextValidateEntries(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Entries); i++ {
|
||||
|
||||
if m.Entries[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Entries[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Entries[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("workflow_runs" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("workflow_runs" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ActionTaskResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ActionTaskResponse) UnmarshalBinary(b []byte) error {
|
||||
var res ActionTaskResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
@@ -7,6 +7,7 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
@@ -38,7 +39,8 @@ type Activity struct {
|
||||
// is private
|
||||
IsPrivate bool `json:"is_private,omitempty"`
|
||||
|
||||
// op type
|
||||
// the type of action
|
||||
// Enum: ["create_repo","rename_repo","star_repo","watch_repo","commit_repo","create_issue","create_pull_request","transfer_repo","push_tag","comment_issue","merge_pull_request","close_issue","reopen_issue","close_pull_request","reopen_pull_request","delete_tag","delete_branch","mirror_sync_push","mirror_sync_create","mirror_sync_delete","approve_pull_request","reject_pull_request","comment_pull","publish_release","pull_review_dismissed","pull_request_ready_for_review","auto_merge_pull_request"]
|
||||
OpType string `json:"op_type,omitempty"`
|
||||
|
||||
// ref name
|
||||
@@ -68,6 +70,10 @@ func (m *Activity) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateOpType(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateActUser(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -98,6 +104,123 @@ func (m *Activity) validateCreated(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var activityTypeOpTypePropEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []string
|
||||
if err := json.Unmarshal([]byte(`["create_repo","rename_repo","star_repo","watch_repo","commit_repo","create_issue","create_pull_request","transfer_repo","push_tag","comment_issue","merge_pull_request","close_issue","reopen_issue","close_pull_request","reopen_pull_request","delete_tag","delete_branch","mirror_sync_push","mirror_sync_create","mirror_sync_delete","approve_pull_request","reject_pull_request","comment_pull","publish_release","pull_review_dismissed","pull_request_ready_for_review","auto_merge_pull_request"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
activityTypeOpTypePropEnum = append(activityTypeOpTypePropEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
// ActivityOpTypeCreateRepo captures enum value "create_repo"
|
||||
ActivityOpTypeCreateRepo string = "create_repo"
|
||||
|
||||
// ActivityOpTypeRenameRepo captures enum value "rename_repo"
|
||||
ActivityOpTypeRenameRepo string = "rename_repo"
|
||||
|
||||
// ActivityOpTypeStarRepo captures enum value "star_repo"
|
||||
ActivityOpTypeStarRepo string = "star_repo"
|
||||
|
||||
// ActivityOpTypeWatchRepo captures enum value "watch_repo"
|
||||
ActivityOpTypeWatchRepo string = "watch_repo"
|
||||
|
||||
// ActivityOpTypeCommitRepo captures enum value "commit_repo"
|
||||
ActivityOpTypeCommitRepo string = "commit_repo"
|
||||
|
||||
// ActivityOpTypeCreateIssue captures enum value "create_issue"
|
||||
ActivityOpTypeCreateIssue string = "create_issue"
|
||||
|
||||
// ActivityOpTypeCreatePullRequest captures enum value "create_pull_request"
|
||||
ActivityOpTypeCreatePullRequest string = "create_pull_request"
|
||||
|
||||
// ActivityOpTypeTransferRepo captures enum value "transfer_repo"
|
||||
ActivityOpTypeTransferRepo string = "transfer_repo"
|
||||
|
||||
// ActivityOpTypePushTag captures enum value "push_tag"
|
||||
ActivityOpTypePushTag string = "push_tag"
|
||||
|
||||
// ActivityOpTypeCommentIssue captures enum value "comment_issue"
|
||||
ActivityOpTypeCommentIssue string = "comment_issue"
|
||||
|
||||
// ActivityOpTypeMergePullRequest captures enum value "merge_pull_request"
|
||||
ActivityOpTypeMergePullRequest string = "merge_pull_request"
|
||||
|
||||
// ActivityOpTypeCloseIssue captures enum value "close_issue"
|
||||
ActivityOpTypeCloseIssue string = "close_issue"
|
||||
|
||||
// ActivityOpTypeReopenIssue captures enum value "reopen_issue"
|
||||
ActivityOpTypeReopenIssue string = "reopen_issue"
|
||||
|
||||
// ActivityOpTypeClosePullRequest captures enum value "close_pull_request"
|
||||
ActivityOpTypeClosePullRequest string = "close_pull_request"
|
||||
|
||||
// ActivityOpTypeReopenPullRequest captures enum value "reopen_pull_request"
|
||||
ActivityOpTypeReopenPullRequest string = "reopen_pull_request"
|
||||
|
||||
// ActivityOpTypeDeleteTag captures enum value "delete_tag"
|
||||
ActivityOpTypeDeleteTag string = "delete_tag"
|
||||
|
||||
// ActivityOpTypeDeleteBranch captures enum value "delete_branch"
|
||||
ActivityOpTypeDeleteBranch string = "delete_branch"
|
||||
|
||||
// ActivityOpTypeMirrorSyncPush captures enum value "mirror_sync_push"
|
||||
ActivityOpTypeMirrorSyncPush string = "mirror_sync_push"
|
||||
|
||||
// ActivityOpTypeMirrorSyncCreate captures enum value "mirror_sync_create"
|
||||
ActivityOpTypeMirrorSyncCreate string = "mirror_sync_create"
|
||||
|
||||
// ActivityOpTypeMirrorSyncDelete captures enum value "mirror_sync_delete"
|
||||
ActivityOpTypeMirrorSyncDelete string = "mirror_sync_delete"
|
||||
|
||||
// ActivityOpTypeApprovePullRequest captures enum value "approve_pull_request"
|
||||
ActivityOpTypeApprovePullRequest string = "approve_pull_request"
|
||||
|
||||
// ActivityOpTypeRejectPullRequest captures enum value "reject_pull_request"
|
||||
ActivityOpTypeRejectPullRequest string = "reject_pull_request"
|
||||
|
||||
// ActivityOpTypeCommentPull captures enum value "comment_pull"
|
||||
ActivityOpTypeCommentPull string = "comment_pull"
|
||||
|
||||
// ActivityOpTypePublishRelease captures enum value "publish_release"
|
||||
ActivityOpTypePublishRelease string = "publish_release"
|
||||
|
||||
// ActivityOpTypePullReviewDismissed captures enum value "pull_review_dismissed"
|
||||
ActivityOpTypePullReviewDismissed string = "pull_review_dismissed"
|
||||
|
||||
// ActivityOpTypePullRequestReadyForReview captures enum value "pull_request_ready_for_review"
|
||||
ActivityOpTypePullRequestReadyForReview string = "pull_request_ready_for_review"
|
||||
|
||||
// ActivityOpTypeAutoMergePullRequest captures enum value "auto_merge_pull_request"
|
||||
ActivityOpTypeAutoMergePullRequest string = "auto_merge_pull_request"
|
||||
)
|
||||
|
||||
// prop value enum
|
||||
func (m *Activity) validateOpTypeEnum(path, location string, value string) error {
|
||||
if err := validate.EnumCase(path, location, value, activityTypeOpTypePropEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Activity) validateOpType(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.OpType) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
// value enum
|
||||
if err := m.validateOpTypeEnum("op_type", "body", m.OpType); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Activity) validateActUser(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.ActUser) { // not required
|
||||
return nil
|
||||
|
@@ -7,9 +7,12 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// AddCollaboratorOption AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
@@ -18,11 +21,66 @@ import (
|
||||
type AddCollaboratorOption struct {
|
||||
|
||||
// permission
|
||||
// Enum: ["read","write","admin"]
|
||||
Permission string `json:"permission,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this add collaborator option
|
||||
func (m *AddCollaboratorOption) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePermission(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var addCollaboratorOptionTypePermissionPropEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []string
|
||||
if err := json.Unmarshal([]byte(`["read","write","admin"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
addCollaboratorOptionTypePermissionPropEnum = append(addCollaboratorOptionTypePermissionPropEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
// AddCollaboratorOptionPermissionRead captures enum value "read"
|
||||
AddCollaboratorOptionPermissionRead string = "read"
|
||||
|
||||
// AddCollaboratorOptionPermissionWrite captures enum value "write"
|
||||
AddCollaboratorOptionPermissionWrite string = "write"
|
||||
|
||||
// AddCollaboratorOptionPermissionAdmin captures enum value "admin"
|
||||
AddCollaboratorOptionPermissionAdmin string = "admin"
|
||||
)
|
||||
|
||||
// prop value enum
|
||||
func (m *AddCollaboratorOption) validatePermissionEnum(path, location string, value string) error {
|
||||
if err := validate.EnumCase(path, location, value, addCollaboratorOptionTypePermissionPropEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AddCollaboratorOption) validatePermission(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Permission) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
// value enum
|
||||
if err := m.validatePermissionEnum("permission", "body", m.Permission); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,9 @@ type BranchProtection struct {
|
||||
// approvals whitelist usernames
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
|
||||
|
||||
// block admin merge override
|
||||
BlockAdminMergeOverride bool `json:"block_admin_merge_override,omitempty"`
|
||||
|
||||
// block on official review requests
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
|
||||
@@ -47,6 +50,12 @@ type BranchProtection struct {
|
||||
// enable approvals whitelist
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
|
||||
// enable force push
|
||||
EnableForcePush bool `json:"enable_force_push,omitempty"`
|
||||
|
||||
// enable force push allowlist
|
||||
EnableForcePushAllowlist bool `json:"enable_force_push_allowlist,omitempty"`
|
||||
|
||||
// enable merge whitelist
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
|
||||
@@ -59,6 +68,15 @@ type BranchProtection struct {
|
||||
// enable status check
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
|
||||
// force push allowlist deploy keys
|
||||
ForcePushAllowlistDeployKeys bool `json:"force_push_allowlist_deploy_keys,omitempty"`
|
||||
|
||||
// force push allowlist teams
|
||||
ForcePushAllowlistTeams []string `json:"force_push_allowlist_teams"`
|
||||
|
||||
// force push allowlist usernames
|
||||
ForcePushAllowlistUsernames []string `json:"force_push_allowlist_usernames"`
|
||||
|
||||
// ignore stale approvals
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
|
||||
@@ -68,6 +86,9 @@ type BranchProtection struct {
|
||||
// merge whitelist usernames
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
|
||||
|
||||
// priority
|
||||
Priority int64 `json:"priority,omitempty"`
|
||||
|
||||
// protected file patterns
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
|
||||
|
@@ -24,6 +24,7 @@ type CreateAccessTokenOption struct {
|
||||
Name *string `json:"name"`
|
||||
|
||||
// scopes
|
||||
// Example: ["all","read:activitypub","read:issue","write:misc","read:notification","read:organization","read:package","read:repository","read:user"]
|
||||
Scopes []string `json:"scopes"`
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,9 @@ type CreateBranchProtectionOption struct {
|
||||
// approvals whitelist usernames
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
|
||||
|
||||
// block admin merge override
|
||||
BlockAdminMergeOverride bool `json:"block_admin_merge_override,omitempty"`
|
||||
|
||||
// block on official review requests
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
|
||||
@@ -41,6 +44,12 @@ type CreateBranchProtectionOption struct {
|
||||
// enable approvals whitelist
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
|
||||
// enable force push
|
||||
EnableForcePush bool `json:"enable_force_push,omitempty"`
|
||||
|
||||
// enable force push allowlist
|
||||
EnableForcePushAllowlist bool `json:"enable_force_push_allowlist,omitempty"`
|
||||
|
||||
// enable merge whitelist
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
|
||||
@@ -53,6 +62,15 @@ type CreateBranchProtectionOption struct {
|
||||
// enable status check
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
|
||||
// force push allowlist deploy keys
|
||||
ForcePushAllowlistDeployKeys bool `json:"force_push_allowlist_deploy_keys,omitempty"`
|
||||
|
||||
// force push allowlist teams
|
||||
ForcePushAllowlistTeams []string `json:"force_push_allowlist_teams"`
|
||||
|
||||
// force push allowlist usernames
|
||||
ForcePushAllowlistUsernames []string `json:"force_push_allowlist_usernames"`
|
||||
|
||||
// ignore stale approvals
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
|
||||
@@ -62,6 +80,9 @@ type CreateBranchProtectionOption struct {
|
||||
// merge whitelist usernames
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
|
||||
|
||||
// priority
|
||||
Priority int64 `json:"priority,omitempty"`
|
||||
|
||||
// protected file patterns
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
|
||||
|
@@ -25,6 +25,9 @@ type CreateOAuth2ApplicationOptions struct {
|
||||
|
||||
// redirect u r is
|
||||
RedirectURIs []string `json:"redirect_uris"`
|
||||
|
||||
// skip secondary authorization
|
||||
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this create o auth2 application options
|
||||
|
@@ -44,6 +44,12 @@ type CreatePullRequestOption struct {
|
||||
// milestone
|
||||
Milestone int64 `json:"milestone,omitempty"`
|
||||
|
||||
// reviewers
|
||||
Reviewers []string `json:"reviewers"`
|
||||
|
||||
// team reviewers
|
||||
TeamReviewers []string `json:"team_reviewers"`
|
||||
|
||||
// title
|
||||
Title string `json:"title,omitempty"`
|
||||
}
|
||||
|
@@ -0,0 +1,56 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// CreateTagProtectionOption CreateTagProtectionOption options for creating a tag protection
|
||||
//
|
||||
// swagger:model CreateTagProtectionOption
|
||||
type CreateTagProtectionOption struct {
|
||||
|
||||
// name pattern
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
|
||||
// whitelist teams
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
|
||||
// whitelist usernames
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
}
|
||||
|
||||
// Validate validates this create tag protection option
|
||||
func (m *CreateTagProtectionOption) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this create tag protection option based on context it is used
|
||||
func (m *CreateTagProtectionOption) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CreateTagProtectionOption) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CreateTagProtectionOption) UnmarshalBinary(b []byte) error {
|
||||
var res CreateTagProtectionOption
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
@@ -23,6 +23,9 @@ type EditBranchProtectionOption struct {
|
||||
// approvals whitelist usernames
|
||||
ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
|
||||
|
||||
// block admin merge override
|
||||
BlockAdminMergeOverride bool `json:"block_admin_merge_override,omitempty"`
|
||||
|
||||
// block on official review requests
|
||||
BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests,omitempty"`
|
||||
|
||||
@@ -38,6 +41,12 @@ type EditBranchProtectionOption struct {
|
||||
// enable approvals whitelist
|
||||
EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist,omitempty"`
|
||||
|
||||
// enable force push
|
||||
EnableForcePush bool `json:"enable_force_push,omitempty"`
|
||||
|
||||
// enable force push allowlist
|
||||
EnableForcePushAllowlist bool `json:"enable_force_push_allowlist,omitempty"`
|
||||
|
||||
// enable merge whitelist
|
||||
EnableMergeWhitelist bool `json:"enable_merge_whitelist,omitempty"`
|
||||
|
||||
@@ -50,6 +59,15 @@ type EditBranchProtectionOption struct {
|
||||
// enable status check
|
||||
EnableStatusCheck bool `json:"enable_status_check,omitempty"`
|
||||
|
||||
// force push allowlist deploy keys
|
||||
ForcePushAllowlistDeployKeys bool `json:"force_push_allowlist_deploy_keys,omitempty"`
|
||||
|
||||
// force push allowlist teams
|
||||
ForcePushAllowlistTeams []string `json:"force_push_allowlist_teams"`
|
||||
|
||||
// force push allowlist usernames
|
||||
ForcePushAllowlistUsernames []string `json:"force_push_allowlist_usernames"`
|
||||
|
||||
// ignore stale approvals
|
||||
IgnoreStaleApprovals bool `json:"ignore_stale_approvals,omitempty"`
|
||||
|
||||
@@ -59,6 +77,9 @@ type EditBranchProtectionOption struct {
|
||||
// merge whitelist usernames
|
||||
MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
|
||||
|
||||
// priority
|
||||
Priority int64 `json:"priority,omitempty"`
|
||||
|
||||
// protected file patterns
|
||||
ProtectedFilePatterns string `json:"protected_file_patterns,omitempty"`
|
||||
|
||||
|
56
common/gitea-generated/models/edit_tag_protection_option.go
Normal file
56
common/gitea-generated/models/edit_tag_protection_option.go
Normal file
@@ -0,0 +1,56 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// EditTagProtectionOption EditTagProtectionOption options for editing a tag protection
|
||||
//
|
||||
// swagger:model EditTagProtectionOption
|
||||
type EditTagProtectionOption struct {
|
||||
|
||||
// name pattern
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
|
||||
// whitelist teams
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
|
||||
// whitelist usernames
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
}
|
||||
|
||||
// Validate validates this edit tag protection option
|
||||
func (m *EditTagProtectionOption) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this edit tag protection option based on context it is used
|
||||
func (m *EditTagProtectionOption) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *EditTagProtectionOption) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *EditTagProtectionOption) UnmarshalBinary(b []byte) error {
|
||||
var res EditTagProtectionOption
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
@@ -40,8 +40,11 @@ type IssueTemplate struct {
|
||||
// title
|
||||
Title string `json:"title,omitempty"`
|
||||
|
||||
// assignees
|
||||
Assignees IssueTemplateStringSlice `json:"assignees,omitempty"`
|
||||
|
||||
// labels
|
||||
Labels IssueTemplateLabels `json:"labels,omitempty"`
|
||||
Labels IssueTemplateStringSlice `json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this issue template
|
||||
@@ -52,6 +55,10 @@ func (m *IssueTemplate) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateAssignees(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateLabels(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -88,6 +95,23 @@ func (m *IssueTemplate) validateFields(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IssueTemplate) validateAssignees(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Assignees) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Assignees.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assignees")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("assignees")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IssueTemplate) validateLabels(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Labels) { // not required
|
||||
return nil
|
||||
@@ -113,6 +137,10 @@ func (m *IssueTemplate) ContextValidate(ctx context.Context, formats strfmt.Regi
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateAssignees(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateLabels(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -148,6 +176,20 @@ func (m *IssueTemplate) contextValidateFields(ctx context.Context, formats strfm
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IssueTemplate) contextValidateAssignees(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if err := m.Assignees.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("assignees")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("assignees")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IssueTemplate) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if err := m.Labels.ContextValidate(ctx, formats); err != nil {
|
||||
|
27
common/gitea-generated/models/issue_template_string_slice.go
Normal file
27
common/gitea-generated/models/issue_template_string_slice.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// IssueTemplateStringSlice issue template string slice
|
||||
//
|
||||
// swagger:model IssueTemplateStringSlice
|
||||
type IssueTemplateStringSlice []string
|
||||
|
||||
// Validate validates this issue template string slice
|
||||
func (m IssueTemplateStringSlice) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this issue template string slice based on context it is used
|
||||
func (m IssueTemplateStringSlice) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
@@ -23,7 +23,7 @@ type MarkdownOption struct {
|
||||
// in: body
|
||||
Context string `json:"Context,omitempty"`
|
||||
|
||||
// Mode to render (comment, gfm, markdown)
|
||||
// Mode to render (markdown, comment, wiki, file)
|
||||
//
|
||||
// in: body
|
||||
Mode string `json:"Mode,omitempty"`
|
||||
@@ -33,8 +33,9 @@ type MarkdownOption struct {
|
||||
// in: body
|
||||
Text string `json:"Text,omitempty"`
|
||||
|
||||
// Is it a wiki page ?
|
||||
// Is it a wiki page? (use mode=wiki instead)
|
||||
//
|
||||
// Deprecated: true
|
||||
// in: body
|
||||
Wiki bool `json:"Wiki,omitempty"`
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ type MarkupOption struct {
|
||||
// in: body
|
||||
FilePath string `json:"FilePath,omitempty"`
|
||||
|
||||
// Mode to render (comment, gfm, markdown, file)
|
||||
// Mode to render (markdown, comment, wiki, file)
|
||||
//
|
||||
// in: body
|
||||
Mode string `json:"Mode,omitempty"`
|
||||
@@ -38,8 +38,9 @@ type MarkupOption struct {
|
||||
// in: body
|
||||
Text string `json:"Text,omitempty"`
|
||||
|
||||
// Is it a wiki page ?
|
||||
// Is it a wiki page? (use mode=wiki instead)
|
||||
//
|
||||
// Deprecated: true
|
||||
// in: body
|
||||
Wiki bool `json:"Wiki,omitempty"`
|
||||
}
|
||||
|
50
common/gitea-generated/models/merge_upstream_request.go
Normal file
50
common/gitea-generated/models/merge_upstream_request.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// MergeUpstreamRequest merge upstream request
|
||||
//
|
||||
// swagger:model MergeUpstreamRequest
|
||||
type MergeUpstreamRequest struct {
|
||||
|
||||
// branch
|
||||
Branch string `json:"branch,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this merge upstream request
|
||||
func (m *MergeUpstreamRequest) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this merge upstream request based on context it is used
|
||||
func (m *MergeUpstreamRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MergeUpstreamRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MergeUpstreamRequest) UnmarshalBinary(b []byte) error {
|
||||
var res MergeUpstreamRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
50
common/gitea-generated/models/merge_upstream_response.go
Normal file
50
common/gitea-generated/models/merge_upstream_response.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// MergeUpstreamResponse merge upstream response
|
||||
//
|
||||
// swagger:model MergeUpstreamResponse
|
||||
type MergeUpstreamResponse struct {
|
||||
|
||||
// merge style
|
||||
MergeStyle string `json:"merge_type,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this merge upstream response
|
||||
func (m *MergeUpstreamResponse) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this merge upstream response based on context it is used
|
||||
func (m *MergeUpstreamResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MergeUpstreamResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MergeUpstreamResponse) UnmarshalBinary(b []byte) error {
|
||||
var res MergeUpstreamResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
@@ -21,6 +21,12 @@ import (
|
||||
// swagger:model MigrateRepoOptions
|
||||
type MigrateRepoOptions struct {
|
||||
|
||||
// a w s access key ID
|
||||
AWSAccessKeyID string `json:"aws_access_key_id,omitempty"`
|
||||
|
||||
// a w s secret access key
|
||||
AWSSecretAccessKey string `json:"aws_secret_access_key,omitempty"`
|
||||
|
||||
// auth password
|
||||
AuthPassword string `json:"auth_password,omitempty"`
|
||||
|
||||
|
@@ -40,6 +40,9 @@ type OAuth2Application struct {
|
||||
|
||||
// redirect u r is
|
||||
RedirectURIs []string `json:"redirect_uris"`
|
||||
|
||||
// skip secondary authorization
|
||||
SkipSecondaryAuthorization bool `json:"skip_secondary_authorization,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this o auth2 application
|
||||
|
@@ -99,6 +99,9 @@ type PullRequest struct {
|
||||
// requested reviewers
|
||||
RequestedReviewers []*User `json:"requested_reviewers"`
|
||||
|
||||
// requested reviewers teams
|
||||
RequestedReviewersTeams []*Team `json:"requested_reviewers_teams"`
|
||||
|
||||
// number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
|
||||
ReviewComments int64 `json:"review_comments,omitempty"`
|
||||
|
||||
@@ -166,6 +169,10 @@ func (m *PullRequest) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateRequestedReviewersTeams(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUpdated(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -330,6 +337,32 @@ func (m *PullRequest) validateRequestedReviewers(formats strfmt.Registry) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PullRequest) validateRequestedReviewersTeams(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.RequestedReviewersTeams) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.RequestedReviewersTeams); i++ {
|
||||
if swag.IsZero(m.RequestedReviewersTeams[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.RequestedReviewersTeams[i] != nil {
|
||||
if err := m.RequestedReviewersTeams[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("requested_reviewers_teams" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("requested_reviewers_teams" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PullRequest) validateUpdated(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Updated) { // not required
|
||||
return nil
|
||||
@@ -489,6 +522,10 @@ func (m *PullRequest) ContextValidate(ctx context.Context, formats strfmt.Regist
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateRequestedReviewersTeams(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateAssignee(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -598,6 +635,31 @@ func (m *PullRequest) contextValidateRequestedReviewers(ctx context.Context, for
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PullRequest) contextValidateRequestedReviewersTeams(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.RequestedReviewersTeams); i++ {
|
||||
|
||||
if m.RequestedReviewersTeams[i] != nil {
|
||||
|
||||
if swag.IsZero(m.RequestedReviewersTeams[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.RequestedReviewersTeams[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("requested_reviewers_teams" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("requested_reviewers_teams" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PullRequest) contextValidateAssignee(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Assignee != nil {
|
||||
|
@@ -23,6 +23,9 @@ type Repository struct {
|
||||
// allow fast forward only
|
||||
AllowFastForwardOnly bool `json:"allow_fast_forward_only_merge,omitempty"`
|
||||
|
||||
// allow manual merge
|
||||
AllowManualMerge bool `json:"allow_manual_merge,omitempty"`
|
||||
|
||||
// allow merge
|
||||
AllowMerge bool `json:"allow_merge_commits,omitempty"`
|
||||
|
||||
@@ -45,6 +48,9 @@ type Repository struct {
|
||||
// Format: date-time
|
||||
ArchivedAt strfmt.DateTime `json:"archived_at,omitempty"`
|
||||
|
||||
// autodetect manual merge
|
||||
AutodetectManualMerge bool `json:"autodetect_manual_merge,omitempty"`
|
||||
|
||||
// avatar URL
|
||||
AvatarURL string `json:"avatar_url,omitempty"`
|
||||
|
||||
@@ -121,6 +127,9 @@ type Repository struct {
|
||||
// languages URL
|
||||
LanguagesURL string `json:"languages_url,omitempty"`
|
||||
|
||||
// licenses
|
||||
Licenses []string `json:"licenses"`
|
||||
|
||||
// link
|
||||
Link string `json:"link,omitempty"`
|
||||
|
||||
@@ -171,6 +180,9 @@ type Repository struct {
|
||||
// template
|
||||
Template bool `json:"template,omitempty"`
|
||||
|
||||
// topics
|
||||
Topics []string `json:"topics"`
|
||||
|
||||
// URL
|
||||
URL string `json:"url,omitempty"`
|
||||
|
||||
|
106
common/gitea-generated/models/tag_protection.go
Normal file
106
common/gitea-generated/models/tag_protection.go
Normal file
@@ -0,0 +1,106 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// TagProtection TagProtection represents a tag protection
|
||||
//
|
||||
// swagger:model TagProtection
|
||||
type TagProtection struct {
|
||||
|
||||
// created
|
||||
// Format: date-time
|
||||
Created strfmt.DateTime `json:"created_at,omitempty"`
|
||||
|
||||
// ID
|
||||
ID int64 `json:"id,omitempty"`
|
||||
|
||||
// name pattern
|
||||
NamePattern string `json:"name_pattern,omitempty"`
|
||||
|
||||
// updated
|
||||
// Format: date-time
|
||||
Updated strfmt.DateTime `json:"updated_at,omitempty"`
|
||||
|
||||
// whitelist teams
|
||||
WhitelistTeams []string `json:"whitelist_teams"`
|
||||
|
||||
// whitelist usernames
|
||||
WhitelistUsernames []string `json:"whitelist_usernames"`
|
||||
}
|
||||
|
||||
// Validate validates this tag protection
|
||||
func (m *TagProtection) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateCreated(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUpdated(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TagProtection) validateCreated(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Created) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("created_at", "body", "date-time", m.Created.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TagProtection) validateUpdated(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Updated) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("updated_at", "body", "date-time", m.Updated.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this tag protection based on context it is used
|
||||
func (m *TagProtection) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TagProtection) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TagProtection) UnmarshalBinary(b []byte) error {
|
||||
var res TagProtection
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// UpdateBranchProtectionPriories UpdateBranchProtectionPriories a list to update the branch protection rule priorities
|
||||
//
|
||||
// swagger:model UpdateBranchProtectionPriories
|
||||
type UpdateBranchProtectionPriories struct {
|
||||
|
||||
// i ds
|
||||
IDs []int64 `json:"ids"`
|
||||
}
|
||||
|
||||
// Validate validates this update branch protection priories
|
||||
func (m *UpdateBranchProtectionPriories) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this update branch protection priories based on context it is used
|
||||
func (m *UpdateBranchProtectionPriories) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UpdateBranchProtectionPriories) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UpdateBranchProtectionPriories) UnmarshalBinary(b []byte) error {
|
||||
var res UpdateBranchProtectionPriories
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
71
common/gitea-generated/models/update_branch_repo_option.go
Normal file
71
common/gitea-generated/models/update_branch_repo_option.go
Normal file
@@ -0,0 +1,71 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// UpdateBranchRepoOption UpdateBranchRepoOption options when updating a branch in a repository
|
||||
//
|
||||
// swagger:model UpdateBranchRepoOption
|
||||
type UpdateBranchRepoOption struct {
|
||||
|
||||
// New branch name
|
||||
// Required: true
|
||||
Name *string `json:"name"`
|
||||
}
|
||||
|
||||
// Validate validates this update branch repo option
|
||||
func (m *UpdateBranchRepoOption) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *UpdateBranchRepoOption) validateName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("name", "body", m.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this update branch repo option based on context it is used
|
||||
func (m *UpdateBranchRepoOption) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *UpdateBranchRepoOption) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UpdateBranchRepoOption) UnmarshalBinary(b []byte) error {
|
||||
var res UpdateBranchRepoOption
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
2
go.mod
2
go.mod
@@ -8,6 +8,7 @@ require (
|
||||
github.com/go-openapi/strfmt v0.23.0
|
||||
github.com/go-openapi/swag v0.23.0
|
||||
github.com/go-openapi/validate v0.24.0
|
||||
github.com/opentracing/opentracing-go v1.2.0
|
||||
github.com/rabbitmq/amqp091-go v1.10.0
|
||||
github.com/tailscale/hujson v0.0.0-20250226034555-ec1d1c113d33
|
||||
go.uber.org/mock v0.5.0
|
||||
@@ -27,7 +28,6 @@ require (
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
go.mongodb.org/mongo-driver v1.14.0 // indirect
|
||||
go.opentelemetry.io/otel v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.24.0 // indirect
|
||||
|
Reference in New Issue
Block a user