Skip to content

Commit

Permalink
bring in redpanda.api.common.v1alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Sep 4, 2024
1 parent 403febb commit 2100511
Show file tree
Hide file tree
Showing 24 changed files with 1,930 additions and 523 deletions.
1 change: 1 addition & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: v2
modules:
- path: proto
name: buf.build/redpandadata/common
deps:
- buf.build/googleapis/googleapis
lint:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension=,js_import_style=legacy_commonjs"
// @generated from file redpanda/common/v1/errordetails.proto (package redpanda.common.v1, syntax proto3)
// @generated from file redpanda/api/common/v1/errordetails.proto (package redpanda.api.common.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Any, Message, proto3 } from "@bufbuild/protobuf";
import { Status } from "../../../google/rpc/status_pb";
import { Status } from "../../../../google/rpc/status_pb";

/**
* AttemptInfo contains information about retryable actions and their specific attempts.
*
* @generated from message redpanda.common.v1.AttemptInfo
* @generated from message redpanda.api.common.v1.AttemptInfo
*/
export class AttemptInfo extends Message<AttemptInfo> {
/**
* @generated from field: repeated redpanda.common.v1.AttemptInfo.Attempt attempts = 1;
* @generated from field: repeated redpanda.api.common.v1.AttemptInfo.Attempt attempts = 1;
*/
attempts: AttemptInfo_Attempt[] = [];

Expand All @@ -24,7 +24,7 @@ export class AttemptInfo extends Message<AttemptInfo> {
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.common.v1.AttemptInfo";
static readonly typeName = "redpanda.api.common.v1.AttemptInfo";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "attempts", kind: "message", T: AttemptInfo_Attempt, repeated: true },
]);
Expand All @@ -47,7 +47,7 @@ export class AttemptInfo extends Message<AttemptInfo> {
}

/**
* @generated from message redpanda.common.v1.AttemptInfo.Attempt
* @generated from message redpanda.api.common.v1.AttemptInfo.Attempt
*/
export class AttemptInfo_Attempt extends Message<AttemptInfo_Attempt> {
/**
Expand All @@ -66,7 +66,7 @@ export class AttemptInfo_Attempt extends Message<AttemptInfo_Attempt> {
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.common.v1.AttemptInfo.Attempt";
static readonly typeName = "redpanda.api.common.v1.AttemptInfo.Attempt";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
{ no: 2, name: "status", kind: "message", T: Status },
Expand Down Expand Up @@ -94,7 +94,7 @@ export class AttemptInfo_Attempt extends Message<AttemptInfo_Attempt> {
* errors thrown by internal systems are discarded by default, so internal
* errors with sensitive information are not exposed.
*
* @generated from message redpanda.common.v1.ExternalError
* @generated from message redpanda.api.common.v1.ExternalError
*/
export class ExternalError extends Message<ExternalError> {
/**
Expand All @@ -113,7 +113,7 @@ export class ExternalError extends Message<ExternalError> {
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.common.v1.ExternalError";
static readonly typeName = "redpanda.api.common.v1.ExternalError";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "details", kind: "message", T: Any, repeated: true },
Expand Down
181 changes: 181 additions & 0 deletions proto/gen/es/redpanda/api/common/v1alpha1/common_pb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension=,js_import_style=legacy_commonjs"
// @generated from file redpanda/api/common/v1alpha1/common.proto (package redpanda.api.common.v1alpha1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Any, Message, proto3 } from "@bufbuild/protobuf";
import { Code } from "../../../../google/rpc/code_pb";

/**
* @generated from enum redpanda.api.common.v1alpha1.Reason
*/
export enum Reason {
/**
* @generated from enum value: REASON_UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,

/**
* The specified resource could not be found.
*
* @generated from enum value: REASON_RESOURCE_NOT_FOUND = 1;
*/
RESOURCE_NOT_FOUND = 1,

/**
* The input provided with the request is invalid.
*
* @generated from enum value: REASON_INVALID_INPUT = 2;
*/
INVALID_INPUT = 2,

/**
* Authentication token is missing.
*
* @generated from enum value: REASON_NO_AUTHENTICATION_TOKEN = 3;
*/
NO_AUTHENTICATION_TOKEN = 3,

/**
* The authentication token provided has expired.
*
* @generated from enum value: REASON_AUTHENTICATION_TOKEN_EXPIRED = 4;
*/
AUTHENTICATION_TOKEN_EXPIRED = 4,

/**
* The authentication token provided is invalid.
*
* @generated from enum value: REASON_AUTHENTICATION_TOKEN_INVALID = 5;
*/
AUTHENTICATION_TOKEN_INVALID = 5,

/**
* The user does not have the necessary permissions.
*
* @generated from enum value: REASON_PERMISSION_DENIED = 6;
*/
PERMISSION_DENIED = 6,

/**
* The request cannot be completed due to server error.
*
* @generated from enum value: REASON_SERVER_ERROR = 7;
*/
SERVER_ERROR = 7,

/**
* The request rate is too high.
*
* @generated from enum value: REASON_TOO_MANY_REQUESTS = 8;
*/
TOO_MANY_REQUESTS = 8,

/**
* The request timed out.
*
* @generated from enum value: REASON_TIMEOUT = 9;
*/
TIMEOUT = 9,

/**
* The feature is not configured.
*
* @generated from enum value: REASON_FEATURE_NOT_CONFIGURED = 10;
*/
FEATURE_NOT_CONFIGURED = 10,

/**
* The feature is not supported in the requested environment.
*
* @generated from enum value: REASON_FEATURE_NOT_SUPPORTED = 11;
*/
FEATURE_NOT_SUPPORTED = 11,
}
// Retrieve enum metadata with: proto3.getEnumType(Reason)
proto3.util.setEnumType(Reason, "redpanda.api.common.v1alpha1.Reason", [
{ no: 0, name: "REASON_UNSPECIFIED" },
{ no: 1, name: "REASON_RESOURCE_NOT_FOUND" },
{ no: 2, name: "REASON_INVALID_INPUT" },
{ no: 3, name: "REASON_NO_AUTHENTICATION_TOKEN" },
{ no: 4, name: "REASON_AUTHENTICATION_TOKEN_EXPIRED" },
{ no: 5, name: "REASON_AUTHENTICATION_TOKEN_INVALID" },
{ no: 6, name: "REASON_PERMISSION_DENIED" },
{ no: 7, name: "REASON_SERVER_ERROR" },
{ no: 8, name: "REASON_TOO_MANY_REQUESTS" },
{ no: 9, name: "REASON_TIMEOUT" },
{ no: 10, name: "REASON_FEATURE_NOT_CONFIGURED" },
{ no: 11, name: "REASON_FEATURE_NOT_SUPPORTED" },
]);

/**
* Modified variant of google.rpc.Status, that uses enum instead of int32 for
* code, so it's nicer in REST.
* The `Status` type defines a logical error model that is suitable for
* different programming environments, including REST APIs and RPC APIs. It is
* used by [gRPC](https://github.com/grpc). Each `Status` message contains
* three pieces of data: error code, error message, and error details.
*
* You can find out more about this error model and how to work with it in the
* [API Design Guide](https://cloud.google.com/apis/design/errors).
*
* @generated from message redpanda.api.common.v1alpha1.ErrorStatus
*/
export class ErrorStatus extends Message<ErrorStatus> {
/**
* The status code, which should be an enum value of
* [google.rpc.Code][google.rpc.Code].
*
* @generated from field: google.rpc.Code code = 1;
*/
code = Code.OK;

/**
* 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.
*
* @generated from field: string message = 2;
*/
message = "";

/**
* A list of messages that carry the error details. There is a common set of
* message types for APIs to use.
*
* @generated from field: repeated google.protobuf.Any details = 3;
*/
details: Any[] = [];

constructor(data?: PartialMessage<ErrorStatus>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.api.common.v1alpha1.ErrorStatus";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "code", kind: "enum", T: proto3.getEnumType(Code) },
{ no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "details", kind: "message", T: Any, repeated: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ErrorStatus {
return new ErrorStatus().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ErrorStatus {
return new ErrorStatus().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ErrorStatus {
return new ErrorStatus().fromJsonString(jsonString, options);
}

static equals(a: ErrorStatus | PlainMessage<ErrorStatus> | undefined, b: ErrorStatus | PlainMessage<ErrorStatus> | undefined): boolean {
return proto3.util.equals(ErrorStatus, a, b);
}
}

76 changes: 76 additions & 0 deletions proto/gen/es/redpanda/api/common/v1alpha1/money_pb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension=,js_import_style=legacy_commonjs"
// @generated from file redpanda/api/common/v1alpha1/money.proto (package redpanda.api.common.v1alpha1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";

/**
* @generated from enum redpanda.api.common.v1alpha1.Currency
*/
export enum Currency {
/**
* @generated from enum value: CURRENCY_UNSPECIFIED = 0;
*/
UNSPECIFIED = 0,

/**
* @generated from enum value: CURRENCY_CURRENCY_USD_CENTS = 1;
*/
CURRENCY_USD_CENTS = 1,
}
// Retrieve enum metadata with: proto3.getEnumType(Currency)
proto3.util.setEnumType(Currency, "redpanda.api.common.v1alpha1.Currency", [
{ no: 0, name: "CURRENCY_UNSPECIFIED" },
{ no: 1, name: "CURRENCY_CURRENCY_USD_CENTS" },
]);

/**
* @generated from message redpanda.api.common.v1alpha1.Money
*/
export class Money extends Message<Money> {
/**
* Amount is a decimal number.
* Examples:
* 10
* 10.15
*
* @generated from field: string amount = 1;
*/
amount = "";

/**
* @generated from field: redpanda.api.common.v1alpha1.Currency currency = 2;
*/
currency = Currency.UNSPECIFIED;

constructor(data?: PartialMessage<Money>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.api.common.v1alpha1.Money";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "amount", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "currency", kind: "enum", T: proto3.getEnumType(Currency) },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Money {
return new Money().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Money {
return new Money().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Money {
return new Money().fromJsonString(jsonString, options);
}

static equals(a: Money | PlainMessage<Money> | undefined, b: Money | PlainMessage<Money> | undefined): boolean {
return proto3.util.equals(Money, a, b);
}
}

Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension=,js_import_style=legacy_commonjs"
// @generated from file redpanda/common/v1/page_token.proto (package redpanda.common.v1, syntax proto3)
// @generated from file redpanda/api/common/v1alpha1/pagination.proto (package redpanda.api.common.v1alpha1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";

/**
* KeySetPageToken encodes a page token that can be used to do KeySet pagination: https://www.cockroachlabs.com/docs/stable/pagination#keyset-pagination
* The page starts with the record that fulfills the key >= value_greater_equal condition, where all records are sorted by key.
* KeySetPageToken represents a pagination token for KeySet pagination.
* It marks the beginning of a page where records start from the key that
* satisfies the condition key >= value_greater_equal. Records are sorted
* alphabetically by key in ascending order.
*
* @generated from message redpanda.common.v1.KeySetPageToken
* @generated from message redpanda.api.common.v1alpha1.KeySetPageToken
*/
export class KeySetPageToken extends Message<KeySetPageToken> {
/**
Expand All @@ -29,7 +31,7 @@ export class KeySetPageToken extends Message<KeySetPageToken> {
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "redpanda.common.v1.KeySetPageToken";
static readonly typeName = "redpanda.api.common.v1alpha1.KeySetPageToken";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "value_greater_equal", kind: "scalar", T: 9 /* ScalarType.STRING */ },
Expand Down
Loading

0 comments on commit 2100511

Please sign in to comment.