...

Source file src/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_responses.go

Documentation: github.com/sigstore/rekor/pkg/generated/client/tlog

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  //
     4  // Copyright 2021 The Sigstore Authors.
     5  //
     6  // Licensed under the Apache License, Version 2.0 (the "License");
     7  // you may not use this file except in compliance with the License.
     8  // You may obtain a copy of the License at
     9  //
    10  //     http://www.apache.org/licenses/LICENSE-2.0
    11  //
    12  // Unless required by applicable law or agreed to in writing, software
    13  // distributed under the License is distributed on an "AS IS" BASIS,
    14  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  // See the License for the specific language governing permissions and
    16  // limitations under the License.
    17  //
    18  
    19  package tlog
    20  
    21  // This file was generated by the swagger tool.
    22  // Editing this file might prove futile when you re-run the swagger generate command
    23  
    24  import (
    25  	"fmt"
    26  	"io"
    27  
    28  	"github.com/go-openapi/runtime"
    29  	"github.com/go-openapi/strfmt"
    30  
    31  	"github.com/sigstore/rekor/pkg/generated/models"
    32  )
    33  
    34  // GetLogProofReader is a Reader for the GetLogProof structure.
    35  type GetLogProofReader struct {
    36  	formats strfmt.Registry
    37  }
    38  
    39  // ReadResponse reads a server response into the received o.
    40  func (o *GetLogProofReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    41  	switch response.Code() {
    42  	case 200:
    43  		result := NewGetLogProofOK()
    44  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    45  			return nil, err
    46  		}
    47  		return result, nil
    48  	case 400:
    49  		result := NewGetLogProofBadRequest()
    50  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    51  			return nil, err
    52  		}
    53  		return nil, result
    54  	default:
    55  		result := NewGetLogProofDefault(response.Code())
    56  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    57  			return nil, err
    58  		}
    59  		if response.Code()/100 == 2 {
    60  			return result, nil
    61  		}
    62  		return nil, result
    63  	}
    64  }
    65  
    66  // NewGetLogProofOK creates a GetLogProofOK with default headers values
    67  func NewGetLogProofOK() *GetLogProofOK {
    68  	return &GetLogProofOK{}
    69  }
    70  
    71  /*
    72  GetLogProofOK describes a response with status code 200, with default header values.
    73  
    74  All hashes required to compute the consistency proof
    75  */
    76  type GetLogProofOK struct {
    77  	Payload *models.ConsistencyProof
    78  }
    79  
    80  // IsSuccess returns true when this get log proof o k response has a 2xx status code
    81  func (o *GetLogProofOK) IsSuccess() bool {
    82  	return true
    83  }
    84  
    85  // IsRedirect returns true when this get log proof o k response has a 3xx status code
    86  func (o *GetLogProofOK) IsRedirect() bool {
    87  	return false
    88  }
    89  
    90  // IsClientError returns true when this get log proof o k response has a 4xx status code
    91  func (o *GetLogProofOK) IsClientError() bool {
    92  	return false
    93  }
    94  
    95  // IsServerError returns true when this get log proof o k response has a 5xx status code
    96  func (o *GetLogProofOK) IsServerError() bool {
    97  	return false
    98  }
    99  
   100  // IsCode returns true when this get log proof o k response a status code equal to that given
   101  func (o *GetLogProofOK) IsCode(code int) bool {
   102  	return code == 200
   103  }
   104  
   105  // Code gets the status code for the get log proof o k response
   106  func (o *GetLogProofOK) Code() int {
   107  	return 200
   108  }
   109  
   110  func (o *GetLogProofOK) Error() string {
   111  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProofOK  %+v", 200, o.Payload)
   112  }
   113  
   114  func (o *GetLogProofOK) String() string {
   115  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProofOK  %+v", 200, o.Payload)
   116  }
   117  
   118  func (o *GetLogProofOK) GetPayload() *models.ConsistencyProof {
   119  	return o.Payload
   120  }
   121  
   122  func (o *GetLogProofOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   123  
   124  	o.Payload = new(models.ConsistencyProof)
   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  // NewGetLogProofBadRequest creates a GetLogProofBadRequest with default headers values
   135  func NewGetLogProofBadRequest() *GetLogProofBadRequest {
   136  	return &GetLogProofBadRequest{}
   137  }
   138  
   139  /*
   140  GetLogProofBadRequest describes a response with status code 400, with default header values.
   141  
   142  The content supplied to the server was invalid
   143  */
   144  type GetLogProofBadRequest struct {
   145  	Payload *models.Error
   146  }
   147  
   148  // IsSuccess returns true when this get log proof bad request response has a 2xx status code
   149  func (o *GetLogProofBadRequest) IsSuccess() bool {
   150  	return false
   151  }
   152  
   153  // IsRedirect returns true when this get log proof bad request response has a 3xx status code
   154  func (o *GetLogProofBadRequest) IsRedirect() bool {
   155  	return false
   156  }
   157  
   158  // IsClientError returns true when this get log proof bad request response has a 4xx status code
   159  func (o *GetLogProofBadRequest) IsClientError() bool {
   160  	return true
   161  }
   162  
   163  // IsServerError returns true when this get log proof bad request response has a 5xx status code
   164  func (o *GetLogProofBadRequest) IsServerError() bool {
   165  	return false
   166  }
   167  
   168  // IsCode returns true when this get log proof bad request response a status code equal to that given
   169  func (o *GetLogProofBadRequest) IsCode(code int) bool {
   170  	return code == 400
   171  }
   172  
   173  // Code gets the status code for the get log proof bad request response
   174  func (o *GetLogProofBadRequest) Code() int {
   175  	return 400
   176  }
   177  
   178  func (o *GetLogProofBadRequest) Error() string {
   179  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProofBadRequest  %+v", 400, o.Payload)
   180  }
   181  
   182  func (o *GetLogProofBadRequest) String() string {
   183  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProofBadRequest  %+v", 400, o.Payload)
   184  }
   185  
   186  func (o *GetLogProofBadRequest) GetPayload() *models.Error {
   187  	return o.Payload
   188  }
   189  
   190  func (o *GetLogProofBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   191  
   192  	o.Payload = new(models.Error)
   193  
   194  	// response payload
   195  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   196  		return err
   197  	}
   198  
   199  	return nil
   200  }
   201  
   202  // NewGetLogProofDefault creates a GetLogProofDefault with default headers values
   203  func NewGetLogProofDefault(code int) *GetLogProofDefault {
   204  	return &GetLogProofDefault{
   205  		_statusCode: code,
   206  	}
   207  }
   208  
   209  /*
   210  GetLogProofDefault describes a response with status code -1, with default header values.
   211  
   212  There was an internal error in the server while processing the request
   213  */
   214  type GetLogProofDefault struct {
   215  	_statusCode int
   216  
   217  	Payload *models.Error
   218  }
   219  
   220  // IsSuccess returns true when this get log proof default response has a 2xx status code
   221  func (o *GetLogProofDefault) IsSuccess() bool {
   222  	return o._statusCode/100 == 2
   223  }
   224  
   225  // IsRedirect returns true when this get log proof default response has a 3xx status code
   226  func (o *GetLogProofDefault) IsRedirect() bool {
   227  	return o._statusCode/100 == 3
   228  }
   229  
   230  // IsClientError returns true when this get log proof default response has a 4xx status code
   231  func (o *GetLogProofDefault) IsClientError() bool {
   232  	return o._statusCode/100 == 4
   233  }
   234  
   235  // IsServerError returns true when this get log proof default response has a 5xx status code
   236  func (o *GetLogProofDefault) IsServerError() bool {
   237  	return o._statusCode/100 == 5
   238  }
   239  
   240  // IsCode returns true when this get log proof default response a status code equal to that given
   241  func (o *GetLogProofDefault) IsCode(code int) bool {
   242  	return o._statusCode == code
   243  }
   244  
   245  // Code gets the status code for the get log proof default response
   246  func (o *GetLogProofDefault) Code() int {
   247  	return o._statusCode
   248  }
   249  
   250  func (o *GetLogProofDefault) Error() string {
   251  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProof default  %+v", o._statusCode, o.Payload)
   252  }
   253  
   254  func (o *GetLogProofDefault) String() string {
   255  	return fmt.Sprintf("[GET /api/v1/log/proof][%d] getLogProof default  %+v", o._statusCode, o.Payload)
   256  }
   257  
   258  func (o *GetLogProofDefault) GetPayload() *models.Error {
   259  	return o.Payload
   260  }
   261  
   262  func (o *GetLogProofDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   263  
   264  	o.Payload = new(models.Error)
   265  
   266  	// response payload
   267  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   268  		return err
   269  	}
   270  
   271  	return nil
   272  }
   273  

View as plain text