github.com/digitalocean/go-netbox@v0.0.2/netbox/client/extras/extras_image_attachments_update_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright 2020 The go-netbox Authors.
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //   http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  //
    17  
    18  package extras
    19  
    20  // This file was generated by the swagger tool.
    21  // Editing this file might prove futile when you re-run the swagger generate command
    22  
    23  import (
    24  	"fmt"
    25  	"io"
    26  
    27  	"github.com/go-openapi/runtime"
    28  	"github.com/go-openapi/strfmt"
    29  
    30  	"github.com/digitalocean/go-netbox/netbox/models"
    31  )
    32  
    33  // ExtrasImageAttachmentsUpdateReader is a Reader for the ExtrasImageAttachmentsUpdate structure.
    34  type ExtrasImageAttachmentsUpdateReader struct {
    35  	formats strfmt.Registry
    36  }
    37  
    38  // ReadResponse reads a server response into the received o.
    39  func (o *ExtrasImageAttachmentsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    40  	switch response.Code() {
    41  	case 200:
    42  		result := NewExtrasImageAttachmentsUpdateOK()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return result, nil
    47  	default:
    48  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    49  	}
    50  }
    51  
    52  // NewExtrasImageAttachmentsUpdateOK creates a ExtrasImageAttachmentsUpdateOK with default headers values
    53  func NewExtrasImageAttachmentsUpdateOK() *ExtrasImageAttachmentsUpdateOK {
    54  	return &ExtrasImageAttachmentsUpdateOK{}
    55  }
    56  
    57  /* ExtrasImageAttachmentsUpdateOK describes a response with status code 200, with default header values.
    58  
    59  ExtrasImageAttachmentsUpdateOK extras image attachments update o k
    60  */
    61  type ExtrasImageAttachmentsUpdateOK struct {
    62  	Payload *models.ImageAttachment
    63  }
    64  
    65  func (o *ExtrasImageAttachmentsUpdateOK) Error() string {
    66  	return fmt.Sprintf("[PUT /extras/image-attachments/{id}/][%d] extrasImageAttachmentsUpdateOK  %+v", 200, o.Payload)
    67  }
    68  func (o *ExtrasImageAttachmentsUpdateOK) GetPayload() *models.ImageAttachment {
    69  	return o.Payload
    70  }
    71  
    72  func (o *ExtrasImageAttachmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    73  
    74  	o.Payload = new(models.ImageAttachment)
    75  
    76  	// response payload
    77  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
    78  		return err
    79  	}
    80  
    81  	return nil
    82  }