diff --git a/src/systemathics/apis/services/daily/v2/get_daily.proto b/src/systemathics/apis/services/daily/v2/get_daily.proto new file mode 100644 index 0000000..eec99bb --- /dev/null +++ b/src/systemathics/apis/services/daily/v2/get_daily.proto @@ -0,0 +1,185 @@ +// Copyright (c) 2021 Systemathics +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Daily prices illustrates daily price movements for an instrument over a look back period. +syntax = "proto3"; + + +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; +import "google/type/date.proto"; + +import "systemathics/apis/type/shared/v1/asset.proto"; +import "systemathics/apis/type/shared/v1/identifier.proto"; +import "systemathics/apis/type/shared/v1/constraints.proto"; + +package systemathics.apis.services.daily.v2; + +// Called to request daily prices data. +service DailyService +{ + + // Gets daily historical data timeseries by identifier using streaming + rpc DailyScalarStream(DailyRequest) returns (stream DailyScalarStreamResponse) + { + option (google.api.http) = { + get: "/v2/daily_scalar/" + }; + } + + + // Gets daily historical data timeseries by identifier using streaming + rpc DailyVectorStream(DailyRequest) returns (stream DailyVectorStreamResponse) + { + option (google.api.http) = { + get: "/v2/daily_vector/" + }; + } + + // Gets all available fields by asset and provider. + rpc DailyFields(google.protobuf.Empty) returns (DailyFieldsResponse) + { + option (google.api.http) = { + get: "/v2/daily_fields/" + }; + } + + // Gets all available provider by asset + rpc DailyAssetProviders(google.protobuf.Empty) returns (DailyAssetProvidersResponse) + { + option (google.api.http) = { + get: "/v2/daily_provider/" + }; + } +} + +// The required input to request the GetDailyByIdentifier endpoint +message DailyRequest +{ + // [Mandatory] The instrument identifier: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] Fields/measures requested for daily data + repeated string fields = 2; + + // [Optional] The constraints used to define the look-back period. + // If empty, then all the available data is retrieved. + systemathics.apis.type.shared.v1.Constraints constraints = 3; +} + + +// Represents the daily scalar stream response. +message DailyScalarStreamResponse +{ + oneof payload + { + // The daily fields. Issued in the first frame. + DailyStreamFields info = 1; + + // The mapping data. Issued in the following frames. + DailyScalarStreamItem data = 2; + } +} + + +// Represents the daily scalar stream response. +message DailyVectorStreamResponse +{ + oneof payload + { + // The daily fields. Issued in the first frame. + DailyStreamFields info = 1; + + // The mapping data. Issued in the following frames. + DailyVectorStreamItem data = 2; + } +} + +// Represents all fields available in a daily scalar stream response. +message DailyStreamFields +{ + // The collection containing fields/measures values. + repeated string fields = 1; +} + + +// Represents the data part of a daily scalar stream response. +message DailyScalarStreamItem +{ + // The data date. + google.type.Date date = 1; + + // The data. Lenght of the array is the same as the fields. + repeated double data = 2; +} + +// Represents the data part of a daily scalar stream response. +message DailyVectorStreamItem +{ + // The data date. + google.type.Date date = 1; + + // The vector key + string key = 2; + + // The data. Lenght of the array is the same as the fields. + repeated double data = 3; +} + + +// Represents a response containing an array of assets with all their providers +message DailyAssetProvidersResponse +{ + // The asset type + repeated DailyAssetProviderItemReponse assets = 1; +} + +// Represents a links between an asset and a provider. +message DailyAssetProviderItemReponse +{ + // The asset type + systemathics.apis.type.shared.v1.AssetType asset_type = 1; + + // The providers + repeated string providers = 2; +} + + +message DailyFieldsResponse +{ + // The collection containing items values for scalars. + repeated DailyFieldsItemResponse scalars = 1; + + // The collection containing items values for vectors. + repeated DailyFieldsItemResponse vectors = 2; +} + +// Represents a links between an asset and a provider. +message DailyFieldsItemResponse +{ + // The asset type + systemathics.apis.type.shared.v1.AssetType asset_type = 1; + + // The provider + string provider = 2; + + // The fields/measures + repeated string fields = 3; +} diff --git a/src/systemathics/apis/services/daily/v2/get_daily_scalar.proto b/src/systemathics/apis/services/daily/v2/get_daily_scalar.proto deleted file mode 100644 index 17e5c9a..0000000 --- a/src/systemathics/apis/services/daily/v2/get_daily_scalar.proto +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) 2021 Systemathics -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// Daily prices illustrates daily price movements for an instrument over a look back period. -syntax = "proto3"; - - -import "google/protobuf/empty.proto"; -import "google/api/annotations.proto"; -import "google/type/date.proto"; - -import "systemathics/apis/type/shared/v1/asset.proto"; -import "systemathics/apis/type/shared/v1/identifier.proto"; -import "systemathics/apis/type/shared/v1/date_interval.proto"; - -package systemathics.apis.services.daily.v2; - -// Called to request daily prices data. -service DailyScalarService -{ - // Gets daily historical data timeseries by identifier - rpc DailyScalar(DailyScalarRequest) returns (DailyScalarResponse) - { - option (google.api.http) = { - get: "/v2/daily_scalar/" - }; - } - - // Gets daily historical data timeseries by identifier using streaming - rpc DailyScalarStream(DailyScalarRequest) returns (stream DailyScalarStreamResponse) - { - option (google.api.http) = { - get: "/v2/daily_scalar_stream/" - }; - } - - // Gets daily historical data by date - //rpc DailyByDate(DailyDateRequest) returns (stream GetDailyByDateResponse) - //{ - // option (google.api.http) = { - // get: "/v2/daily_date/" - // }; - //} - - // Gets all available fields by asset and provider. - rpc DailyScalarFields(google.protobuf.Empty) returns (DailyScalarFieldsResponse) - { - option (google.api.http) = { - get: "/v2/daily_scalar_fields/" - }; - } - - // Gets all available provider by asset - rpc DailyScalarAssetProvider(google.protobuf.Empty) returns (DailyScalarAssetProviderResponse) - { - option (google.api.http) = { - get: "/v2/daily_scalar_provider/" - }; - } -} - -// The required input to request the GetDailyByIdentifier endpoint -message DailyScalarRequest -{ - // [Mandatory] The instrument identifier: a bloomberg ticker and an asset type - systemathics.apis.type.shared.v1.Identifier identifier = 1; - - // [Mandatory] Fields/measures requested for daily data - repeated string fields = 2; - - // [Optional] The date intervals array used to define the look-back period. - // If empty, then all the available data is retrieved. - repeated systemathics.apis.type.shared.v1.DateInterval date_intervals = 3; - - // [Optional] The corporate action adjustment (dividends). - // By default the value is set to false : the split is applied in all cases - bool adjustment = 4; -} - -// The required input to request the GetDailyByDate endpoint -//message GetDailyByDateRequest -//{ -// // [Mandatory] The instrument identifiers: a bloomberg ticker and an asset type -// repeated systemathics.apis.type.shared.v1.Identifier identifiers = 1; -// -// // [Mandatory] The date used to request data. -// google.type.Date date = 2; -// -// // [Optional] The corporate action adjustment (dividends). -// // By default the value is set to false : the split is applied in all cases -// optional bool adjustment = 3; -//} - - -// Represents a daily scalar response. -message DailyScalarResponse -{ - // The dates array. The lenght of the array is the same as the data. - repeated google.type.Date dates = 1; - - // The daily data. Keys are the fields/measures present in the request. - map fields_data = 2; -} - -// Represents a daily scalar value response. -message DailyScalarValueResponse -{ - // The daily data. Lenght of the array is the same as the dates array. - repeated double data = 1; -} - -//// Represents a daily response. -//message GetDailyByDateResponse -//{ -// oneof payload -// { -// // The fields with their order that can be found in `data` values -// GetDailyByDateFields fields = 1; -// -// // The mapping data -// GetDailyByDateData data = 2; -// } -//} -// -//message GetDailyByDateFields -//{ -// // The fields with their order that can be found in `data` values -// repeated string fields = 1; -//} -// -//message GetDailyByDateData -//{ -// // The instrument identifier: a bloomberg ticker and an asset type -// systemathics.apis.type.shared.v1.Identifier identifier = 1; -// -// // The daily data. The mapping is provided by the first element of the stream. -// repeated double data = 2; -//} - - - -// Represents the daily scalar stream response. -message DailyScalarStreamResponse -{ - oneof payload - { - // The daily fields. Issued in the first frame. - DailyScalarStreamFields info = 1; - - // The mapping data. Issued in the following frames. - DailyScalarStreamItem data = 2; - } -} - -// Represents all fields available in a daily scalar stream response. -message DailyScalarStreamFields -{ - // The collection containing fields/measures values. - repeated string fields = 1; -} - - -// Represents the data part of a daily scalar stream response. -message DailyScalarStreamItem -{ - // The data date. - google.type.Date date = 1; - - // The data. Lenght of the array is the same as the fields. - repeated double data = 2; -} - -// Represents a response containing an array of items. -message DailyScalarAssetProviderResponse -{ - // The collection containing items values. - repeated DailyScalarAssetProviderItemResponse data = 1; -} - -// Represents a links between an asset and a provider. -message DailyScalarAssetProviderItemResponse -{ - // The asset type - systemathics.apis.type.shared.v1.AssetType asset_type = 1; - - // The provider - string provider = 2; -} - -message DailyScalarFieldsResponse -{ - // The collection containing items values. - repeated DailyScalarFieldsItemResponse data = 1; -} - -// Represents a links between an asset and a provider. -message DailyScalarFieldsItemResponse -{ - // The asset type - systemathics.apis.type.shared.v1.AssetType asset_type = 1; - - // The provider - string provider = 2; - - // The fields/measures - repeated string fields = 3; -} diff --git a/src/systemathics/apis/services/daily/v2/set_daily.proto b/src/systemathics/apis/services/daily/v2/set_daily.proto new file mode 100644 index 0000000..b63280b --- /dev/null +++ b/src/systemathics/apis/services/daily/v2/set_daily.proto @@ -0,0 +1,245 @@ +// Copyright (c) 2021 Systemathics +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Daily prices illustrates daily price movements for an instrument over a look back period. +syntax = "proto3"; + + +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; +import "google/type/date.proto"; +import "google/protobuf/struct.proto"; + +import "systemathics/apis/type/shared/v1/asset.proto"; +import "systemathics/apis/type/shared/v1/identifier.proto"; +import "systemathics/apis/type/shared/v1/constraints.proto"; +import "systemathics/apis/type/shared/v2/set_data_mode.proto"; + +package systemathics.apis.services.daily.v2; + +// Called to set daily prices data and clear. +service SetDailyService +{ + // Sets daily scalar timeseries. + rpc WriteDailyScalar(SetDailyScalarRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + post: "/v2/daily_scalar" + }; + } + + rpc WriteDailyScalarStream(stream SetDailyScalarStreamRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + post: "/v2/daily_scalar" + }; + } + + // Sets daily vector timeseries. + rpc WriteDailyVector(SetDailyVectorRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + post: "/v2/daily_vector" + }; + } + + // Sets daily vector timeseries. + rpc WriteDailyVectorStream(stream SetDailyVectorStreamRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + post: "/v2/daily_vector" + }; + } + + // Update daily scalar timeseries. + rpc UpdateDailyScalar(SetDailyScalarRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + put: "/v2/daily_scalar" + }; + } + + // Update daily scalar timeseries. + rpc UpdateDailyScalarStream(stream SetDailyScalarStreamRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + put: "/v2/daily_scalar" + }; + } + + + // Update daily vectors timeseries. + rpc UpdateDailyVector(SetDailyVectorRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + put: "/v2/daily_vector" + }; + } + + // Update daily vectors timeseries. + rpc UpdateDailyVectorStream(stream SetDailyVectorStreamRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + put: "/v2/daily_vector" + }; + } + + // Delete daily scalar timeseries. + rpc DeleteDailyScalar(DeleteDailyScalarRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + delete: "/v2/daily_scalar" + }; + } + + // Delete daily scalar timeseries. + rpc DeleteDailyVector(DeleteDailyVectorRequest) returns (google.protobuf.Empty) + { + option (google.api.http) = { + delete: "/v2/daily_vector" + }; + } +} +// The required input to request the SetDailyScalar endpoint +message SetDailyScalarRequest +{ + // [Mandatory] The instrument identifiers: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] The date used to request data. + google.type.Date date = 2; + + // [Mandatory] The data with field as a key + map data = 3; +} + + +// The required input to request the SetDailyScalar endpoint +message SetDailyScalarStreamRequest +{ + oneof payload + { + // The daily info + SetDailyInfo info = 1; + + // The mapping data + SetDailyScalarData data = 2; + } +} + +// The required input to request the SetDailyScalar endpoint +message SetDailyVectorRequest +{ + // [Mandatory] The instrument identifiers: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] The date used to request data. + google.type.Date date = 2; + + // [Mandatory] The vector key. + string key = 3; + + // [Mandatory] The data with field as a key + map data = 4; +} + +// The required input to request the SetDailyScalar endpoint +message SetDailyVectorStreamRequest +{ + oneof payload + { + // The daily info + SetDailyInfo info = 1; + + // The mapping data + SetDailyVectorData data = 2; + } +} + +// The required input to request DeleteDailyScalar. +message DeleteDailyScalarRequest +{ + // [Mandatory] The instrument identifiers: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] The fields to be deleted. + repeated string fields = 2; + + // [Mandatory] The dates to be deleted. + repeated google.type.Date dates = 3; +} + + +// The required input to request DeleteDailyScalar. +message DeleteDailyVectorRequest +{ + // [Mandatory] The instrument identifiers: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] The fields to be deleted. + repeated string fields = 2; + + // [Mandatory] The keys to be deleted. + repeated VectorKey keys = 3; +} + +// The required input to request the GetDailyByDate endpoint +message SetDailyInfo +{ + // [Mandatory] The instrument identifiers: a bloomberg dailyer and an asset type + systemathics.apis.type.shared.v1.Identifier identifier = 1; + + // [Mandatory] The data names. + repeated string fields = 2; +} + +// Represent the data to be added to the data scalar timeseries. +message SetDailyScalarData +{ + // [Mandatory] The date used to request data. + google.type.Date date = 1; + + // [Mandatory] The data. + repeated double data = 2; +} + +// Represent the key for a vector. +message VectorKey { + // [Mandatory] The date used to request data. + google.type.Date date = 1; + + // [Mandatory] The vector key. + string key = 2; +} + + +// Represent the data to be added to the data scalar timeseries. +message SetDailyVectorData +{ + // [Mandatory] The date used to request data. + google.type.Date date = 1; + + // [Mandatory] The vector key. + string key = 2; + + // [Mandatory] The data. + repeated double data = 3; +} + diff --git a/src/systemathics/apis/services/daily/v2/set_daily_scalar.proto b/src/systemathics/apis/services/daily/v2/set_daily_scalar.proto deleted file mode 100644 index 12b1e94..0000000 --- a/src/systemathics/apis/services/daily/v2/set_daily_scalar.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2021 Systemathics -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// Daily prices illustrates daily price movements for an instrument over a look back period. -syntax = "proto3"; - - -import "google/protobuf/empty.proto"; -import "google/api/annotations.proto"; -import "google/type/date.proto"; -import "google/protobuf/struct.proto"; - -import "systemathics/apis/type/shared/v1/asset.proto"; -import "systemathics/apis/type/shared/v1/identifier.proto"; -import "systemathics/apis/type/shared/v1/date_interval.proto"; -import "systemathics/apis/type/shared/v2/set_data_mode.proto"; - -package systemathics.apis.services.daily.v2; - -// Called to set daily prices data and clear. -service SetDailyScalarService -{ - // Sets daily scalar timeseries. - rpc SetDailyScalar(stream SetDailyScalarRequest) returns (google.protobuf.Empty) - { - option (google.api.http) = { - post: "/v2/daily" - }; - } - - // Delete daily scalar timeseries. - rpc ClearDailyScalar(ClearDailyScalarRequest) returns (google.protobuf.Empty) - { - option (google.api.http) = { - delete: "/v2/daily" - }; - } -} - - -// The required input to request the SetDailyScalar endpoint -message SetDailyScalarRequest -{ - oneof payload - { - // The daily info - SetDailyScalarInfo info = 1; - - // The mapping data - SetDailyScalarData data = 2; - } -} -// The required input to request ClearDailyScalar. -message ClearDailyScalarRequest -{ - // [Mandatory] The instrument identifiers: a bloomberg ticker and an asset type - systemathics.apis.type.shared.v1.Identifier identifier = 1; - - // [Mandatory] The fields to be deleted. - repeated string fields = 2; -} - -// The required input to request the GetDailyByDate endpoint -message SetDailyScalarInfo -{ - // [Mandatory] The instrument identifiers: a bloomberg ticker and an asset type - systemathics.apis.type.shared.v1.Identifier identifier = 1; - - // [Mandatory] The data names. - repeated string fields = 2; - - // Set the writing mode (write/overwrite or append) - systemathics.apis.type.shared.v2.SetDataMode mode = 3; -} - -// Represent the data to be added to the data scalar timeseries. -message SetDailyScalarData -{ - // [Mandatory] The date used to request data. - google.type.Date date = 1; - - // [Mandatory] The date used to request data. - repeated double data = 2; -} -