Files
komp_ac/common/src/proto/komp_ac.table_definition.rs
2026-09-03 19:21:54 +02:00

3443 lines
158 KiB
Rust

// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateCustomExchangeRatesTableRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateCustomExchangeRatesTableResponse {
#[prost(int64, tag = "1")]
pub table_definition_id: i64,
#[prost(bool, tag = "2")]
pub created: bool,
}
/// Defines the input for creating a new table definition.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostTableDefinitionRequest {
/// Table name to create inside the target profile.
/// Must be lowercase, alphanumeric with underscores,
/// start with a letter, and be \<= 63 chars.
/// Forbidden names include the system columns and tables owned by dedicated
/// server operations, such as "custom_exchange_rates". The "\_id" suffix is
/// allowed.
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
/// The table's columns, including its links and stored linked projections.
/// A projection uses field_type FROM(link_column.source_column); its physical
/// type and money metadata are inferred from the linked source column.
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
/// Column names to index, matching names declared above. System columns
/// ("id", "deleted", "created_at", "row_revision") already have indexes, and
/// a LINK column is indexed when it is created. Requests naming either are
/// rejected.
#[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Name of profile (Postgres schema) where the table will be created.
/// Same naming rules as table_name; cannot collide with reserved schemas
/// like "public", "information_schema", or ones starting with "pg\_".
#[prost(string, tag = "5")]
pub profile_name: ::prost::alloc::string::String,
/// Columns whose values identify a row to users in pickers, in the order
/// they are shown. Each must name one of the user-defined columns above.
/// Empty means the row is identified by its id alone.
#[prost(string, repeated, tag = "7")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// ISO-4217 currency the profile keeps its accounting in. A profile is one
/// accounting entity and keeps one set of books, so this is required only when
/// the request creates the profile, and is ignored afterwards. It is unrelated
/// to individual MONEY-column currencies: tables may hold money in any currency, and amounts convert
/// to this one when they reach the ledger.
#[prost(string, tag = "8")]
pub accounting_currency: ::prost::alloc::string::String,
/// Initial compiled direct-rate provider. It is enabled for each initial
/// foreign currency below; more provider/currency bindings may be appended later.
#[prost(string, tag = "11")]
pub rate_source_id: ::prost::alloc::string::String,
/// Append-only foreign currencies initially enabled for this profile.
#[prost(string, repeated, tag = "12")]
pub foreign_currencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// When true, the table is stored once in the global physical schema and is
/// visible from every profile. profile_name and accounting_currency are ignored.
#[prost(bool, tag = "9")]
pub global: bool,
/// Names for the columns a definition row generates, in place of the ones the
/// backend would give them. See GeneratedColumnAlias.
#[prost(message, repeated, tag = "10")]
pub generated_aliases: ::prost::alloc::vec::Vec<GeneratedColumnAlias>,
}
/// Renames one column a definition row generates, at the moment it is created.
///
/// A generated column cannot be named in the column list -- the definition row
/// is required to be named after its own type, and what it expands into is the
/// backend's to decide. The name is only ever a display name over a physical
/// column, though, so it is free to be anything: this is where that choice is
/// made, instead of a SetColumnPresentation call afterwards.
///
/// ACCOUNTING, PHONE and IBAN generated columns may be renamed: their
/// relationships are recorded by physical column, so the rest of the system can
/// find them without knowing their display names. ACCOUNTING_TRANSFER connectors
/// are the exception and are refused here exactly as SetColumnPresentation refuses
/// them.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeneratedColumnAlias {
/// The name the backend would otherwise give the column: one of ACCOUNTING's
/// "name", "tax_point_date", "debit", "credit" or "account", or a PHONE or
/// IBAN companion such as "work_phone_ext". Must name a column the request
/// really generates -- an alias for anything else is rejected rather than
/// ignored, so a typo cannot pass silently.
#[prost(string, tag = "1")]
pub generated_name: ::prost::alloc::string::String,
/// What the column should be called instead. Preserved exactly for display.
/// Aliases may contain Unicode letters, numbers, spaces, punctuation and
/// symbols, but not leading/trailing whitespace or control characters, and
/// are limited to 63 UTF-8 bytes. Uniqueness and lookup use a compatibility-
/// normalized, Unicode-case-folded key that collapses whitespace and ignores
/// emoji while keeping punctuation significant.
#[prost(string, tag = "2")]
pub alias: ::prost::alloc::string::String,
}
/// Defines the input for explicitly creating tables backed by one invoice
/// Enables a stored global Typst template for one profile and immediately
/// creates the input-table family declared by that template.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateInvoiceTemplateTableRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub template_name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyInvoiceTemplateTableRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub template_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub tables: ::prost::alloc::vec::Vec<InvoiceTemplateTableDefinition>,
#[prost(message, repeated, tag = "4")]
pub field_bindings: ::prost::alloc::vec::Vec<InvoiceTemplateFieldBinding>,
/// The immutable version whose komp_ac_fields the administrator mapped.
/// Applying never silently switches to a newer version with a different
/// contract between inspection and submission.
#[prost(int64, tag = "5")]
pub template_version_id: i64,
}
/// One administrator-designed table in the template input bundle. The empty
/// collection_path is the root; a path ending in \[\] owns that repeated scope.
/// The nested table definition retains every normal table option, including
/// ACCOUNTING, generated aliases, ledgers, indexes, links and display columns.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvoiceTemplateTableDefinition {
#[prost(string, tag = "1")]
pub collection_path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub definition: ::core::option::Option<PostTableDefinitionRequest>,
}
/// Maps one path from komp_ac_fields to one table column. A regular binding
/// names a declared column. An accounting binding names a semantic generated
/// role, so aliases and the order of Typst fields cannot change its meaning.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InvoiceTemplateFieldBinding {
#[prost(string, tag = "1")]
pub field_path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection_path: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub column_name: ::prost::alloc::string::String,
#[prost(enumeration = "InvoiceTemplateAccountingRole", tag = "4")]
pub accounting_role: i32,
/// Optional source reached through column_name when that column is a LINK.
/// Both names are empty for a value stored directly on the invoice table.
#[prost(string, tag = "5")]
pub source_table_name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub source_column_name: ::prost::alloc::string::String,
}
/// One physical dynamic table created for an invoice template scope. The root
/// has an empty collection_path and parent_table_name. Each \[\] scope names its
/// collection and the generated table that owns those repeated rows.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeneratedInvoiceTemplateTable {
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collection_path: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub parent_table_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub sql: ::prost::alloc::string::String,
}
/// Reports the complete table bundle created from one invoice template.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateInvoiceTemplateTableResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(message, repeated, tag = "2")]
pub tables: ::prost::alloc::vec::Vec<GeneratedInvoiceTemplateTable>,
#[prost(int64, tag = "3")]
pub template_version_id: i64,
}
/// Defines append-only column additions for an existing table.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddTableColumnsRequest {
/// Existing profile/schema name.
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
/// Existing table name in the profile.
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
/// New user-defined columns only. Existing columns cannot be changed here.
/// Stored linked projections use field_type FROM(link_column.source_column).
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
/// Optional indexes for the new columns only.
#[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Names for the columns the appended definition rows generate, exactly as on
/// PostTableDefinitionRequest.
#[prost(message, repeated, tag = "5")]
pub generated_aliases: ::prost::alloc::vec::Vec<GeneratedColumnAlias>,
}
/// One atomic structural edit to an existing empty table.
///
/// Removals use stable column IDs rather than aliases. Generated companion
/// columns must be removed together with their generating column. New columns
/// follow the same contract as AddTableColumns.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutTableDefinitionRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(int64, repeated, tag = "3")]
pub remove_column_ids: ::prost::alloc::vec::Vec<i64>,
#[prost(message, repeated, tag = "4")]
pub add_columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
#[prost(string, repeated, tag = "5")]
pub add_indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "6")]
pub generated_aliases: ::prost::alloc::vec::Vec<GeneratedColumnAlias>,
/// Revision returned by GetProfileDetails. Prevents a stale editor from
/// overwriting a newer structural or presentation change.
#[prost(int64, tag = "7")]
pub expected_row_version: i64,
/// New physical/catalog name. Empty, or equal to table_name, keeps the
/// current name for backwards-compatible callers.
#[prost(string, tag = "8")]
pub new_table_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PutTableDefinitionResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub sql: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub row_version: i64,
#[prost(int64, repeated, tag = "4")]
pub removed_column_ids: ::prost::alloc::vec::Vec<i64>,
}
/// Describes one user-defined column for a table.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ColumnDefinition {
/// Public display name for this column; the physical column uses a stable
/// server-assigned ordinal name. Preserved exactly for display. It may contain
/// Unicode letters, numbers, spaces, punctuation and symbols, but not
/// leading/trailing whitespace or control characters, and is limited to 63
/// UTF-8 bytes. Its canonical form must be unique within the table and cannot
/// claim a reserved system-column name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Logical column type. Supported values (case-insensitive):
/// TEXT
/// BOOLEAN
/// INSTANT (local input resolved in the authenticated user's timezone
/// and displayed in the viewer timezone)
/// USER_DATETIME (local input resolved in the user's timezone)
/// RAW_DATETIME (timezone-free civil datetime)
/// PHONE (international or national phone number; generates extension/type/country/calling-code companions)
/// TIME (timezone-free time of day)
/// MONEY (= unconstrained NUMERIC; currency is declared below)
/// ACCOUNT_STATEMENT_CLASS (A = assets, P = equity and liabilities,
/// N = expenses, V = revenue)
/// ACCOUNTING (creates schema-managed name, account, debit, and credit fields;
/// account always selects a row from the profile's managed ledger_accounts table;
/// name is limited to 10 characters and one stored row contributes
/// one line to the profile journal)
/// ACCOUNTING_TRANSFER (creates automatic source-period/account/book/
/// denomination fields and writable target equivalents; one
/// table may contain only one accounting transfer definition)
/// INT
/// BIGINT
/// DATE
/// DURATION
/// PERIOD
/// LINK(table) → BIGINT referencing that table in the same profile, indexed
/// automatically. A table may hold several links to the same
/// target as long as the columns are named differently.
/// FROM(link.source) → stored, read-only copy of an atomic column reached
/// through another column in this definition whose type is
/// LINK(...). SQL type and money metadata are inferred.
#[prost(string, tag = "2")]
pub field_type: ::prost::alloc::string::String,
/// MONEY rounding applied before a value is stored.
#[prost(enumeration = "MoneyRounding", tag = "3")]
pub rounding: i32,
/// When true, this numeric column is server-owned and projected
/// from quantity-ledger contributions.
#[prost(bool, tag = "4")]
pub quantity_ledger: bool,
/// Canonical uppercase ISO-4217 currency code. Required for MONEY and forbidden
/// for every other field type.
#[prost(string, tag = "5")]
pub currency: ::prost::alloc::string::String,
/// When true, the server rejects omitted or explicitly null values.
#[prost(bool, tag = "6")]
pub required: bool,
/// Enables a Boolean ledger on Boolean columns. ANY means
/// one true contribution wins; ALL means one false contribution wins.
#[prost(enumeration = "BooleanLedgerOperator", tag = "7")]
#[serde(default, alias = "boolean_ledger_operator")]
pub boolean_ledger: i32,
}
/// Response after table creation (success + DDL preview).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TableDefinitionResponse {
/// True if all DB changes and metadata inserts succeeded.
#[prost(bool, tag = "1")]
pub success: bool,
/// The actual SQL executed: CREATE TABLE + CREATE INDEX statements.
#[prost(string, tag = "2")]
pub sql: ::prost::alloc::string::String,
}
/// Describes the tree of all profiles and their tables.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProfileTreeResponse {
/// All profiles in the system.
#[prost(message, repeated, tag = "1")]
pub profiles: ::prost::alloc::vec::Vec<profile_tree_response::Profile>,
/// The profile holding the tables every profile shares. Callers browse this
/// one when the user has not chosen a profile, so the name is reported here
/// rather than being known in advance.
#[prost(string, tag = "2")]
pub shared_profile_name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ProfileTreeResponse`.
pub mod profile_tree_response {
/// One link: the table it points at, and the column carrying it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Dependency {
/// Table being referenced.
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
/// Column holding the reference, named by whoever declared the link. This
/// is what identifies the link, since a table may point at one target
/// several times.
#[prost(string, tag = "2")]
pub column_name: ::prost::alloc::string::String,
}
/// Table entry in a profile.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Table {
/// Internal ID from table_definitions.id (metadata record).
#[prost(int64, tag = "1")]
pub id: i64,
/// Table name within the profile (schema).
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Links this table declares. One entry per link, so a table that names the
/// same target twice appears twice.
#[prost(message, repeated, tag = "3")]
pub depends_on: ::prost::alloc::vec::Vec<Dependency>,
/// Columns whose values make up the human-readable row label, in order.
#[prost(string, repeated, tag = "4")]
pub row_display_columns: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
/// "dynamic" for user-defined tables, "system" for backend-managed tables.
#[prost(string, tag = "5")]
pub table_kind: ::prost::alloc::string::String,
/// True when this table is shared by every profile.
#[prost(bool, tag = "6")]
pub global: bool,
/// Profile (schema) the table is actually stored in. A global table is
/// listed under every profile it is visible from, so this names the one it
/// belongs to rather than the one it was reached through, and callers can
/// use it as the table's identity without deciding anything themselves.
#[prost(string, tag = "7")]
pub profile_name: ::prost::alloc::string::String,
}
/// Profile (schema) entry.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Profile {
/// Name of the schema/profile (as stored in `schemas.name`).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// All tables in that schema and their dependencies.
#[prost(message, repeated, tag = "2")]
pub tables: ::prost::alloc::vec::Vec<Table>,
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTableCatalogRequest {
/// Selected profile. Omit this field to request the global-only scope.
#[prost(string, optional, tag = "1")]
pub profile_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTableCatalogResponse {
#[prost(message, repeated, tag = "1")]
pub tables: ::prost::alloc::vec::Vec<profile_tree_response::Table>,
}
/// Request to fetch all tables, columns and scripts for a profile.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetProfileDetailsRequest {
/// Profile (schema) name to fetch details for.
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
}
/// Response with all tables, columns and scripts for a profile.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProfileDetailsResponse {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub tables: ::prost::alloc::vec::Vec<TableDetail>,
}
/// Request to copy one full profile into a new profile.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CopyProfileRequest {
#[prost(string, tag = "1")]
pub source_profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub target_profile_name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub table_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response after copying a profile.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CopyProfileResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub tables_copied: i32,
#[prost(int32, tag = "4")]
pub scripts_copied: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExportProfileBlueprintRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
/// Empty exports every dynamic table in the profile. Otherwise only these tables
/// are created by import; their unselected local dependencies become requirements.
#[prost(string, repeated, tag = "2")]
pub table_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExportProfileBlueprintResponse {
#[prost(string, tag = "1")]
pub blueprint_json: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub blueprint_sha256: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub tables: i32,
#[prost(int32, tag = "4")]
pub required_local_tables: i32,
#[prost(int32, tag = "5")]
pub required_global_tables: i32,
#[prost(int32, tag = "6")]
pub templates: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PlanProfileBlueprintImportRequest {
#[prost(string, tag = "1")]
pub target_profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub blueprint_json: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProfileBlueprintImportAction {
/// One of create, reuse, add, or conflict.
#[prost(string, tag = "1")]
pub action: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub detail: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlanProfileBlueprintImportResponse {
#[prost(bool, tag = "1")]
pub can_import: bool,
#[prost(string, tag = "2")]
pub plan_sha256: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub actions: ::prost::alloc::vec::Vec<ProfileBlueprintImportAction>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportProfileBlueprintRequest {
#[prost(string, tag = "1")]
pub target_profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub blueprint_json: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub expected_plan_sha256: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportProfileBlueprintResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub tables_created: i32,
#[prost(int32, tag = "4")]
pub globals_created: i32,
#[prost(int32, tag = "5")]
pub globals_reused: i32,
#[prost(int32, tag = "6")]
pub templates_created: i32,
#[prost(int32, tag = "7")]
pub templates_reused: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAliasChangeHistoryRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(int64, optional, tag = "2")]
pub table_definition_id: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "3")]
pub column_id: ::core::option::Option<i64>,
#[prost(enumeration = "AliasChangeKind", tag = "4")]
pub alias_kind: i32,
#[prost(string, optional, tag = "5")]
pub option_value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, tag = "6")]
pub limit: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AliasChangeHistoryEntry {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub change_set_id: ::prost::alloc::string::String,
#[prost(enumeration = "AliasChangeKind", tag = "3")]
pub alias_kind: i32,
#[prost(string, tag = "4")]
pub profile_name: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub table_definition_id: i64,
#[prost(string, tag = "6")]
pub table_name: ::prost::alloc::string::String,
#[prost(int64, optional, tag = "7")]
pub column_id: ::core::option::Option<i64>,
#[prost(string, tag = "8")]
pub column_name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "9")]
pub option_value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "10")]
pub old_alias: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "11")]
pub new_alias: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub changed_by_user_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "13")]
pub changed_by_user_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "14")]
pub changed_at: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAliasChangeHistoryResponse {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<AliasChangeHistoryEntry>,
}
/// Describes a table with its columns and associated scripts.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableDetail {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub id: i64,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
#[prost(message, repeated, tag = "4")]
pub scripts: ::prost::alloc::vec::Vec<ScriptInfo>,
#[prost(string, repeated, tag = "6")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, message", tag = "7")]
pub column_behaviors: ::std::collections::HashMap<
::prost::alloc::string::String,
ColumnBehavior,
>,
#[prost(string, tag = "8")]
pub table_kind: ::prost::alloc::string::String,
#[prost(bool, tag = "9")]
pub global: bool,
/// Revision of this table definition for optimistic concurrency control.
#[prost(int64, tag = "10")]
pub row_version: i64,
/// Profile (schema) the table is actually stored in, which is not the
/// requested profile when a global table is being listed. See
/// ProfileTreeResponse.Table.profile_name.
#[prost(string, tag = "11")]
pub profile_name: ::prost::alloc::string::String,
/// True when the physical table contains at least one row, including a
/// soft-deleted row. Populated tables are append-only: PutTableDefinition is
/// no longer available, while AddTableColumns remains available.
#[prost(bool, tag = "12")]
pub has_data: bool,
/// User-managed single-column indexes. Backend-managed indexes are omitted.
#[prost(string, repeated, tag = "13")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Server-owned behavior for one logical column returned in table details.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnBehavior {
/// True when the server created the column as a companion of another column.
#[prost(bool, tag = "1")]
pub generated: bool,
/// True when clients must display but never submit edits for the column.
#[prost(bool, tag = "2")]
pub read_only: bool,
/// Logical source column name, empty for ordinary user-defined columns.
#[prost(string, tag = "3")]
pub generated_from: ::prost::alloc::string::String,
/// True when clients may offer this column in an alias rename picker.
#[prost(bool, tag = "4")]
pub renameable: bool,
/// Stable public identity used when updating this column's presentation.
#[prost(int64, tag = "5")]
pub column_id: i64,
/// True when bundled data-entry clients should not render this column.
/// This is not an authorization boundary; data APIs still expose the column.
#[prost(bool, tag = "6")]
pub hidden_from_forms: bool,
/// Current public option names. For a renamed option, both fields contain its
/// alias; the stored value is never disclosed. Public writes use the alias.
#[prost(message, repeated, tag = "7")]
pub option_value_aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
}
/// A script that targets a specific column in a table.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ScriptInfo {
#[prost(int64, tag = "1")]
pub script_id: i64,
#[prost(string, tag = "2")]
pub target_column: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub target_column_type: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub script: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
}
/// One column's desired public presentation. Its position in the containing
/// repeated field is its presentation order.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ColumnPresentation {
/// Stable public identity of the table_definition_columns row.
#[prost(int64, tag = "1")]
pub column_id: i64,
#[prost(string, tag = "2")]
pub alias: ::prost::alloc::string::String,
}
/// Atomically replaces every user-visible column alias and their order.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetColumnPresentationRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnPresentation>,
/// Row version returned by GetProfileDetails when this presentation was read.
#[prost(int64, tag = "4")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetColumnPresentationResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnPresentation>,
/// New row version after the update.
#[prost(int64, tag = "4")]
pub row_version: i64,
}
/// Atomically replaces the columns whose values identify rows in pickers and
/// link labels. Their order is the order in which their values are displayed.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetRowDisplayColumnsRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Row version returned by GetProfileDetails when this metadata was read.
#[prost(int64, tag = "4")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetRowDisplayColumnsResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, repeated, tag = "2")]
pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// New row version after the update, or the current version for a no-op.
#[prost(int64, tag = "3")]
pub row_version: i64,
}
/// Atomically replaces the table's user-managed single-column indexes. Indexes
/// owned by the backend, including link and navigation indexes, are unchanged.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetTableIndexesRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Row version returned by GetProfileDetails when the indexes were read.
#[prost(int64, tag = "4")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetTableIndexesResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, repeated, tag = "2")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// New row version after the update, or the current version for a no-op.
#[prost(int64, tag = "3")]
pub row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetColumnRequiredRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
/// Stable column identity returned in GetProfileDetails.column_behaviors.
#[prost(int64, tag = "3")]
pub column_id: i64,
#[prost(bool, tag = "4")]
pub required: bool,
/// Row version returned by GetProfileDetails when the column was read.
#[prost(int64, tag = "5")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetColumnRequiredResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(int64, tag = "2")]
pub column_id: i64,
#[prost(bool, tag = "3")]
pub required: bool,
/// New row version after the update, or the current version for a no-op.
#[prost(int64, tag = "4")]
pub row_version: i64,
}
/// One public option name. `value` identifies the option by its current public
/// alias and `alias` is its desired public alias; stored values remain internal.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OptionValueAlias {
#[prost(string, tag = "1")]
pub value: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alias: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetColumnOptionAliasesRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub column_id: i64,
/// Partial sets are supported; omitted values use their canonical spelling.
/// An empty list removes every alias from the column.
#[prost(message, repeated, tag = "4")]
pub aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
#[prost(int64, tag = "5")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetColumnOptionAliasesResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub column_id: i64,
#[prost(message, repeated, tag = "4")]
pub aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
#[prost(int64, tag = "5")]
pub row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetColumnFormVisibilityRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub column_id: i64,
#[prost(bool, tag = "4")]
pub hidden_from_forms: bool,
/// Row version returned by GetProfileDetails when the column was read.
#[prost(int64, tag = "5")]
pub expected_row_version: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetColumnFormVisibilityResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub column_id: i64,
#[prost(bool, tag = "4")]
pub hidden_from_forms: bool,
/// New row version after the update.
#[prost(int64, tag = "5")]
pub row_version: i64,
}
/// Request to delete one table definition entirely.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteTableRequest {
/// Profile (schema) name owning the table (must exist).
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
/// Table to drop (must exist in the profile).
/// Executes DROP TABLE "profile"."table" CASCADE and then removes metadata.
#[prost(string, tag = "2")]
pub table_name: ::prost::alloc::string::String,
}
/// Response after table deletion.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteTableResponse {
/// True if table and metadata were successfully deleted in one transaction.
#[prost(bool, tag = "1")]
pub success: bool,
/// Human-readable summary of what was removed.
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProfileRequest {
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProfileResponse {
#[prost(bool, tag = "1")]
pub success: bool,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub tables_deleted: i32,
}
/// Response describing the whole column-type vocabulary.
///
/// This is the authority a client builds its column-type picker from: every rule
/// a client would otherwise hardcode about what a type means is a field here. The
/// list covers types clients may NOT declare as well (see `declarable`), so that
/// the same call also explains the types GetProfileDetails reports back for
/// server-generated companion columns.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListColumnTypesResponse {
/// Every column type, declarable or not, ordered by name.
#[prost(message, repeated, tag = "1")]
pub column_types: ::prost::alloc::vec::Vec<list_column_types_response::ColumnType>,
/// Every canonical ISO-4217 code accepted by currency-bearing columns and
/// profile accounting settings, ordered alphabetically.
#[prost(string, repeated, tag = "2")]
pub currency_codes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `ListColumnTypesResponse`.
pub mod list_column_types_response {
/// One column type and everything a client needs to know to offer it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnType {
/// Logical column type (e.g. "money", "instant"). Passed to the server as
/// ColumnDefinition.field_type — see `spelling`, which is what says whether
/// this name is the whole spelling.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Underlying PostgreSQL type the logical type maps to (e.g. "NUMERIC").
/// Empty when `compound` is true.
#[prost(string, tag = "2")]
pub sql_type: ::prost::alloc::string::String,
/// False for types the server generates on its own and rejects when a client
/// declares them: the phone and IBAN companions, and the accounting-transfer
/// connectors. A column-type picker must offer only declarable types.
#[prost(bool, tag = "3")]
pub declarable: bool,
/// True when the type is a definition row rather than a column: it expands
/// into several schema-managed companion columns and no column of this name
/// survives. A compound type can therefore never be indexed, never be a row
/// display column, and has no single sql_type of its own.
#[prost(bool, tag = "4")]
pub compound: bool,
/// Whether `name` is the whole spelling or takes arguments.
#[prost(enumeration = "super::ColumnTypeSpelling", tag = "5")]
pub spelling: i32,
/// Whether ColumnDefinition.currency is required. Currency is rejected on
/// every type where this is false.
#[prost(bool, tag = "6")]
pub requires_currency: bool,
/// True when the type may only be chosen while the table is being created.
/// AddTableColumns rejects these, because they bring schema-managed columns
/// that cannot be bolted onto a table that already exists.
#[prost(bool, tag = "7")]
pub creation_only: bool,
/// Whether ColumnDefinition.quantity_ledger may be set on this type.
#[prost(bool, tag = "8")]
pub allows_quantity_ledger: bool,
/// Whether ColumnDefinition.boolean_ledger may be set on this type.
#[prost(bool, tag = "11")]
pub allows_boolean_ledger: bool,
/// Optional name grouping several types a client offers behind one choice —
/// "temporal" for the date and time types, "gtin" for the GTIN lengths.
/// Empty when the type stands on its own.
#[prost(string, tag = "9")]
pub group: ::prost::alloc::string::String,
/// What this type expands into, in the order the server creates the
/// columns. Populated for compound types only, where the generated names
/// are fixed; empty for every other type, including the ones whose
/// companions are named after the declared column (phone, iban).
///
/// A picker offering a compound type shows these, so choosing it is not a
/// blind choice. The columns stay the server's to create — none of them may
/// be declared.
#[prost(message, repeated, tag = "10")]
pub generated_columns: ::prost::alloc::vec::Vec<column_type::GeneratedColumn>,
}
/// Nested message and enum types in `ColumnType`.
pub mod column_type {
/// One column a compound type expands into.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeneratedColumn {
/// Name the server gives the column. Fixed, and reserved: a table
/// declaring a compound type may not also declare a column of this name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The generated column's own logical type, as this same catalog
/// describes it.
#[prost(string, tag = "2")]
pub field_type: ::prost::alloc::string::String,
/// Whether the generated column carries the currency and rounding
/// declared on the definition row.
#[prost(bool, tag = "3")]
pub inherits_currency: bool,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InvoiceTemplateAccountingRole {
Unspecified = 0,
InvoiceTemplateAccountingName = 1,
InvoiceTemplateAccountingTaxPointDate = 2,
InvoiceTemplateAccountingAccount = 3,
InvoiceTemplateAccountingDebit = 4,
InvoiceTemplateAccountingCredit = 5,
}
impl InvoiceTemplateAccountingRole {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "INVOICE_TEMPLATE_ACCOUNTING_ROLE_UNSPECIFIED",
Self::InvoiceTemplateAccountingName => "INVOICE_TEMPLATE_ACCOUNTING_NAME",
Self::InvoiceTemplateAccountingTaxPointDate => {
"INVOICE_TEMPLATE_ACCOUNTING_TAX_POINT_DATE"
}
Self::InvoiceTemplateAccountingAccount => {
"INVOICE_TEMPLATE_ACCOUNTING_ACCOUNT"
}
Self::InvoiceTemplateAccountingDebit => "INVOICE_TEMPLATE_ACCOUNTING_DEBIT",
Self::InvoiceTemplateAccountingCredit => "INVOICE_TEMPLATE_ACCOUNTING_CREDIT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INVOICE_TEMPLATE_ACCOUNTING_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
"INVOICE_TEMPLATE_ACCOUNTING_NAME" => {
Some(Self::InvoiceTemplateAccountingName)
}
"INVOICE_TEMPLATE_ACCOUNTING_TAX_POINT_DATE" => {
Some(Self::InvoiceTemplateAccountingTaxPointDate)
}
"INVOICE_TEMPLATE_ACCOUNTING_ACCOUNT" => {
Some(Self::InvoiceTemplateAccountingAccount)
}
"INVOICE_TEMPLATE_ACCOUNTING_DEBIT" => {
Some(Self::InvoiceTemplateAccountingDebit)
}
"INVOICE_TEMPLATE_ACCOUNTING_CREDIT" => {
Some(Self::InvoiceTemplateAccountingCredit)
}
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MoneyRounding {
None = 0,
HalfUp = 1,
}
impl MoneyRounding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "MONEY_ROUNDING_NONE",
Self::HalfUp => "MONEY_ROUNDING_HALF_UP",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MONEY_ROUNDING_NONE" => Some(Self::None),
"MONEY_ROUNDING_HALF_UP" => Some(Self::HalfUp),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BooleanLedgerOperator {
Unspecified = 0,
Any = 1,
All = 2,
}
impl BooleanLedgerOperator {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "BOOLEAN_LEDGER_OPERATOR_UNSPECIFIED",
Self::Any => "BOOLEAN_LEDGER_OPERATOR_ANY",
Self::All => "BOOLEAN_LEDGER_OPERATOR_ALL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BOOLEAN_LEDGER_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
"BOOLEAN_LEDGER_OPERATOR_ANY" => Some(Self::Any),
"BOOLEAN_LEDGER_OPERATOR_ALL" => Some(Self::All),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AliasChangeKind {
Unspecified = 0,
Column = 1,
Option = 2,
}
impl AliasChangeKind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ALIAS_CHANGE_KIND_UNSPECIFIED",
Self::Column => "ALIAS_CHANGE_KIND_COLUMN",
Self::Option => "ALIAS_CHANGE_KIND_OPTION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALIAS_CHANGE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"ALIAS_CHANGE_KIND_COLUMN" => Some(Self::Column),
"ALIAS_CHANGE_KIND_OPTION" => Some(Self::Option),
_ => None,
}
}
}
/// How a column type is spelled in ColumnDefinition.field_type.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ColumnTypeSpelling {
/// The name is the whole spelling: "text", "money", "gtin_13".
Bare = 0,
/// The name takes the name of another table in the same profile:
/// "link(adresar)". The column holds that table's id, and the server creates
/// the foreign key and its index. A picker offers the profile's other tables
/// as the argument.
Link = 2,
}
impl ColumnTypeSpelling {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Bare => "COLUMN_TYPE_SPELLING_BARE",
Self::Link => "COLUMN_TYPE_SPELLING_LINK",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COLUMN_TYPE_SPELLING_BARE" => Some(Self::Bare),
"COLUMN_TYPE_SPELLING_LINK" => Some(Self::Link),
_ => None,
}
}
}
/// Generated client implementations.
pub mod table_definition_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// The TableDefinition service manages the entire lifecycle of user-defined
/// tables (stored as both metadata and physical PostgreSQL tables) inside
/// logical "profiles" (schemas). Each table has stored structure, links, and
/// validation rules.
#[derive(Debug, Clone)]
pub struct TableDefinitionClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TableDefinitionClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> TableDefinitionClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TableDefinitionClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TableDefinitionClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Creates a new table (and schema if missing) with system columns,
/// linked-table foreign keys, user-defined columns, and optional indexes.
/// Also inserts metadata and default validation rules. Entirely transactional.
pub async fn post_table_definition(
&mut self,
request: impl tonic::IntoRequest<super::PostTableDefinitionRequest>,
) -> std::result::Result<
tonic::Response<super::TableDefinitionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/PostTableDefinition",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"PostTableDefinition",
),
);
self.inner.unary(req, path, codec).await
}
/// Explicitly creates the optional administrator-managed exchange-rate table
/// in an existing profile. The server owns its core shape and constraints.
pub async fn create_custom_exchange_rates_table(
&mut self,
request: impl tonic::IntoRequest<
super::CreateCustomExchangeRatesTableRequest,
>,
) -> std::result::Result<
tonic::Response<super::CreateCustomExchangeRatesTableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/CreateCustomExchangeRatesTable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"CreateCustomExchangeRatesTable",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a regular user-table bundle from the restricted komp_ac_fields
/// contract embedded in a Typst invoice template. This is invoked explicitly
/// by the user; templates do not provision tables merely by existing.
pub async fn create_invoice_template_table(
&mut self,
request: impl tonic::IntoRequest<super::CreateInvoiceTemplateTableRequest>,
) -> std::result::Result<
tonic::Response<super::CreateInvoiceTemplateTableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/CreateInvoiceTemplateTable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"CreateInvoiceTemplateTable",
),
);
self.inner.unary(req, path, codec).await
}
/// Applies the administrator-reviewed, explicitly typed table bundle and
/// exact komp_ac_fields bindings for an imported Typst template.
pub async fn apply_invoice_template_table(
&mut self,
request: impl tonic::IntoRequest<super::ApplyInvoiceTemplateTableRequest>,
) -> std::result::Result<
tonic::Response<super::CreateInvoiceTemplateTableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/ApplyInvoiceTemplateTable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"ApplyInvoiceTemplateTable",
),
);
self.inner.unary(req, path, codec).await
}
/// Appends new user-defined columns to an existing table.
/// Existing columns, links, and table logic are never changed by this call.
pub async fn add_table_columns(
&mut self,
request: impl tonic::IntoRequest<super::AddTableColumnsRequest>,
) -> std::result::Result<
tonic::Response<super::TableDefinitionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/AddTableColumns",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"AddTableColumns",
),
);
self.inner.unary(req, path, codec).await
}
/// Atomically removes selected columns and appends new columns to an empty
/// dynamic table. Column identities come from GetProfileDetails. The call is
/// rejected after any row, including a soft-deleted row, has been stored.
pub async fn put_table_definition(
&mut self,
request: impl tonic::IntoRequest<super::PutTableDefinitionRequest>,
) -> std::result::Result<
tonic::Response<super::PutTableDefinitionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/PutTableDefinition",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"PutTableDefinition",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists all profiles (schemas) and their tables with declared dependencies.
/// This provides a tree-like overview of table relationships.
pub async fn get_profile_tree(
&mut self,
request: impl tonic::IntoRequest<super::super::common::Empty>,
) -> std::result::Result<
tonic::Response<super::ProfileTreeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/GetProfileTree",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"GetProfileTree",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists the tables visible in one data-entry scope. When profile_name is
/// absent, only global tables are returned.
pub async fn get_table_catalog(
&mut self,
request: impl tonic::IntoRequest<super::GetTableCatalogRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableCatalogResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/GetTableCatalog",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"GetTableCatalog",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists every column type a table may declare, along with the SQL type it
/// maps to. Pure data retrieval - no business logic.
pub async fn list_column_types(
&mut self,
request: impl tonic::IntoRequest<super::super::common::Empty>,
) -> std::result::Result<
tonic::Response<super::ListColumnTypesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/ListColumnTypes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"ListColumnTypes",
),
);
self.inner.unary(req, path, codec).await
}
/// Fetches all tables with their columns and scripts for a specific profile.
/// Pure data retrieval - no business logic.
pub async fn get_profile_details(
&mut self,
request: impl tonic::IntoRequest<super::GetProfileDetailsRequest>,
) -> std::result::Result<
tonic::Response<super::GetProfileDetailsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/GetProfileDetails",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"GetProfileDetails",
),
);
self.inner.unary(req, path, codec).await
}
/// Copies one complete profile into a new profile without copying table data.
pub async fn copy_profile(
&mut self,
request: impl tonic::IntoRequest<super::CopyProfileRequest>,
) -> std::result::Result<
tonic::Response<super::CopyProfileResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/CopyProfile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"CopyProfile",
),
);
self.inner.unary(req, path, codec).await
}
/// Serializes selected table structure and every required structural dependency.
/// Dynamic table rows and deployment-local security state are never included.
pub async fn export_profile_blueprint(
&mut self,
request: impl tonic::IntoRequest<super::ExportProfileBlueprintRequest>,
) -> std::result::Result<
tonic::Response<super::ExportProfileBlueprintResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/ExportProfileBlueprint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"ExportProfileBlueprint",
),
);
self.inner.unary(req, path, codec).await
}
/// Reconciles a portable blueprint against a destination profile without writing.
pub async fn plan_profile_blueprint_import(
&mut self,
request: impl tonic::IntoRequest<super::PlanProfileBlueprintImportRequest>,
) -> std::result::Result<
tonic::Response<super::PlanProfileBlueprintImportResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/PlanProfileBlueprintImport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"PlanProfileBlueprintImport",
),
);
self.inner.unary(req, path, codec).await
}
/// Applies a previously reviewed blueprint plan atomically. The plan hash protects
/// against both a changed package and destination drift between preview and apply.
pub async fn import_profile_blueprint(
&mut self,
request: impl tonic::IntoRequest<super::ImportProfileBlueprintRequest>,
) -> std::result::Result<
tonic::Response<super::ImportProfileBlueprintResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/ImportProfileBlueprint",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"ImportProfileBlueprint",
),
);
self.inner.unary(req, path, codec).await
}
/// Returns the unified append-only history for column and option aliases.
pub async fn get_alias_change_history(
&mut self,
request: impl tonic::IntoRequest<super::GetAliasChangeHistoryRequest>,
) -> std::result::Result<
tonic::Response<super::GetAliasChangeHistoryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/GetAliasChangeHistory",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"GetAliasChangeHistory",
),
);
self.inner.unary(req, path, codec).await
}
/// Atomically replaces the aliases and presentation order of a table's columns.
/// Physical column names and identities remain unchanged.
pub async fn set_column_presentation(
&mut self,
request: impl tonic::IntoRequest<super::SetColumnPresentationRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnPresentationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetColumnPresentation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetColumnPresentation",
),
);
self.inner.unary(req, path, codec).await
}
/// Replaces the columns whose values identify rows to users. This is
/// presentation metadata and may be changed after rows have been stored.
pub async fn set_row_display_columns(
&mut self,
request: impl tonic::IntoRequest<super::SetRowDisplayColumnsRequest>,
) -> std::result::Result<
tonic::Response<super::SetRowDisplayColumnsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetRowDisplayColumns",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetRowDisplayColumns",
),
);
self.inner.unary(req, path, codec).await
}
/// Replaces the user-managed indexes of an existing dynamic table. Physical
/// indexes are created or dropped even when rows have already been stored.
pub async fn set_table_indexes(
&mut self,
request: impl tonic::IntoRequest<super::SetTableIndexesRequest>,
) -> std::result::Result<
tonic::Response<super::SetTableIndexesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetTableIndexes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetTableIndexes",
),
);
self.inner.unary(req, path, codec).await
}
/// Changes whether one existing column is required. Enabling the requirement
/// is rejected while an active row has no value for the column.
pub async fn set_column_required(
&mut self,
request: impl tonic::IntoRequest<super::SetColumnRequiredRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnRequiredResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetColumnRequired",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetColumnRequired",
),
);
self.inner.unary(req, path, codec).await
}
/// Replaces the optional user-visible aliases for a fixed-option column.
/// Stored values remain stable machine values and scripts never depend on labels.
pub async fn set_column_option_aliases(
&mut self,
request: impl tonic::IntoRequest<super::SetColumnOptionAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnOptionAliasesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetColumnOptionAliases",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetColumnOptionAliases",
),
);
self.inner.unary(req, path, codec).await
}
/// Shows or hides one column in bundled data-entry forms. This is presentation
/// metadata only: hidden columns remain available to data APIs, scripts and
/// backend calculations.
pub async fn set_column_form_visibility(
&mut self,
request: impl tonic::IntoRequest<super::SetColumnFormVisibilityRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnFormVisibilityResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/SetColumnFormVisibility",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"SetColumnFormVisibility",
),
);
self.inner.unary(req, path, codec).await
}
/// Drops a table and its metadata, then deletes the profile if it becomes empty.
pub async fn delete_table(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTableRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteTableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/DeleteTable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"DeleteTable",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes an entire profile only when none of its user or backend-managed
/// tables, audit stores, document stores, or accounting stores contain data.
pub async fn delete_profile(
&mut self,
request: impl tonic::IntoRequest<super::DeleteProfileRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteProfileResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/komp_ac.table_definition.TableDefinition/DeleteProfile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"komp_ac.table_definition.TableDefinition",
"DeleteProfile",
),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod table_definition_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with TableDefinitionServer.
#[async_trait]
pub trait TableDefinition: std::marker::Send + std::marker::Sync + 'static {
/// Creates a new table (and schema if missing) with system columns,
/// linked-table foreign keys, user-defined columns, and optional indexes.
/// Also inserts metadata and default validation rules. Entirely transactional.
async fn post_table_definition(
&self,
request: tonic::Request<super::PostTableDefinitionRequest>,
) -> std::result::Result<
tonic::Response<super::TableDefinitionResponse>,
tonic::Status,
>;
/// Explicitly creates the optional administrator-managed exchange-rate table
/// in an existing profile. The server owns its core shape and constraints.
async fn create_custom_exchange_rates_table(
&self,
request: tonic::Request<super::CreateCustomExchangeRatesTableRequest>,
) -> std::result::Result<
tonic::Response<super::CreateCustomExchangeRatesTableResponse>,
tonic::Status,
>;
/// Creates a regular user-table bundle from the restricted komp_ac_fields
/// contract embedded in a Typst invoice template. This is invoked explicitly
/// by the user; templates do not provision tables merely by existing.
async fn create_invoice_template_table(
&self,
request: tonic::Request<super::CreateInvoiceTemplateTableRequest>,
) -> std::result::Result<
tonic::Response<super::CreateInvoiceTemplateTableResponse>,
tonic::Status,
>;
/// Applies the administrator-reviewed, explicitly typed table bundle and
/// exact komp_ac_fields bindings for an imported Typst template.
async fn apply_invoice_template_table(
&self,
request: tonic::Request<super::ApplyInvoiceTemplateTableRequest>,
) -> std::result::Result<
tonic::Response<super::CreateInvoiceTemplateTableResponse>,
tonic::Status,
>;
/// Appends new user-defined columns to an existing table.
/// Existing columns, links, and table logic are never changed by this call.
async fn add_table_columns(
&self,
request: tonic::Request<super::AddTableColumnsRequest>,
) -> std::result::Result<
tonic::Response<super::TableDefinitionResponse>,
tonic::Status,
>;
/// Atomically removes selected columns and appends new columns to an empty
/// dynamic table. Column identities come from GetProfileDetails. The call is
/// rejected after any row, including a soft-deleted row, has been stored.
async fn put_table_definition(
&self,
request: tonic::Request<super::PutTableDefinitionRequest>,
) -> std::result::Result<
tonic::Response<super::PutTableDefinitionResponse>,
tonic::Status,
>;
/// Lists all profiles (schemas) and their tables with declared dependencies.
/// This provides a tree-like overview of table relationships.
async fn get_profile_tree(
&self,
request: tonic::Request<super::super::common::Empty>,
) -> std::result::Result<
tonic::Response<super::ProfileTreeResponse>,
tonic::Status,
>;
/// Lists the tables visible in one data-entry scope. When profile_name is
/// absent, only global tables are returned.
async fn get_table_catalog(
&self,
request: tonic::Request<super::GetTableCatalogRequest>,
) -> std::result::Result<
tonic::Response<super::GetTableCatalogResponse>,
tonic::Status,
>;
/// Lists every column type a table may declare, along with the SQL type it
/// maps to. Pure data retrieval - no business logic.
async fn list_column_types(
&self,
request: tonic::Request<super::super::common::Empty>,
) -> std::result::Result<
tonic::Response<super::ListColumnTypesResponse>,
tonic::Status,
>;
/// Fetches all tables with their columns and scripts for a specific profile.
/// Pure data retrieval - no business logic.
async fn get_profile_details(
&self,
request: tonic::Request<super::GetProfileDetailsRequest>,
) -> std::result::Result<
tonic::Response<super::GetProfileDetailsResponse>,
tonic::Status,
>;
/// Copies one complete profile into a new profile without copying table data.
async fn copy_profile(
&self,
request: tonic::Request<super::CopyProfileRequest>,
) -> std::result::Result<
tonic::Response<super::CopyProfileResponse>,
tonic::Status,
>;
/// Serializes selected table structure and every required structural dependency.
/// Dynamic table rows and deployment-local security state are never included.
async fn export_profile_blueprint(
&self,
request: tonic::Request<super::ExportProfileBlueprintRequest>,
) -> std::result::Result<
tonic::Response<super::ExportProfileBlueprintResponse>,
tonic::Status,
>;
/// Reconciles a portable blueprint against a destination profile without writing.
async fn plan_profile_blueprint_import(
&self,
request: tonic::Request<super::PlanProfileBlueprintImportRequest>,
) -> std::result::Result<
tonic::Response<super::PlanProfileBlueprintImportResponse>,
tonic::Status,
>;
/// Applies a previously reviewed blueprint plan atomically. The plan hash protects
/// against both a changed package and destination drift between preview and apply.
async fn import_profile_blueprint(
&self,
request: tonic::Request<super::ImportProfileBlueprintRequest>,
) -> std::result::Result<
tonic::Response<super::ImportProfileBlueprintResponse>,
tonic::Status,
>;
/// Returns the unified append-only history for column and option aliases.
async fn get_alias_change_history(
&self,
request: tonic::Request<super::GetAliasChangeHistoryRequest>,
) -> std::result::Result<
tonic::Response<super::GetAliasChangeHistoryResponse>,
tonic::Status,
>;
/// Atomically replaces the aliases and presentation order of a table's columns.
/// Physical column names and identities remain unchanged.
async fn set_column_presentation(
&self,
request: tonic::Request<super::SetColumnPresentationRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnPresentationResponse>,
tonic::Status,
>;
/// Replaces the columns whose values identify rows to users. This is
/// presentation metadata and may be changed after rows have been stored.
async fn set_row_display_columns(
&self,
request: tonic::Request<super::SetRowDisplayColumnsRequest>,
) -> std::result::Result<
tonic::Response<super::SetRowDisplayColumnsResponse>,
tonic::Status,
>;
/// Replaces the user-managed indexes of an existing dynamic table. Physical
/// indexes are created or dropped even when rows have already been stored.
async fn set_table_indexes(
&self,
request: tonic::Request<super::SetTableIndexesRequest>,
) -> std::result::Result<
tonic::Response<super::SetTableIndexesResponse>,
tonic::Status,
>;
/// Changes whether one existing column is required. Enabling the requirement
/// is rejected while an active row has no value for the column.
async fn set_column_required(
&self,
request: tonic::Request<super::SetColumnRequiredRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnRequiredResponse>,
tonic::Status,
>;
/// Replaces the optional user-visible aliases for a fixed-option column.
/// Stored values remain stable machine values and scripts never depend on labels.
async fn set_column_option_aliases(
&self,
request: tonic::Request<super::SetColumnOptionAliasesRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnOptionAliasesResponse>,
tonic::Status,
>;
/// Shows or hides one column in bundled data-entry forms. This is presentation
/// metadata only: hidden columns remain available to data APIs, scripts and
/// backend calculations.
async fn set_column_form_visibility(
&self,
request: tonic::Request<super::SetColumnFormVisibilityRequest>,
) -> std::result::Result<
tonic::Response<super::SetColumnFormVisibilityResponse>,
tonic::Status,
>;
/// Drops a table and its metadata, then deletes the profile if it becomes empty.
async fn delete_table(
&self,
request: tonic::Request<super::DeleteTableRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteTableResponse>,
tonic::Status,
>;
/// Deletes an entire profile only when none of its user or backend-managed
/// tables, audit stores, document stores, or accounting stores contain data.
async fn delete_profile(
&self,
request: tonic::Request<super::DeleteProfileRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteProfileResponse>,
tonic::Status,
>;
}
/// The TableDefinition service manages the entire lifecycle of user-defined
/// tables (stored as both metadata and physical PostgreSQL tables) inside
/// logical "profiles" (schemas). Each table has stored structure, links, and
/// validation rules.
#[derive(Debug)]
pub struct TableDefinitionServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> TableDefinitionServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for TableDefinitionServer<T>
where
T: TableDefinition,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/komp_ac.table_definition.TableDefinition/PostTableDefinition" => {
#[allow(non_camel_case_types)]
struct PostTableDefinitionSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::PostTableDefinitionRequest>
for PostTableDefinitionSvc<T> {
type Response = super::TableDefinitionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PostTableDefinitionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::post_table_definition(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PostTableDefinitionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/CreateCustomExchangeRatesTable" => {
#[allow(non_camel_case_types)]
struct CreateCustomExchangeRatesTableSvc<T: TableDefinition>(
pub Arc<T>,
);
impl<
T: TableDefinition,
> tonic::server::UnaryService<
super::CreateCustomExchangeRatesTableRequest,
> for CreateCustomExchangeRatesTableSvc<T> {
type Response = super::CreateCustomExchangeRatesTableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::CreateCustomExchangeRatesTableRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::create_custom_exchange_rates_table(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateCustomExchangeRatesTableSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/CreateInvoiceTemplateTable" => {
#[allow(non_camel_case_types)]
struct CreateInvoiceTemplateTableSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<
super::CreateInvoiceTemplateTableRequest,
> for CreateInvoiceTemplateTableSvc<T> {
type Response = super::CreateInvoiceTemplateTableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::CreateInvoiceTemplateTableRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::create_invoice_template_table(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateInvoiceTemplateTableSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/ApplyInvoiceTemplateTable" => {
#[allow(non_camel_case_types)]
struct ApplyInvoiceTemplateTableSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<
super::ApplyInvoiceTemplateTableRequest,
> for ApplyInvoiceTemplateTableSvc<T> {
type Response = super::CreateInvoiceTemplateTableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::ApplyInvoiceTemplateTableRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::apply_invoice_template_table(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ApplyInvoiceTemplateTableSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/AddTableColumns" => {
#[allow(non_camel_case_types)]
struct AddTableColumnsSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::AddTableColumnsRequest>
for AddTableColumnsSvc<T> {
type Response = super::TableDefinitionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AddTableColumnsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::add_table_columns(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = AddTableColumnsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/PutTableDefinition" => {
#[allow(non_camel_case_types)]
struct PutTableDefinitionSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::PutTableDefinitionRequest>
for PutTableDefinitionSvc<T> {
type Response = super::PutTableDefinitionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PutTableDefinitionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::put_table_definition(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PutTableDefinitionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/GetProfileTree" => {
#[allow(non_camel_case_types)]
struct GetProfileTreeSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::super::common::Empty>
for GetProfileTreeSvc<T> {
type Response = super::ProfileTreeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::super::common::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::get_profile_tree(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetProfileTreeSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/GetTableCatalog" => {
#[allow(non_camel_case_types)]
struct GetTableCatalogSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::GetTableCatalogRequest>
for GetTableCatalogSvc<T> {
type Response = super::GetTableCatalogResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetTableCatalogRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::get_table_catalog(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetTableCatalogSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/ListColumnTypes" => {
#[allow(non_camel_case_types)]
struct ListColumnTypesSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::super::common::Empty>
for ListColumnTypesSvc<T> {
type Response = super::ListColumnTypesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::super::common::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::list_column_types(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListColumnTypesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/GetProfileDetails" => {
#[allow(non_camel_case_types)]
struct GetProfileDetailsSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::GetProfileDetailsRequest>
for GetProfileDetailsSvc<T> {
type Response = super::GetProfileDetailsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetProfileDetailsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::get_profile_details(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetProfileDetailsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/CopyProfile" => {
#[allow(non_camel_case_types)]
struct CopyProfileSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::CopyProfileRequest>
for CopyProfileSvc<T> {
type Response = super::CopyProfileResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CopyProfileRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::copy_profile(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CopyProfileSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/ExportProfileBlueprint" => {
#[allow(non_camel_case_types)]
struct ExportProfileBlueprintSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::ExportProfileBlueprintRequest>
for ExportProfileBlueprintSvc<T> {
type Response = super::ExportProfileBlueprintResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExportProfileBlueprintRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::export_profile_blueprint(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExportProfileBlueprintSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/PlanProfileBlueprintImport" => {
#[allow(non_camel_case_types)]
struct PlanProfileBlueprintImportSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<
super::PlanProfileBlueprintImportRequest,
> for PlanProfileBlueprintImportSvc<T> {
type Response = super::PlanProfileBlueprintImportResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::PlanProfileBlueprintImportRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::plan_profile_blueprint_import(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PlanProfileBlueprintImportSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/ImportProfileBlueprint" => {
#[allow(non_camel_case_types)]
struct ImportProfileBlueprintSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::ImportProfileBlueprintRequest>
for ImportProfileBlueprintSvc<T> {
type Response = super::ImportProfileBlueprintResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ImportProfileBlueprintRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::import_profile_blueprint(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ImportProfileBlueprintSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/GetAliasChangeHistory" => {
#[allow(non_camel_case_types)]
struct GetAliasChangeHistorySvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::GetAliasChangeHistoryRequest>
for GetAliasChangeHistorySvc<T> {
type Response = super::GetAliasChangeHistoryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetAliasChangeHistoryRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::get_alias_change_history(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetAliasChangeHistorySvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetColumnPresentation" => {
#[allow(non_camel_case_types)]
struct SetColumnPresentationSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetColumnPresentationRequest>
for SetColumnPresentationSvc<T> {
type Response = super::SetColumnPresentationResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetColumnPresentationRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_column_presentation(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetColumnPresentationSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetRowDisplayColumns" => {
#[allow(non_camel_case_types)]
struct SetRowDisplayColumnsSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetRowDisplayColumnsRequest>
for SetRowDisplayColumnsSvc<T> {
type Response = super::SetRowDisplayColumnsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetRowDisplayColumnsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_row_display_columns(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetRowDisplayColumnsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetTableIndexes" => {
#[allow(non_camel_case_types)]
struct SetTableIndexesSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetTableIndexesRequest>
for SetTableIndexesSvc<T> {
type Response = super::SetTableIndexesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetTableIndexesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_table_indexes(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetTableIndexesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetColumnRequired" => {
#[allow(non_camel_case_types)]
struct SetColumnRequiredSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetColumnRequiredRequest>
for SetColumnRequiredSvc<T> {
type Response = super::SetColumnRequiredResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetColumnRequiredRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_column_required(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetColumnRequiredSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetColumnOptionAliases" => {
#[allow(non_camel_case_types)]
struct SetColumnOptionAliasesSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetColumnOptionAliasesRequest>
for SetColumnOptionAliasesSvc<T> {
type Response = super::SetColumnOptionAliasesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetColumnOptionAliasesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_column_option_aliases(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetColumnOptionAliasesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/SetColumnFormVisibility" => {
#[allow(non_camel_case_types)]
struct SetColumnFormVisibilitySvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::SetColumnFormVisibilityRequest>
for SetColumnFormVisibilitySvc<T> {
type Response = super::SetColumnFormVisibilityResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::SetColumnFormVisibilityRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::set_column_form_visibility(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SetColumnFormVisibilitySvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/DeleteTable" => {
#[allow(non_camel_case_types)]
struct DeleteTableSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::DeleteTableRequest>
for DeleteTableSvc<T> {
type Response = super::DeleteTableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteTableRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::delete_table(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteTableSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/komp_ac.table_definition.TableDefinition/DeleteProfile" => {
#[allow(non_camel_case_types)]
struct DeleteProfileSvc<T: TableDefinition>(pub Arc<T>);
impl<
T: TableDefinition,
> tonic::server::UnaryService<super::DeleteProfileRequest>
for DeleteProfileSvc<T> {
type Response = super::DeleteProfileResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteProfileRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as TableDefinition>::delete_profile(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteProfileSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for TableDefinitionServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "komp_ac.table_definition.TableDefinition";
impl<T> tonic::server::NamedService for TableDefinitionServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}