/
volume_info.go
112 lines (86 loc) · 2.64 KB
/
volume_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Code generated by go-swagger; DO NOT EDIT.
package types
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"github.com/go-openapi/errors"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// VolumeInfo Volume represents the configuration of a volume for the container.
// swagger:model VolumeInfo
type VolumeInfo struct {
// Date/Time the volume was created.
CreatedAt string `json:"CreatedAt,omitempty"`
// Driver is the Driver name used to create the volume.
Driver string `json:"Driver,omitempty"`
// Labels is metadata specific to the volume.
Labels map[string]string `json:"Labels,omitempty"`
// Mountpoint is the location on disk of the volume.
Mountpoint string `json:"Mountpoint,omitempty"`
// Name is the name of the volume.
Name string `json:"Name,omitempty"`
// Scope describes the level at which the volume exists
// (e.g. `global` for cluster-wide or `local` for machine level)
//
Scope string `json:"Scope,omitempty"`
// Status provides low-level status information about the volume.
Status map[string]interface{} `json:"Status,omitempty"`
}
// Validate validates this volume info
func (m *VolumeInfo) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// additional properties value enum
var volumeInfoStatusValueEnum []interface{}
func init() {
var res []interface{}
if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {
panic(err)
}
for _, v := range res {
volumeInfoStatusValueEnum = append(volumeInfoStatusValueEnum, v)
}
}
func (m *VolumeInfo) validateStatusValueEnum(path, location string, value interface{}) error {
if err := validate.Enum(path, location, value, volumeInfoStatusValueEnum); err != nil {
return err
}
return nil
}
func (m *VolumeInfo) validateStatus(formats strfmt.Registry) error {
if swag.IsZero(m.Status) { // not required
return nil
}
for k := range m.Status {
if err := m.validateStatusValueEnum("Status"+"."+k, "body", m.Status[k]); err != nil {
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *VolumeInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *VolumeInfo) UnmarshalBinary(b []byte) error {
var res VolumeInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}