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 c1573d2
Show file tree
Hide file tree
Showing 8 changed files with 2,124 additions and 43 deletions.
34 changes: 34 additions & 0 deletions apis/refs/v1beta1/workstationclusterref.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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"`
}

type WorkstationCluster struct {
ProjectID string
Location string
ResourceID string
}

func (s *WorkstationCluster) String() string {
return "projects/" + s.ProjectID + "locations/" + s.Location + "/workstationClusters/" + s.ResourceID
}
28 changes: 28 additions & 0 deletions apis/workstations/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// 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

// +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.

15 changes: 1 addition & 14 deletions apis/workstations/v1alpha1/workstationcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,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 c1573d2

Please sign in to comment.