autogits/bots-common/gitea-generated/client/repository/create_repo_variable_responses.go
Adam Majer 598ecbbd5a .
2024-07-07 21:12:40 +02:00

291 lines
9.4 KiB
Go

// 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"
)
// CreateRepoVariableReader is a Reader for the CreateRepoVariable structure.
type CreateRepoVariableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CreateRepoVariableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewCreateRepoVariableCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 204:
result := NewCreateRepoVariableNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewCreateRepoVariableBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewCreateRepoVariableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /repos/{owner}/{repo}/actions/variables/{variablename}] createRepoVariable", response, response.Code())
}
}
// NewCreateRepoVariableCreated creates a CreateRepoVariableCreated with default headers values
func NewCreateRepoVariableCreated() *CreateRepoVariableCreated {
return &CreateRepoVariableCreated{}
}
/*
CreateRepoVariableCreated describes a response with status code 201, with default header values.
response when creating a repo-level variable
*/
type CreateRepoVariableCreated struct {
}
// IsSuccess returns true when this create repo variable created response has a 2xx status code
func (o *CreateRepoVariableCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this create repo variable created response has a 3xx status code
func (o *CreateRepoVariableCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this create repo variable created response has a 4xx status code
func (o *CreateRepoVariableCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this create repo variable created response has a 5xx status code
func (o *CreateRepoVariableCreated) IsServerError() bool {
return false
}
// IsCode returns true when this create repo variable created response a status code equal to that given
func (o *CreateRepoVariableCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the create repo variable created response
func (o *CreateRepoVariableCreated) Code() int {
return 201
}
func (o *CreateRepoVariableCreated) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableCreated", 201)
}
func (o *CreateRepoVariableCreated) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableCreated", 201)
}
func (o *CreateRepoVariableCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewCreateRepoVariableNoContent creates a CreateRepoVariableNoContent with default headers values
func NewCreateRepoVariableNoContent() *CreateRepoVariableNoContent {
return &CreateRepoVariableNoContent{}
}
/*
CreateRepoVariableNoContent describes a response with status code 204, with default header values.
response when creating a repo-level variable
*/
type CreateRepoVariableNoContent struct {
}
// IsSuccess returns true when this create repo variable no content response has a 2xx status code
func (o *CreateRepoVariableNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this create repo variable no content response has a 3xx status code
func (o *CreateRepoVariableNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this create repo variable no content response has a 4xx status code
func (o *CreateRepoVariableNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this create repo variable no content response has a 5xx status code
func (o *CreateRepoVariableNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this create repo variable no content response a status code equal to that given
func (o *CreateRepoVariableNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the create repo variable no content response
func (o *CreateRepoVariableNoContent) Code() int {
return 204
}
func (o *CreateRepoVariableNoContent) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNoContent", 204)
}
func (o *CreateRepoVariableNoContent) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNoContent", 204)
}
func (o *CreateRepoVariableNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewCreateRepoVariableBadRequest creates a CreateRepoVariableBadRequest with default headers values
func NewCreateRepoVariableBadRequest() *CreateRepoVariableBadRequest {
return &CreateRepoVariableBadRequest{}
}
/*
CreateRepoVariableBadRequest describes a response with status code 400, with default header values.
APIError is error format response
*/
type CreateRepoVariableBadRequest struct {
Message string
URL string
}
// IsSuccess returns true when this create repo variable bad request response has a 2xx status code
func (o *CreateRepoVariableBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this create repo variable bad request response has a 3xx status code
func (o *CreateRepoVariableBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this create repo variable bad request response has a 4xx status code
func (o *CreateRepoVariableBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this create repo variable bad request response has a 5xx status code
func (o *CreateRepoVariableBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this create repo variable bad request response a status code equal to that given
func (o *CreateRepoVariableBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the create repo variable bad request response
func (o *CreateRepoVariableBadRequest) Code() int {
return 400
}
func (o *CreateRepoVariableBadRequest) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableBadRequest", 400)
}
func (o *CreateRepoVariableBadRequest) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableBadRequest", 400)
}
func (o *CreateRepoVariableBadRequest) 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
}
// NewCreateRepoVariableNotFound creates a CreateRepoVariableNotFound with default headers values
func NewCreateRepoVariableNotFound() *CreateRepoVariableNotFound {
return &CreateRepoVariableNotFound{}
}
/*
CreateRepoVariableNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type CreateRepoVariableNotFound struct {
}
// IsSuccess returns true when this create repo variable not found response has a 2xx status code
func (o *CreateRepoVariableNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this create repo variable not found response has a 3xx status code
func (o *CreateRepoVariableNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this create repo variable not found response has a 4xx status code
func (o *CreateRepoVariableNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this create repo variable not found response has a 5xx status code
func (o *CreateRepoVariableNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this create repo variable not found response a status code equal to that given
func (o *CreateRepoVariableNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the create repo variable not found response
func (o *CreateRepoVariableNotFound) Code() int {
return 404
}
func (o *CreateRepoVariableNotFound) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNotFound", 404)
}
func (o *CreateRepoVariableNotFound) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/actions/variables/{variablename}][%d] createRepoVariableNotFound", 404)
}
func (o *CreateRepoVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}