github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/replication/get_replication_log_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package replication
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/go-openapi/runtime"
    13  	"github.com/go-openapi/strfmt"
    14  
    15  	"github.com/goharbor/go-client/pkg/sdk/v2.0/models"
    16  )
    17  
    18  // GetReplicationLogReader is a Reader for the GetReplicationLog structure.
    19  type GetReplicationLogReader struct {
    20  	formats strfmt.Registry
    21  }
    22  
    23  // ReadResponse reads a server response into the received o.
    24  func (o *GetReplicationLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    25  	switch response.Code() {
    26  	case 200:
    27  		result := NewGetReplicationLogOK()
    28  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    29  			return nil, err
    30  		}
    31  		return result, nil
    32  	case 401:
    33  		result := NewGetReplicationLogUnauthorized()
    34  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    35  			return nil, err
    36  		}
    37  		return nil, result
    38  	case 403:
    39  		result := NewGetReplicationLogForbidden()
    40  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    41  			return nil, err
    42  		}
    43  		return nil, result
    44  	case 404:
    45  		result := NewGetReplicationLogNotFound()
    46  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    47  			return nil, err
    48  		}
    49  		return nil, result
    50  	case 500:
    51  		result := NewGetReplicationLogInternalServerError()
    52  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    53  			return nil, err
    54  		}
    55  		return nil, result
    56  	default:
    57  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    58  	}
    59  }
    60  
    61  // NewGetReplicationLogOK creates a GetReplicationLogOK with default headers values
    62  func NewGetReplicationLogOK() *GetReplicationLogOK {
    63  	return &GetReplicationLogOK{}
    64  }
    65  
    66  /*
    67  GetReplicationLogOK describes a response with status code 200, with default header values.
    68  
    69  Success
    70  */
    71  type GetReplicationLogOK struct {
    72  
    73  	/* The content type of response body
    74  	 */
    75  	ContentType string
    76  
    77  	Payload string
    78  }
    79  
    80  // IsSuccess returns true when this get replication log o k response has a 2xx status code
    81  func (o *GetReplicationLogOK) IsSuccess() bool {
    82  	return true
    83  }
    84  
    85  // IsRedirect returns true when this get replication log o k response has a 3xx status code
    86  func (o *GetReplicationLogOK) IsRedirect() bool {
    87  	return false
    88  }
    89  
    90  // IsClientError returns true when this get replication log o k response has a 4xx status code
    91  func (o *GetReplicationLogOK) IsClientError() bool {
    92  	return false
    93  }
    94  
    95  // IsServerError returns true when this get replication log o k response has a 5xx status code
    96  func (o *GetReplicationLogOK) IsServerError() bool {
    97  	return false
    98  }
    99  
   100  // IsCode returns true when this get replication log o k response a status code equal to that given
   101  func (o *GetReplicationLogOK) IsCode(code int) bool {
   102  	return code == 200
   103  }
   104  
   105  func (o *GetReplicationLogOK) Error() string {
   106  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogOK  %+v", 200, o.Payload)
   107  }
   108  
   109  func (o *GetReplicationLogOK) String() string {
   110  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogOK  %+v", 200, o.Payload)
   111  }
   112  
   113  func (o *GetReplicationLogOK) GetPayload() string {
   114  	return o.Payload
   115  }
   116  
   117  func (o *GetReplicationLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   118  
   119  	// hydrates response header Content-Type
   120  	hdrContentType := response.GetHeader("Content-Type")
   121  
   122  	if hdrContentType != "" {
   123  		o.ContentType = hdrContentType
   124  	}
   125  
   126  	// response payload
   127  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   128  		return err
   129  	}
   130  
   131  	return nil
   132  }
   133  
   134  // NewGetReplicationLogUnauthorized creates a GetReplicationLogUnauthorized with default headers values
   135  func NewGetReplicationLogUnauthorized() *GetReplicationLogUnauthorized {
   136  	return &GetReplicationLogUnauthorized{}
   137  }
   138  
   139  /*
   140  GetReplicationLogUnauthorized describes a response with status code 401, with default header values.
   141  
   142  Unauthorized
   143  */
   144  type GetReplicationLogUnauthorized struct {
   145  
   146  	/* The ID of the corresponding request for the response
   147  	 */
   148  	XRequestID string
   149  
   150  	Payload *models.Errors
   151  }
   152  
   153  // IsSuccess returns true when this get replication log unauthorized response has a 2xx status code
   154  func (o *GetReplicationLogUnauthorized) IsSuccess() bool {
   155  	return false
   156  }
   157  
   158  // IsRedirect returns true when this get replication log unauthorized response has a 3xx status code
   159  func (o *GetReplicationLogUnauthorized) IsRedirect() bool {
   160  	return false
   161  }
   162  
   163  // IsClientError returns true when this get replication log unauthorized response has a 4xx status code
   164  func (o *GetReplicationLogUnauthorized) IsClientError() bool {
   165  	return true
   166  }
   167  
   168  // IsServerError returns true when this get replication log unauthorized response has a 5xx status code
   169  func (o *GetReplicationLogUnauthorized) IsServerError() bool {
   170  	return false
   171  }
   172  
   173  // IsCode returns true when this get replication log unauthorized response a status code equal to that given
   174  func (o *GetReplicationLogUnauthorized) IsCode(code int) bool {
   175  	return code == 401
   176  }
   177  
   178  func (o *GetReplicationLogUnauthorized) Error() string {
   179  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogUnauthorized  %+v", 401, o.Payload)
   180  }
   181  
   182  func (o *GetReplicationLogUnauthorized) String() string {
   183  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogUnauthorized  %+v", 401, o.Payload)
   184  }
   185  
   186  func (o *GetReplicationLogUnauthorized) GetPayload() *models.Errors {
   187  	return o.Payload
   188  }
   189  
   190  func (o *GetReplicationLogUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   191  
   192  	// hydrates response header X-Request-Id
   193  	hdrXRequestID := response.GetHeader("X-Request-Id")
   194  
   195  	if hdrXRequestID != "" {
   196  		o.XRequestID = hdrXRequestID
   197  	}
   198  
   199  	o.Payload = new(models.Errors)
   200  
   201  	// response payload
   202  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   203  		return err
   204  	}
   205  
   206  	return nil
   207  }
   208  
   209  // NewGetReplicationLogForbidden creates a GetReplicationLogForbidden with default headers values
   210  func NewGetReplicationLogForbidden() *GetReplicationLogForbidden {
   211  	return &GetReplicationLogForbidden{}
   212  }
   213  
   214  /*
   215  GetReplicationLogForbidden describes a response with status code 403, with default header values.
   216  
   217  Forbidden
   218  */
   219  type GetReplicationLogForbidden struct {
   220  
   221  	/* The ID of the corresponding request for the response
   222  	 */
   223  	XRequestID string
   224  
   225  	Payload *models.Errors
   226  }
   227  
   228  // IsSuccess returns true when this get replication log forbidden response has a 2xx status code
   229  func (o *GetReplicationLogForbidden) IsSuccess() bool {
   230  	return false
   231  }
   232  
   233  // IsRedirect returns true when this get replication log forbidden response has a 3xx status code
   234  func (o *GetReplicationLogForbidden) IsRedirect() bool {
   235  	return false
   236  }
   237  
   238  // IsClientError returns true when this get replication log forbidden response has a 4xx status code
   239  func (o *GetReplicationLogForbidden) IsClientError() bool {
   240  	return true
   241  }
   242  
   243  // IsServerError returns true when this get replication log forbidden response has a 5xx status code
   244  func (o *GetReplicationLogForbidden) IsServerError() bool {
   245  	return false
   246  }
   247  
   248  // IsCode returns true when this get replication log forbidden response a status code equal to that given
   249  func (o *GetReplicationLogForbidden) IsCode(code int) bool {
   250  	return code == 403
   251  }
   252  
   253  func (o *GetReplicationLogForbidden) Error() string {
   254  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogForbidden  %+v", 403, o.Payload)
   255  }
   256  
   257  func (o *GetReplicationLogForbidden) String() string {
   258  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogForbidden  %+v", 403, o.Payload)
   259  }
   260  
   261  func (o *GetReplicationLogForbidden) GetPayload() *models.Errors {
   262  	return o.Payload
   263  }
   264  
   265  func (o *GetReplicationLogForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   266  
   267  	// hydrates response header X-Request-Id
   268  	hdrXRequestID := response.GetHeader("X-Request-Id")
   269  
   270  	if hdrXRequestID != "" {
   271  		o.XRequestID = hdrXRequestID
   272  	}
   273  
   274  	o.Payload = new(models.Errors)
   275  
   276  	// response payload
   277  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   278  		return err
   279  	}
   280  
   281  	return nil
   282  }
   283  
   284  // NewGetReplicationLogNotFound creates a GetReplicationLogNotFound with default headers values
   285  func NewGetReplicationLogNotFound() *GetReplicationLogNotFound {
   286  	return &GetReplicationLogNotFound{}
   287  }
   288  
   289  /*
   290  GetReplicationLogNotFound describes a response with status code 404, with default header values.
   291  
   292  Not found
   293  */
   294  type GetReplicationLogNotFound struct {
   295  
   296  	/* The ID of the corresponding request for the response
   297  	 */
   298  	XRequestID string
   299  
   300  	Payload *models.Errors
   301  }
   302  
   303  // IsSuccess returns true when this get replication log not found response has a 2xx status code
   304  func (o *GetReplicationLogNotFound) IsSuccess() bool {
   305  	return false
   306  }
   307  
   308  // IsRedirect returns true when this get replication log not found response has a 3xx status code
   309  func (o *GetReplicationLogNotFound) IsRedirect() bool {
   310  	return false
   311  }
   312  
   313  // IsClientError returns true when this get replication log not found response has a 4xx status code
   314  func (o *GetReplicationLogNotFound) IsClientError() bool {
   315  	return true
   316  }
   317  
   318  // IsServerError returns true when this get replication log not found response has a 5xx status code
   319  func (o *GetReplicationLogNotFound) IsServerError() bool {
   320  	return false
   321  }
   322  
   323  // IsCode returns true when this get replication log not found response a status code equal to that given
   324  func (o *GetReplicationLogNotFound) IsCode(code int) bool {
   325  	return code == 404
   326  }
   327  
   328  func (o *GetReplicationLogNotFound) Error() string {
   329  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogNotFound  %+v", 404, o.Payload)
   330  }
   331  
   332  func (o *GetReplicationLogNotFound) String() string {
   333  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogNotFound  %+v", 404, o.Payload)
   334  }
   335  
   336  func (o *GetReplicationLogNotFound) GetPayload() *models.Errors {
   337  	return o.Payload
   338  }
   339  
   340  func (o *GetReplicationLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   341  
   342  	// hydrates response header X-Request-Id
   343  	hdrXRequestID := response.GetHeader("X-Request-Id")
   344  
   345  	if hdrXRequestID != "" {
   346  		o.XRequestID = hdrXRequestID
   347  	}
   348  
   349  	o.Payload = new(models.Errors)
   350  
   351  	// response payload
   352  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   353  		return err
   354  	}
   355  
   356  	return nil
   357  }
   358  
   359  // NewGetReplicationLogInternalServerError creates a GetReplicationLogInternalServerError with default headers values
   360  func NewGetReplicationLogInternalServerError() *GetReplicationLogInternalServerError {
   361  	return &GetReplicationLogInternalServerError{}
   362  }
   363  
   364  /*
   365  GetReplicationLogInternalServerError describes a response with status code 500, with default header values.
   366  
   367  Internal server error
   368  */
   369  type GetReplicationLogInternalServerError struct {
   370  
   371  	/* The ID of the corresponding request for the response
   372  	 */
   373  	XRequestID string
   374  
   375  	Payload *models.Errors
   376  }
   377  
   378  // IsSuccess returns true when this get replication log internal server error response has a 2xx status code
   379  func (o *GetReplicationLogInternalServerError) IsSuccess() bool {
   380  	return false
   381  }
   382  
   383  // IsRedirect returns true when this get replication log internal server error response has a 3xx status code
   384  func (o *GetReplicationLogInternalServerError) IsRedirect() bool {
   385  	return false
   386  }
   387  
   388  // IsClientError returns true when this get replication log internal server error response has a 4xx status code
   389  func (o *GetReplicationLogInternalServerError) IsClientError() bool {
   390  	return false
   391  }
   392  
   393  // IsServerError returns true when this get replication log internal server error response has a 5xx status code
   394  func (o *GetReplicationLogInternalServerError) IsServerError() bool {
   395  	return true
   396  }
   397  
   398  // IsCode returns true when this get replication log internal server error response a status code equal to that given
   399  func (o *GetReplicationLogInternalServerError) IsCode(code int) bool {
   400  	return code == 500
   401  }
   402  
   403  func (o *GetReplicationLogInternalServerError) Error() string {
   404  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogInternalServerError  %+v", 500, o.Payload)
   405  }
   406  
   407  func (o *GetReplicationLogInternalServerError) String() string {
   408  	return fmt.Sprintf("[GET /replication/executions/{id}/tasks/{task_id}/log][%d] getReplicationLogInternalServerError  %+v", 500, o.Payload)
   409  }
   410  
   411  func (o *GetReplicationLogInternalServerError) GetPayload() *models.Errors {
   412  	return o.Payload
   413  }
   414  
   415  func (o *GetReplicationLogInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   416  
   417  	// hydrates response header X-Request-Id
   418  	hdrXRequestID := response.GetHeader("X-Request-Id")
   419  
   420  	if hdrXRequestID != "" {
   421  		o.XRequestID = hdrXRequestID
   422  	}
   423  
   424  	o.Payload = new(models.Errors)
   425  
   426  	// response payload
   427  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   428  		return err
   429  	}
   430  
   431  	return nil
   432  }