This repository has been archived by the owner on Jul 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
resource_type.go
75 lines (57 loc) · 2.14 KB
/
resource_type.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
// Code generated by go-swagger; DO NOT EDIT.
package models
// 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"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// ResourceType resource type
//
// swagger:model ResourceType
type ResourceType string
const (
// ResourceTypePayportAssociations captures enum value "payport_associations"
ResourceTypePayportAssociations ResourceType = "payport_associations"
// ResourceTypeLimits captures enum value "limits"
ResourceTypeLimits ResourceType = "limits"
// ResourceTypeBacsAssociations captures enum value "bacs_associations"
ResourceTypeBacsAssociations ResourceType = "bacs_associations"
// ResourceTypeConfirmationOfPayeeAssociations captures enum value "confirmation_of_payee_associations"
ResourceTypeConfirmationOfPayeeAssociations ResourceType = "confirmation_of_payee_associations"
// ResourceTypeSepaddAssociations captures enum value "sepadd_associations"
ResourceTypeSepaddAssociations ResourceType = "sepadd_associations"
// ResourceTypeSwiftAssociations captures enum value "swift_associations"
ResourceTypeSwiftAssociations ResourceType = "swift_associations"
)
// for schema
var resourceTypeEnum []interface{}
func init() {
var res []ResourceType
if err := json.Unmarshal([]byte(`["payport_associations","limits","bacs_associations","confirmation_of_payee_associations","sepadd_associations","swift_associations"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
resourceTypeEnum = append(resourceTypeEnum, v)
}
}
func (m ResourceType) validateResourceTypeEnum(path, location string, value ResourceType) error {
if err := validate.Enum(path, location, value, resourceTypeEnum); err != nil {
return err
}
return nil
}
// Validate validates this resource type
func (m ResourceType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateResourceTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}