|
| 1 | +// Copyright (c) 2021 Systemathics |
| 2 | +// |
| 3 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | +// of this software and associated documentation files (the "Software"), to deal |
| 5 | +// in the Software without restriction, including without limitation the rights |
| 6 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | +// copies of the Software, and to permit persons to whom the Software is |
| 8 | +// furnished to do so, subject to the following conditions: |
| 9 | +// |
| 10 | +// The above copyright notice and this permission notice shall be included in all |
| 11 | +// copies or substantial portions of the Software. |
| 12 | +// |
| 13 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 | +// SOFTWARE. |
| 20 | + |
| 21 | +// Daily calendars illustrates daily holidays for an instrument over a look back period. |
| 22 | +syntax = "proto3"; |
| 23 | + |
| 24 | + |
| 25 | +import "google/api/annotations.proto"; |
| 26 | +import "google/type/date.proto"; |
| 27 | + |
| 28 | +import "systemathics/apis/type/shared/v1/identifier.proto"; |
| 29 | +import "systemathics/apis/type/shared/v1/date_interval.proto"; |
| 30 | + |
| 31 | +package systemathics.apis.services.daily.v1; |
| 32 | + |
| 33 | +// Called to request daily calendars data. |
| 34 | +service DailyCalendarsService |
| 35 | +{ |
| 36 | + // Gets daily historical calendars |
| 37 | + rpc DailyCalendars(DailyCalendarsRequest) returns (DailyCalendarsResponse) |
| 38 | + { |
| 39 | + option (google.api.http) = { |
| 40 | + get: "/v1/daily/calendars" |
| 41 | + }; |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +// The required input to request the DailyCalendarsService |
| 46 | +message DailyCalendarsRequest |
| 47 | +{ |
| 48 | + // [Mandatory] The instrument identifier: a ticker and exchange |
| 49 | + systemathics.apis.type.shared.v1.Identifier identifier = 1; |
| 50 | + |
| 51 | + // [Optional] The date interval used to define the look-back period. |
| 52 | + // If empty, then all the available data is retrieved. |
| 53 | + systemathics.apis.type.shared.v1.DateInterval date_interval = 2; |
| 54 | +} |
| 55 | + |
| 56 | +// Represents a daily calendars response. |
| 57 | +message DailyCalendarsResponse |
| 58 | +{ |
| 59 | + // The daily calendars: an array of DailyCalendar objects |
| 60 | + repeated DailyCalendar data = 1; |
| 61 | +} |
| 62 | + |
| 63 | +// Contains the daily calendars data: date, name, description and isholiday. |
| 64 | +message DailyCalendar |
| 65 | +{ |
| 66 | + // Date of the calendar |
| 67 | + google.type.Date date = 1; |
| 68 | + |
| 69 | + // The calendar's name |
| 70 | + string name = 2; |
| 71 | + |
| 72 | + // The additional information to describe the calendar |
| 73 | + string description = 3; |
| 74 | + |
| 75 | + // The value indicating whether the day is holiday (market closed) |
| 76 | + bool is_holiday = 4; |
| 77 | + |
| 78 | + // The data quality scoring : from 0 (bad) to 100 (good) |
| 79 | + double score = 5; |
| 80 | +} |
| 81 | + |
0 commit comments