Skip to content

Commit

Permalink
feat: Add types for WorkstationConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvigil committed Sep 30, 2024
1 parent 93278d7 commit 09a15ea
Show file tree
Hide file tree
Showing 18 changed files with 3,716 additions and 105 deletions.
24 changes: 24 additions & 0 deletions apis/refs/v1beta1/workstationclusterref.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1beta1

type WorkstationClusterRef struct {
/* The WorkstationCluster selfLink, when not managed by Config Connector. */
External string `json:"external,omitempty"`
/* The `name` field of a `WorkstationCluster` resource. */
Name string `json:"name,omitempty"`
/* The `namespace` field of a `WorkstationCluster` resource. */
Namespace string `json:"namespace,omitempty"`
}
44 changes: 44 additions & 0 deletions apis/workstations/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

type WorkstationAnnotation struct {
// Key for the annotation.
Key string `json:"key,omitempty"`

// Value for the annotation.
Value string `json:"value,omitempty"`
}

type WorkstationLabel struct {
// Key for the label.
Key string `json:"key,omitempty"`

// Value for the label.
Value string `json:"value,omitempty"`
}

// +kcc:proto=google.rpc.Status
type WorkstationServiceGCPCondition struct {
// The status code, which should be an enum value of
// [google.rpc.Code][google.rpc.Code].
Code *int `json:"code,omitempty"`

// A developer-facing error message, which should be in English. Any
// user-facing error message should be localized and sent in the
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
// by the client.
Message *string `json:"message,omitempty"`
}
371 changes: 371 additions & 0 deletions apis/workstations/v1alpha1/types.generated.go

Large diffs are not rendered by default.

35 changes: 3 additions & 32 deletions apis/workstations/v1alpha1/workstationcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ type WorkstationClusterSpec struct {
DisplayName *string `json:"displayName,omitempty"`

// Optional. Client-specified annotations.
Annotations []WorkstationClusterAnnotation `json:"annotations,omitempty"`
Annotations []WorkstationAnnotation `json:"annotations,omitempty"`

// Optional.
// [Labels](https://cloud.google.com/workstations/docs/label-resources) that
// are applied to the workstation cluster and that are also propagated to the
// underlying Compute Engine resources.
Labels []WorkstationClusterLabel `json:"labels,omitempty"`
Labels []WorkstationLabel `json:"labels,omitempty"`

// Immutable. Reference to the Compute Engine network in which instances associated
// with this workstation cluster will be created.
Expand All @@ -67,22 +67,6 @@ type WorkstationClusterSpec struct {
PrivateClusterConfig *WorkstationCluster_PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
}

type WorkstationClusterAnnotation struct {
// Key for the annotation.
Key string `json:"key,omitempty"`

// Value for the annotation.
Value string `json:"value,omitempty"`
}

type WorkstationClusterLabel struct {
// Key for the annotation.
Key string `json:"key,omitempty"`

// Value for the annotation.
Value string `json:"value,omitempty"`
}

// +kcc:proto=google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig
type WorkstationCluster_PrivateClusterConfig struct {
// Immutable. Whether Workstations endpoint is private.
Expand Down Expand Up @@ -163,20 +147,7 @@ type WorkstationClusterObservedState struct {

// Output only. Status conditions describing the workstation cluster's current
// state.
GCPConditions []WorkstationClusterGCPCondition `json:"gcpConditions,omitempty"`
}

// +kcc:proto=google.rpc.Status
type WorkstationClusterGCPCondition struct {
// The status code, which should be an enum value of
// [google.rpc.Code][google.rpc.Code].
Code *int `json:"code,omitempty"`

// A developer-facing error message, which should be in English. Any
// user-facing error message should be localized and sent in the
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
// by the client.
Message *string `json:"message,omitempty"`
GCPConditions []WorkstationServiceGCPCondition `json:"gcpConditions,omitempty"`
}

// +genclient
Expand Down
Loading

0 comments on commit 09a15ea

Please sign in to comment.