-
Notifications
You must be signed in to change notification settings - Fork 10
/
cloud_account_vmc_region_enumeration_specification.go
148 lines (117 loc) · 5.55 KB
/
cloud_account_vmc_region_enumeration_specification.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// 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 (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CloudAccountVmcRegionEnumerationSpecification Specification for a region enumeration of vmc cloud account.
//
// swagger:model CloudAccountVmcRegionEnumerationSpecification
type CloudAccountVmcRegionEnumerationSpecification struct {
// Accept self signed certificate when connecting to vSphere
// Example: false
AcceptSelfSignedCertificate bool `json:"acceptSelfSignedCertificate,omitempty"`
// VMC API access key. Either provide apiKey or provide a cloudAccountId of an existing account.
APIKey string `json:"apiKey,omitempty"`
// Certificate for a cloud account.
// Example: {\"certificate\": \"-----BEGIN CERTIFICATE-----\\nMIIDHjCCAoegAwIBAgIBATANBgkqhkiG9w0BAQsFADCBpjEUMBIGA1UEChMLVk13\\nYXJlIEluYAAc1pw18GT3iAqQRPx0PrjzJhgjIJMla\\n/1Kg4byY4FPSacNiRgY/FG2bPCqZk1yRfzmkFYCW/vU+Dg==\\n-----END CERTIFICATE-----\\n-\"}
CertificateInfo *CertificateInfoSpecification `json:"certificateInfo,omitempty"`
// Existing cloud account id. Either provide existing cloud account Id, or apiKey, sddcId, username, password, hostName, nsxHostName.
// Example: b8b7a918-342e-4a53-a3b0-b935da0fe601
CloudAccountID string `json:"cloudAccountId,omitempty"`
// The host name of the CSP service.
// Example: console-stg.cloud.vmware.com
CspHostName string `json:"cspHostName,omitempty"`
// Identifier of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors
// Example: 23959a1e-18bc-4f0c-ac49-b5aeb4b6eef4
DcID string `json:"dcId,omitempty"`
// The environment where the agent has been deployed. When the agent has been deployed using the "Add Ons" in VMC UI or Api use "aap".
// Example: aap
Environment string `json:"environment,omitempty"`
// Enter the IP address or FQDN of the vCenter Server in the specified SDDC. The cloud proxy belongs on this vCenter. Either provide hostName or provide a cloudAccountId of an existing account.
// Example: vc1.vmware.com
HostName string `json:"hostName,omitempty"`
// The IP address of the NSX Manager server in the specified SDDC / FQDN.Either provide nsxHostName or provide a cloudAccountId of an existing account.
// Example: nsxManager.sddc-52-12-8-145.vmwaretest.com
NsxHostName string `json:"nsxHostName,omitempty"`
// Password for the user used to authenticate with the cloud Account. Either provide password or provide a cloudAccountId of an existing account.
// Example: cndhjslacd90ascdbasyoucbdh
Password string `json:"password,omitempty"`
// Identifier of the on-premise SDDC to be used by this cloud account. Note that NSX-V SDDCs are not supported. Either provide sddcId or provide a cloudAccountId of an existing account.
// Example: CMBU-PRD-NSXT-M8GA-090319
SddcID string `json:"sddcId,omitempty"`
// vCenter user name for the specified SDDC.The specified user requires CloudAdmin credentials. The user does not require CloudGlobalAdmin credentials.Either provide username or provide a cloudAccountId of an existing account.
// Example: administrator@mycompany.com
Username string `json:"username,omitempty"`
}
// Validate validates this cloud account vmc region enumeration specification
func (m *CloudAccountVmcRegionEnumerationSpecification) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCertificateInfo(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CloudAccountVmcRegionEnumerationSpecification) validateCertificateInfo(formats strfmt.Registry) error {
if swag.IsZero(m.CertificateInfo) { // not required
return nil
}
if m.CertificateInfo != nil {
if err := m.CertificateInfo.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("certificateInfo")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("certificateInfo")
}
return err
}
}
return nil
}
// ContextValidate validate this cloud account vmc region enumeration specification based on the context it is used
func (m *CloudAccountVmcRegionEnumerationSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCertificateInfo(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CloudAccountVmcRegionEnumerationSpecification) contextValidateCertificateInfo(ctx context.Context, formats strfmt.Registry) error {
if m.CertificateInfo != nil {
if err := m.CertificateInfo.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("certificateInfo")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("certificateInfo")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CloudAccountVmcRegionEnumerationSpecification) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CloudAccountVmcRegionEnumerationSpecification) UnmarshalBinary(b []byte) error {
var res CloudAccountVmcRegionEnumerationSpecification
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}