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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package gc
     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  // GetGCLogReader is a Reader for the GetGCLog structure.
    19  type GetGCLogReader struct {
    20  	formats strfmt.Registry
    21  }
    22  
    23  // ReadResponse reads a server response into the received o.
    24  func (o *GetGCLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    25  	switch response.Code() {
    26  	case 200:
    27  		result := NewGetGCLogOK()
    28  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    29  			return nil, err
    30  		}
    31  		return result, nil
    32  	case 400:
    33  		result := NewGetGCLogBadRequest()
    34  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    35  			return nil, err
    36  		}
    37  		return nil, result
    38  	case 401:
    39  		result := NewGetGCLogUnauthorized()
    40  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    41  			return nil, err
    42  		}
    43  		return nil, result
    44  	case 403:
    45  		result := NewGetGCLogForbidden()
    46  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    47  			return nil, err
    48  		}
    49  		return nil, result
    50  	case 404:
    51  		result := NewGetGCLogNotFound()
    52  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    53  			return nil, err
    54  		}
    55  		return nil, result
    56  	case 500:
    57  		result := NewGetGCLogInternalServerError()
    58  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    59  			return nil, err
    60  		}
    61  		return nil, result
    62  	default:
    63  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    64  	}
    65  }
    66  
    67  // NewGetGCLogOK creates a GetGCLogOK with default headers values
    68  func NewGetGCLogOK() *GetGCLogOK {
    69  	return &GetGCLogOK{}
    70  }
    71  
    72  /*
    73  GetGCLogOK describes a response with status code 200, with default header values.
    74  
    75  Get successfully.
    76  */
    77  type GetGCLogOK struct {
    78  	Payload string
    79  }
    80  
    81  // IsSuccess returns true when this get Gc log o k response has a 2xx status code
    82  func (o *GetGCLogOK) IsSuccess() bool {
    83  	return true
    84  }
    85  
    86  // IsRedirect returns true when this get Gc log o k response has a 3xx status code
    87  func (o *GetGCLogOK) IsRedirect() bool {
    88  	return false
    89  }
    90  
    91  // IsClientError returns true when this get Gc log o k response has a 4xx status code
    92  func (o *GetGCLogOK) IsClientError() bool {
    93  	return false
    94  }
    95  
    96  // IsServerError returns true when this get Gc log o k response has a 5xx status code
    97  func (o *GetGCLogOK) IsServerError() bool {
    98  	return false
    99  }
   100  
   101  // IsCode returns true when this get Gc log o k response a status code equal to that given
   102  func (o *GetGCLogOK) IsCode(code int) bool {
   103  	return code == 200
   104  }
   105  
   106  func (o *GetGCLogOK) Error() string {
   107  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogOK  %+v", 200, o.Payload)
   108  }
   109  
   110  func (o *GetGCLogOK) String() string {
   111  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogOK  %+v", 200, o.Payload)
   112  }
   113  
   114  func (o *GetGCLogOK) GetPayload() string {
   115  	return o.Payload
   116  }
   117  
   118  func (o *GetGCLogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   119  
   120  	// response payload
   121  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   122  		return err
   123  	}
   124  
   125  	return nil
   126  }
   127  
   128  // NewGetGCLogBadRequest creates a GetGCLogBadRequest with default headers values
   129  func NewGetGCLogBadRequest() *GetGCLogBadRequest {
   130  	return &GetGCLogBadRequest{}
   131  }
   132  
   133  /*
   134  GetGCLogBadRequest describes a response with status code 400, with default header values.
   135  
   136  Bad request
   137  */
   138  type GetGCLogBadRequest struct {
   139  
   140  	/* The ID of the corresponding request for the response
   141  	 */
   142  	XRequestID string
   143  
   144  	Payload *models.Errors
   145  }
   146  
   147  // IsSuccess returns true when this get Gc log bad request response has a 2xx status code
   148  func (o *GetGCLogBadRequest) IsSuccess() bool {
   149  	return false
   150  }
   151  
   152  // IsRedirect returns true when this get Gc log bad request response has a 3xx status code
   153  func (o *GetGCLogBadRequest) IsRedirect() bool {
   154  	return false
   155  }
   156  
   157  // IsClientError returns true when this get Gc log bad request response has a 4xx status code
   158  func (o *GetGCLogBadRequest) IsClientError() bool {
   159  	return true
   160  }
   161  
   162  // IsServerError returns true when this get Gc log bad request response has a 5xx status code
   163  func (o *GetGCLogBadRequest) IsServerError() bool {
   164  	return false
   165  }
   166  
   167  // IsCode returns true when this get Gc log bad request response a status code equal to that given
   168  func (o *GetGCLogBadRequest) IsCode(code int) bool {
   169  	return code == 400
   170  }
   171  
   172  func (o *GetGCLogBadRequest) Error() string {
   173  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogBadRequest  %+v", 400, o.Payload)
   174  }
   175  
   176  func (o *GetGCLogBadRequest) String() string {
   177  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogBadRequest  %+v", 400, o.Payload)
   178  }
   179  
   180  func (o *GetGCLogBadRequest) GetPayload() *models.Errors {
   181  	return o.Payload
   182  }
   183  
   184  func (o *GetGCLogBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   185  
   186  	// hydrates response header X-Request-Id
   187  	hdrXRequestID := response.GetHeader("X-Request-Id")
   188  
   189  	if hdrXRequestID != "" {
   190  		o.XRequestID = hdrXRequestID
   191  	}
   192  
   193  	o.Payload = new(models.Errors)
   194  
   195  	// response payload
   196  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   197  		return err
   198  	}
   199  
   200  	return nil
   201  }
   202  
   203  // NewGetGCLogUnauthorized creates a GetGCLogUnauthorized with default headers values
   204  func NewGetGCLogUnauthorized() *GetGCLogUnauthorized {
   205  	return &GetGCLogUnauthorized{}
   206  }
   207  
   208  /*
   209  GetGCLogUnauthorized describes a response with status code 401, with default header values.
   210  
   211  Unauthorized
   212  */
   213  type GetGCLogUnauthorized struct {
   214  
   215  	/* The ID of the corresponding request for the response
   216  	 */
   217  	XRequestID string
   218  
   219  	Payload *models.Errors
   220  }
   221  
   222  // IsSuccess returns true when this get Gc log unauthorized response has a 2xx status code
   223  func (o *GetGCLogUnauthorized) IsSuccess() bool {
   224  	return false
   225  }
   226  
   227  // IsRedirect returns true when this get Gc log unauthorized response has a 3xx status code
   228  func (o *GetGCLogUnauthorized) IsRedirect() bool {
   229  	return false
   230  }
   231  
   232  // IsClientError returns true when this get Gc log unauthorized response has a 4xx status code
   233  func (o *GetGCLogUnauthorized) IsClientError() bool {
   234  	return true
   235  }
   236  
   237  // IsServerError returns true when this get Gc log unauthorized response has a 5xx status code
   238  func (o *GetGCLogUnauthorized) IsServerError() bool {
   239  	return false
   240  }
   241  
   242  // IsCode returns true when this get Gc log unauthorized response a status code equal to that given
   243  func (o *GetGCLogUnauthorized) IsCode(code int) bool {
   244  	return code == 401
   245  }
   246  
   247  func (o *GetGCLogUnauthorized) Error() string {
   248  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogUnauthorized  %+v", 401, o.Payload)
   249  }
   250  
   251  func (o *GetGCLogUnauthorized) String() string {
   252  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogUnauthorized  %+v", 401, o.Payload)
   253  }
   254  
   255  func (o *GetGCLogUnauthorized) GetPayload() *models.Errors {
   256  	return o.Payload
   257  }
   258  
   259  func (o *GetGCLogUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   260  
   261  	// hydrates response header X-Request-Id
   262  	hdrXRequestID := response.GetHeader("X-Request-Id")
   263  
   264  	if hdrXRequestID != "" {
   265  		o.XRequestID = hdrXRequestID
   266  	}
   267  
   268  	o.Payload = new(models.Errors)
   269  
   270  	// response payload
   271  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   272  		return err
   273  	}
   274  
   275  	return nil
   276  }
   277  
   278  // NewGetGCLogForbidden creates a GetGCLogForbidden with default headers values
   279  func NewGetGCLogForbidden() *GetGCLogForbidden {
   280  	return &GetGCLogForbidden{}
   281  }
   282  
   283  /*
   284  GetGCLogForbidden describes a response with status code 403, with default header values.
   285  
   286  Forbidden
   287  */
   288  type GetGCLogForbidden struct {
   289  
   290  	/* The ID of the corresponding request for the response
   291  	 */
   292  	XRequestID string
   293  
   294  	Payload *models.Errors
   295  }
   296  
   297  // IsSuccess returns true when this get Gc log forbidden response has a 2xx status code
   298  func (o *GetGCLogForbidden) IsSuccess() bool {
   299  	return false
   300  }
   301  
   302  // IsRedirect returns true when this get Gc log forbidden response has a 3xx status code
   303  func (o *GetGCLogForbidden) IsRedirect() bool {
   304  	return false
   305  }
   306  
   307  // IsClientError returns true when this get Gc log forbidden response has a 4xx status code
   308  func (o *GetGCLogForbidden) IsClientError() bool {
   309  	return true
   310  }
   311  
   312  // IsServerError returns true when this get Gc log forbidden response has a 5xx status code
   313  func (o *GetGCLogForbidden) IsServerError() bool {
   314  	return false
   315  }
   316  
   317  // IsCode returns true when this get Gc log forbidden response a status code equal to that given
   318  func (o *GetGCLogForbidden) IsCode(code int) bool {
   319  	return code == 403
   320  }
   321  
   322  func (o *GetGCLogForbidden) Error() string {
   323  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogForbidden  %+v", 403, o.Payload)
   324  }
   325  
   326  func (o *GetGCLogForbidden) String() string {
   327  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogForbidden  %+v", 403, o.Payload)
   328  }
   329  
   330  func (o *GetGCLogForbidden) GetPayload() *models.Errors {
   331  	return o.Payload
   332  }
   333  
   334  func (o *GetGCLogForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   335  
   336  	// hydrates response header X-Request-Id
   337  	hdrXRequestID := response.GetHeader("X-Request-Id")
   338  
   339  	if hdrXRequestID != "" {
   340  		o.XRequestID = hdrXRequestID
   341  	}
   342  
   343  	o.Payload = new(models.Errors)
   344  
   345  	// response payload
   346  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   347  		return err
   348  	}
   349  
   350  	return nil
   351  }
   352  
   353  // NewGetGCLogNotFound creates a GetGCLogNotFound with default headers values
   354  func NewGetGCLogNotFound() *GetGCLogNotFound {
   355  	return &GetGCLogNotFound{}
   356  }
   357  
   358  /*
   359  GetGCLogNotFound describes a response with status code 404, with default header values.
   360  
   361  Not found
   362  */
   363  type GetGCLogNotFound struct {
   364  
   365  	/* The ID of the corresponding request for the response
   366  	 */
   367  	XRequestID string
   368  
   369  	Payload *models.Errors
   370  }
   371  
   372  // IsSuccess returns true when this get Gc log not found response has a 2xx status code
   373  func (o *GetGCLogNotFound) IsSuccess() bool {
   374  	return false
   375  }
   376  
   377  // IsRedirect returns true when this get Gc log not found response has a 3xx status code
   378  func (o *GetGCLogNotFound) IsRedirect() bool {
   379  	return false
   380  }
   381  
   382  // IsClientError returns true when this get Gc log not found response has a 4xx status code
   383  func (o *GetGCLogNotFound) IsClientError() bool {
   384  	return true
   385  }
   386  
   387  // IsServerError returns true when this get Gc log not found response has a 5xx status code
   388  func (o *GetGCLogNotFound) IsServerError() bool {
   389  	return false
   390  }
   391  
   392  // IsCode returns true when this get Gc log not found response a status code equal to that given
   393  func (o *GetGCLogNotFound) IsCode(code int) bool {
   394  	return code == 404
   395  }
   396  
   397  func (o *GetGCLogNotFound) Error() string {
   398  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogNotFound  %+v", 404, o.Payload)
   399  }
   400  
   401  func (o *GetGCLogNotFound) String() string {
   402  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogNotFound  %+v", 404, o.Payload)
   403  }
   404  
   405  func (o *GetGCLogNotFound) GetPayload() *models.Errors {
   406  	return o.Payload
   407  }
   408  
   409  func (o *GetGCLogNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   410  
   411  	// hydrates response header X-Request-Id
   412  	hdrXRequestID := response.GetHeader("X-Request-Id")
   413  
   414  	if hdrXRequestID != "" {
   415  		o.XRequestID = hdrXRequestID
   416  	}
   417  
   418  	o.Payload = new(models.Errors)
   419  
   420  	// response payload
   421  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   422  		return err
   423  	}
   424  
   425  	return nil
   426  }
   427  
   428  // NewGetGCLogInternalServerError creates a GetGCLogInternalServerError with default headers values
   429  func NewGetGCLogInternalServerError() *GetGCLogInternalServerError {
   430  	return &GetGCLogInternalServerError{}
   431  }
   432  
   433  /*
   434  GetGCLogInternalServerError describes a response with status code 500, with default header values.
   435  
   436  Internal server error
   437  */
   438  type GetGCLogInternalServerError struct {
   439  
   440  	/* The ID of the corresponding request for the response
   441  	 */
   442  	XRequestID string
   443  
   444  	Payload *models.Errors
   445  }
   446  
   447  // IsSuccess returns true when this get Gc log internal server error response has a 2xx status code
   448  func (o *GetGCLogInternalServerError) IsSuccess() bool {
   449  	return false
   450  }
   451  
   452  // IsRedirect returns true when this get Gc log internal server error response has a 3xx status code
   453  func (o *GetGCLogInternalServerError) IsRedirect() bool {
   454  	return false
   455  }
   456  
   457  // IsClientError returns true when this get Gc log internal server error response has a 4xx status code
   458  func (o *GetGCLogInternalServerError) IsClientError() bool {
   459  	return false
   460  }
   461  
   462  // IsServerError returns true when this get Gc log internal server error response has a 5xx status code
   463  func (o *GetGCLogInternalServerError) IsServerError() bool {
   464  	return true
   465  }
   466  
   467  // IsCode returns true when this get Gc log internal server error response a status code equal to that given
   468  func (o *GetGCLogInternalServerError) IsCode(code int) bool {
   469  	return code == 500
   470  }
   471  
   472  func (o *GetGCLogInternalServerError) Error() string {
   473  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogInternalServerError  %+v", 500, o.Payload)
   474  }
   475  
   476  func (o *GetGCLogInternalServerError) String() string {
   477  	return fmt.Sprintf("[GET /system/gc/{gc_id}/log][%d] getGcLogInternalServerError  %+v", 500, o.Payload)
   478  }
   479  
   480  func (o *GetGCLogInternalServerError) GetPayload() *models.Errors {
   481  	return o.Payload
   482  }
   483  
   484  func (o *GetGCLogInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   485  
   486  	// hydrates response header X-Request-Id
   487  	hdrXRequestID := response.GetHeader("X-Request-Id")
   488  
   489  	if hdrXRequestID != "" {
   490  		o.XRequestID = hdrXRequestID
   491  	}
   492  
   493  	o.Payload = new(models.Errors)
   494  
   495  	// response payload
   496  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   497  		return err
   498  	}
   499  
   500  	return nil
   501  }