-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminorgprotoorg.go
225 lines (197 loc) · 10.7 KB
/
adminorgprotoorg.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package nvidiagpucloud
import (
"context"
"net/http"
"github.com/stainless-sdks/nvidia-gpu-cloud-go/internal/apijson"
"github.com/stainless-sdks/nvidia-gpu-cloud-go/internal/param"
"github.com/stainless-sdks/nvidia-gpu-cloud-go/internal/requestconfig"
"github.com/stainless-sdks/nvidia-gpu-cloud-go/option"
)
// AdminOrgProtoOrgService contains methods and other services that help with
// interacting with the nvidia-gpu-cloud API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewAdminOrgProtoOrgService] method instead.
type AdminOrgProtoOrgService struct {
Options []option.RequestOption
}
// NewAdminOrgProtoOrgService generates a new service that applies the given
// options to each request. These options are applied after the parent client's
// options (if there is one), and before any request-specific options.
func NewAdminOrgProtoOrgService(opts ...option.RequestOption) (r *AdminOrgProtoOrgService) {
r = &AdminOrgProtoOrgService{}
r.Options = opts
return
}
// OrgCreateRequest is used to create the organization or when no nca_id is
// provided upfront, the OrgCreateRequest is stored as proto org, and proto org
// flow initiates (SuperAdmin privileges required)
func (r *AdminOrgProtoOrgService) New(ctx context.Context, params AdminOrgProtoOrgNewParams, opts ...option.RequestOption) (res *http.Response, err error) {
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
path := "v3/admin/orgs"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
return
}
type AdminOrgProtoOrgNewParams struct {
// user country
Country param.Field[string] `json:"country"`
// optional description of the organization
Description param.Field[string] `json:"description"`
// Name of the organization that will be shown to users.
DisplayName param.Field[string] `json:"displayName"`
// Identify the initiator of the org request
Initiator param.Field[string] `json:"initiator"`
// Is NVIDIA internal org or not
IsInternal param.Field[bool] `json:"isInternal"`
// Organization name
Name param.Field[string] `json:"name"`
// NVIDIA Cloud Account Identifier
NcaID param.Field[string] `json:"ncaId"`
// NVIDIA Cloud Account Number
NcaNumber param.Field[string] `json:"ncaNumber"`
// Org owner.
OrgOwner param.Field[AdminOrgProtoOrgNewParamsOrgOwner] `json:"orgOwner"`
// product end customer name for enterprise(Fleet Command) product
PecName param.Field[string] `json:"pecName"`
// product end customer salesforce.com Id (external customer Id) for
// enterprise(Fleet Command) product
PecSfdcID param.Field[string] `json:"pecSfdcId"`
ProductEnablements param.Field[[]AdminOrgProtoOrgNewParamsProductEnablement] `json:"productEnablements"`
// This should be deprecated, use productEnablements instead
ProductSubscriptions param.Field[[]AdminOrgProtoOrgNewParamsProductSubscription] `json:"productSubscriptions"`
// Proto org identifier
ProtoOrgID param.Field[string] `json:"protoOrgId"`
// Company or organization industry
SalesforceAccountIndustry param.Field[string] `json:"salesforceAccountIndustry"`
// Send email to org owner or not. Default is true
SendEmail param.Field[bool] `json:"sendEmail"`
Type param.Field[AdminOrgProtoOrgNewParamsType] `json:"type"`
Ncid param.Field[string] `cookie:"ncid"`
VisitorID param.Field[string] `cookie:"VisitorID"`
}
func (r AdminOrgProtoOrgNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Org owner.
type AdminOrgProtoOrgNewParamsOrgOwner struct {
// Email address of the org owner.
Email param.Field[string] `json:"email,required"`
// Org owner name.
FullName param.Field[string] `json:"fullName"`
// Identity Provider ID of the org owner.
IdpID param.Field[string] `json:"idpId"`
// Starfleet ID of the org owner.
StarfleetID param.Field[string] `json:"starfleetId"`
}
func (r AdminOrgProtoOrgNewParamsOrgOwner) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Product Enablement
type AdminOrgProtoOrgNewParamsProductEnablement struct {
// Product Name (NVAIE, BASE_COMMAND, REGISTRY, etc)
ProductName param.Field[string] `json:"productName,required"`
// Product Enablement Types
Type param.Field[AdminOrgProtoOrgNewParamsProductEnablementsType] `json:"type,required"`
// Date on which the subscription expires. The subscription is invalid after this
// date. (yyyy-MM-dd)
ExpirationDate param.Field[string] `json:"expirationDate"`
PoDetails param.Field[[]AdminOrgProtoOrgNewParamsProductEnablementsPoDetail] `json:"poDetails"`
}
func (r AdminOrgProtoOrgNewParamsProductEnablement) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Product Enablement Types
type AdminOrgProtoOrgNewParamsProductEnablementsType string
const (
AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminEval AdminOrgProtoOrgNewParamsProductEnablementsType = "NGC_ADMIN_EVAL"
AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminNfr AdminOrgProtoOrgNewParamsProductEnablementsType = "NGC_ADMIN_NFR"
AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminCommercial AdminOrgProtoOrgNewParamsProductEnablementsType = "NGC_ADMIN_COMMERCIAL"
AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsEval AdminOrgProtoOrgNewParamsProductEnablementsType = "EMS_EVAL"
AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsNfr AdminOrgProtoOrgNewParamsProductEnablementsType = "EMS_NFR"
AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsCommercial AdminOrgProtoOrgNewParamsProductEnablementsType = "EMS_COMMERCIAL"
AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminDeveloper AdminOrgProtoOrgNewParamsProductEnablementsType = "NGC_ADMIN_DEVELOPER"
)
func (r AdminOrgProtoOrgNewParamsProductEnablementsType) IsKnown() bool {
switch r {
case AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminEval, AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminNfr, AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminCommercial, AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsEval, AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsNfr, AdminOrgProtoOrgNewParamsProductEnablementsTypeEmsCommercial, AdminOrgProtoOrgNewParamsProductEnablementsTypeNgcAdminDeveloper:
return true
}
return false
}
// Purchase Order.
type AdminOrgProtoOrgNewParamsProductEnablementsPoDetail struct {
// Entitlement identifier.
EntitlementID param.Field[string] `json:"entitlementId"`
// PAK (Product Activation Key) identifier.
PkID param.Field[string] `json:"pkId"`
}
func (r AdminOrgProtoOrgNewParamsProductEnablementsPoDetail) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Product Subscription
type AdminOrgProtoOrgNewParamsProductSubscription struct {
// Product Name (NVAIE, BASE_COMMAND, FleetCommand, REGISTRY, etc).
ProductName param.Field[string] `json:"productName,required"`
// Unique entitlement identifier
ID param.Field[string] `json:"id"`
// EMS Subscription type. (options: EMS_EVAL, EMS_NFR and EMS_COMMERCIAL)
EmsEntitlementType param.Field[AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType] `json:"emsEntitlementType"`
// Date on which the subscription expires. The subscription is invalid after this
// date. (yyyy-MM-dd)
ExpirationDate param.Field[string] `json:"expirationDate"`
// Date on which the subscription becomes active. (yyyy-MM-dd)
StartDate param.Field[string] `json:"startDate"`
// Subscription type. (options: NGC_ADMIN_EVAL, NGC_ADMIN_NFR,
// NGC_ADMIN_COMMERCIAL)
Type param.Field[AdminOrgProtoOrgNewParamsProductSubscriptionsType] `json:"type"`
}
func (r AdminOrgProtoOrgNewParamsProductSubscription) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// EMS Subscription type. (options: EMS_EVAL, EMS_NFR and EMS_COMMERCIAL)
type AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType string
const (
AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsEval AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType = "EMS_EVAL"
AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsNfr AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType = "EMS_NFR"
AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsCommerical AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType = "EMS_COMMERICAL"
AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsCommercial AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType = "EMS_COMMERCIAL"
)
func (r AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementType) IsKnown() bool {
switch r {
case AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsEval, AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsNfr, AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsCommerical, AdminOrgProtoOrgNewParamsProductSubscriptionsEmsEntitlementTypeEmsCommercial:
return true
}
return false
}
// Subscription type. (options: NGC_ADMIN_EVAL, NGC_ADMIN_NFR,
// NGC_ADMIN_COMMERCIAL)
type AdminOrgProtoOrgNewParamsProductSubscriptionsType string
const (
AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminEval AdminOrgProtoOrgNewParamsProductSubscriptionsType = "NGC_ADMIN_EVAL"
AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminNfr AdminOrgProtoOrgNewParamsProductSubscriptionsType = "NGC_ADMIN_NFR"
AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminCommercial AdminOrgProtoOrgNewParamsProductSubscriptionsType = "NGC_ADMIN_COMMERCIAL"
)
func (r AdminOrgProtoOrgNewParamsProductSubscriptionsType) IsKnown() bool {
switch r {
case AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminEval, AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminNfr, AdminOrgProtoOrgNewParamsProductSubscriptionsTypeNgcAdminCommercial:
return true
}
return false
}
type AdminOrgProtoOrgNewParamsType string
const (
AdminOrgProtoOrgNewParamsTypeUnknown AdminOrgProtoOrgNewParamsType = "UNKNOWN"
AdminOrgProtoOrgNewParamsTypeCloud AdminOrgProtoOrgNewParamsType = "CLOUD"
AdminOrgProtoOrgNewParamsTypeEnterprise AdminOrgProtoOrgNewParamsType = "ENTERPRISE"
AdminOrgProtoOrgNewParamsTypeIndividual AdminOrgProtoOrgNewParamsType = "INDIVIDUAL"
)
func (r AdminOrgProtoOrgNewParamsType) IsKnown() bool {
switch r {
case AdminOrgProtoOrgNewParamsTypeUnknown, AdminOrgProtoOrgNewParamsTypeCloud, AdminOrgProtoOrgNewParamsTypeEnterprise, AdminOrgProtoOrgNewParamsTypeIndividual:
return true
}
return false
}