Skip to content

Commit

Permalink
chore(core): refactor CheckNamespace endpoint and fix comment (#234)
Browse files Browse the repository at this point in the history
Because

- we'd like to simplify the message of CheckNamespaceRequest

This commit

- refactor CheckNamespace endpoint
- fix comment
  • Loading branch information
donch1989 authored Dec 6, 2023
1 parent 61c3ca8 commit 7aa7e1c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
17 changes: 6 additions & 11 deletions core/mgmt/v1beta/mgmt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -312,21 +312,16 @@ message PatchAuthenticatedUserResponse {
}

// CheckNamespaceRequest represents a request to verify if
// a namespace has been occupied and know its type
// a namespace has been occupied
message CheckNamespaceRequest {
// CheckNamespaceRequestBody
message CheckNamespaceRequestBody {
// The resource id of to check,
string id = 1 [(google.api.field_behavior) = REQUIRED];
}
// body
CheckNamespaceRequestBody namespace = 1 [(google.api.field_behavior) = REQUIRED];
// Namespace ID to be checked
string id = 1 [(google.api.field_behavior) = REQUIRED];
}

// CheckNamespaceResponse represents a response about whether
// the queried username has been occupied
// the queried namespace has been occupied and return its type
message CheckNamespaceResponse {
// Namespace type
// Namespace type enum
enum Namespace {
// UNSPECIFIED
NAMESPACE_UNSPECIFIED = 0;
Expand All @@ -339,7 +334,7 @@ message CheckNamespaceResponse {
// Reserved
NAMESPACE_RESERVED = 4;
}
// A boolean value indicating whether the username has been occupied
// Namespace type
Namespace type = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion core/mgmt/v1beta/mgmt_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ service MgmtPublicService {
rpc CheckNamespace(CheckNamespaceRequest) returns (CheckNamespaceResponse) {
option (google.api.http) = {
post: "/v1beta/check-namespace"
body: "namespace"
body: "*"
};
option (google.api.method_signature) = "namespace";
}
Expand Down
33 changes: 16 additions & 17 deletions openapiv2/openapiv2.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5399,14 +5399,11 @@ paths:
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: namespace
description: body
- name: body
in: body
required: true
schema:
$ref: '#/definitions/CheckNamespaceRequestCheckNamespaceRequestBody'
required:
- namespace
$ref: '#/definitions/v1betaCheckNamespaceRequest'
tags:
- MgmtPublicService
/v1beta/connector-definitions:
Expand Down Expand Up @@ -6280,15 +6277,6 @@ definitions:
format: int32
title: exp
title: UnsignedAccessToken
CheckNamespaceRequestCheckNamespaceRequestBody:
type: object
properties:
id:
type: string
title: The resource id of to check,
title: CheckNamespaceRequestBody
required:
- id
CheckNamespaceResponseNamespace:
type: string
enum:
Expand All @@ -6304,7 +6292,7 @@ definitions:
- NAMESPACE_USER: User
- NAMESPACE_ORGANIZATION: Org
- NAMESPACE_RESERVED: Reserved
title: Namespace type
title: Namespace type enum
HealthCheckResponseServingStatus:
type: string
enum:
Expand Down Expand Up @@ -8327,15 +8315,26 @@ definitions:
title: |-
CheckConnectorResponse represents a response to fetch a
connector's current state
v1betaCheckNamespaceRequest:
type: object
properties:
id:
type: string
title: Namespace ID to be checked
title: |-
CheckNamespaceRequest represents a request to verify if
a namespace has been occupied
required:
- id
v1betaCheckNamespaceResponse:
type: object
properties:
type:
$ref: '#/definitions/CheckNamespaceResponseNamespace'
title: A boolean value indicating whether the username has been occupied
title: Namespace type
title: |-
CheckNamespaceResponse represents a response about whether
the queried username has been occupied
the queried namespace has been occupied and return its type
v1betaComponent:
type: object
properties:
Expand Down

0 comments on commit 7aa7e1c

Please sign in to comment.