1// Code generated by go-swagger; DO NOT EDIT. 2 3// Copyright Prometheus Team 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package models 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 22import ( 23 "github.com/go-openapi/errors" 24 "github.com/go-openapi/strfmt" 25 "github.com/go-openapi/swag" 26 "github.com/go-openapi/validate" 27) 28 29// VersionInfo version info 30// 31// swagger:model versionInfo 32type VersionInfo struct { 33 34 // branch 35 // Required: true 36 Branch *string `json:"branch"` 37 38 // build date 39 // Required: true 40 BuildDate *string `json:"buildDate"` 41 42 // build user 43 // Required: true 44 BuildUser *string `json:"buildUser"` 45 46 // go version 47 // Required: true 48 GoVersion *string `json:"goVersion"` 49 50 // revision 51 // Required: true 52 Revision *string `json:"revision"` 53 54 // version 55 // Required: true 56 Version *string `json:"version"` 57} 58 59// Validate validates this version info 60func (m *VersionInfo) Validate(formats strfmt.Registry) error { 61 var res []error 62 63 if err := m.validateBranch(formats); err != nil { 64 res = append(res, err) 65 } 66 67 if err := m.validateBuildDate(formats); err != nil { 68 res = append(res, err) 69 } 70 71 if err := m.validateBuildUser(formats); err != nil { 72 res = append(res, err) 73 } 74 75 if err := m.validateGoVersion(formats); err != nil { 76 res = append(res, err) 77 } 78 79 if err := m.validateRevision(formats); err != nil { 80 res = append(res, err) 81 } 82 83 if err := m.validateVersion(formats); err != nil { 84 res = append(res, err) 85 } 86 87 if len(res) > 0 { 88 return errors.CompositeValidationError(res...) 89 } 90 return nil 91} 92 93func (m *VersionInfo) validateBranch(formats strfmt.Registry) error { 94 95 if err := validate.Required("branch", "body", m.Branch); err != nil { 96 return err 97 } 98 99 return nil 100} 101 102func (m *VersionInfo) validateBuildDate(formats strfmt.Registry) error { 103 104 if err := validate.Required("buildDate", "body", m.BuildDate); err != nil { 105 return err 106 } 107 108 return nil 109} 110 111func (m *VersionInfo) validateBuildUser(formats strfmt.Registry) error { 112 113 if err := validate.Required("buildUser", "body", m.BuildUser); err != nil { 114 return err 115 } 116 117 return nil 118} 119 120func (m *VersionInfo) validateGoVersion(formats strfmt.Registry) error { 121 122 if err := validate.Required("goVersion", "body", m.GoVersion); err != nil { 123 return err 124 } 125 126 return nil 127} 128 129func (m *VersionInfo) validateRevision(formats strfmt.Registry) error { 130 131 if err := validate.Required("revision", "body", m.Revision); err != nil { 132 return err 133 } 134 135 return nil 136} 137 138func (m *VersionInfo) validateVersion(formats strfmt.Registry) error { 139 140 if err := validate.Required("version", "body", m.Version); err != nil { 141 return err 142 } 143 144 return nil 145} 146 147// MarshalBinary interface implementation 148func (m *VersionInfo) MarshalBinary() ([]byte, error) { 149 if m == nil { 150 return nil, nil 151 } 152 return swag.WriteJSON(m) 153} 154 155// UnmarshalBinary interface implementation 156func (m *VersionInfo) UnmarshalBinary(b []byte) error { 157 var res VersionInfo 158 if err := swag.ReadJSON(b, &res); err != nil { 159 return err 160 } 161 *m = res 162 return nil 163} 164