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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package jobservice
     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  // ActionGetJobLogReader is a Reader for the ActionGetJobLog structure.
    19  type ActionGetJobLogReader struct {
    20  	formats strfmt.Registry
    21  }
    22  
    23  // ReadResponse reads a server response into the received o.
    24  func (o *ActionGetJobLogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    25  	switch response.Code() {
    26  	case 200:
    27  		result := NewActionGetJobLogOK()
    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 := NewActionGetJobLogUnauthorized()
    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 := NewActionGetJobLogForbidden()
    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 := NewActionGetJobLogNotFound()
    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 := NewActionGetJobLogInternalServerError()
    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  // NewActionGetJobLogOK creates a ActionGetJobLogOK with default headers values
    62  func NewActionGetJobLogOK() *ActionGetJobLogOK {
    63  	return &ActionGetJobLogOK{}
    64  }
    65  
    66  /*
    67  ActionGetJobLogOK describes a response with status code 200, with default header values.
    68  
    69  Get job log successfully.
    70  */
    71  type ActionGetJobLogOK 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 action get job log o k response has a 2xx status code
    81  func (o *ActionGetJobLogOK) IsSuccess() bool {
    82  	return true
    83  }
    84  
    85  // IsRedirect returns true when this action get job log o k response has a 3xx status code
    86  func (o *ActionGetJobLogOK) IsRedirect() bool {
    87  	return false
    88  }
    89  
    90  // IsClientError returns true when this action get job log o k response has a 4xx status code
    91  func (o *ActionGetJobLogOK) IsClientError() bool {
    92  	return false
    93  }
    94  
    95  // IsServerError returns true when this action get job log o k response has a 5xx status code
    96  func (o *ActionGetJobLogOK) IsServerError() bool {
    97  	return false
    98  }
    99  
   100  // IsCode returns true when this action get job log o k response a status code equal to that given
   101  func (o *ActionGetJobLogOK) IsCode(code int) bool {
   102  	return code == 200
   103  }
   104  
   105  func (o *ActionGetJobLogOK) Error() string {
   106  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogOK  %+v", 200, o.Payload)
   107  }
   108  
   109  func (o *ActionGetJobLogOK) String() string {
   110  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogOK  %+v", 200, o.Payload)
   111  }
   112  
   113  func (o *ActionGetJobLogOK) GetPayload() string {
   114  	return o.Payload
   115  }
   116  
   117  func (o *ActionGetJobLogOK) 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  // NewActionGetJobLogUnauthorized creates a ActionGetJobLogUnauthorized with default headers values
   135  func NewActionGetJobLogUnauthorized() *ActionGetJobLogUnauthorized {
   136  	return &ActionGetJobLogUnauthorized{}
   137  }
   138  
   139  /*
   140  ActionGetJobLogUnauthorized describes a response with status code 401, with default header values.
   141  
   142  Unauthorized
   143  */
   144  type ActionGetJobLogUnauthorized 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 action get job log unauthorized response has a 2xx status code
   154  func (o *ActionGetJobLogUnauthorized) IsSuccess() bool {
   155  	return false
   156  }
   157  
   158  // IsRedirect returns true when this action get job log unauthorized response has a 3xx status code
   159  func (o *ActionGetJobLogUnauthorized) IsRedirect() bool {
   160  	return false
   161  }
   162  
   163  // IsClientError returns true when this action get job log unauthorized response has a 4xx status code
   164  func (o *ActionGetJobLogUnauthorized) IsClientError() bool {
   165  	return true
   166  }
   167  
   168  // IsServerError returns true when this action get job log unauthorized response has a 5xx status code
   169  func (o *ActionGetJobLogUnauthorized) IsServerError() bool {
   170  	return false
   171  }
   172  
   173  // IsCode returns true when this action get job log unauthorized response a status code equal to that given
   174  func (o *ActionGetJobLogUnauthorized) IsCode(code int) bool {
   175  	return code == 401
   176  }
   177  
   178  func (o *ActionGetJobLogUnauthorized) Error() string {
   179  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogUnauthorized  %+v", 401, o.Payload)
   180  }
   181  
   182  func (o *ActionGetJobLogUnauthorized) String() string {
   183  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogUnauthorized  %+v", 401, o.Payload)
   184  }
   185  
   186  func (o *ActionGetJobLogUnauthorized) GetPayload() *models.Errors {
   187  	return o.Payload
   188  }
   189  
   190  func (o *ActionGetJobLogUnauthorized) 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  // NewActionGetJobLogForbidden creates a ActionGetJobLogForbidden with default headers values
   210  func NewActionGetJobLogForbidden() *ActionGetJobLogForbidden {
   211  	return &ActionGetJobLogForbidden{}
   212  }
   213  
   214  /*
   215  ActionGetJobLogForbidden describes a response with status code 403, with default header values.
   216  
   217  Forbidden
   218  */
   219  type ActionGetJobLogForbidden 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 action get job log forbidden response has a 2xx status code
   229  func (o *ActionGetJobLogForbidden) IsSuccess() bool {
   230  	return false
   231  }
   232  
   233  // IsRedirect returns true when this action get job log forbidden response has a 3xx status code
   234  func (o *ActionGetJobLogForbidden) IsRedirect() bool {
   235  	return false
   236  }
   237  
   238  // IsClientError returns true when this action get job log forbidden response has a 4xx status code
   239  func (o *ActionGetJobLogForbidden) IsClientError() bool {
   240  	return true
   241  }
   242  
   243  // IsServerError returns true when this action get job log forbidden response has a 5xx status code
   244  func (o *ActionGetJobLogForbidden) IsServerError() bool {
   245  	return false
   246  }
   247  
   248  // IsCode returns true when this action get job log forbidden response a status code equal to that given
   249  func (o *ActionGetJobLogForbidden) IsCode(code int) bool {
   250  	return code == 403
   251  }
   252  
   253  func (o *ActionGetJobLogForbidden) Error() string {
   254  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogForbidden  %+v", 403, o.Payload)
   255  }
   256  
   257  func (o *ActionGetJobLogForbidden) String() string {
   258  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogForbidden  %+v", 403, o.Payload)
   259  }
   260  
   261  func (o *ActionGetJobLogForbidden) GetPayload() *models.Errors {
   262  	return o.Payload
   263  }
   264  
   265  func (o *ActionGetJobLogForbidden) 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  // NewActionGetJobLogNotFound creates a ActionGetJobLogNotFound with default headers values
   285  func NewActionGetJobLogNotFound() *ActionGetJobLogNotFound {
   286  	return &ActionGetJobLogNotFound{}
   287  }
   288  
   289  /*
   290  ActionGetJobLogNotFound describes a response with status code 404, with default header values.
   291  
   292  Not found
   293  */
   294  type ActionGetJobLogNotFound 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 action get job log not found response has a 2xx status code
   304  func (o *ActionGetJobLogNotFound) IsSuccess() bool {
   305  	return false
   306  }
   307  
   308  // IsRedirect returns true when this action get job log not found response has a 3xx status code
   309  func (o *ActionGetJobLogNotFound) IsRedirect() bool {
   310  	return false
   311  }
   312  
   313  // IsClientError returns true when this action get job log not found response has a 4xx status code
   314  func (o *ActionGetJobLogNotFound) IsClientError() bool {
   315  	return true
   316  }
   317  
   318  // IsServerError returns true when this action get job log not found response has a 5xx status code
   319  func (o *ActionGetJobLogNotFound) IsServerError() bool {
   320  	return false
   321  }
   322  
   323  // IsCode returns true when this action get job log not found response a status code equal to that given
   324  func (o *ActionGetJobLogNotFound) IsCode(code int) bool {
   325  	return code == 404
   326  }
   327  
   328  func (o *ActionGetJobLogNotFound) Error() string {
   329  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogNotFound  %+v", 404, o.Payload)
   330  }
   331  
   332  func (o *ActionGetJobLogNotFound) String() string {
   333  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogNotFound  %+v", 404, o.Payload)
   334  }
   335  
   336  func (o *ActionGetJobLogNotFound) GetPayload() *models.Errors {
   337  	return o.Payload
   338  }
   339  
   340  func (o *ActionGetJobLogNotFound) 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  // NewActionGetJobLogInternalServerError creates a ActionGetJobLogInternalServerError with default headers values
   360  func NewActionGetJobLogInternalServerError() *ActionGetJobLogInternalServerError {
   361  	return &ActionGetJobLogInternalServerError{}
   362  }
   363  
   364  /*
   365  ActionGetJobLogInternalServerError describes a response with status code 500, with default header values.
   366  
   367  Internal server error
   368  */
   369  type ActionGetJobLogInternalServerError 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 action get job log internal server error response has a 2xx status code
   379  func (o *ActionGetJobLogInternalServerError) IsSuccess() bool {
   380  	return false
   381  }
   382  
   383  // IsRedirect returns true when this action get job log internal server error response has a 3xx status code
   384  func (o *ActionGetJobLogInternalServerError) IsRedirect() bool {
   385  	return false
   386  }
   387  
   388  // IsClientError returns true when this action get job log internal server error response has a 4xx status code
   389  func (o *ActionGetJobLogInternalServerError) IsClientError() bool {
   390  	return false
   391  }
   392  
   393  // IsServerError returns true when this action get job log internal server error response has a 5xx status code
   394  func (o *ActionGetJobLogInternalServerError) IsServerError() bool {
   395  	return true
   396  }
   397  
   398  // IsCode returns true when this action get job log internal server error response a status code equal to that given
   399  func (o *ActionGetJobLogInternalServerError) IsCode(code int) bool {
   400  	return code == 500
   401  }
   402  
   403  func (o *ActionGetJobLogInternalServerError) Error() string {
   404  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogInternalServerError  %+v", 500, o.Payload)
   405  }
   406  
   407  func (o *ActionGetJobLogInternalServerError) String() string {
   408  	return fmt.Sprintf("[GET /jobservice/jobs/{job_id}/log][%d] actionGetJobLogInternalServerError  %+v", 500, o.Payload)
   409  }
   410  
   411  func (o *ActionGetJobLogInternalServerError) GetPayload() *models.Errors {
   412  	return o.Payload
   413  }
   414  
   415  func (o *ActionGetJobLogInternalServerError) 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  }