Commit 9b159368 authored by Johnny's avatar Johnny

refactor: clean unused fields

parent 778a5eb1
...@@ -9,13 +9,13 @@ import ( ...@@ -9,13 +9,13 @@ import (
exprv1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1" exprv1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
) )
// CommonSQLConverter handles the common CEL to SQL conversion logic // CommonSQLConverter handles the common CEL to SQL conversion logic.
type CommonSQLConverter struct { type CommonSQLConverter struct {
dialect SQLDialect dialect SQLDialect
paramIndex int paramIndex int
} }
// NewCommonSQLConverter creates a new converter with the specified dialect // NewCommonSQLConverter creates a new converter with the specified dialect.
func NewCommonSQLConverter(dialect SQLDialect) *CommonSQLConverter { func NewCommonSQLConverter(dialect SQLDialect) *CommonSQLConverter {
return &CommonSQLConverter{ return &CommonSQLConverter{
dialect: dialect, dialect: dialect,
...@@ -23,7 +23,7 @@ func NewCommonSQLConverter(dialect SQLDialect) *CommonSQLConverter { ...@@ -23,7 +23,7 @@ func NewCommonSQLConverter(dialect SQLDialect) *CommonSQLConverter {
} }
} }
// ConvertExprToSQL converts a CEL expression to SQL using the configured dialect // ConvertExprToSQL converts a CEL expression to SQL using the configured dialect.
func (c *CommonSQLConverter) ConvertExprToSQL(ctx *ConvertContext, expr *exprv1.Expr) error { func (c *CommonSQLConverter) ConvertExprToSQL(ctx *ConvertContext, expr *exprv1.Expr) error {
if v, ok := expr.ExprKind.(*exprv1.Expr_CallExpr); ok { if v, ok := expr.ExprKind.(*exprv1.Expr_CallExpr); ok {
switch v.CallExpr.Function { switch v.CallExpr.Function {
...@@ -428,7 +428,7 @@ func (c *CommonSQLConverter) handleBooleanComparison(ctx *ConvertContext, field, ...@@ -428,7 +428,7 @@ func (c *CommonSQLConverter) handleBooleanComparison(ctx *ConvertContext, field,
return nil return nil
} }
func (c *CommonSQLConverter) getComparisonOperator(function string) string { func (*CommonSQLConverter) getComparisonOperator(function string) string {
switch function { switch function {
case "_==_": case "_==_":
return "=" return "="
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"strings" "strings"
) )
// SQLDialect defines database-specific SQL generation methods // SQLDialect defines database-specific SQL generation methods.
type SQLDialect interface { type SQLDialect interface {
// Basic field access // Basic field access
GetTablePrefix() string GetTablePrefix() string
...@@ -27,7 +27,7 @@ type SQLDialect interface { ...@@ -27,7 +27,7 @@ type SQLDialect interface {
GetCurrentTimestamp() string GetCurrentTimestamp() string
} }
// DatabaseType represents the type of database // DatabaseType represents the type of database.
type DatabaseType string type DatabaseType string
const ( const (
...@@ -36,7 +36,7 @@ const ( ...@@ -36,7 +36,7 @@ const (
PostgreSQL DatabaseType = "postgres" PostgreSQL DatabaseType = "postgres"
) )
// GetDialect returns the appropriate dialect for the database type // GetDialect returns the appropriate dialect for the database type.
func GetDialect(dbType DatabaseType) SQLDialect { func GetDialect(dbType DatabaseType) SQLDialect {
switch dbType { switch dbType {
case SQLite: case SQLite:
...@@ -50,14 +50,14 @@ func GetDialect(dbType DatabaseType) SQLDialect { ...@@ -50,14 +50,14 @@ func GetDialect(dbType DatabaseType) SQLDialect {
} }
} }
// SQLiteDialect implements SQLDialect for SQLite // SQLiteDialect implements SQLDialect for SQLite.
type SQLiteDialect struct{} type SQLiteDialect struct{}
func (d *SQLiteDialect) GetTablePrefix() string { func (*SQLiteDialect) GetTablePrefix() string {
return "`memo`" return "`memo`"
} }
func (d *SQLiteDialect) GetParameterPlaceholder(index int) string { func (*SQLiteDialect) GetParameterPlaceholder(_ int) string {
return "?" return "?"
} }
...@@ -69,15 +69,15 @@ func (d *SQLiteDialect) GetJSONArrayLength(path string) string { ...@@ -69,15 +69,15 @@ func (d *SQLiteDialect) GetJSONArrayLength(path string) string {
return fmt.Sprintf("JSON_ARRAY_LENGTH(COALESCE(%s, JSON_ARRAY()))", d.GetJSONExtract(path)) return fmt.Sprintf("JSON_ARRAY_LENGTH(COALESCE(%s, JSON_ARRAY()))", d.GetJSONExtract(path))
} }
func (d *SQLiteDialect) GetJSONContains(path, element string) string { func (d *SQLiteDialect) GetJSONContains(path, _ string) string {
return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path)) return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path))
} }
func (d *SQLiteDialect) GetJSONLike(path, pattern string) string { func (d *SQLiteDialect) GetJSONLike(path, _ string) string {
return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path)) return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path))
} }
func (d *SQLiteDialect) GetBooleanValue(value bool) interface{} { func (*SQLiteDialect) GetBooleanValue(value bool) interface{} {
if value { if value {
return 1 return 1
} }
...@@ -96,18 +96,18 @@ func (d *SQLiteDialect) GetTimestampComparison(field string) string { ...@@ -96,18 +96,18 @@ func (d *SQLiteDialect) GetTimestampComparison(field string) string {
return fmt.Sprintf("%s.`%s`", d.GetTablePrefix(), field) return fmt.Sprintf("%s.`%s`", d.GetTablePrefix(), field)
} }
func (d *SQLiteDialect) GetCurrentTimestamp() string { func (*SQLiteDialect) GetCurrentTimestamp() string {
return "strftime('%s', 'now')" return "strftime('%s', 'now')"
} }
// MySQLDialect implements SQLDialect for MySQL // MySQLDialect implements SQLDialect for MySQL.
type MySQLDialect struct{} type MySQLDialect struct{}
func (d *MySQLDialect) GetTablePrefix() string { func (*MySQLDialect) GetTablePrefix() string {
return "`memo`" return "`memo`"
} }
func (d *MySQLDialect) GetParameterPlaceholder(index int) string { func (*MySQLDialect) GetParameterPlaceholder(_ int) string {
return "?" return "?"
} }
...@@ -119,15 +119,15 @@ func (d *MySQLDialect) GetJSONArrayLength(path string) string { ...@@ -119,15 +119,15 @@ func (d *MySQLDialect) GetJSONArrayLength(path string) string {
return fmt.Sprintf("JSON_LENGTH(COALESCE(%s, JSON_ARRAY()))", d.GetJSONExtract(path)) return fmt.Sprintf("JSON_LENGTH(COALESCE(%s, JSON_ARRAY()))", d.GetJSONExtract(path))
} }
func (d *MySQLDialect) GetJSONContains(path, element string) string { func (d *MySQLDialect) GetJSONContains(path, _ string) string {
return fmt.Sprintf("JSON_CONTAINS(%s, ?)", d.GetJSONExtract(path)) return fmt.Sprintf("JSON_CONTAINS(%s, ?)", d.GetJSONExtract(path))
} }
func (d *MySQLDialect) GetJSONLike(path, pattern string) string { func (d *MySQLDialect) GetJSONLike(path, _ string) string {
return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path)) return fmt.Sprintf("%s LIKE ?", d.GetJSONExtract(path))
} }
func (d *MySQLDialect) GetBooleanValue(value bool) interface{} { func (*MySQLDialect) GetBooleanValue(value bool) interface{} {
return value return value
} }
...@@ -147,18 +147,18 @@ func (d *MySQLDialect) GetTimestampComparison(field string) string { ...@@ -147,18 +147,18 @@ func (d *MySQLDialect) GetTimestampComparison(field string) string {
return fmt.Sprintf("UNIX_TIMESTAMP(%s.`%s`)", d.GetTablePrefix(), field) return fmt.Sprintf("UNIX_TIMESTAMP(%s.`%s`)", d.GetTablePrefix(), field)
} }
func (d *MySQLDialect) GetCurrentTimestamp() string { func (*MySQLDialect) GetCurrentTimestamp() string {
return "UNIX_TIMESTAMP()" return "UNIX_TIMESTAMP()"
} }
// PostgreSQLDialect implements SQLDialect for PostgreSQL // PostgreSQLDialect implements SQLDialect for PostgreSQL.
type PostgreSQLDialect struct{} type PostgreSQLDialect struct{}
func (d *PostgreSQLDialect) GetTablePrefix() string { func (*PostgreSQLDialect) GetTablePrefix() string {
return "memo" return "memo"
} }
func (d *PostgreSQLDialect) GetParameterPlaceholder(index int) string { func (*PostgreSQLDialect) GetParameterPlaceholder(index int) string {
return fmt.Sprintf("$%d", index) return fmt.Sprintf("$%d", index)
} }
...@@ -181,21 +181,21 @@ func (d *PostgreSQLDialect) GetJSONArrayLength(path string) string { ...@@ -181,21 +181,21 @@ func (d *PostgreSQLDialect) GetJSONArrayLength(path string) string {
return fmt.Sprintf("jsonb_array_length(COALESCE(%s.%s, '[]'::jsonb))", d.GetTablePrefix(), jsonPath) return fmt.Sprintf("jsonb_array_length(COALESCE(%s.%s, '[]'::jsonb))", d.GetTablePrefix(), jsonPath)
} }
func (d *PostgreSQLDialect) GetJSONContains(path, element string) string { func (d *PostgreSQLDialect) GetJSONContains(path, _ string) string {
jsonPath := strings.Replace(path, "$.tags", "payload->'tags'", 1) jsonPath := strings.Replace(path, "$.tags", "payload->'tags'", 1)
return fmt.Sprintf("%s.%s @> jsonb_build_array(?)", d.GetTablePrefix(), jsonPath) return fmt.Sprintf("%s.%s @> jsonb_build_array(?)", d.GetTablePrefix(), jsonPath)
} }
func (d *PostgreSQLDialect) GetJSONLike(path, pattern string) string { func (d *PostgreSQLDialect) GetJSONLike(path, _ string) string {
jsonPath := strings.Replace(path, "$.tags", "payload->'tags'", 1) jsonPath := strings.Replace(path, "$.tags", "payload->'tags'", 1)
return fmt.Sprintf("%s.%s @> jsonb_build_array(?)", d.GetTablePrefix(), jsonPath) return fmt.Sprintf("%s.%s @> jsonb_build_array(?)", d.GetTablePrefix(), jsonPath)
} }
func (d *PostgreSQLDialect) GetBooleanValue(value bool) interface{} { func (*PostgreSQLDialect) GetBooleanValue(value bool) interface{} {
return value return value
} }
func (d *PostgreSQLDialect) GetBooleanComparison(path string, value bool) string { func (d *PostgreSQLDialect) GetBooleanComparison(path string, _ bool) string {
return fmt.Sprintf("(%s)::boolean = ?", d.GetJSONExtract(path)) return fmt.Sprintf("(%s)::boolean = ?", d.GetJSONExtract(path))
} }
...@@ -207,6 +207,6 @@ func (d *PostgreSQLDialect) GetTimestampComparison(field string) string { ...@@ -207,6 +207,6 @@ func (d *PostgreSQLDialect) GetTimestampComparison(field string) string {
return fmt.Sprintf("EXTRACT(EPOCH FROM %s.%s)", d.GetTablePrefix(), field) return fmt.Sprintf("EXTRACT(EPOCH FROM %s.%s)", d.GetTablePrefix(), field)
} }
func (d *PostgreSQLDialect) GetCurrentTimestamp() string { func (*PostgreSQLDialect) GetCurrentTimestamp() string {
return "EXTRACT(EPOCH FROM NOW())" return "EXTRACT(EPOCH FROM NOW())"
} }
...@@ -4,14 +4,14 @@ import ( ...@@ -4,14 +4,14 @@ import (
"fmt" "fmt"
) )
// SQLTemplate holds database-specific SQL fragments // SQLTemplate holds database-specific SQL fragments.
type SQLTemplate struct { type SQLTemplate struct {
SQLite string SQLite string
MySQL string MySQL string
PostgreSQL string PostgreSQL string
} }
// TemplateDBType represents the database type for templates // TemplateDBType represents the database type for templates.
type TemplateDBType string type TemplateDBType string
const ( const (
...@@ -20,7 +20,7 @@ const ( ...@@ -20,7 +20,7 @@ const (
PostgreSQLTemplate TemplateDBType = "postgres" PostgreSQLTemplate TemplateDBType = "postgres"
) )
// SQLTemplates contains common SQL patterns for different databases // SQLTemplates contains common SQL patterns for different databases.
var SQLTemplates = map[string]SQLTemplate{ var SQLTemplates = map[string]SQLTemplate{
"json_extract": { "json_extract": {
SQLite: "JSON_EXTRACT(`memo`.`payload`, '%s')", SQLite: "JSON_EXTRACT(`memo`.`payload`, '%s')",
...@@ -94,7 +94,7 @@ var SQLTemplates = map[string]SQLTemplate{ ...@@ -94,7 +94,7 @@ var SQLTemplates = map[string]SQLTemplate{
}, },
} }
// GetSQL returns the appropriate SQL for the given template and database type // GetSQL returns the appropriate SQL for the given template and database type.
func GetSQL(templateName string, dbType TemplateDBType) string { func GetSQL(templateName string, dbType TemplateDBType) string {
template, exists := SQLTemplates[templateName] template, exists := SQLTemplates[templateName]
if !exists { if !exists {
...@@ -113,7 +113,7 @@ func GetSQL(templateName string, dbType TemplateDBType) string { ...@@ -113,7 +113,7 @@ func GetSQL(templateName string, dbType TemplateDBType) string {
} }
} }
// GetParameterPlaceholder returns the appropriate parameter placeholder for the database // GetParameterPlaceholder returns the appropriate parameter placeholder for the database.
func GetParameterPlaceholder(dbType TemplateDBType, index int) string { func GetParameterPlaceholder(dbType TemplateDBType, index int) string {
switch dbType { switch dbType {
case PostgreSQLTemplate: case PostgreSQLTemplate:
...@@ -123,7 +123,7 @@ func GetParameterPlaceholder(dbType TemplateDBType, index int) string { ...@@ -123,7 +123,7 @@ func GetParameterPlaceholder(dbType TemplateDBType, index int) string {
} }
} }
// GetParameterValue returns the appropriate parameter value for the database // GetParameterValue returns the appropriate parameter value for the database.
func GetParameterValue(dbType TemplateDBType, templateName string, value interface{}) interface{} { func GetParameterValue(dbType TemplateDBType, templateName string, value interface{}) interface{} {
switch templateName { switch templateName {
case "json_contains_element", "json_contains_tag": case "json_contains_element", "json_contains_tag":
...@@ -136,7 +136,7 @@ func GetParameterValue(dbType TemplateDBType, templateName string, value interfa ...@@ -136,7 +136,7 @@ func GetParameterValue(dbType TemplateDBType, templateName string, value interfa
} }
} }
// FormatPlaceholders formats a list of placeholders for the given database type // FormatPlaceholders formats a list of placeholders for the given database type.
func FormatPlaceholders(dbType TemplateDBType, count int, startIndex int) []string { func FormatPlaceholders(dbType TemplateDBType, count int, startIndex int) []string {
placeholders := make([]string, count) placeholders := make([]string, count)
for i := 0; i < count; i++ { for i := 0; i < count; i++ {
......
...@@ -39,22 +39,8 @@ message GetCurrentSessionResponse { ...@@ -39,22 +39,8 @@ message GetCurrentSessionResponse {
} }
message CreateSessionRequest { message CreateSessionRequest {
// Provide one authentication method (username/password or SSO). // Nested message for password-based authentication credentials.
// Required field to specify the authentication method. message PasswordCredentials {
oneof method {
// Username and password authentication method.
PasswordCredentials password_credentials = 1;
// SSO provider authentication method.
SSOCredentials sso_credentials = 2;
}
// Whether the session should never expire.
// Optional field that defaults to false for security.
bool never_expire = 3 [(google.api.field_behavior) = OPTIONAL];
}
message PasswordCredentials {
// The username to sign in with. // The username to sign in with.
// Required field for password-based authentication. // Required field for password-based authentication.
string username = 1 [(google.api.field_behavior) = REQUIRED]; string username = 1 [(google.api.field_behavior) = REQUIRED];
...@@ -62,9 +48,10 @@ message PasswordCredentials { ...@@ -62,9 +48,10 @@ message PasswordCredentials {
// The password to sign in with. // The password to sign in with.
// Required field for password-based authentication. // Required field for password-based authentication.
string password = 2 [(google.api.field_behavior) = REQUIRED]; string password = 2 [(google.api.field_behavior) = REQUIRED];
} }
message SSOCredentials { // Nested message for SSO authentication credentials.
message SSOCredentials {
// The ID of the SSO provider. // The ID of the SSO provider.
// Required field to identify the SSO provider. // Required field to identify the SSO provider.
int32 idp_id = 1 [(google.api.field_behavior) = REQUIRED]; int32 idp_id = 1 [(google.api.field_behavior) = REQUIRED];
...@@ -76,6 +63,21 @@ message SSOCredentials { ...@@ -76,6 +63,21 @@ message SSOCredentials {
// The redirect URI used in the SSO flow. // The redirect URI used in the SSO flow.
// Required field for security validation. // Required field for security validation.
string redirect_uri = 3 [(google.api.field_behavior) = REQUIRED]; string redirect_uri = 3 [(google.api.field_behavior) = REQUIRED];
}
// Provide one authentication method (username/password or SSO).
// Required field to specify the authentication method.
oneof method {
// Username and password authentication method.
PasswordCredentials password_credentials = 1;
// SSO provider authentication method.
SSOCredentials sso_credentials = 2;
}
// Whether the session should never expire.
// Optional field that defaults to false for security.
bool never_expire = 3 [(google.api.field_behavior) = OPTIONAL];
} }
message DeleteSessionRequest {} message DeleteSessionRequest {}
...@@ -103,20 +103,11 @@ message OAuth2Config { ...@@ -103,20 +103,11 @@ message OAuth2Config {
FieldMapping field_mapping = 7; FieldMapping field_mapping = 7;
} }
message ListIdentityProvidersRequest { message ListIdentityProvidersRequest {}
// Optional. The maximum number of identity providers to return.
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token for pagination.
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
}
message ListIdentityProvidersResponse { message ListIdentityProvidersResponse {
// The list of identity providers. // The list of identity providers.
repeated IdentityProvider identity_providers = 1; repeated IdentityProvider identity_providers = 1;
// A token for the next page of results.
string next_page_token = 2;
} }
message GetIdentityProviderRequest { message GetIdentityProviderRequest {
......
...@@ -75,23 +75,11 @@ message ListShortcutsRequest { ...@@ -75,23 +75,11 @@ message ListShortcutsRequest {
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"} (google.api.resource_reference) = {child_type: "memos.api.v1/Shortcut"}
]; ];
// Optional. The maximum number of shortcuts to return.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token for pagination.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
} }
message ListShortcutsResponse { message ListShortcutsResponse {
// The list of shortcuts. // The list of shortcuts.
repeated Shortcut shortcuts = 1; repeated Shortcut shortcuts = 1;
// A token for the next page of results.
string next_page_token = 2;
// The total count of shortcuts.
int32 total_size = 3;
} }
message GetShortcutRequest { message GetShortcutRequest {
......
...@@ -84,41 +84,11 @@ message Webhook { ...@@ -84,41 +84,11 @@ message Webhook {
google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
} }
message ListWebhooksRequest { message ListWebhooksRequest {}
// Optional. The maximum number of webhooks to return.
// The service may return fewer than this value.
// If unspecified, at most 50 webhooks will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token, received from a previous `ListWebhooks` call.
// Provide this to retrieve the subsequent page.
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. Filter to apply to the list results.
// Example: "state=ACTIVE" or "creator=users/123"
// Supported operators: =, !=, <, <=, >, >=, :
// Supported fields: display_name, url, creator, state, create_time, update_time
string filter = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The order to sort results by.
// Example: "create_time desc" or "display_name asc"
string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. If true, show deleted webhooks in the response.
bool show_deleted = 5 [(google.api.field_behavior) = OPTIONAL];
}
message ListWebhooksResponse { message ListWebhooksResponse {
// The list of webhooks. // The list of webhooks.
repeated Webhook webhooks = 1; repeated Webhook webhooks = 1;
// A token that can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
// The total count of webhooks (may be approximate).
int32 total_size = 3;
} }
message GetWebhookRequest { message GetWebhookRequest {
...@@ -128,10 +98,6 @@ message GetWebhookRequest { ...@@ -128,10 +98,6 @@ message GetWebhookRequest {
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "memos.api.v1/Webhook"} (google.api.resource_reference) = {type: "memos.api.v1/Webhook"}
]; ];
// Optional. The fields to return in the response.
// If not specified, all fields are returned.
google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL];
} }
message CreateWebhookRequest { message CreateWebhookRequest {
...@@ -148,10 +114,6 @@ message CreateWebhookRequest { ...@@ -148,10 +114,6 @@ message CreateWebhookRequest {
// Optional. If set, validate the request but don't actually create the webhook. // Optional. If set, validate the request but don't actually create the webhook.
bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. An idempotency token that can be used to ensure that multiple
// requests to create a webhook have the same result.
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
} }
message UpdateWebhookRequest { message UpdateWebhookRequest {
...@@ -160,9 +122,6 @@ message UpdateWebhookRequest { ...@@ -160,9 +122,6 @@ message UpdateWebhookRequest {
// Required. The list of fields to update. // Required. The list of fields to update.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. If set to true, allows updating sensitive fields.
bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL];
} }
message DeleteWebhookRequest { message DeleteWebhookRequest {
...@@ -172,9 +131,6 @@ message DeleteWebhookRequest { ...@@ -172,9 +131,6 @@ message DeleteWebhookRequest {
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "memos.api.v1/Webhook"} (google.api.resource_reference) = {type: "memos.api.v1/Webhook"}
]; ];
// Optional. If set to true, the webhook will be deleted even if it has associated data.
bool force = 2 [(google.api.field_behavior) = OPTIONAL];
} }
message WebhookRequestPayload { message WebhookRequestPayload {
......
This diff is collapsed.
...@@ -381,10 +381,6 @@ func (x *OAuth2Config) GetFieldMapping() *FieldMapping { ...@@ -381,10 +381,6 @@ func (x *OAuth2Config) GetFieldMapping() *FieldMapping {
type ListIdentityProvidersRequest struct { type ListIdentityProvidersRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// Optional. The maximum number of identity providers to return.
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. A page token for pagination.
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -419,26 +415,10 @@ func (*ListIdentityProvidersRequest) Descriptor() ([]byte, []int) { ...@@ -419,26 +415,10 @@ func (*ListIdentityProvidersRequest) Descriptor() ([]byte, []int) {
return file_api_v1_idp_service_proto_rawDescGZIP(), []int{4} return file_api_v1_idp_service_proto_rawDescGZIP(), []int{4}
} }
func (x *ListIdentityProvidersRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListIdentityProvidersRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
type ListIdentityProvidersResponse struct { type ListIdentityProvidersResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// The list of identity providers. // The list of identity providers.
IdentityProviders []*IdentityProvider `protobuf:"bytes,1,rep,name=identity_providers,json=identityProviders,proto3" json:"identity_providers,omitempty"` IdentityProviders []*IdentityProvider `protobuf:"bytes,1,rep,name=identity_providers,json=identityProviders,proto3" json:"identity_providers,omitempty"`
// A token for the next page of results.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -480,13 +460,6 @@ func (x *ListIdentityProvidersResponse) GetIdentityProviders() []*IdentityProvid ...@@ -480,13 +460,6 @@ func (x *ListIdentityProvidersResponse) GetIdentityProviders() []*IdentityProvid
return nil return nil
} }
func (x *ListIdentityProvidersResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
type GetIdentityProviderRequest struct { type GetIdentityProviderRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// Required. The resource name of the identity provider to get. // Required. The resource name of the identity provider to get.
...@@ -723,14 +696,10 @@ const file_api_v1_idp_service_proto_rawDesc = "" + ...@@ -723,14 +696,10 @@ const file_api_v1_idp_service_proto_rawDesc = "" +
"\ttoken_url\x18\x04 \x01(\tR\btokenUrl\x12\"\n" + "\ttoken_url\x18\x04 \x01(\tR\btokenUrl\x12\"\n" +
"\ruser_info_url\x18\x05 \x01(\tR\vuserInfoUrl\x12\x16\n" + "\ruser_info_url\x18\x05 \x01(\tR\vuserInfoUrl\x12\x16\n" +
"\x06scopes\x18\x06 \x03(\tR\x06scopes\x12?\n" + "\x06scopes\x18\x06 \x03(\tR\x06scopes\x12?\n" +
"\rfield_mapping\x18\a \x01(\v2\x1a.memos.api.v1.FieldMappingR\ffieldMapping\"d\n" + "\rfield_mapping\x18\a \x01(\v2\x1a.memos.api.v1.FieldMappingR\ffieldMapping\"\x1e\n" +
"\x1cListIdentityProvidersRequest\x12 \n" + "\x1cListIdentityProvidersRequest\"n\n" +
"\tpage_size\x18\x01 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" +
"\n" +
"page_token\x18\x02 \x01(\tB\x03\xe0A\x01R\tpageToken\"\x96\x01\n" +
"\x1dListIdentityProvidersResponse\x12M\n" + "\x1dListIdentityProvidersResponse\x12M\n" +
"\x12identity_providers\x18\x01 \x03(\v2\x1e.memos.api.v1.IdentityProviderR\x11identityProviders\x12&\n" + "\x12identity_providers\x18\x01 \x03(\v2\x1e.memos.api.v1.IdentityProviderR\x11identityProviders\"W\n" +
"\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"W\n" +
"\x1aGetIdentityProviderRequest\x129\n" + "\x1aGetIdentityProviderRequest\x129\n" +
"\x04name\x18\x01 \x01(\tB%\xe0A\x02\xfaA\x1f\n" + "\x04name\x18\x01 \x01(\tB%\xe0A\x02\xfaA\x1f\n" +
"\x1dmemos.api.v1/IdentityProviderR\x04name\"\xa8\x01\n" + "\x1dmemos.api.v1/IdentityProviderR\x04name\"\xa8\x01\n" +
......
...@@ -35,8 +35,6 @@ var ( ...@@ -35,8 +35,6 @@ var (
_ = metadata.Join _ = metadata.Join
) )
var filter_IdentityProviderService_ListIdentityProviders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq ListIdentityProvidersRequest protoReq ListIdentityProvidersRequest
...@@ -45,12 +43,6 @@ func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context ...@@ -45,12 +43,6 @@ func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context
if req.Body != nil { if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body) _, _ = io.Copy(io.Discard, req.Body)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_ListIdentityProviders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListIdentityProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListIdentityProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -60,12 +52,6 @@ func local_request_IdentityProviderService_ListIdentityProviders_0(ctx context.C ...@@ -60,12 +52,6 @@ func local_request_IdentityProviderService_ListIdentityProviders_0(ctx context.C
protoReq ListIdentityProvidersRequest protoReq ListIdentityProvidersRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_ListIdentityProviders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListIdentityProviders(ctx, &protoReq) msg, err := server.ListIdentityProviders(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
......
...@@ -93,10 +93,6 @@ type ListShortcutsRequest struct { ...@@ -93,10 +93,6 @@ type ListShortcutsRequest struct {
// Required. The parent resource where shortcuts are listed. // Required. The parent resource where shortcuts are listed.
// Format: users/{user} // Format: users/{user}
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The maximum number of shortcuts to return.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. A page token for pagination.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -138,28 +134,10 @@ func (x *ListShortcutsRequest) GetParent() string { ...@@ -138,28 +134,10 @@ func (x *ListShortcutsRequest) GetParent() string {
return "" return ""
} }
func (x *ListShortcutsRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListShortcutsRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
type ListShortcutsResponse struct { type ListShortcutsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// The list of shortcuts. // The list of shortcuts.
Shortcuts []*Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"` Shortcuts []*Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"`
// A token for the next page of results.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// The total count of shortcuts.
TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -201,20 +179,6 @@ func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut { ...@@ -201,20 +179,6 @@ func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut {
return nil return nil
} }
func (x *ListShortcutsResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
func (x *ListShortcutsResponse) GetTotalSize() int32 {
if x != nil {
return x.TotalSize
}
return 0
}
type GetShortcutRequest struct { type GetShortcutRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
// Required. The resource name of the shortcut to retrieve. // Required. The resource name of the shortcut to retrieve.
...@@ -434,17 +398,11 @@ const file_api_v1_shortcut_service_proto_rawDesc = "" + ...@@ -434,17 +398,11 @@ const file_api_v1_shortcut_service_proto_rawDesc = "" +
"\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x19\n" + "\x04name\x18\x01 \x01(\tB\x03\xe0A\bR\x04name\x12\x19\n" +
"\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" + "\x05title\x18\x02 \x01(\tB\x03\xe0A\x02R\x05title\x12\x1b\n" +
"\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter:R\xeaAO\n" + "\x06filter\x18\x03 \x01(\tB\x03\xe0A\x01R\x06filter:R\xeaAO\n" +
"\x15memos.api.v1/Shortcut\x12!users/{user}/shortcuts/{shortcut}*\tshortcuts2\bshortcut\"\x93\x01\n" + "\x15memos.api.v1/Shortcut\x12!users/{user}/shortcuts/{shortcut}*\tshortcuts2\bshortcut\"M\n" +
"\x14ListShortcutsRequest\x125\n" + "\x14ListShortcutsRequest\x125\n" +
"\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\x12 \n" + "\x06parent\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\x12\x15memos.api.v1/ShortcutR\x06parent\"M\n" +
"\tpage_size\x18\x02 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" +
"\n" +
"page_token\x18\x03 \x01(\tB\x03\xe0A\x01R\tpageToken\"\x94\x01\n" +
"\x15ListShortcutsResponse\x124\n" + "\x15ListShortcutsResponse\x124\n" +
"\tshortcuts\x18\x01 \x03(\v2\x16.memos.api.v1.ShortcutR\tshortcuts\x12&\n" + "\tshortcuts\x18\x01 \x03(\v2\x16.memos.api.v1.ShortcutR\tshortcuts\"G\n" +
"\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12\x1d\n" +
"\n" +
"total_size\x18\x03 \x01(\x05R\ttotalSize\"G\n" +
"\x12GetShortcutRequest\x121\n" + "\x12GetShortcutRequest\x121\n" +
"\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" + "\x04name\x18\x01 \x01(\tB\x1d\xe0A\x02\xfaA\x17\n" +
"\x15memos.api.v1/ShortcutR\x04name\"\xb1\x01\n" + "\x15memos.api.v1/ShortcutR\x04name\"\xb1\x01\n" +
......
...@@ -35,8 +35,6 @@ var ( ...@@ -35,8 +35,6 @@ var (
_ = metadata.Join _ = metadata.Join
) )
var filter_ShortcutService_ListShortcuts_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq ListShortcutsRequest protoReq ListShortcutsRequest
...@@ -54,12 +52,6 @@ func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runt ...@@ -54,12 +52,6 @@ func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runt
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_ListShortcuts_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -78,12 +70,6 @@ func local_request_ShortcutService_ListShortcuts_0(ctx context.Context, marshale ...@@ -78,12 +70,6 @@ func local_request_ShortcutService_ListShortcuts_0(ctx context.Context, marshale
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ShortcutService_ListShortcuts_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListShortcuts(ctx, &protoReq) msg, err := server.ListShortcuts(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
......
This diff is collapsed.
...@@ -35,8 +35,6 @@ var ( ...@@ -35,8 +35,6 @@ var (
_ = metadata.Join _ = metadata.Join
) )
var filter_WebhookService_ListWebhooks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
func request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq ListWebhooksRequest protoReq ListWebhooksRequest
...@@ -45,12 +43,6 @@ func request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler runtim ...@@ -45,12 +43,6 @@ func request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler runtim
if req.Body != nil { if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body) _, _ = io.Copy(io.Discard, req.Body)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_ListWebhooks_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListWebhooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListWebhooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -60,18 +52,10 @@ func local_request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler ...@@ -60,18 +52,10 @@ func local_request_WebhookService_ListWebhooks_0(ctx context.Context, marshaler
protoReq ListWebhooksRequest protoReq ListWebhooksRequest
metadata runtime.ServerMetadata metadata runtime.ServerMetadata
) )
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_ListWebhooks_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListWebhooks(ctx, &protoReq) msg, err := server.ListWebhooks(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
var filter_WebhookService_GetWebhook_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_WebhookService_GetWebhook_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_WebhookService_GetWebhook_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq GetWebhookRequest protoReq GetWebhookRequest
...@@ -89,12 +73,6 @@ func request_WebhookService_GetWebhook_0(ctx context.Context, marshaler runtime. ...@@ -89,12 +73,6 @@ func request_WebhookService_GetWebhook_0(ctx context.Context, marshaler runtime.
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_GetWebhook_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.GetWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -113,12 +91,6 @@ func local_request_WebhookService_GetWebhook_0(ctx context.Context, marshaler ru ...@@ -113,12 +91,6 @@ func local_request_WebhookService_GetWebhook_0(ctx context.Context, marshaler ru
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_GetWebhook_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetWebhook(ctx, &protoReq) msg, err := server.GetWebhook(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
...@@ -245,8 +217,6 @@ func local_request_WebhookService_UpdateWebhook_0(ctx context.Context, marshaler ...@@ -245,8 +217,6 @@ func local_request_WebhookService_UpdateWebhook_0(ctx context.Context, marshaler
return msg, metadata, err return msg, metadata, err
} }
var filter_WebhookService_DeleteWebhook_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler runtime.Marshaler, client WebhookServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var ( var (
protoReq DeleteWebhookRequest protoReq DeleteWebhookRequest
...@@ -264,12 +234,6 @@ func request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler runti ...@@ -264,12 +234,6 @@ func request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler runti
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_DeleteWebhook_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DeleteWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.DeleteWebhook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
...@@ -288,12 +252,6 @@ func local_request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler ...@@ -288,12 +252,6 @@ func local_request_WebhookService_DeleteWebhook_0(ctx context.Context, marshaler
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
} }
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WebhookService_DeleteWebhook_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DeleteWebhook(ctx, &protoReq) msg, err := server.DeleteWebhook(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
......
...@@ -201,18 +201,6 @@ paths: ...@@ -201,18 +201,6 @@ paths:
description: An unexpected error response. description: An unexpected error response.
schema: schema:
$ref: '#/definitions/googlerpcStatus' $ref: '#/definitions/googlerpcStatus'
parameters:
- name: pageSize
description: Optional. The maximum number of identity providers to return.
in: query
required: false
type: integer
format: int32
- name: pageToken
description: Optional. A page token for pagination.
in: query
required: false
type: string
tags: tags:
- IdentityProviderService - IdentityProviderService
post: post:
...@@ -627,45 +615,6 @@ paths: ...@@ -627,45 +615,6 @@ paths:
description: An unexpected error response. description: An unexpected error response.
schema: schema:
$ref: '#/definitions/googlerpcStatus' $ref: '#/definitions/googlerpcStatus'
parameters:
- name: pageSize
description: |-
Optional. The maximum number of webhooks to return.
The service may return fewer than this value.
If unspecified, at most 50 webhooks will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
in: query
required: false
type: integer
format: int32
- name: pageToken
description: |-
Optional. A page token, received from a previous `ListWebhooks` call.
Provide this to retrieve the subsequent page.
in: query
required: false
type: string
- name: filter
description: |-
Optional. Filter to apply to the list results.
Example: "state=ACTIVE" or "creator=users/123"
Supported operators: =, !=, <, <=, >, >=, :
Supported fields: display_name, url, creator, state, create_time, update_time
in: query
required: false
type: string
- name: orderBy
description: |-
Optional. The order to sort results by.
Example: "create_time desc" or "display_name asc"
in: query
required: false
type: string
- name: showDeleted
description: Optional. If true, show deleted webhooks in the response.
in: query
required: false
type: boolean
tags: tags:
- WebhookService - WebhookService
post: post:
...@@ -702,13 +651,6 @@ paths: ...@@ -702,13 +651,6 @@ paths:
in: query in: query
required: false required: false
type: boolean type: boolean
- name: requestId
description: |-
Optional. An idempotency token that can be used to ensure that multiple
requests to create a webhook have the same result.
in: query
required: false
type: string
tags: tags:
- WebhookService - WebhookService
/api/v1/workspace/profile: /api/v1/workspace/profile:
...@@ -1314,13 +1256,6 @@ paths: ...@@ -1314,13 +1256,6 @@ paths:
required: true required: true
type: string type: string
pattern: webhooks/[^/]+ pattern: webhooks/[^/]+
- name: readMask
description: |-
Optional. The fields to return in the response.
If not specified, all fields are returned.
in: query
required: false
type: string
tags: tags:
- WebhookService - WebhookService
delete: delete:
...@@ -1448,11 +1383,6 @@ paths: ...@@ -1448,11 +1383,6 @@ paths:
required: true required: true
type: string type: string
pattern: webhooks/[^/]+ pattern: webhooks/[^/]+
- name: force
description: Optional. If set to true, the webhook will be deleted even if it has associated data.
in: query
required: false
type: boolean
tags: tags:
- WebhookService - WebhookService
/api/v1/{name}: /api/v1/{name}:
...@@ -2098,17 +2028,6 @@ paths: ...@@ -2098,17 +2028,6 @@ paths:
required: true required: true
type: string type: string
pattern: users/[^/]+ pattern: users/[^/]+
- name: pageSize
description: Optional. The maximum number of shortcuts to return.
in: query
required: false
type: integer
format: int32
- name: pageToken
description: Optional. A page token for pagination.
in: query
required: false
type: string
tags: tags:
- ShortcutService - ShortcutService
post: post:
...@@ -2472,11 +2391,6 @@ paths: ...@@ -2472,11 +2391,6 @@ paths:
- url - url
- state - state
- webhook - webhook
- name: allowMissing
description: Optional. If set to true, allows updating sensitive fields.
in: query
required: false
type: boolean
tags: tags:
- WebhookService - WebhookService
/file/{name}/{filename}: /file/{name}/{filename}:
...@@ -2529,6 +2443,47 @@ definitions: ...@@ -2529,6 +2443,47 @@ definitions:
- INFO: Info level. - INFO: Info level.
- WARN: Warn level. - WARN: Warn level.
- ERROR: Error level. - ERROR: Error level.
CreateSessionRequestPasswordCredentials:
type: object
properties:
username:
type: string
description: |-
The username to sign in with.
Required field for password-based authentication.
password:
type: string
description: |-
The password to sign in with.
Required field for password-based authentication.
description: Nested message for password-based authentication credentials.
required:
- username
- password
CreateSessionRequestSSOCredentials:
type: object
properties:
idpId:
type: integer
format: int32
description: |-
The ID of the SSO provider.
Required field to identify the SSO provider.
code:
type: string
description: |-
The authorization code from the SSO provider.
Required field for completing the SSO flow.
redirectUri:
type: string
description: |-
The redirect URI used in the SSO flow.
Required field for security validation.
description: Nested message for SSO authentication credentials.
required:
- idpId
- code
- redirectUri
ListNodeKind: ListNodeKind:
type: string type: string
enum: enum:
...@@ -3316,10 +3271,10 @@ definitions: ...@@ -3316,10 +3271,10 @@ definitions:
type: object type: object
properties: properties:
passwordCredentials: passwordCredentials:
$ref: '#/definitions/v1PasswordCredentials' $ref: '#/definitions/CreateSessionRequestPasswordCredentials'
description: Username and password authentication method. description: Username and password authentication method.
ssoCredentials: ssoCredentials:
$ref: '#/definitions/v1SSOCredentials' $ref: '#/definitions/CreateSessionRequestSSOCredentials'
description: SSO provider authentication method. description: SSO provider authentication method.
neverExpire: neverExpire:
type: boolean type: boolean
...@@ -3531,9 +3486,6 @@ definitions: ...@@ -3531,9 +3486,6 @@ definitions:
type: object type: object
$ref: '#/definitions/apiv1IdentityProvider' $ref: '#/definitions/apiv1IdentityProvider'
description: The list of identity providers. description: The list of identity providers.
nextPageToken:
type: string
description: A token for the next page of results.
v1ListInboxesResponse: v1ListInboxesResponse:
type: object type: object
properties: properties:
...@@ -3656,13 +3608,6 @@ definitions: ...@@ -3656,13 +3608,6 @@ definitions:
type: object type: object
$ref: '#/definitions/apiv1Shortcut' $ref: '#/definitions/apiv1Shortcut'
description: The list of shortcuts. description: The list of shortcuts.
nextPageToken:
type: string
description: A token for the next page of results.
totalSize:
type: integer
format: int32
description: The total count of shortcuts.
v1ListUserAccessTokensResponse: v1ListUserAccessTokensResponse:
type: object type: object
properties: properties:
...@@ -3715,15 +3660,6 @@ definitions: ...@@ -3715,15 +3660,6 @@ definitions:
type: object type: object
$ref: '#/definitions/v1Webhook' $ref: '#/definitions/v1Webhook'
description: The list of webhooks. description: The list of webhooks.
nextPageToken:
type: string
description: |-
A token that can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
totalSize:
type: integer
format: int32
description: The total count of webhooks (may be approximate).
v1MathBlockNode: v1MathBlockNode:
type: object type: object
properties: properties:
...@@ -3930,22 +3866,6 @@ definitions: ...@@ -3930,22 +3866,6 @@ definitions:
type: object type: object
$ref: '#/definitions/v1Node' $ref: '#/definitions/v1Node'
description: The parsed markdown nodes. description: The parsed markdown nodes.
v1PasswordCredentials:
type: object
properties:
username:
type: string
description: |-
The username to sign in with.
Required field for password-based authentication.
password:
type: string
description: |-
The password to sign in with.
Required field for password-based authentication.
required:
- username
- password
v1Reaction: v1Reaction:
type: object type: object
properties: properties:
...@@ -4004,29 +3924,6 @@ definitions: ...@@ -4004,29 +3924,6 @@ definitions:
markdown: markdown:
type: string type: string
description: The restored markdown content. description: The restored markdown content.
v1SSOCredentials:
type: object
properties:
idpId:
type: integer
format: int32
description: |-
The ID of the SSO provider.
Required field to identify the SSO provider.
code:
type: string
description: |-
The authorization code from the SSO provider.
Required field for completing the SSO flow.
redirectUri:
type: string
description: |-
The redirect URI used in the SSO flow.
Required field for security validation.
required:
- idpId
- code
- redirectUri
v1SearchUsersResponse: v1SearchUsersResponse:
type: object type: object
properties: properties:
......
...@@ -79,7 +79,6 @@ func (s *APIV1Service) ListWebhooks(ctx context.Context, _ *v1pb.ListWebhooksReq ...@@ -79,7 +79,6 @@ func (s *APIV1Service) ListWebhooks(ctx context.Context, _ *v1pb.ListWebhooksReq
response := &v1pb.ListWebhooksResponse{ response := &v1pb.ListWebhooksResponse{
Webhooks: []*v1pb.Webhook{}, Webhooks: []*v1pb.Webhook{},
TotalSize: int32(len(webhooks)),
} }
for _, webhook := range webhooks { for _, webhook := range webhooks {
response.Webhooks = append(response.Webhooks, convertWebhookFromStore(webhook)) response.Webhooks = append(response.Webhooks, convertWebhookFromStore(webhook))
...@@ -146,10 +145,6 @@ func (s *APIV1Service) UpdateWebhook(ctx context.Context, request *v1pb.UpdateWe ...@@ -146,10 +145,6 @@ func (s *APIV1Service) UpdateWebhook(ctx context.Context, request *v1pb.UpdateWe
return nil, status.Errorf(codes.Internal, "failed to get webhook: %v", err) return nil, status.Errorf(codes.Internal, "failed to get webhook: %v", err)
} }
if existingWebhook == nil { if existingWebhook == nil {
if request.AllowMissing {
// Could create webhook if missing, but for now return not found
return nil, status.Errorf(codes.NotFound, "webhook not found")
}
return nil, status.Errorf(codes.NotFound, "webhook not found") return nil, status.Errorf(codes.NotFound, "webhook not found")
} }
......
...@@ -284,7 +284,7 @@ func (d *DB) convertWithTemplates(ctx *filter.ConvertContext, expr *exprv1.Expr) ...@@ -284,7 +284,7 @@ func (d *DB) convertWithTemplates(ctx *filter.ConvertContext, expr *exprv1.Expr)
return nil return nil
} }
func (d *DB) getComparisonOperator(function string) string { func (*DB) getComparisonOperator(function string) string {
switch function { switch function {
case "_==_": case "_==_":
return "=" return "="
......
...@@ -18,7 +18,6 @@ func (d *DB) ConvertExprToSQL(ctx *filter.ConvertContext, expr *exprv1.Expr) err ...@@ -18,7 +18,6 @@ func (d *DB) ConvertExprToSQL(ctx *filter.ConvertContext, expr *exprv1.Expr) err
} }
func (d *DB) convertWithParameterIndex(ctx *filter.ConvertContext, expr *exprv1.Expr, dbType filter.TemplateDBType, paramIndex int) (int, error) { func (d *DB) convertWithParameterIndex(ctx *filter.ConvertContext, expr *exprv1.Expr, dbType filter.TemplateDBType, paramIndex int) (int, error) {
if v, ok := expr.ExprKind.(*exprv1.Expr_CallExpr); ok { if v, ok := expr.ExprKind.(*exprv1.Expr_CallExpr); ok {
switch v.CallExpr.Function { switch v.CallExpr.Function {
case "_||_", "_&&_": case "_||_", "_&&_":
...@@ -306,7 +305,7 @@ func (d *DB) convertWithParameterIndex(ctx *filter.ConvertContext, expr *exprv1. ...@@ -306,7 +305,7 @@ func (d *DB) convertWithParameterIndex(ctx *filter.ConvertContext, expr *exprv1.
return paramIndex, nil return paramIndex, nil
} }
func (d *DB) getComparisonOperator(function string) string { func (*DB) getComparisonOperator(function string) string {
switch function { switch function {
case "_==_": case "_==_":
return "=" return "="
......
...@@ -284,7 +284,7 @@ func (d *DB) convertWithTemplates(ctx *filter.ConvertContext, expr *exprv1.Expr) ...@@ -284,7 +284,7 @@ func (d *DB) convertWithTemplates(ctx *filter.ConvertContext, expr *exprv1.Expr)
return nil return nil
} }
func (d *DB) getComparisonOperator(function string) string { func (*DB) getComparisonOperator(function string) string {
switch function { switch function {
case "_==_": case "_==_":
return "=" return "="
......
...@@ -21,11 +21,11 @@ export interface GetCurrentSessionResponse { ...@@ -21,11 +21,11 @@ export interface GetCurrentSessionResponse {
export interface CreateSessionRequest { export interface CreateSessionRequest {
/** Username and password authentication method. */ /** Username and password authentication method. */
passwordCredentials?: passwordCredentials?:
| PasswordCredentials | CreateSessionRequest_PasswordCredentials
| undefined; | undefined;
/** SSO provider authentication method. */ /** SSO provider authentication method. */
ssoCredentials?: ssoCredentials?:
| SSOCredentials | CreateSessionRequest_SSOCredentials
| undefined; | undefined;
/** /**
* Whether the session should never expire. * Whether the session should never expire.
...@@ -34,7 +34,8 @@ export interface CreateSessionRequest { ...@@ -34,7 +34,8 @@ export interface CreateSessionRequest {
neverExpire: boolean; neverExpire: boolean;
} }
export interface PasswordCredentials { /** Nested message for password-based authentication credentials. */
export interface CreateSessionRequest_PasswordCredentials {
/** /**
* The username to sign in with. * The username to sign in with.
* Required field for password-based authentication. * Required field for password-based authentication.
...@@ -47,7 +48,8 @@ export interface PasswordCredentials { ...@@ -47,7 +48,8 @@ export interface PasswordCredentials {
password: string; password: string;
} }
export interface SSOCredentials { /** Nested message for SSO authentication credentials. */
export interface CreateSessionRequest_SSOCredentials {
/** /**
* The ID of the SSO provider. * The ID of the SSO provider.
* Required field to identify the SSO provider. * Required field to identify the SSO provider.
...@@ -155,10 +157,10 @@ function createBaseCreateSessionRequest(): CreateSessionRequest { ...@@ -155,10 +157,10 @@ function createBaseCreateSessionRequest(): CreateSessionRequest {
export const CreateSessionRequest: MessageFns<CreateSessionRequest> = { export const CreateSessionRequest: MessageFns<CreateSessionRequest> = {
encode(message: CreateSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: CreateSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.passwordCredentials !== undefined) { if (message.passwordCredentials !== undefined) {
PasswordCredentials.encode(message.passwordCredentials, writer.uint32(10).fork()).join(); CreateSessionRequest_PasswordCredentials.encode(message.passwordCredentials, writer.uint32(10).fork()).join();
} }
if (message.ssoCredentials !== undefined) { if (message.ssoCredentials !== undefined) {
SSOCredentials.encode(message.ssoCredentials, writer.uint32(18).fork()).join(); CreateSessionRequest_SSOCredentials.encode(message.ssoCredentials, writer.uint32(18).fork()).join();
} }
if (message.neverExpire !== false) { if (message.neverExpire !== false) {
writer.uint32(24).bool(message.neverExpire); writer.uint32(24).bool(message.neverExpire);
...@@ -178,7 +180,7 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = { ...@@ -178,7 +180,7 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = {
break; break;
} }
message.passwordCredentials = PasswordCredentials.decode(reader, reader.uint32()); message.passwordCredentials = CreateSessionRequest_PasswordCredentials.decode(reader, reader.uint32());
continue; continue;
} }
case 2: { case 2: {
...@@ -186,7 +188,7 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = { ...@@ -186,7 +188,7 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = {
break; break;
} }
message.ssoCredentials = SSOCredentials.decode(reader, reader.uint32()); message.ssoCredentials = CreateSessionRequest_SSOCredentials.decode(reader, reader.uint32());
continue; continue;
} }
case 3: { case 3: {
...@@ -212,22 +214,22 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = { ...@@ -212,22 +214,22 @@ export const CreateSessionRequest: MessageFns<CreateSessionRequest> = {
fromPartial(object: DeepPartial<CreateSessionRequest>): CreateSessionRequest { fromPartial(object: DeepPartial<CreateSessionRequest>): CreateSessionRequest {
const message = createBaseCreateSessionRequest(); const message = createBaseCreateSessionRequest();
message.passwordCredentials = (object.passwordCredentials !== undefined && object.passwordCredentials !== null) message.passwordCredentials = (object.passwordCredentials !== undefined && object.passwordCredentials !== null)
? PasswordCredentials.fromPartial(object.passwordCredentials) ? CreateSessionRequest_PasswordCredentials.fromPartial(object.passwordCredentials)
: undefined; : undefined;
message.ssoCredentials = (object.ssoCredentials !== undefined && object.ssoCredentials !== null) message.ssoCredentials = (object.ssoCredentials !== undefined && object.ssoCredentials !== null)
? SSOCredentials.fromPartial(object.ssoCredentials) ? CreateSessionRequest_SSOCredentials.fromPartial(object.ssoCredentials)
: undefined; : undefined;
message.neverExpire = object.neverExpire ?? false; message.neverExpire = object.neverExpire ?? false;
return message; return message;
}, },
}; };
function createBasePasswordCredentials(): PasswordCredentials { function createBaseCreateSessionRequest_PasswordCredentials(): CreateSessionRequest_PasswordCredentials {
return { username: "", password: "" }; return { username: "", password: "" };
} }
export const PasswordCredentials: MessageFns<PasswordCredentials> = { export const CreateSessionRequest_PasswordCredentials: MessageFns<CreateSessionRequest_PasswordCredentials> = {
encode(message: PasswordCredentials, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: CreateSessionRequest_PasswordCredentials, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.username !== "") { if (message.username !== "") {
writer.uint32(10).string(message.username); writer.uint32(10).string(message.username);
} }
...@@ -237,10 +239,10 @@ export const PasswordCredentials: MessageFns<PasswordCredentials> = { ...@@ -237,10 +239,10 @@ export const PasswordCredentials: MessageFns<PasswordCredentials> = {
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): PasswordCredentials { decode(input: BinaryReader | Uint8Array, length?: number): CreateSessionRequest_PasswordCredentials {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePasswordCredentials(); const message = createBaseCreateSessionRequest_PasswordCredentials();
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
...@@ -269,23 +271,23 @@ export const PasswordCredentials: MessageFns<PasswordCredentials> = { ...@@ -269,23 +271,23 @@ export const PasswordCredentials: MessageFns<PasswordCredentials> = {
return message; return message;
}, },
create(base?: DeepPartial<PasswordCredentials>): PasswordCredentials { create(base?: DeepPartial<CreateSessionRequest_PasswordCredentials>): CreateSessionRequest_PasswordCredentials {
return PasswordCredentials.fromPartial(base ?? {}); return CreateSessionRequest_PasswordCredentials.fromPartial(base ?? {});
}, },
fromPartial(object: DeepPartial<PasswordCredentials>): PasswordCredentials { fromPartial(object: DeepPartial<CreateSessionRequest_PasswordCredentials>): CreateSessionRequest_PasswordCredentials {
const message = createBasePasswordCredentials(); const message = createBaseCreateSessionRequest_PasswordCredentials();
message.username = object.username ?? ""; message.username = object.username ?? "";
message.password = object.password ?? ""; message.password = object.password ?? "";
return message; return message;
}, },
}; };
function createBaseSSOCredentials(): SSOCredentials { function createBaseCreateSessionRequest_SSOCredentials(): CreateSessionRequest_SSOCredentials {
return { idpId: 0, code: "", redirectUri: "" }; return { idpId: 0, code: "", redirectUri: "" };
} }
export const SSOCredentials: MessageFns<SSOCredentials> = { export const CreateSessionRequest_SSOCredentials: MessageFns<CreateSessionRequest_SSOCredentials> = {
encode(message: SSOCredentials, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(message: CreateSessionRequest_SSOCredentials, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.idpId !== 0) { if (message.idpId !== 0) {
writer.uint32(8).int32(message.idpId); writer.uint32(8).int32(message.idpId);
} }
...@@ -298,10 +300,10 @@ export const SSOCredentials: MessageFns<SSOCredentials> = { ...@@ -298,10 +300,10 @@ export const SSOCredentials: MessageFns<SSOCredentials> = {
return writer; return writer;
}, },
decode(input: BinaryReader | Uint8Array, length?: number): SSOCredentials { decode(input: BinaryReader | Uint8Array, length?: number): CreateSessionRequest_SSOCredentials {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length; let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSSOCredentials(); const message = createBaseCreateSessionRequest_SSOCredentials();
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
...@@ -338,11 +340,11 @@ export const SSOCredentials: MessageFns<SSOCredentials> = { ...@@ -338,11 +340,11 @@ export const SSOCredentials: MessageFns<SSOCredentials> = {
return message; return message;
}, },
create(base?: DeepPartial<SSOCredentials>): SSOCredentials { create(base?: DeepPartial<CreateSessionRequest_SSOCredentials>): CreateSessionRequest_SSOCredentials {
return SSOCredentials.fromPartial(base ?? {}); return CreateSessionRequest_SSOCredentials.fromPartial(base ?? {});
}, },
fromPartial(object: DeepPartial<SSOCredentials>): SSOCredentials { fromPartial(object: DeepPartial<CreateSessionRequest_SSOCredentials>): CreateSessionRequest_SSOCredentials {
const message = createBaseSSOCredentials(); const message = createBaseCreateSessionRequest_SSOCredentials();
message.idpId = object.idpId ?? 0; message.idpId = object.idpId ?? 0;
message.code = object.code ?? ""; message.code = object.code ?? "";
message.redirectUri = object.redirectUri ?? ""; message.redirectUri = object.redirectUri ?? "";
......
...@@ -83,17 +83,11 @@ export interface OAuth2Config { ...@@ -83,17 +83,11 @@ export interface OAuth2Config {
} }
export interface ListIdentityProvidersRequest { export interface ListIdentityProvidersRequest {
/** Optional. The maximum number of identity providers to return. */
pageSize: number;
/** Optional. A page token for pagination. */
pageToken: string;
} }
export interface ListIdentityProvidersResponse { export interface ListIdentityProvidersResponse {
/** The list of identity providers. */ /** The list of identity providers. */
identityProviders: IdentityProvider[]; identityProviders: IdentityProvider[];
/** A token for the next page of results. */
nextPageToken: string;
} }
export interface GetIdentityProviderRequest { export interface GetIdentityProviderRequest {
...@@ -491,17 +485,11 @@ export const OAuth2Config: MessageFns<OAuth2Config> = { ...@@ -491,17 +485,11 @@ export const OAuth2Config: MessageFns<OAuth2Config> = {
}; };
function createBaseListIdentityProvidersRequest(): ListIdentityProvidersRequest { function createBaseListIdentityProvidersRequest(): ListIdentityProvidersRequest {
return { pageSize: 0, pageToken: "" }; return {};
} }
export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersRequest> = { export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersRequest> = {
encode(message: ListIdentityProvidersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { encode(_: ListIdentityProvidersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.pageSize !== 0) {
writer.uint32(8).int32(message.pageSize);
}
if (message.pageToken !== "") {
writer.uint32(18).string(message.pageToken);
}
return writer; return writer;
}, },
...@@ -512,22 +500,6 @@ export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersReque ...@@ -512,22 +500,6 @@ export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersReque
while (reader.pos < end) { while (reader.pos < end) {
const tag = reader.uint32(); const tag = reader.uint32();
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.pageSize = reader.int32();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pageToken = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
...@@ -540,16 +512,14 @@ export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersReque ...@@ -540,16 +512,14 @@ export const ListIdentityProvidersRequest: MessageFns<ListIdentityProvidersReque
create(base?: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest { create(base?: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest {
return ListIdentityProvidersRequest.fromPartial(base ?? {}); return ListIdentityProvidersRequest.fromPartial(base ?? {});
}, },
fromPartial(object: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest { fromPartial(_: DeepPartial<ListIdentityProvidersRequest>): ListIdentityProvidersRequest {
const message = createBaseListIdentityProvidersRequest(); const message = createBaseListIdentityProvidersRequest();
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
return message; return message;
}, },
}; };
function createBaseListIdentityProvidersResponse(): ListIdentityProvidersResponse { function createBaseListIdentityProvidersResponse(): ListIdentityProvidersResponse {
return { identityProviders: [], nextPageToken: "" }; return { identityProviders: [] };
} }
export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResponse> = { export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResponse> = {
...@@ -557,9 +527,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp ...@@ -557,9 +527,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp
for (const v of message.identityProviders) { for (const v of message.identityProviders) {
IdentityProvider.encode(v!, writer.uint32(10).fork()).join(); IdentityProvider.encode(v!, writer.uint32(10).fork()).join();
} }
if (message.nextPageToken !== "") {
writer.uint32(18).string(message.nextPageToken);
}
return writer; return writer;
}, },
...@@ -578,14 +545,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp ...@@ -578,14 +545,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp
message.identityProviders.push(IdentityProvider.decode(reader, reader.uint32())); message.identityProviders.push(IdentityProvider.decode(reader, reader.uint32()));
continue; continue;
} }
case 2: {
if (tag !== 18) {
break;
}
message.nextPageToken = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
...@@ -601,7 +560,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp ...@@ -601,7 +560,6 @@ export const ListIdentityProvidersResponse: MessageFns<ListIdentityProvidersResp
fromPartial(object: DeepPartial<ListIdentityProvidersResponse>): ListIdentityProvidersResponse { fromPartial(object: DeepPartial<ListIdentityProvidersResponse>): ListIdentityProvidersResponse {
const message = createBaseListIdentityProvidersResponse(); const message = createBaseListIdentityProvidersResponse();
message.identityProviders = object.identityProviders?.map((e) => IdentityProvider.fromPartial(e)) || []; message.identityProviders = object.identityProviders?.map((e) => IdentityProvider.fromPartial(e)) || [];
message.nextPageToken = object.nextPageToken ?? "";
return message; return message;
}, },
}; };
......
...@@ -29,19 +29,11 @@ export interface ListShortcutsRequest { ...@@ -29,19 +29,11 @@ export interface ListShortcutsRequest {
* Format: users/{user} * Format: users/{user}
*/ */
parent: string; parent: string;
/** Optional. The maximum number of shortcuts to return. */
pageSize: number;
/** Optional. A page token for pagination. */
pageToken: string;
} }
export interface ListShortcutsResponse { export interface ListShortcutsResponse {
/** The list of shortcuts. */ /** The list of shortcuts. */
shortcuts: Shortcut[]; shortcuts: Shortcut[];
/** A token for the next page of results. */
nextPageToken: string;
/** The total count of shortcuts. */
totalSize: number;
} }
export interface GetShortcutRequest { export interface GetShortcutRequest {
...@@ -154,7 +146,7 @@ export const Shortcut: MessageFns<Shortcut> = { ...@@ -154,7 +146,7 @@ export const Shortcut: MessageFns<Shortcut> = {
}; };
function createBaseListShortcutsRequest(): ListShortcutsRequest { function createBaseListShortcutsRequest(): ListShortcutsRequest {
return { parent: "", pageSize: 0, pageToken: "" }; return { parent: "" };
} }
export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = { export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = {
...@@ -162,12 +154,6 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = { ...@@ -162,12 +154,6 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = {
if (message.parent !== "") { if (message.parent !== "") {
writer.uint32(10).string(message.parent); writer.uint32(10).string(message.parent);
} }
if (message.pageSize !== 0) {
writer.uint32(16).int32(message.pageSize);
}
if (message.pageToken !== "") {
writer.uint32(26).string(message.pageToken);
}
return writer; return writer;
}, },
...@@ -186,22 +172,6 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = { ...@@ -186,22 +172,6 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = {
message.parent = reader.string(); message.parent = reader.string();
continue; continue;
} }
case 2: {
if (tag !== 16) {
break;
}
message.pageSize = reader.int32();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.pageToken = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
...@@ -217,14 +187,12 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = { ...@@ -217,14 +187,12 @@ export const ListShortcutsRequest: MessageFns<ListShortcutsRequest> = {
fromPartial(object: DeepPartial<ListShortcutsRequest>): ListShortcutsRequest { fromPartial(object: DeepPartial<ListShortcutsRequest>): ListShortcutsRequest {
const message = createBaseListShortcutsRequest(); const message = createBaseListShortcutsRequest();
message.parent = object.parent ?? ""; message.parent = object.parent ?? "";
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
return message; return message;
}, },
}; };
function createBaseListShortcutsResponse(): ListShortcutsResponse { function createBaseListShortcutsResponse(): ListShortcutsResponse {
return { shortcuts: [], nextPageToken: "", totalSize: 0 }; return { shortcuts: [] };
} }
export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = { export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = {
...@@ -232,12 +200,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = { ...@@ -232,12 +200,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = {
for (const v of message.shortcuts) { for (const v of message.shortcuts) {
Shortcut.encode(v!, writer.uint32(10).fork()).join(); Shortcut.encode(v!, writer.uint32(10).fork()).join();
} }
if (message.nextPageToken !== "") {
writer.uint32(18).string(message.nextPageToken);
}
if (message.totalSize !== 0) {
writer.uint32(24).int32(message.totalSize);
}
return writer; return writer;
}, },
...@@ -256,22 +218,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = { ...@@ -256,22 +218,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = {
message.shortcuts.push(Shortcut.decode(reader, reader.uint32())); message.shortcuts.push(Shortcut.decode(reader, reader.uint32()));
continue; continue;
} }
case 2: {
if (tag !== 18) {
break;
}
message.nextPageToken = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.totalSize = reader.int32();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
...@@ -287,8 +233,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = { ...@@ -287,8 +233,6 @@ export const ListShortcutsResponse: MessageFns<ListShortcutsResponse> = {
fromPartial(object: DeepPartial<ListShortcutsResponse>): ListShortcutsResponse { fromPartial(object: DeepPartial<ListShortcutsResponse>): ListShortcutsResponse {
const message = createBaseListShortcutsResponse(); const message = createBaseListShortcutsResponse();
message.shortcuts = object.shortcuts?.map((e) => Shortcut.fromPartial(e)) || []; message.shortcuts = object.shortcuts?.map((e) => Shortcut.fromPartial(e)) || [];
message.nextPageToken = object.nextPageToken ?? "";
message.totalSize = object.totalSize ?? 0;
return message; return message;
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment