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 models 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 "context" 26 27 "github.com/go-openapi/strfmt" 28 "github.com/go-openapi/swag" 29 ) 30 31 // Error error 32 // 33 // swagger:model Error 34 type Error struct { 35 36 // code 37 Code int64 `json:"code,omitempty"` 38 39 // message 40 Message string `json:"message,omitempty"` 41 } 42 43 // Validate validates this error 44 func (m *Error) Validate(formats strfmt.Registry) error { 45 return nil 46 } 47 48 // ContextValidate validates this error based on context it is used 49 func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 50 return nil 51 } 52 53 // MarshalBinary interface implementation 54 func (m *Error) MarshalBinary() ([]byte, error) { 55 if m == nil { 56 return nil, nil 57 } 58 return swag.WriteJSON(m) 59 } 60 61 // UnmarshalBinary interface implementation 62 func (m *Error) UnmarshalBinary(b []byte) error { 63 var res Error 64 if err := swag.ReadJSON(b, &res); err != nil { 65 return err 66 } 67 *m = res 68 return nil 69 } 70