@databricks/sdk-workspaces 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v1/model.js CHANGED
@@ -1,536 +1,414 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { FieldMask } from '@databricks/sdk-core/wkt';
3
- import { z } from 'zod';
1
+ import { z } from "zod";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+
4
+ //#region src/v1/model.ts
4
5
  /**
5
- * Corresponds to compute mode defined here:
6
- * https://src.dev.databricks.com/databricks/universe@9076536b18479afd639d1c1f9dd5a59f72215e69/-/blob/central/api/common.proto?L872
7
- */
8
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
9
- export const ComputeMode = {
10
- /** Classic + Serverless */
11
- HYBRID: 'HYBRID',
12
- /** Serverless-only. */
13
- SERVERLESS: 'SERVERLESS',
6
+ * Corresponds to compute mode defined here:
7
+ * https://src.dev.databricks.com/databricks/universe@9076536b18479afd639d1c1f9dd5a59f72215e69/-/blob/central/api/common.proto?L872
8
+ */
9
+ const ComputeMode = {
10
+ HYBRID: "HYBRID",
11
+ SERVERLESS: "SERVERLESS"
14
12
  };
15
13
  /**
16
- * Specifies the network connectivity types for the GKE nodes and the GKE master network.
17
- *
18
- * Set to `PRIVATE_NODE_PUBLIC_MASTER` for a private GKE cluster
19
- * for the workspace. The GKE nodes will not have public IPs.
20
- *
21
- * Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster.
22
- * The nodes of a public GKE cluster have public IP addresses.
23
- */
24
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
25
- export const GkeConnectivityType = {
26
- /**
27
- * The nodes of the GKE cluster will have private IP only. GKE master will still have a public
28
- * IP.
29
- */
30
- PRIVATE_NODE_PUBLIC_MASTER: 'PRIVATE_NODE_PUBLIC_MASTER',
31
- /** The GKE cluster will have public IPs for both its nodes and GKE master. */
32
- PUBLIC_NODE_PUBLIC_MASTER: 'PUBLIC_NODE_PUBLIC_MASTER',
14
+ * Specifies the network connectivity types for the GKE nodes and the GKE master network.
15
+ *
16
+ * Set to `PRIVATE_NODE_PUBLIC_MASTER` for a private GKE cluster
17
+ * for the workspace. The GKE nodes will not have public IPs.
18
+ *
19
+ * Set to `PUBLIC_NODE_PUBLIC_MASTER` for a public GKE cluster.
20
+ * The nodes of a public GKE cluster have public IP addresses.
21
+ */
22
+ const GkeConnectivityType = {
23
+ PRIVATE_NODE_PUBLIC_MASTER: "PRIVATE_NODE_PUBLIC_MASTER",
24
+ PUBLIC_NODE_PUBLIC_MASTER: "PUBLIC_NODE_PUBLIC_MASTER"
33
25
  };
34
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
35
- export const PricingTier = {
36
- /** unknown tier that signifies invalid tier values */
37
- UNKNOWN: 'UNKNOWN',
38
- /** Tier for CE workspaces */
39
- COMMUNITY_EDITION: 'COMMUNITY_EDITION',
40
- /** Standard pricing tier that maps to STANDARD_TIER feature tier */
41
- STANDARD: 'STANDARD',
42
- /** Premium pricing tier that maps to STANDARD_W_SEC_TIER feature tier */
43
- PREMIUM: 'PREMIUM',
44
- /** Enterprise pricing tier that maps to ENTERPRISE_TIER_V2 feature tier */
45
- ENTERPRISE: 'ENTERPRISE',
46
- /** Dedicated pricing tier that maps to the DEDICATED feature tier */
47
- DEDICATED: 'DEDICATED',
26
+ const PricingTier = {
27
+ UNKNOWN: "UNKNOWN",
28
+ COMMUNITY_EDITION: "COMMUNITY_EDITION",
29
+ STANDARD: "STANDARD",
30
+ PREMIUM: "PREMIUM",
31
+ ENTERPRISE: "ENTERPRISE",
32
+ DEDICATED: "DEDICATED"
48
33
  };
49
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
50
- export const StorageMode = {
51
- /** The storage resources of the workspace are hosted by customers. */
52
- CUSTOMER_HOSTED: 'CUSTOMER_HOSTED',
53
- /** The storage resources of the workspace are hosted by Databricks. */
54
- DEFAULT_STORAGE: 'DEFAULT_STORAGE',
34
+ const StorageMode = {
35
+ CUSTOMER_HOSTED: "CUSTOMER_HOSTED",
36
+ DEFAULT_STORAGE: "DEFAULT_STORAGE"
55
37
  };
56
38
  /**
57
- * The different statuses of a workspace. The following represents the current set of valid
58
- * transitions from status to status:
59
- * NOT_PROVISIONED
60
- * -> PROVISIONING
61
- * -> CANCELLED
62
- * PROVISIONING
63
- * -> RUNNING
64
- * -> FAILED
65
- * -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project)
66
- * RUNNING
67
- * -> PROVISIONING
68
- * -> BANNED
69
- * -> CANCELLED
70
- * FAILED
71
- * -> PROVISIONING
72
- * -> CANCELLED
73
- * BANNED
74
- * -> RUNNING
75
- * -> CANCELLED
76
- * Note that a transition from any state to itself is also valid.
77
- */
78
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
79
- export const WorkspaceStatus = {
80
- /**
81
- * Status for workspaces that have been created but not provisioned yet. It is technically
82
- * possible for an Azure workspace to be in this state, but only for less than a second in almost
83
- * all cases, as it will almost immediately transition to PROVISIONING. AWS workspaces may be in
84
- * NOT_PROVISIONED state for much longer.
85
- */
86
- NOT_PROVISIONED: 'NOT_PROVISIONED',
87
- /** Status for workspaces being provisioned. */
88
- PROVISIONING: 'PROVISIONING',
89
- /** Status for running workspaces. */
90
- RUNNING: 'RUNNING',
91
- /**
92
- * Status for workspaces that have failed to be provisioned. This is currently an AWS-only state
93
- * since an Azure customer can easily retry to launch a workspace that failed to launch, whereas
94
- * this process is different in AWS.
95
- */
96
- FAILED: 'FAILED',
97
- /**
98
- * Status for banned workspaces. This is intended for use with CE workspaces, although there is no
99
- * code to enforce this restriction. These workspaces can be unbanned at a later time.
100
- */
101
- BANNED: 'BANNED',
102
- /** Status for cancelling workspaces. This state always comes before the CANCELLED status. */
103
- CANCELLING: 'CANCELLING',
39
+ * The different statuses of a workspace. The following represents the current set of valid
40
+ * transitions from status to status:
41
+ * NOT_PROVISIONED
42
+ * -> PROVISIONING
43
+ * -> CANCELLED
44
+ * PROVISIONING
45
+ * -> RUNNING
46
+ * -> FAILED
47
+ * -> CANCELLED (note that this transition is disallowed in the MultiWorkspace Project)
48
+ * RUNNING
49
+ * -> PROVISIONING
50
+ * -> BANNED
51
+ * -> CANCELLED
52
+ * FAILED
53
+ * -> PROVISIONING
54
+ * -> CANCELLED
55
+ * BANNED
56
+ * -> RUNNING
57
+ * -> CANCELLED
58
+ * Note that a transition from any state to itself is also valid.
59
+ */
60
+ const WorkspaceStatus = {
61
+ NOT_PROVISIONED: "NOT_PROVISIONED",
62
+ PROVISIONING: "PROVISIONING",
63
+ RUNNING: "RUNNING",
64
+ FAILED: "FAILED",
65
+ BANNED: "BANNED",
66
+ CANCELLING: "CANCELLING"
104
67
  };
105
- export const unmarshalAzureWorkspaceInfoSchema = z
106
- .object({
107
- resource_group: z.string().optional(),
108
- subscription_id: z.string().optional(),
109
- })
110
- .transform(d => ({
111
- resourceGroup: d.resource_group,
112
- subscriptionId: d.subscription_id,
68
+ const unmarshalAzureWorkspaceInfoSchema = z.object({
69
+ resource_group: z.string().optional(),
70
+ subscription_id: z.string().optional()
71
+ }).transform((d) => ({
72
+ resourceGroup: d.resource_group,
73
+ subscriptionId: d.subscription_id
113
74
  }));
114
- export const unmarshalCloudResourceContainerSchema = z
115
- .object({
116
- gcp: z.lazy(() => unmarshalGcpCloudResourceContainerSchema).optional(),
117
- })
118
- .transform(d => ({
119
- cloudResourceContainer: d.gcp !== undefined ? { $case: 'gcp', gcp: d.gcp } : undefined,
75
+ const unmarshalCloudResourceContainerSchema = z.object({ gcp: z.lazy(() => unmarshalGcpCloudResourceContainerSchema).optional() }).transform((d) => ({ cloudResourceContainer: d.gcp !== void 0 ? {
76
+ $case: "gcp",
77
+ gcp: d.gcp
78
+ } : void 0 }));
79
+ const unmarshalGcpCloudResourceContainerSchema = z.object({ project_id: z.string().optional() }).transform((d) => ({ projectId: d.project_id }));
80
+ const unmarshalGcpCommonNetworkConfigSchema = z.object({
81
+ gke_connectivity_type: z.string().optional(),
82
+ gke_cluster_master_ip_range: z.string().optional()
83
+ }).transform((d) => ({
84
+ gkeConnectivityType: d.gke_connectivity_type,
85
+ gkeClusterMasterIpRange: d.gke_cluster_master_ip_range
120
86
  }));
121
- export const unmarshalGcpCloudResourceContainerSchema = z
122
- .object({
123
- project_id: z.string().optional(),
124
- })
125
- .transform(d => ({
126
- projectId: d.project_id,
87
+ const unmarshalGcpManagedNetworkConfigSchema = z.object({
88
+ subnet_cidr: z.string().optional(),
89
+ gke_cluster_pod_ip_range: z.string().optional(),
90
+ gke_cluster_service_ip_range: z.string().optional()
91
+ }).transform((d) => ({
92
+ subnetCidr: d.subnet_cidr,
93
+ gkeClusterPodIpRange: d.gke_cluster_pod_ip_range,
94
+ gkeClusterServiceIpRange: d.gke_cluster_service_ip_range
127
95
  }));
128
- export const unmarshalGcpCommonNetworkConfigSchema = z
129
- .object({
130
- gke_connectivity_type: z.string().optional(),
131
- gke_cluster_master_ip_range: z.string().optional(),
132
- })
133
- .transform(d => ({
134
- gkeConnectivityType: d.gke_connectivity_type,
135
- gkeClusterMasterIpRange: d.gke_cluster_master_ip_range,
96
+ const unmarshalGkeConfigSchema = z.object({
97
+ connectivity_type: z.string().optional(),
98
+ master_ip_range: z.string().optional()
99
+ }).transform((d) => ({
100
+ connectivityType: d.connectivity_type,
101
+ masterIpRange: d.master_ip_range
136
102
  }));
137
- export const unmarshalGcpManagedNetworkConfigSchema = z
138
- .object({
139
- subnet_cidr: z.string().optional(),
140
- gke_cluster_pod_ip_range: z.string().optional(),
141
- gke_cluster_service_ip_range: z.string().optional(),
142
- })
143
- .transform(d => ({
144
- subnetCidr: d.subnet_cidr,
145
- gkeClusterPodIpRange: d.gke_cluster_pod_ip_range,
146
- gkeClusterServiceIpRange: d.gke_cluster_service_ip_range,
103
+ const unmarshalWorkspaceSchema = z.object({
104
+ workspace_id: z.union([z.number(), z.bigint()]).transform((v) => BigInt(v)).optional(),
105
+ workspace_name: z.string().optional(),
106
+ aws_region: z.string().optional(),
107
+ creation_time: z.union([z.number(), z.bigint()]).transform((v) => BigInt(v)).optional(),
108
+ deployment_name: z.string().optional(),
109
+ workspace_status: z.string().optional(),
110
+ account_id: z.string().optional(),
111
+ credentials_id: z.string().optional(),
112
+ storage_configuration_id: z.string().optional(),
113
+ workspace_status_message: z.string().optional(),
114
+ network_id: z.string().optional(),
115
+ gcp_managed_network_config: z.lazy(() => unmarshalGcpManagedNetworkConfigSchema).optional(),
116
+ pricing_tier: z.string().optional(),
117
+ private_access_settings_id: z.string().optional(),
118
+ managed_services_customer_managed_key_id: z.string().optional(),
119
+ storage_customer_managed_key_id: z.string().optional(),
120
+ location: z.string().optional(),
121
+ cloud: z.string().optional(),
122
+ network: z.lazy(() => unmarshalWorkspaceNetworkSchema).optional(),
123
+ azure_workspace_info: z.lazy(() => unmarshalAzureWorkspaceInfoSchema).optional(),
124
+ gke_config: z.lazy(() => unmarshalGkeConfigSchema).optional(),
125
+ cloud_resource_container: z.lazy(() => unmarshalCloudResourceContainerSchema).optional(),
126
+ custom_tags: z.record(z.string(), z.string()).optional(),
127
+ network_connectivity_config_id: z.string().optional(),
128
+ storage_mode: z.string().optional(),
129
+ compute_mode: z.string().optional(),
130
+ expected_workspace_status: z.string().optional()
131
+ }).transform((d) => ({
132
+ workspaceId: d.workspace_id,
133
+ workspaceName: d.workspace_name,
134
+ awsRegion: d.aws_region,
135
+ creationTime: d.creation_time,
136
+ deploymentName: d.deployment_name,
137
+ workspaceStatus: d.workspace_status,
138
+ accountId: d.account_id,
139
+ credentialsId: d.credentials_id,
140
+ storageConfigurationId: d.storage_configuration_id,
141
+ workspaceStatusMessage: d.workspace_status_message,
142
+ networkConfig: d.network_id !== void 0 ? {
143
+ $case: "networkId",
144
+ networkId: d.network_id
145
+ } : d.gcp_managed_network_config !== void 0 ? {
146
+ $case: "gcpManagedNetworkConfig",
147
+ gcpManagedNetworkConfig: d.gcp_managed_network_config
148
+ } : void 0,
149
+ pricingTier: d.pricing_tier,
150
+ privateAccessSettingsId: d.private_access_settings_id,
151
+ managedServicesCustomerManagedKeyId: d.managed_services_customer_managed_key_id,
152
+ storageCustomerManagedKeyId: d.storage_customer_managed_key_id,
153
+ location: d.location,
154
+ cloud: d.cloud,
155
+ network: d.network,
156
+ azureWorkspaceInfo: d.azure_workspace_info,
157
+ gkeConfig: d.gke_config,
158
+ cloudResourceContainer: d.cloud_resource_container,
159
+ customTags: d.custom_tags,
160
+ networkConnectivityConfigId: d.network_connectivity_config_id,
161
+ storageMode: d.storage_mode,
162
+ computeMode: d.compute_mode,
163
+ expectedWorkspaceStatus: d.expected_workspace_status
147
164
  }));
148
- export const unmarshalGkeConfigSchema = z
149
- .object({
150
- connectivity_type: z.string().optional(),
151
- master_ip_range: z.string().optional(),
152
- })
153
- .transform(d => ({
154
- connectivityType: d.connectivity_type,
155
- masterIpRange: d.master_ip_range,
165
+ const unmarshalWorkspaceNetworkSchema = z.object({
166
+ gcp_managed_network_config: z.lazy(() => unmarshalGcpManagedNetworkConfigSchema).optional(),
167
+ network_id: z.string().optional(),
168
+ gcp_common_network_config: z.lazy(() => unmarshalGcpCommonNetworkConfigSchema).optional()
169
+ }).transform((d) => ({
170
+ network: d.gcp_managed_network_config !== void 0 ? {
171
+ $case: "gcpManagedNetworkConfig",
172
+ gcpManagedNetworkConfig: d.gcp_managed_network_config
173
+ } : d.network_id !== void 0 ? {
174
+ $case: "networkId",
175
+ networkId: d.network_id
176
+ } : void 0,
177
+ gcpCommonNetworkConfig: d.gcp_common_network_config
156
178
  }));
157
- export const unmarshalWorkspaceSchema = z
158
- .object({
159
- workspace_id: z
160
- .union([z.number(), z.bigint()])
161
- .transform(v => BigInt(v))
162
- .optional(),
163
- workspace_name: z.string().optional(),
164
- aws_region: z.string().optional(),
165
- creation_time: z
166
- .union([z.number(), z.bigint()])
167
- .transform(v => BigInt(v))
168
- .optional(),
169
- deployment_name: z.string().optional(),
170
- workspace_status: z.string().optional(),
171
- account_id: z.string().optional(),
172
- credentials_id: z.string().optional(),
173
- storage_configuration_id: z.string().optional(),
174
- workspace_status_message: z.string().optional(),
175
- network_id: z.string().optional(),
176
- gcp_managed_network_config: z
177
- .lazy(() => unmarshalGcpManagedNetworkConfigSchema)
178
- .optional(),
179
- pricing_tier: z.string().optional(),
180
- private_access_settings_id: z.string().optional(),
181
- managed_services_customer_managed_key_id: z.string().optional(),
182
- storage_customer_managed_key_id: z.string().optional(),
183
- location: z.string().optional(),
184
- cloud: z.string().optional(),
185
- network: z.lazy(() => unmarshalWorkspaceNetworkSchema).optional(),
186
- azure_workspace_info: z
187
- .lazy(() => unmarshalAzureWorkspaceInfoSchema)
188
- .optional(),
189
- gke_config: z.lazy(() => unmarshalGkeConfigSchema).optional(),
190
- cloud_resource_container: z
191
- .lazy(() => unmarshalCloudResourceContainerSchema)
192
- .optional(),
193
- custom_tags: z.record(z.string(), z.string()).optional(),
194
- network_connectivity_config_id: z.string().optional(),
195
- storage_mode: z.string().optional(),
196
- compute_mode: z.string().optional(),
197
- expected_workspace_status: z.string().optional(),
198
- })
199
- .transform(d => ({
200
- workspaceId: d.workspace_id,
201
- workspaceName: d.workspace_name,
202
- awsRegion: d.aws_region,
203
- creationTime: d.creation_time,
204
- deploymentName: d.deployment_name,
205
- workspaceStatus: d.workspace_status,
206
- accountId: d.account_id,
207
- credentialsId: d.credentials_id,
208
- storageConfigurationId: d.storage_configuration_id,
209
- workspaceStatusMessage: d.workspace_status_message,
210
- networkConfig: d.network_id !== undefined
211
- ? { $case: 'networkId', networkId: d.network_id }
212
- : d.gcp_managed_network_config !== undefined
213
- ? {
214
- $case: 'gcpManagedNetworkConfig',
215
- gcpManagedNetworkConfig: d.gcp_managed_network_config,
216
- }
217
- : undefined,
218
- pricingTier: d.pricing_tier,
219
- privateAccessSettingsId: d.private_access_settings_id,
220
- managedServicesCustomerManagedKeyId: d.managed_services_customer_managed_key_id,
221
- storageCustomerManagedKeyId: d.storage_customer_managed_key_id,
222
- location: d.location,
223
- cloud: d.cloud,
224
- network: d.network,
225
- azureWorkspaceInfo: d.azure_workspace_info,
226
- gkeConfig: d.gke_config,
227
- cloudResourceContainer: d.cloud_resource_container,
228
- customTags: d.custom_tags,
229
- networkConnectivityConfigId: d.network_connectivity_config_id,
230
- storageMode: d.storage_mode,
231
- computeMode: d.compute_mode,
232
- expectedWorkspaceStatus: d.expected_workspace_status,
179
+ const marshalAzureWorkspaceInfoSchema = z.object({
180
+ resourceGroup: z.string().optional(),
181
+ subscriptionId: z.string().optional()
182
+ }).transform((d) => ({
183
+ resource_group: d.resourceGroup,
184
+ subscription_id: d.subscriptionId
233
185
  }));
234
- export const unmarshalWorkspaceNetworkSchema = z
235
- .object({
236
- gcp_managed_network_config: z
237
- .lazy(() => unmarshalGcpManagedNetworkConfigSchema)
238
- .optional(),
239
- network_id: z.string().optional(),
240
- gcp_common_network_config: z
241
- .lazy(() => unmarshalGcpCommonNetworkConfigSchema)
242
- .optional(),
243
- })
244
- .transform(d => ({
245
- network: d.gcp_managed_network_config !== undefined
246
- ? {
247
- $case: 'gcpManagedNetworkConfig',
248
- gcpManagedNetworkConfig: d.gcp_managed_network_config,
249
- }
250
- : d.network_id !== undefined
251
- ? { $case: 'networkId', networkId: d.network_id }
252
- : undefined,
253
- gcpCommonNetworkConfig: d.gcp_common_network_config,
186
+ const marshalCloudResourceContainerSchema = z.object({ cloudResourceContainer: z.discriminatedUnion("$case", [z.object({
187
+ $case: z.literal("gcp"),
188
+ gcp: z.lazy(() => marshalGcpCloudResourceContainerSchema)
189
+ })]).optional() }).transform((d) => ({ ...d.cloudResourceContainer?.$case === "gcp" && { gcp: d.cloudResourceContainer.gcp } }));
190
+ const marshalCreateWorkspaceRequestSchema = z.object({
191
+ accountId: z.string().optional(),
192
+ workspaceName: z.string().optional(),
193
+ deploymentName: z.string().optional(),
194
+ awsRegion: z.string().optional(),
195
+ location: z.string().optional(),
196
+ cloud: z.string().optional(),
197
+ pricingTier: z.string().optional(),
198
+ cloudResourceContainer: z.lazy(() => marshalCloudResourceContainerSchema).optional(),
199
+ credentialsId: z.string().optional(),
200
+ storageConfigurationId: z.string().optional(),
201
+ networkId: z.string().optional(),
202
+ gcpManagedNetworkConfig: z.lazy(() => marshalGcpManagedNetworkConfigSchema).optional(),
203
+ gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(),
204
+ privateAccessSettingsId: z.string().optional(),
205
+ managedServicesCustomerManagedKeyId: z.string().optional(),
206
+ storageCustomerManagedKeyId: z.string().optional(),
207
+ customTags: z.record(z.string(), z.string()).optional(),
208
+ computeMode: z.string().optional(),
209
+ networkConnectivityConfigId: z.string().optional()
210
+ }).transform((d) => ({
211
+ account_id: d.accountId,
212
+ workspace_name: d.workspaceName,
213
+ deployment_name: d.deploymentName,
214
+ aws_region: d.awsRegion,
215
+ location: d.location,
216
+ cloud: d.cloud,
217
+ pricing_tier: d.pricingTier,
218
+ cloud_resource_container: d.cloudResourceContainer,
219
+ credentials_id: d.credentialsId,
220
+ storage_configuration_id: d.storageConfigurationId,
221
+ network_id: d.networkId,
222
+ gcp_managed_network_config: d.gcpManagedNetworkConfig,
223
+ gke_config: d.gkeConfig,
224
+ private_access_settings_id: d.privateAccessSettingsId,
225
+ managed_services_customer_managed_key_id: d.managedServicesCustomerManagedKeyId,
226
+ storage_customer_managed_key_id: d.storageCustomerManagedKeyId,
227
+ custom_tags: d.customTags,
228
+ compute_mode: d.computeMode,
229
+ network_connectivity_config_id: d.networkConnectivityConfigId
254
230
  }));
255
- export const marshalAzureWorkspaceInfoSchema = z
256
- .object({
257
- resourceGroup: z.string().optional(),
258
- subscriptionId: z.string().optional(),
259
- })
260
- .transform(d => ({
261
- resource_group: d.resourceGroup,
262
- subscription_id: d.subscriptionId,
231
+ const marshalGcpCloudResourceContainerSchema = z.object({ projectId: z.string().optional() }).transform((d) => ({ project_id: d.projectId }));
232
+ const marshalGcpCommonNetworkConfigSchema = z.object({
233
+ gkeConnectivityType: z.string().optional(),
234
+ gkeClusterMasterIpRange: z.string().optional()
235
+ }).transform((d) => ({
236
+ gke_connectivity_type: d.gkeConnectivityType,
237
+ gke_cluster_master_ip_range: d.gkeClusterMasterIpRange
263
238
  }));
264
- export const marshalCloudResourceContainerSchema = z
265
- .object({
266
- cloudResourceContainer: z
267
- .discriminatedUnion('$case', [
268
- z.object({
269
- $case: z.literal('gcp'),
270
- gcp: z.lazy(() => marshalGcpCloudResourceContainerSchema),
271
- }),
272
- ])
273
- .optional(),
274
- })
275
- .transform(d => ({
276
- ...(d.cloudResourceContainer?.$case === 'gcp' && {
277
- gcp: d.cloudResourceContainer.gcp,
278
- }),
239
+ const marshalGcpManagedNetworkConfigSchema = z.object({
240
+ subnetCidr: z.string().optional(),
241
+ gkeClusterPodIpRange: z.string().optional(),
242
+ gkeClusterServiceIpRange: z.string().optional()
243
+ }).transform((d) => ({
244
+ subnet_cidr: d.subnetCidr,
245
+ gke_cluster_pod_ip_range: d.gkeClusterPodIpRange,
246
+ gke_cluster_service_ip_range: d.gkeClusterServiceIpRange
279
247
  }));
280
- export const marshalCreateWorkspaceRequestSchema = z
281
- .object({
282
- accountId: z.string().optional(),
283
- workspaceName: z.string().optional(),
284
- deploymentName: z.string().optional(),
285
- awsRegion: z.string().optional(),
286
- location: z.string().optional(),
287
- cloud: z.string().optional(),
288
- pricingTier: z.string().optional(),
289
- cloudResourceContainer: z
290
- .lazy(() => marshalCloudResourceContainerSchema)
291
- .optional(),
292
- credentialsId: z.string().optional(),
293
- storageConfigurationId: z.string().optional(),
294
- networkId: z.string().optional(),
295
- gcpManagedNetworkConfig: z
296
- .lazy(() => marshalGcpManagedNetworkConfigSchema)
297
- .optional(),
298
- gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(),
299
- privateAccessSettingsId: z.string().optional(),
300
- managedServicesCustomerManagedKeyId: z.string().optional(),
301
- storageCustomerManagedKeyId: z.string().optional(),
302
- customTags: z.record(z.string(), z.string()).optional(),
303
- computeMode: z.string().optional(),
304
- networkConnectivityConfigId: z.string().optional(),
305
- })
306
- .transform(d => ({
307
- account_id: d.accountId,
308
- workspace_name: d.workspaceName,
309
- deployment_name: d.deploymentName,
310
- aws_region: d.awsRegion,
311
- location: d.location,
312
- cloud: d.cloud,
313
- pricing_tier: d.pricingTier,
314
- cloud_resource_container: d.cloudResourceContainer,
315
- credentials_id: d.credentialsId,
316
- storage_configuration_id: d.storageConfigurationId,
317
- network_id: d.networkId,
318
- gcp_managed_network_config: d.gcpManagedNetworkConfig,
319
- gke_config: d.gkeConfig,
320
- private_access_settings_id: d.privateAccessSettingsId,
321
- managed_services_customer_managed_key_id: d.managedServicesCustomerManagedKeyId,
322
- storage_customer_managed_key_id: d.storageCustomerManagedKeyId,
323
- custom_tags: d.customTags,
324
- compute_mode: d.computeMode,
325
- network_connectivity_config_id: d.networkConnectivityConfigId,
248
+ const marshalGkeConfigSchema = z.object({
249
+ connectivityType: z.string().optional(),
250
+ masterIpRange: z.string().optional()
251
+ }).transform((d) => ({
252
+ connectivity_type: d.connectivityType,
253
+ master_ip_range: d.masterIpRange
326
254
  }));
327
- export const marshalGcpCloudResourceContainerSchema = z
328
- .object({
329
- projectId: z.string().optional(),
330
- })
331
- .transform(d => ({
332
- project_id: d.projectId,
255
+ const marshalWorkspaceSchema = z.object({
256
+ workspaceId: z.bigint().optional(),
257
+ workspaceName: z.string().optional(),
258
+ awsRegion: z.string().optional(),
259
+ creationTime: z.bigint().optional(),
260
+ deploymentName: z.string().optional(),
261
+ workspaceStatus: z.string().optional(),
262
+ accountId: z.string().optional(),
263
+ credentialsId: z.string().optional(),
264
+ storageConfigurationId: z.string().optional(),
265
+ workspaceStatusMessage: z.string().optional(),
266
+ networkConfig: z.discriminatedUnion("$case", [z.object({
267
+ $case: z.literal("networkId"),
268
+ networkId: z.string()
269
+ }), z.object({
270
+ $case: z.literal("gcpManagedNetworkConfig"),
271
+ gcpManagedNetworkConfig: z.lazy(() => marshalGcpManagedNetworkConfigSchema)
272
+ })]).optional(),
273
+ pricingTier: z.string().optional(),
274
+ privateAccessSettingsId: z.string().optional(),
275
+ managedServicesCustomerManagedKeyId: z.string().optional(),
276
+ storageCustomerManagedKeyId: z.string().optional(),
277
+ location: z.string().optional(),
278
+ cloud: z.string().optional(),
279
+ network: z.lazy(() => marshalWorkspaceNetworkSchema).optional(),
280
+ azureWorkspaceInfo: z.lazy(() => marshalAzureWorkspaceInfoSchema).optional(),
281
+ gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(),
282
+ cloudResourceContainer: z.lazy(() => marshalCloudResourceContainerSchema).optional(),
283
+ customTags: z.record(z.string(), z.string()).optional(),
284
+ networkConnectivityConfigId: z.string().optional(),
285
+ storageMode: z.string().optional(),
286
+ computeMode: z.string().optional(),
287
+ expectedWorkspaceStatus: z.string().optional()
288
+ }).transform((d) => ({
289
+ workspace_id: d.workspaceId,
290
+ workspace_name: d.workspaceName,
291
+ aws_region: d.awsRegion,
292
+ creation_time: d.creationTime,
293
+ deployment_name: d.deploymentName,
294
+ workspace_status: d.workspaceStatus,
295
+ account_id: d.accountId,
296
+ credentials_id: d.credentialsId,
297
+ storage_configuration_id: d.storageConfigurationId,
298
+ workspace_status_message: d.workspaceStatusMessage,
299
+ ...d.networkConfig?.$case === "networkId" && { network_id: d.networkConfig.networkId },
300
+ ...d.networkConfig?.$case === "gcpManagedNetworkConfig" && { gcp_managed_network_config: d.networkConfig.gcpManagedNetworkConfig },
301
+ pricing_tier: d.pricingTier,
302
+ private_access_settings_id: d.privateAccessSettingsId,
303
+ managed_services_customer_managed_key_id: d.managedServicesCustomerManagedKeyId,
304
+ storage_customer_managed_key_id: d.storageCustomerManagedKeyId,
305
+ location: d.location,
306
+ cloud: d.cloud,
307
+ network: d.network,
308
+ azure_workspace_info: d.azureWorkspaceInfo,
309
+ gke_config: d.gkeConfig,
310
+ cloud_resource_container: d.cloudResourceContainer,
311
+ custom_tags: d.customTags,
312
+ network_connectivity_config_id: d.networkConnectivityConfigId,
313
+ storage_mode: d.storageMode,
314
+ compute_mode: d.computeMode,
315
+ expected_workspace_status: d.expectedWorkspaceStatus
333
316
  }));
334
- export const marshalGcpCommonNetworkConfigSchema = z
335
- .object({
336
- gkeConnectivityType: z.string().optional(),
337
- gkeClusterMasterIpRange: z.string().optional(),
338
- })
339
- .transform(d => ({
340
- gke_connectivity_type: d.gkeConnectivityType,
341
- gke_cluster_master_ip_range: d.gkeClusterMasterIpRange,
342
- }));
343
- export const marshalGcpManagedNetworkConfigSchema = z
344
- .object({
345
- subnetCidr: z.string().optional(),
346
- gkeClusterPodIpRange: z.string().optional(),
347
- gkeClusterServiceIpRange: z.string().optional(),
348
- })
349
- .transform(d => ({
350
- subnet_cidr: d.subnetCidr,
351
- gke_cluster_pod_ip_range: d.gkeClusterPodIpRange,
352
- gke_cluster_service_ip_range: d.gkeClusterServiceIpRange,
353
- }));
354
- export const marshalGkeConfigSchema = z
355
- .object({
356
- connectivityType: z.string().optional(),
357
- masterIpRange: z.string().optional(),
358
- })
359
- .transform(d => ({
360
- connectivity_type: d.connectivityType,
361
- master_ip_range: d.masterIpRange,
362
- }));
363
- export const marshalWorkspaceSchema = z
364
- .object({
365
- workspaceId: z.bigint().optional(),
366
- workspaceName: z.string().optional(),
367
- awsRegion: z.string().optional(),
368
- creationTime: z.bigint().optional(),
369
- deploymentName: z.string().optional(),
370
- workspaceStatus: z.string().optional(),
371
- accountId: z.string().optional(),
372
- credentialsId: z.string().optional(),
373
- storageConfigurationId: z.string().optional(),
374
- workspaceStatusMessage: z.string().optional(),
375
- networkConfig: z
376
- .discriminatedUnion('$case', [
377
- z.object({ $case: z.literal('networkId'), networkId: z.string() }),
378
- z.object({
379
- $case: z.literal('gcpManagedNetworkConfig'),
380
- gcpManagedNetworkConfig: z.lazy(() => marshalGcpManagedNetworkConfigSchema),
381
- }),
382
- ])
383
- .optional(),
384
- pricingTier: z.string().optional(),
385
- privateAccessSettingsId: z.string().optional(),
386
- managedServicesCustomerManagedKeyId: z.string().optional(),
387
- storageCustomerManagedKeyId: z.string().optional(),
388
- location: z.string().optional(),
389
- cloud: z.string().optional(),
390
- network: z.lazy(() => marshalWorkspaceNetworkSchema).optional(),
391
- azureWorkspaceInfo: z
392
- .lazy(() => marshalAzureWorkspaceInfoSchema)
393
- .optional(),
394
- gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(),
395
- cloudResourceContainer: z
396
- .lazy(() => marshalCloudResourceContainerSchema)
397
- .optional(),
398
- customTags: z.record(z.string(), z.string()).optional(),
399
- networkConnectivityConfigId: z.string().optional(),
400
- storageMode: z.string().optional(),
401
- computeMode: z.string().optional(),
402
- expectedWorkspaceStatus: z.string().optional(),
403
- })
404
- .transform(d => ({
405
- workspace_id: d.workspaceId,
406
- workspace_name: d.workspaceName,
407
- aws_region: d.awsRegion,
408
- creation_time: d.creationTime,
409
- deployment_name: d.deploymentName,
410
- workspace_status: d.workspaceStatus,
411
- account_id: d.accountId,
412
- credentials_id: d.credentialsId,
413
- storage_configuration_id: d.storageConfigurationId,
414
- workspace_status_message: d.workspaceStatusMessage,
415
- ...(d.networkConfig?.$case === 'networkId' && {
416
- network_id: d.networkConfig.networkId,
417
- }),
418
- ...(d.networkConfig?.$case === 'gcpManagedNetworkConfig' && {
419
- gcp_managed_network_config: d.networkConfig.gcpManagedNetworkConfig,
420
- }),
421
- pricing_tier: d.pricingTier,
422
- private_access_settings_id: d.privateAccessSettingsId,
423
- managed_services_customer_managed_key_id: d.managedServicesCustomerManagedKeyId,
424
- storage_customer_managed_key_id: d.storageCustomerManagedKeyId,
425
- location: d.location,
426
- cloud: d.cloud,
427
- network: d.network,
428
- azure_workspace_info: d.azureWorkspaceInfo,
429
- gke_config: d.gkeConfig,
430
- cloud_resource_container: d.cloudResourceContainer,
431
- custom_tags: d.customTags,
432
- network_connectivity_config_id: d.networkConnectivityConfigId,
433
- storage_mode: d.storageMode,
434
- compute_mode: d.computeMode,
435
- expected_workspace_status: d.expectedWorkspaceStatus,
436
- }));
437
- export const marshalWorkspaceNetworkSchema = z
438
- .object({
439
- network: z
440
- .discriminatedUnion('$case', [
441
- z.object({
442
- $case: z.literal('gcpManagedNetworkConfig'),
443
- gcpManagedNetworkConfig: z.lazy(() => marshalGcpManagedNetworkConfigSchema),
444
- }),
445
- z.object({ $case: z.literal('networkId'), networkId: z.string() }),
446
- ])
447
- .optional(),
448
- gcpCommonNetworkConfig: z
449
- .lazy(() => marshalGcpCommonNetworkConfigSchema)
450
- .optional(),
451
- })
452
- .transform(d => ({
453
- ...(d.network?.$case === 'gcpManagedNetworkConfig' && {
454
- gcp_managed_network_config: d.network.gcpManagedNetworkConfig,
455
- }),
456
- ...(d.network?.$case === 'networkId' && { network_id: d.network.networkId }),
457
- gcp_common_network_config: d.gcpCommonNetworkConfig,
317
+ const marshalWorkspaceNetworkSchema = z.object({
318
+ network: z.discriminatedUnion("$case", [z.object({
319
+ $case: z.literal("gcpManagedNetworkConfig"),
320
+ gcpManagedNetworkConfig: z.lazy(() => marshalGcpManagedNetworkConfigSchema)
321
+ }), z.object({
322
+ $case: z.literal("networkId"),
323
+ networkId: z.string()
324
+ })]).optional(),
325
+ gcpCommonNetworkConfig: z.lazy(() => marshalGcpCommonNetworkConfigSchema).optional()
326
+ }).transform((d) => ({
327
+ ...d.network?.$case === "gcpManagedNetworkConfig" && { gcp_managed_network_config: d.network.gcpManagedNetworkConfig },
328
+ ...d.network?.$case === "networkId" && { network_id: d.network.networkId },
329
+ gcp_common_network_config: d.gcpCommonNetworkConfig
458
330
  }));
459
331
  const azureWorkspaceInfoFieldMaskSchema = {
460
- resourceGroup: { wire: 'resource_group' },
461
- subscriptionId: { wire: 'subscription_id' },
462
- };
463
- const cloudResourceContainerFieldMaskSchema = {
464
- gcp: { wire: 'gcp', children: () => gcpCloudResourceContainerFieldMaskSchema },
465
- };
466
- const gcpCloudResourceContainerFieldMaskSchema = {
467
- projectId: { wire: 'project_id' },
332
+ resourceGroup: { wire: "resource_group" },
333
+ subscriptionId: { wire: "subscription_id" }
468
334
  };
335
+ const cloudResourceContainerFieldMaskSchema = { gcp: {
336
+ wire: "gcp",
337
+ children: () => gcpCloudResourceContainerFieldMaskSchema
338
+ } };
339
+ const gcpCloudResourceContainerFieldMaskSchema = { projectId: { wire: "project_id" } };
469
340
  const gcpCommonNetworkConfigFieldMaskSchema = {
470
- gkeClusterMasterIpRange: { wire: 'gke_cluster_master_ip_range' },
471
- gkeConnectivityType: { wire: 'gke_connectivity_type' },
341
+ gkeClusterMasterIpRange: { wire: "gke_cluster_master_ip_range" },
342
+ gkeConnectivityType: { wire: "gke_connectivity_type" }
472
343
  };
473
344
  const gcpManagedNetworkConfigFieldMaskSchema = {
474
- gkeClusterPodIpRange: { wire: 'gke_cluster_pod_ip_range' },
475
- gkeClusterServiceIpRange: { wire: 'gke_cluster_service_ip_range' },
476
- subnetCidr: { wire: 'subnet_cidr' },
345
+ gkeClusterPodIpRange: { wire: "gke_cluster_pod_ip_range" },
346
+ gkeClusterServiceIpRange: { wire: "gke_cluster_service_ip_range" },
347
+ subnetCidr: { wire: "subnet_cidr" }
477
348
  };
478
349
  const gkeConfigFieldMaskSchema = {
479
- connectivityType: { wire: 'connectivity_type' },
480
- masterIpRange: { wire: 'master_ip_range' },
350
+ connectivityType: { wire: "connectivity_type" },
351
+ masterIpRange: { wire: "master_ip_range" }
481
352
  };
482
353
  const workspaceFieldMaskSchema = {
483
- accountId: { wire: 'account_id' },
484
- awsRegion: { wire: 'aws_region' },
485
- azureWorkspaceInfo: {
486
- wire: 'azure_workspace_info',
487
- children: () => azureWorkspaceInfoFieldMaskSchema,
488
- },
489
- cloud: { wire: 'cloud' },
490
- cloudResourceContainer: {
491
- wire: 'cloud_resource_container',
492
- children: () => cloudResourceContainerFieldMaskSchema,
493
- },
494
- computeMode: { wire: 'compute_mode' },
495
- creationTime: { wire: 'creation_time' },
496
- credentialsId: { wire: 'credentials_id' },
497
- customTags: { wire: 'custom_tags' },
498
- deploymentName: { wire: 'deployment_name' },
499
- expectedWorkspaceStatus: { wire: 'expected_workspace_status' },
500
- gcpManagedNetworkConfig: {
501
- wire: 'gcp_managed_network_config',
502
- children: () => gcpManagedNetworkConfigFieldMaskSchema,
503
- },
504
- gkeConfig: { wire: 'gke_config', children: () => gkeConfigFieldMaskSchema },
505
- location: { wire: 'location' },
506
- managedServicesCustomerManagedKeyId: {
507
- wire: 'managed_services_customer_managed_key_id',
508
- },
509
- network: { wire: 'network', children: () => workspaceNetworkFieldMaskSchema },
510
- networkConnectivityConfigId: { wire: 'network_connectivity_config_id' },
511
- networkId: { wire: 'network_id' },
512
- pricingTier: { wire: 'pricing_tier' },
513
- privateAccessSettingsId: { wire: 'private_access_settings_id' },
514
- storageConfigurationId: { wire: 'storage_configuration_id' },
515
- storageCustomerManagedKeyId: { wire: 'storage_customer_managed_key_id' },
516
- storageMode: { wire: 'storage_mode' },
517
- workspaceId: { wire: 'workspace_id' },
518
- workspaceName: { wire: 'workspace_name' },
519
- workspaceStatus: { wire: 'workspace_status' },
520
- workspaceStatusMessage: { wire: 'workspace_status_message' },
354
+ accountId: { wire: "account_id" },
355
+ awsRegion: { wire: "aws_region" },
356
+ azureWorkspaceInfo: {
357
+ wire: "azure_workspace_info",
358
+ children: () => azureWorkspaceInfoFieldMaskSchema
359
+ },
360
+ cloud: { wire: "cloud" },
361
+ cloudResourceContainer: {
362
+ wire: "cloud_resource_container",
363
+ children: () => cloudResourceContainerFieldMaskSchema
364
+ },
365
+ computeMode: { wire: "compute_mode" },
366
+ creationTime: { wire: "creation_time" },
367
+ credentialsId: { wire: "credentials_id" },
368
+ customTags: { wire: "custom_tags" },
369
+ deploymentName: { wire: "deployment_name" },
370
+ expectedWorkspaceStatus: { wire: "expected_workspace_status" },
371
+ gcpManagedNetworkConfig: {
372
+ wire: "gcp_managed_network_config",
373
+ children: () => gcpManagedNetworkConfigFieldMaskSchema
374
+ },
375
+ gkeConfig: {
376
+ wire: "gke_config",
377
+ children: () => gkeConfigFieldMaskSchema
378
+ },
379
+ location: { wire: "location" },
380
+ managedServicesCustomerManagedKeyId: { wire: "managed_services_customer_managed_key_id" },
381
+ network: {
382
+ wire: "network",
383
+ children: () => workspaceNetworkFieldMaskSchema
384
+ },
385
+ networkConnectivityConfigId: { wire: "network_connectivity_config_id" },
386
+ networkId: { wire: "network_id" },
387
+ pricingTier: { wire: "pricing_tier" },
388
+ privateAccessSettingsId: { wire: "private_access_settings_id" },
389
+ storageConfigurationId: { wire: "storage_configuration_id" },
390
+ storageCustomerManagedKeyId: { wire: "storage_customer_managed_key_id" },
391
+ storageMode: { wire: "storage_mode" },
392
+ workspaceId: { wire: "workspace_id" },
393
+ workspaceName: { wire: "workspace_name" },
394
+ workspaceStatus: { wire: "workspace_status" },
395
+ workspaceStatusMessage: { wire: "workspace_status_message" }
521
396
  };
522
- export function workspaceFieldMask(...paths) {
523
- return FieldMask.build(paths, workspaceFieldMaskSchema);
397
+ function workspaceFieldMask(...paths) {
398
+ return FieldMask.build(paths, workspaceFieldMaskSchema);
524
399
  }
525
400
  const workspaceNetworkFieldMaskSchema = {
526
- gcpCommonNetworkConfig: {
527
- wire: 'gcp_common_network_config',
528
- children: () => gcpCommonNetworkConfigFieldMaskSchema,
529
- },
530
- gcpManagedNetworkConfig: {
531
- wire: 'gcp_managed_network_config',
532
- children: () => gcpManagedNetworkConfigFieldMaskSchema,
533
- },
534
- networkId: { wire: 'network_id' },
401
+ gcpCommonNetworkConfig: {
402
+ wire: "gcp_common_network_config",
403
+ children: () => gcpCommonNetworkConfigFieldMaskSchema
404
+ },
405
+ gcpManagedNetworkConfig: {
406
+ wire: "gcp_managed_network_config",
407
+ children: () => gcpManagedNetworkConfigFieldMaskSchema
408
+ },
409
+ networkId: { wire: "network_id" }
535
410
  };
411
+
412
+ //#endregion
413
+ export { ComputeMode, GkeConnectivityType, PricingTier, StorageMode, WorkspaceStatus, marshalAzureWorkspaceInfoSchema, marshalCloudResourceContainerSchema, marshalCreateWorkspaceRequestSchema, marshalGcpCloudResourceContainerSchema, marshalGcpCommonNetworkConfigSchema, marshalGcpManagedNetworkConfigSchema, marshalGkeConfigSchema, marshalWorkspaceNetworkSchema, marshalWorkspaceSchema, unmarshalAzureWorkspaceInfoSchema, unmarshalCloudResourceContainerSchema, unmarshalGcpCloudResourceContainerSchema, unmarshalGcpCommonNetworkConfigSchema, unmarshalGcpManagedNetworkConfigSchema, unmarshalGkeConfigSchema, unmarshalWorkspaceNetworkSchema, unmarshalWorkspaceSchema, workspaceFieldMask };
536
414
  //# sourceMappingURL=model.js.map