Skip to content

Commit

Permalink
[public-api] only allow optional in update
Browse files Browse the repository at this point in the history
  • Loading branch information
akosyakov committed Nov 8, 2023
1 parent 9f692bb commit bce6f2c
Show file tree
Hide file tree
Showing 6 changed files with 493 additions and 467 deletions.
16 changes: 10 additions & 6 deletions components/public-api/gitpod/v1/organization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package gitpod.v1;

import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "gitpod/v1/pagination.proto";

Expand All @@ -18,9 +19,9 @@ message OrganizationMember {
string user_id = 1;
OrganizationRole role = 2;
google.protobuf.Timestamp member_since = 3;
optional string avatar_url = 4;
optional string full_name = 5;
optional string email = 6;
string avatar_url = 4;

Check failure on line 22 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "4" on message "OrganizationMember" moved from inside to outside a oneof.
string full_name = 5;

Check failure on line 23 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "5" on message "OrganizationMember" moved from inside to outside a oneof.
string email = 6;

Check failure on line 24 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "6" on message "OrganizationMember" moved from inside to outside a oneof.
bool owned_by_organization = 7;
}

Expand All @@ -32,7 +33,7 @@ enum OrganizationRole {

message OrganizationSettings {
bool workspace_sharing_disabled = 1;
optional string default_workspace_image = 2;
string default_workspace_image = 2;

Check failure on line 36 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "OrganizationSettings" moved from inside to outside a oneof.
}

service OrganizationService {
Expand Down Expand Up @@ -107,8 +108,11 @@ message UpdateOrganizationSettingsRequest {
// organization_id is the ID of the organization to update the settings for.
string organization_id = 1;

// settings are the settings to update
OrganizationSettings settings = 2;
google.protobuf.FieldMask reset_mask = 2;

Check failure on line 111 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" with name "reset_mask" on message "UpdateOrganizationSettingsRequest" changed option "json_name" from "settings" to "resetMask".

Check failure on line 111 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "UpdateOrganizationSettingsRequest" changed type from "gitpod.v1.OrganizationSettings" to "google.protobuf.FieldMask".

Check failure on line 111 in components/public-api/gitpod/v1/organization.proto

View workflow job for this annotation

GitHub Actions / build

Field "2" on message "UpdateOrganizationSettingsRequest" changed name from "settings" to "reset_mask".

optional bool workspace_sharing_disabled = 3;

optional string default_workspace_image = 4;
}

message UpdateOrganizationSettingsResponse {
Expand Down
16 changes: 8 additions & 8 deletions components/public-api/gitpod/v1/workspace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ message Workspace {
// Obtain available regions using the ListRegions operation.
//
// +optional defaults to the user's default region
optional string region = 8;
string region = 8;

Check failure on line 46 in components/public-api/gitpod/v1/workspace.proto

View workflow job for this annotation

GitHub Actions / build

Field "8" on message "Workspace" moved from inside to outside a oneof.

// workspace_class specifies the workspace class with which to create the
// workspace. Obtain available workspace classes using the ListWorkspaceClass
// operation.
//
// +optional defaults to the class configured on the project or the cluster's
// default class.
optional string workspace_class = 9;
string workspace_class = 9;

Check failure on line 54 in components/public-api/gitpod/v1/workspace.proto

View workflow job for this annotation

GitHub Actions / build

Field "9" on message "Workspace" moved from inside to outside a oneof.

// editor specifies the editor that will be used with this workspace.
// Obtain available editors using the EditorService.ListEditors operation.
//
// +optional defaults to the default editor of the user
optional EditorReference editor = 10;
EditorReference editor = 10;

Check failure on line 60 in components/public-api/gitpod/v1/workspace.proto

View workflow job for this annotation

GitHub Actions / build

Field "10" on message "Workspace" moved from inside to outside a oneof.

// context_url is the normalized URL from which the workspace was created
// TODO(ak) replace with resolveContextURL API
Expand All @@ -66,7 +66,7 @@ message Workspace {
// Prebuild ID is the unique identifier of the prebuild
// from which this workspace was created
// +optional if empty then this workspace was not created from a prebuild
optional string prebuild_id = 12;
string prebuild_id = 12;
}

message WorkspaceStatus {
Expand All @@ -77,7 +77,7 @@ message WorkspaceStatus {
WorkspacePhase phase = 1;

// message is an optional human-readable message detailing the current phase
optional string message = 2;
string message = 2;

// workspace_url is the URL of the workspace. Only present when the phase is
// running.
Expand All @@ -104,11 +104,11 @@ message WorkspaceStatus {
message WorkspaceConditions {
// failed contains technical details for the failure of the workspace.
// +optional If this field is empty, the workspace has not failed.
optional string failed = 1;
string failed = 1;

// timeout contains the reason the workspace has timed out.
// +optional If this field is empty, the workspace has not timed out.
optional string timeout = 2;
string timeout = 2;
}

// Admission level describes who can access a workspace instance and its ports.
Expand Down Expand Up @@ -256,5 +256,5 @@ message EditorReference {

message WorkspaceEnvironmentVariable {
string name = 1;
optional string value = 2;
string value = 2;
}
Loading

0 comments on commit bce6f2c

Please sign in to comment.