代码拉取完成,页面将自动刷新
// Code generated by go-swagger; DO NOT EDIT.
package retention
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/mittwald/goharbor-client/v5/apiv2/model"
)
// TriggerRetentionExecutionReader is a Reader for the TriggerRetentionExecution structure.
type TriggerRetentionExecutionReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *TriggerRetentionExecutionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewTriggerRetentionExecutionOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 201:
result := NewTriggerRetentionExecutionCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewTriggerRetentionExecutionUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewTriggerRetentionExecutionForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewTriggerRetentionExecutionInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewTriggerRetentionExecutionOK creates a TriggerRetentionExecutionOK with default headers values
func NewTriggerRetentionExecutionOK() *TriggerRetentionExecutionOK {
return &TriggerRetentionExecutionOK{}
}
/*TriggerRetentionExecutionOK handles this case with default header values.
Trigger a Retention job successfully.
*/
type TriggerRetentionExecutionOK struct {
}
func (o *TriggerRetentionExecutionOK) Error() string {
return fmt.Sprintf("[POST /retentions/{id}/executions][%d] triggerRetentionExecutionOK ", 200)
}
func (o *TriggerRetentionExecutionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewTriggerRetentionExecutionCreated creates a TriggerRetentionExecutionCreated with default headers values
func NewTriggerRetentionExecutionCreated() *TriggerRetentionExecutionCreated {
return &TriggerRetentionExecutionCreated{}
}
/*TriggerRetentionExecutionCreated handles this case with default header values.
Created
*/
type TriggerRetentionExecutionCreated struct {
/*The location of the resource
*/
Location string
/*The ID of the corresponding request for the response
*/
XRequestID string
}
func (o *TriggerRetentionExecutionCreated) Error() string {
return fmt.Sprintf("[POST /retentions/{id}/executions][%d] triggerRetentionExecutionCreated ", 201)
}
func (o *TriggerRetentionExecutionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Location
o.Location = response.GetHeader("Location")
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
return nil
}
// NewTriggerRetentionExecutionUnauthorized creates a TriggerRetentionExecutionUnauthorized with default headers values
func NewTriggerRetentionExecutionUnauthorized() *TriggerRetentionExecutionUnauthorized {
return &TriggerRetentionExecutionUnauthorized{}
}
/*TriggerRetentionExecutionUnauthorized handles this case with default header values.
Unauthorized
*/
type TriggerRetentionExecutionUnauthorized struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *TriggerRetentionExecutionUnauthorized) Error() string {
return fmt.Sprintf("[POST /retentions/{id}/executions][%d] triggerRetentionExecutionUnauthorized %+v", 401, o.Payload)
}
func (o *TriggerRetentionExecutionUnauthorized) GetPayload() *model.Errors {
return o.Payload
}
func (o *TriggerRetentionExecutionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewTriggerRetentionExecutionForbidden creates a TriggerRetentionExecutionForbidden with default headers values
func NewTriggerRetentionExecutionForbidden() *TriggerRetentionExecutionForbidden {
return &TriggerRetentionExecutionForbidden{}
}
/*TriggerRetentionExecutionForbidden handles this case with default header values.
Forbidden
*/
type TriggerRetentionExecutionForbidden struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *TriggerRetentionExecutionForbidden) Error() string {
return fmt.Sprintf("[POST /retentions/{id}/executions][%d] triggerRetentionExecutionForbidden %+v", 403, o.Payload)
}
func (o *TriggerRetentionExecutionForbidden) GetPayload() *model.Errors {
return o.Payload
}
func (o *TriggerRetentionExecutionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewTriggerRetentionExecutionInternalServerError creates a TriggerRetentionExecutionInternalServerError with default headers values
func NewTriggerRetentionExecutionInternalServerError() *TriggerRetentionExecutionInternalServerError {
return &TriggerRetentionExecutionInternalServerError{}
}
/*TriggerRetentionExecutionInternalServerError handles this case with default header values.
Internal server error
*/
type TriggerRetentionExecutionInternalServerError struct {
/*The ID of the corresponding request for the response
*/
XRequestID string
Payload *model.Errors
}
func (o *TriggerRetentionExecutionInternalServerError) Error() string {
return fmt.Sprintf("[POST /retentions/{id}/executions][%d] triggerRetentionExecutionInternalServerError %+v", 500, o.Payload)
}
func (o *TriggerRetentionExecutionInternalServerError) GetPayload() *model.Errors {
return o.Payload
}
func (o *TriggerRetentionExecutionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Request-Id
o.XRequestID = response.GetHeader("X-Request-Id")
o.Payload = new(model.Errors)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
/*TriggerRetentionExecutionBody trigger retention execution body
swagger:model TriggerRetentionExecutionBody
*/
type TriggerRetentionExecutionBody struct {
// dry run
DryRun bool `json:"dry_run,omitempty"`
}
// Validate validates this trigger retention execution body
func (o *TriggerRetentionExecutionBody) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *TriggerRetentionExecutionBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *TriggerRetentionExecutionBody) UnmarshalBinary(b []byte) error {
var res TriggerRetentionExecutionBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。