Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 1 | // Code generated by go-swagger; DO NOT EDIT. |
| 2 | |
| 3 | // Copyright 2018 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 | package extras |
| 18 | |
| 19 | // This file was generated by the swagger tool. |
| 20 | // Editing this file might prove futile when you re-run the swagger generate command |
| 21 | |
| 22 | import ( |
| 23 | "fmt" |
| 24 | "io" |
| 25 | |
| 26 | "github.com/go-openapi/runtime" |
| 27 | |
| 28 | strfmt "github.com/go-openapi/strfmt" |
| 29 | |
| 30 | "github.com/digitalocean/go-netbox/netbox/models" |
| 31 | ) |
| 32 | |
| 33 | // ExtrasImageAttachmentsCreateReader is a Reader for the ExtrasImageAttachmentsCreate structure. |
| 34 | type ExtrasImageAttachmentsCreateReader struct { |
| 35 | formats strfmt.Registry |
| 36 | } |
| 37 | |
| 38 | // ReadResponse reads a server response into the received o. |
| 39 | func (o *ExtrasImageAttachmentsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { |
| 40 | switch response.Code() { |
| 41 | |
| 42 | case 201: |
| 43 | result := NewExtrasImageAttachmentsCreateCreated() |
| 44 | if err := result.readResponse(response, consumer, o.formats); err != nil { |
| 45 | return nil, err |
| 46 | } |
| 47 | return result, nil |
| 48 | |
| 49 | default: |
| 50 | return nil, runtime.NewAPIError("unknown error", response, response.Code()) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // NewExtrasImageAttachmentsCreateCreated creates a ExtrasImageAttachmentsCreateCreated with default headers values |
| 55 | func NewExtrasImageAttachmentsCreateCreated() *ExtrasImageAttachmentsCreateCreated { |
| 56 | return &ExtrasImageAttachmentsCreateCreated{} |
| 57 | } |
| 58 | |
| 59 | /*ExtrasImageAttachmentsCreateCreated handles this case with default header values. |
| 60 | |
| 61 | ExtrasImageAttachmentsCreateCreated extras image attachments create created |
| 62 | */ |
| 63 | type ExtrasImageAttachmentsCreateCreated struct { |
| 64 | Payload *models.WritableImageAttachment |
| 65 | } |
| 66 | |
| 67 | func (o *ExtrasImageAttachmentsCreateCreated) Error() string { |
| 68 | return fmt.Sprintf("[POST /extras/image-attachments/][%d] extrasImageAttachmentsCreateCreated %+v", 201, o.Payload) |
| 69 | } |
| 70 | |
| 71 | func (o *ExtrasImageAttachmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
| 72 | |
| 73 | o.Payload = new(models.WritableImageAttachment) |
| 74 | |
| 75 | // response payload |
| 76 | if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| 77 | return err |
| 78 | } |
| 79 | |
| 80 | return nil |
| 81 | } |