diff --git a/.github/scripts/raise-pull-request.sh b/.github/scripts/raise-pull-request.sh index 4f980fd..82af95e 100755 --- a/.github/scripts/raise-pull-request.sh +++ b/.github/scripts/raise-pull-request.sh @@ -18,25 +18,24 @@ then git checkout -b $branch_name export SCHEMA=${PWD}/../$GITHUB_SCHEMA_REPO/$SCHEMA_DIRECTORY - docker compose -f docker-compose.generate.yml up - + docker compose -f docker-compose.generate.yml up --build + git status - if git diff-index --quiet HEAD -- - then - echo "No changes to commit." - else + if [[ -n $(git status --porcelain) ]]; then + echo "There are changes" git add -A . git commit -m "feat($GITHUB_SCHEMA_REPO-sdks): Auto-commit from PR #$pr_number of $GITHUB_SCHEMA_REPO" echo "Committed local changes" - git push origin $branch_name echo "Pushed all the changes to the remote location" + else + echo "No changes to commit." fi - export GITHUB_USER=$USER export GITHUB_TOKEN=$USER_API_KEY hub pull-request -m "feat($GITHUB_SCHEMA_REPO-sdks): Updating SDKs for the changes in $GITHUB_SCHEMA_REPO #$pr_number PR" -h $branch_name + else echo "Branch($branch_name) exists. Updating it with new changes." @@ -44,18 +43,17 @@ else git pull export SCHEMA=${PWD}/../$GITHUB_SCHEMA_REPO/$SCHEMA_DIRECTORY - docker compose -f docker-compose.generate.yml up + docker compose -f docker-compose.generate.yml up --build git status - if git diff-index --quiet HEAD -- - then - echo "No local changes to commit." - else + if [[ -n $(git status --porcelain) ]]; then + echo "There are changes" git add -A . git commit -m "feat($GITHUB_SCHEMA_REPO-sdks): Auto-commit from PR #$pr_number of $GITHUB_SCHEMA_REPO" echo "Committed local changes" - git push origin $branch_name echo "Pushed all the changes to the remote location" + else + echo "No changes to commit." fi fi diff --git a/.github/workflows/generate-sdks.yml b/.github/workflows/generate-sdks.yml index 44253fb..253c74f 100755 --- a/.github/workflows/generate-sdks.yml +++ b/.github/workflows/generate-sdks.yml @@ -42,14 +42,17 @@ jobs: fi - name: Check out ${{ env.GITHUB_SCHEMA_SDKS_REPO }} repository - if: steps.schema-change-check.outputs.is-schema-changed == 'true' + if: steps.schema-change-check.outputs.is-schema-changed == 'true' || contains(github.event.pull_request.labels.*.name, 'generate-sdk-pr') uses: actions/checkout@v2 with: repository: ${{ env.GITHUB_SCHEMA_SDKS_REPO }} path: sdks fetch-depth: 0 token: ${{ env.USER_API_KEY }} - + - name: Raise or update SDKs pull request - if: steps.schema-change-check.outputs.is-schema-changed == 'true' - run: ${{ github.event.repository.name }}/.github/scripts/raise-pull-request.sh + if: steps.schema-change-check.outputs.is-schema-changed == 'true' || contains(github.event.pull_request.labels.*.name, 'generate-sdk-pr') + run: | + sudo apt-get -y install git + ${{ github.event.repository.name }}/.github/scripts/raise-pull-request.sh + diff --git a/proto/v1/fds/protobuf/stach/MetadataItem.proto b/proto/v1/fds/protobuf/stach/MetadataItem.proto new file mode 100644 index 0000000..ee4f5c4 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/MetadataItem.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package factset.protobuf.stach; + +option csharp_namespace = "FactSet.Protobuf.Stach"; +option java_package = "com.factset.protobuf.stach"; +option java_outer_classname = "MetadataItemProto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +import "fds/protobuf/stach/table/Reference.proto"; + +message MetadataItem { + reserved 104, 105, 200; + reserved "uint32_value", "uint64_value", "any_value"; + + string name = 1; + oneof data { + double double_value = 100; + float float_value = 101; + int32 int32_value = 102; + int64 int64_value = 103; + bool bool_value = 106; + string string_value = 107; + google.protobuf.Duration duration_value = 108; + google.protobuf.Timestamp timestamp_value = 109; + + factset.protobuf.stach.table.Reference ref_value = 201; + } +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/Package.proto b/proto/v1/fds/protobuf/stach/Package.proto new file mode 100644 index 0000000..6db6f52 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/Package.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package factset.protobuf.stach; + + +option csharp_namespace = "FactSet.Protobuf.Stach"; +option java_package = "com.factset.protobuf.stach"; +option java_outer_classname = "PackageProto"; + +import "fds/protobuf/stach/table/Table.proto"; + +message Package { + string version = 1; + repeated string primary_table_ids = 2; + map tables = 3; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/DataType.proto b/proto/v1/fds/protobuf/stach/table/DataType.proto new file mode 100644 index 0000000..4e66892 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/DataType.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "DataTypeProto"; + +enum DataType { + UNKNOWN_DATATYPE = 0; + DOUBLE = 1; + FLOAT = 2; + INT32 = 3; + INT64 = 4; + //UINT32 = 5; + //UINT64 = 6; + BOOL = 7; + STRING = 8; + DURATION = 9; + TIMESTAMP = 10; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/HorizontalAlignment.proto b/proto/v1/fds/protobuf/stach/table/HorizontalAlignment.proto new file mode 100644 index 0000000..ee053c9 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/HorizontalAlignment.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "HorizontalAlignmentProto"; + +enum HorizontalAlignment { + UNKNOWN_HALIGN = 0; + LEFT = 1; + CENTER = 2; + RIGHT = 3; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/ListOfMetadata.proto b/proto/v1/fds/protobuf/stach/table/ListOfMetadata.proto new file mode 100644 index 0000000..09c0ecb --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/ListOfMetadata.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "ListOfMetadataProto"; + +message ListOfMetadata { + repeated string ids = 1; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/MetadataCollection.proto b/proto/v1/fds/protobuf/stach/table/MetadataCollection.proto new file mode 100644 index 0000000..f6b188c --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/MetadataCollection.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "MetadataCollectionProto"; + +import "fds/protobuf/stach/MetadataItem.proto"; +import "fds/protobuf/stach/table/MetadataLocations.proto"; + +message MetadataCollection { + map items = 1; + MetadataLocations locations = 2; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/MetadataLocations.proto b/proto/v1/fds/protobuf/stach/table/MetadataLocations.proto new file mode 100644 index 0000000..cf9ba5f --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/MetadataLocations.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "MetadataLocationsProto"; + +import "fds/protobuf/stach/table/ListOfMetadata.proto"; + +message MetadataLocations { + repeated string table = 1; + map columns = 2; + map rows = 3; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/Reference.proto b/proto/v1/fds/protobuf/stach/table/Reference.proto new file mode 100644 index 0000000..b0d3dda --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/Reference.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "ReferenceProto"; + +import "fds/protobuf/stach/table/ReferenceType.proto"; + +message Reference { + ReferenceType reference_type = 1; + string table_id = 2; + string column_id = 3; + string row_id = 4; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/ReferenceFilterMode.proto b/proto/v1/fds/protobuf/stach/table/ReferenceFilterMode.proto new file mode 100644 index 0000000..2b611e4 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/ReferenceFilterMode.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "ReferenceFilterModeProto"; + +enum ReferenceFilterMode { + INCLUDE = 0; + EXCLUDE = 1; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/ReferenceType.proto b/proto/v1/fds/protobuf/stach/table/ReferenceType.proto new file mode 100644 index 0000000..8c972ba --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/ReferenceType.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "ReferenceTypeProto"; + +enum ReferenceType { + UNKNOWN_REFERENCE_TYPE = 0; + TABLE = 1; + COLUMN = 2; + ROW = 3; + CELL = 4; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/SeriesData.proto b/proto/v1/fds/protobuf/stach/table/SeriesData.proto new file mode 100644 index 0000000..14c929f --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/SeriesData.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "SeriesDataProto"; + +import "fds/protobuf/stach/table/Wrappers.proto"; + +message SeriesData { + reserved 104, 105; + reserved "uint32_array", "uint64_array"; + + map ranges = 1; + oneof data { + DoubleArray double_array = 100; + FloatArray float_array = 101; + Int32Array int32_array = 102; + Int64Array int64_array = 103; + BoolArray bool_array = 106; + StringArray string_array = 107; + DurationArray duration_array = 108; + TimestampArray timestamp_array = 109; + } +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/SeriesDefinition.proto b/proto/v1/fds/protobuf/stach/table/SeriesDefinition.proto new file mode 100644 index 0000000..9d0669b --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/SeriesDefinition.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "SeriesDefinitionProto"; + +import "fds/protobuf/stach/table/DataType.proto"; +import "fds/protobuf/stach/table/SeriesFormat.proto"; + +message SeriesDefinition { + reserved 10; + reserved "header_index"; + + string id = 1; + string name = 2; + string description = 3; + DataType type = 4; + bool is_dimension = 5; + bool is_hidden = 6; + string next_sibling_id = 7; + string parent_id = 8; + string header_id = 9; + SeriesFormat format = 11; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/SeriesFormat.proto b/proto/v1/fds/protobuf/stach/table/SeriesFormat.proto new file mode 100644 index 0000000..bac0bb2 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/SeriesFormat.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "SeriesFormatProto"; + +import "fds/protobuf/stach/table/HorizontalAlignment.proto"; +import "fds/protobuf/stach/table/VerticalAlignment.proto"; + +message SeriesFormat { + string format = 1; + string null_format = 2; + HorizontalAlignment halign = 3; + VerticalAlignment valign = 4; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/Table.proto b/proto/v1/fds/protobuf/stach/table/Table.proto new file mode 100644 index 0000000..1444819 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/Table.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "TableProto"; + +import "fds/protobuf/stach/table/TableData.proto"; +import "fds/protobuf/stach/table/TableDefinition.proto"; + +message Table { + TableDefinition definition = 1; + TableData data = 2; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/TableData.proto b/proto/v1/fds/protobuf/stach/table/TableData.proto new file mode 100644 index 0000000..fb6beb2 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/TableData.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "TableDataProto"; + +import "fds/protobuf/stach/table/MetadataCollection.proto"; +import "fds/protobuf/stach/table/SeriesDefinition.proto"; +import "fds/protobuf/stach/table/SeriesData.proto"; + +message TableData { + repeated SeriesDefinition rows = 1; + map columns = 2; + MetadataCollection metadata = 3; +} diff --git a/proto/v1/fds/protobuf/stach/table/TableDefinition.proto b/proto/v1/fds/protobuf/stach/table/TableDefinition.proto new file mode 100644 index 0000000..c6a2b3f --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/TableDefinition.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "TableDefinitionProto"; + +import "fds/protobuf/stach/table/SeriesDefinition.proto"; + +message TableDefinition { + string header_table_id = 1; + repeated SeriesDefinition columns = 2; +} + diff --git a/proto/v1/fds/protobuf/stach/table/VerticalAlignment.proto b/proto/v1/fds/protobuf/stach/table/VerticalAlignment.proto new file mode 100644 index 0000000..40ce589 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/VerticalAlignment.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "VerticalAlignmentProto"; + +enum VerticalAlignment { + UNKNOWN_VALIGN = 0; + TOP = 1; + MIDDLE = 2; + BOTTOM = 3; +} \ No newline at end of file diff --git a/proto/v1/fds/protobuf/stach/table/Wrappers.proto b/proto/v1/fds/protobuf/stach/table/Wrappers.proto new file mode 100644 index 0000000..89974c0 --- /dev/null +++ b/proto/v1/fds/protobuf/stach/table/Wrappers.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package factset.protobuf.stach.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.Table"; +option java_package = "com.factset.protobuf.stach.table"; +option java_outer_classname = "WrappersProto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +message DoubleArray { + repeated double values = 1; +} +message FloatArray { + repeated float values = 1; +} +message Int32Array { + repeated int32 values = 1; +} +message Int64Array { + repeated int64 values = 1; +} +message BoolArray { + repeated bool values = 1; +} +message StringArray { + repeated string values = 1; +} +message DurationArray { + repeated google.protobuf.Duration values = 1; +} +message TimestampArray { + repeated google.protobuf.Timestamp values = 1; +} \ No newline at end of file diff --git a/proto/google/protobuf/struct.proto b/proto/v1/google/protobuf/struct.proto similarity index 100% rename from proto/google/protobuf/struct.proto rename to proto/v1/google/protobuf/struct.proto diff --git a/proto/v2/fds/protobuf/stach/v2/Package.proto b/proto/v2/fds/protobuf/stach/v2/Package.proto new file mode 100644 index 0000000..2af7345 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/Package.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2"; +option java_package = "com.factset.protobuf.stach.v2"; +option java_outer_classname = "PackageProto"; + +import "fds/protobuf/stach/v2/table/Table.proto"; + +// A column organized package of tables +message Package { + // The version of the STACH schema. Formatted {major}.{minor} + string version = 1; + + // The array of primary table ids + repeated string primary_table_ids = 2; + + // The map (key: table id) of all tables + map tables = 3; +} diff --git a/proto/v2/fds/protobuf/stach/v2/RowOrganized.proto b/proto/v2/fds/protobuf/stach/v2/RowOrganized.proto new file mode 100644 index 0000000..fe72194 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/RowOrganized.proto @@ -0,0 +1,130 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2"; +option java_package = "com.factset.protobuf.stach.v2"; +option java_outer_classname = "RowOrganizedProto"; + +import "fds/protobuf/stach/v2/table/MetadataItem.proto"; +import "fds/protobuf/stach/v2/table/CellDefinition.proto"; +import "fds/protobuf/stach/v2/table/ColumnDefinition.proto"; +import "google/protobuf/struct.proto"; + +// A row organized package of tables +message RowOrganizedPackage { + // The version of the STACH schema. Formatted {major}.{minor} + string version = 1; + + // The map (key: table id) of all tables + map tables = 2; + + // A row organized table + message Table { + // The definition + TableDefinition definition = 1; + + // The headers definition + TableDefinition headers_definition = 2; + + // The data + TableData data = 3; + } + + // A table definition + message TableDefinition { + // The column definitions + repeated factset.protobuf.stach.v2.table.ColumnDefinition columns = 1; + } + + // A table data + message TableData { + // The rows + repeated Row rows = 1; + + // The map (key: metadataitem id) of metadata at the table location + map table_metadata = 2; + + // The map (key: column id) of metadata at the column location + map column_metadata = 3; + } + + // A row + message Row { + // A type of row + enum RowType { + Body = 0; // A body row + Header = 1; // A header row + } + + // The row id + string id = 1; + + // The row type + RowType row_type = 2; + + oneof kind { + // The list of cell values + google.protobuf.ListValue cells = 3; + + // The map of cell values + google.protobuf.Struct values = 4; + } + + // The details for a body row cell + map cell_details = 5; + + // The details for a header row cell + map header_cell_details = 6; + + // The map (key: metadataitem id) of metadata at the row location + map row_metadata = 7; + } + + // A body row cell detail + message CellDetail { + // The group level + int32 group_level = 1; + + // The definition of the cell; overrides the column definition + factset.protobuf.stach.v2.table.CellDefinition cell_definition = 2; + + // The map (key: metadataitem id) of metadata at the cell location + map cell_metadata = 3; + } + + // A header row cell detail + message HeaderCellDetail { + // A table where a row is sourced from + enum TableSource { + UNKNOWN = 0; + NONE = 1; + PRIMARY = 2; + HEADERS = 3; + } + + // The column span + int32 colspan = 1; + + // The row span + int32 rowspan = 2; + + // The table where the row is sourced from + TableSource source = 3; + + // The column index; used to index into the `headers_definition.columns` array + int32 column_index = 4; + + // The definition of the cell; overrides the column definition + factset.protobuf.stach.v2.table.CellDefinition cell_definition = 5; + + // The map (key: metadataitem id) of metadata at the cell location + map cell_metadata = 6; + } + + // A wrapper for a map of metadata items + message MapOfMetadata { + // The map (key: metadataitem id) metadata + map items = 1; + } +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/CellDefinition.proto b/proto/v2/fds/protobuf/stach/v2/table/CellDefinition.proto new file mode 100644 index 0000000..4bfbf53 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/CellDefinition.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "CellDefinitionProto"; + +import "fds/protobuf/stach/v2/table/DataFormat.proto"; + +/* A cell definition + * + * Overrides the column and row definition + */ +message CellDefinition { + // The data type; correlates with the chosen property for `ColumnData.data`; overrides the `ColumnDefinition.type` + string type = 1; + + // The data format; overrides the `RowDefinition.format` and the `ColumnDefinition.format` + DataFormat format = 2; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/ColumnData.proto b/proto/v2/fds/protobuf/stach/v2/table/ColumnData.proto new file mode 100644 index 0000000..2e8e935 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/ColumnData.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "ColumnDataProto"; + +import "fds/protobuf/stach/v2/table/CellDefinition.proto"; +import "google/protobuf/struct.proto"; + +/* An array of column data + * + * The type chosen correlates to the data type of the `ColumnDefinition.type` + */ +message ColumnData { + // The map (key: uncompressed index, value: length to repeat the value) used during compression + map ranges = 1; + + // The values + google.protobuf.ListValue values = 2; + + // The cell definitions + repeated CellDefinition definitions = 3; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/ColumnDefinition.proto b/proto/v2/fds/protobuf/stach/v2/table/ColumnDefinition.proto new file mode 100644 index 0000000..607bec5 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/ColumnDefinition.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "ColumnDefinitionProto"; + +import "fds/protobuf/stach/v2/table/DataFormat.proto"; + +// A definition of a column +message ColumnDefinition { + // The id; used for referring to a column internal to a package + string id = 1; + + // The name; used for referring to a column external to a package + string name = 2; + + // The description; used for rendering human readable headers + string description = 3; + + // The data type; correlates with the chosen property for `ColumnData.data` + string type = 4; + + // Whether this column is a dimension or not + bool is_dimension = 5; + + // Whether this column is hidden or not + bool is_hidden = 6; + + // The next sibling column in the collapsed column tree + string next_sibling_id = 7; + + // The parent column in the collapsed column tree + string parent_id = 8; + + // The header id + string header_id = 9; + + // The data format + DataFormat format = 10; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/DataFormat.proto b/proto/v2/fds/protobuf/stach/v2/table/DataFormat.proto new file mode 100644 index 0000000..38e3d7c --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/DataFormat.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "DataFormatProto"; + +import "fds/protobuf/stach/v2/table/HorizontalAlignment.proto"; +import "fds/protobuf/stach/v2/table/VerticalAlignment.proto"; + +// A data format +message DataFormat { + // The format + string format = 1; + + // The null format + string null_format = 2; + + // The horizontal alignment + HorizontalAlignment halign = 3; + + // The vertical alignment + VerticalAlignment valign = 4; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/HorizontalAlignment.proto b/proto/v2/fds/protobuf/stach/v2/table/HorizontalAlignment.proto new file mode 100644 index 0000000..5a51e99 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/HorizontalAlignment.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "HorizontalAlignmentProto"; + +// A horizontal alignment +enum HorizontalAlignment { + UNKNOWN_HALIGN = 0; // This value should never be used, but exists to ensure that a value is specified + LEFT = 1; // Value is horizontally aligned to the left of the cell + CENTER = 2; // Value is horizontally aligned in the center of the cell + RIGHT = 3; // Value is horizontally aligned to the right of the cell +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/ListOfMetadata.proto b/proto/v2/fds/protobuf/stach/v2/table/ListOfMetadata.proto new file mode 100644 index 0000000..492928a --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/ListOfMetadata.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "ListOfMetadataProto"; + +// A list of metadata ids +message ListOfMetadata { + // The list of metadata ids + repeated string ids = 1; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/MetadataCollection.proto b/proto/v2/fds/protobuf/stach/v2/table/MetadataCollection.proto new file mode 100644 index 0000000..fa3b2ee --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/MetadataCollection.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "MetadataCollectionProto"; + +import "fds/protobuf/stach/v2/table/MetadataItem.proto"; +import "fds/protobuf/stach/v2/table/MetadataLocations.proto"; + +// A collection of metadata for a table +message MetadataCollection { + // The metadata items associated with a table + map items = 1; + + // The locations where metadata items are associated + MetadataLocations locations = 2; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/MetadataItem.proto b/proto/v2/fds/protobuf/stach/v2/table/MetadataItem.proto new file mode 100644 index 0000000..52e2568 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/MetadataItem.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "MetadataItemProto"; + +import "google/protobuf/struct.proto"; +import "fds/protobuf/stach/v2/table/Reference.proto"; + +/* A metadata item + * + * Represents data to describe the table or parts of the table + */ +message MetadataItem { + oneof data { + // The value + google.protobuf.Value value = 1; + + // The table reference + Reference reference = 2; + } +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/MetadataLocations.proto b/proto/v2/fds/protobuf/stach/v2/table/MetadataLocations.proto new file mode 100644 index 0000000..97d5fb1 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/MetadataLocations.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "MetadataLocationsProto"; + +import "fds/protobuf/stach/v2/table/ListOfMetadata.proto"; + +// The metadata locations for a table +message MetadataLocations { + // A message wrapper for a map of columns to `CellsRowMap` + message CellsColumnMap { + // The map (key: column id) of columns to `CellsRowMap` + map columns = 1; + } + + // A message wrapper for a map of rows to a list of metadata + message CellsRowMap { + // The map (key: row id) of rows to a list of metadata + map rows = 1; + } + + // The array (metadata item id) of metadata items associated with the whole table + repeated string table = 1; + + // The map (key: column id) of all metadata items associated with a column + map columns = 2; + + // The map (key: row id) of all metadata items associated with a row + map rows = 3; + + // The metadata items associated with specific cells + CellsColumnMap cells = 4; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/Reference.proto b/proto/v2/fds/protobuf/stach/v2/table/Reference.proto new file mode 100644 index 0000000..10198f0 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/Reference.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "ReferenceProto"; + +import "fds/protobuf/stach/v2/table/ReferenceType.proto"; + +// A reference to a table or a piece of a table +message Reference { + // The type of the reference + ReferenceType reference_type = 1; + + // The table id + string table_id = 2; + + // The column id + string column_id = 3; + + // The row id + string row_id = 4; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/ReferenceType.proto b/proto/v2/fds/protobuf/stach/v2/table/ReferenceType.proto new file mode 100644 index 0000000..5a38b27 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/ReferenceType.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "ReferenceTypeProto"; + +// The type of table reference +enum ReferenceType { + UNKNOWN_REFERENCE_TYPE = 0; // This value should never be used, but exists to ensure that a value is specified + TABLE = 1; // The table reference + COLUMN = 2; // The column reference + ROW = 3; // The row reference + CELL = 4; // The cell reference +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/RowDefinition.proto b/proto/v2/fds/protobuf/stach/v2/table/RowDefinition.proto new file mode 100644 index 0000000..9c404e7 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/RowDefinition.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "RowDefinitionProto"; + +import "fds/protobuf/stach/v2/table/DataFormat.proto"; + +/* A definition of a row + * + * Overrides the column definition + */ +message RowDefinition { + // The id; used for referring to a row internal to a package + string id = 1; + + // The data format; overrides the `ColumnDefinition.format` + DataFormat format = 2; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/Table.proto b/proto/v2/fds/protobuf/stach/v2/table/Table.proto new file mode 100644 index 0000000..ad054fe --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/Table.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "TableProto"; + +import "fds/protobuf/stach/v2/table/TableData.proto"; +import "fds/protobuf/stach/v2/table/TableDefinition.proto"; + +// A column organized table +message Table { + // The definition + TableDefinition definition = 1; + + // The data + TableData data = 2; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/TableData.proto b/proto/v2/fds/protobuf/stach/v2/table/TableData.proto new file mode 100644 index 0000000..fb921ed --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/TableData.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "TableDataProto"; + +import "fds/protobuf/stach/v2/table/ColumnData.proto"; +import "fds/protobuf/stach/v2/table/MetadataCollection.proto"; +import "fds/protobuf/stach/v2/table/RowDefinition.proto"; + +// An object of table data +message TableData { + // The array of rows definitions + repeated RowDefinition rows = 1; + + // The map (key: column id) of column data + map columns = 2; + + // The metadata + MetadataCollection metadata = 3; +} diff --git a/proto/v2/fds/protobuf/stach/v2/table/TableDefinition.proto b/proto/v2/fds/protobuf/stach/v2/table/TableDefinition.proto new file mode 100644 index 0000000..58e7573 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/TableDefinition.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "TableDefinitionProto"; + +import "fds/protobuf/stach/v2/table/ColumnDefinition.proto"; + +// A table definition +message TableDefinition { + // The id of the headers table + string header_table_id = 1; + + // The array of column definitions + repeated ColumnDefinition columns = 2; +} \ No newline at end of file diff --git a/proto/v2/fds/protobuf/stach/v2/table/VerticalAlignment.proto b/proto/v2/fds/protobuf/stach/v2/table/VerticalAlignment.proto new file mode 100644 index 0000000..e48fdf1 --- /dev/null +++ b/proto/v2/fds/protobuf/stach/v2/table/VerticalAlignment.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package factset.protobuf.stach.v2.table; + +option csharp_namespace = "FactSet.Protobuf.Stach.V2.Table"; +option go_package = "github.com/factset/stachschema-sdks/go/fds/protobuf/stach/v2/table"; +option java_package = "com.factset.protobuf.stach.v2.table"; +option java_outer_classname = "VerticalAlignmentProto"; + +// A vertical alignment +enum VerticalAlignment { + UNKNOWN_VALIGN = 0; // This value should never be used, but exists to ensure that a value is specified + TOP = 1; // Value is vertically aligned to the top of the cell + MIDDLE = 2; // Value is vertically aligned to the middle of the cell + BOTTOM = 3; // Value is vertically aligned to the bottom of the cell +} \ No newline at end of file diff --git a/proto/v2/google/protobuf/struct.proto b/proto/v2/google/protobuf/struct.proto new file mode 100644 index 0000000..a98f0a2 --- /dev/null +++ b/proto/v2/google/protobuf/struct.proto @@ -0,0 +1,96 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} \ No newline at end of file diff --git a/proto/fds/protobuf/stach/v3/Column.proto b/proto/v3/fds/protobuf/stach/v3/Column.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/Column.proto rename to proto/v3/fds/protobuf/stach/v3/Column.proto diff --git a/proto/fds/protobuf/stach/v3/MetadataItem.proto b/proto/v3/fds/protobuf/stach/v3/MetadataItem.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/MetadataItem.proto rename to proto/v3/fds/protobuf/stach/v3/MetadataItem.proto diff --git a/proto/fds/protobuf/stach/v3/RowOrganizedTable.proto b/proto/v3/fds/protobuf/stach/v3/RowOrganizedTable.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/RowOrganizedTable.proto rename to proto/v3/fds/protobuf/stach/v3/RowOrganizedTable.proto diff --git a/proto/fds/protobuf/stach/v3/Table.proto b/proto/v3/fds/protobuf/stach/v3/Table.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/Table.proto rename to proto/v3/fds/protobuf/stach/v3/Table.proto diff --git a/proto/fds/protobuf/stach/v3/TableView.proto b/proto/v3/fds/protobuf/stach/v3/TableView.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/TableView.proto rename to proto/v3/fds/protobuf/stach/v3/TableView.proto diff --git a/proto/fds/protobuf/stach/v3/Views.proto b/proto/v3/fds/protobuf/stach/v3/Views.proto similarity index 100% rename from proto/fds/protobuf/stach/v3/Views.proto rename to proto/v3/fds/protobuf/stach/v3/Views.proto diff --git a/proto/v3/google/protobuf/struct.proto b/proto/v3/google/protobuf/struct.proto new file mode 100644 index 0000000..7d7808e --- /dev/null +++ b/proto/v3/google/protobuf/struct.proto @@ -0,0 +1,96 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +}