1// Copyright 2019 Google LLC. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14// 15 16syntax = "proto3"; 17 18package google.actions.type; 19 20import "google/type/datetime.proto"; 21 22option go_package = "google.golang.org/genproto/googleapis/type/date_time_range;date_time_range"; 23option java_multiple_files = true; 24option java_outer_classname = "DateTimeRangeProto"; 25option java_package = "com.google.actions.type"; 26option objc_class_prefix = "AOGTP"; 27 28// Represents a date and time range. This can represent: 29// 30// * A range between points in time with time zone or offset, e.g. the duration 31// of a flight which starts in the "America/New_York" time zone and ends in 32// the "Australia/Sydney" time zone 33// * A range between points in time without time zone/offset info, e.g. an 34// appointment in local time 35// * A range starting at a specific date and time, e.g. the range of time which 36// can be measured in milliseconds since the Unix epoch (period starting with 37// 1970-01-01T00:00:00Z) 38// * A range ending at a specific date and time, e.g. range of time before 39// a deadline 40// 41// When considering whether a DateTime falls within a DateTimeRange, the start 42// of the range is inclusive and the end is exclusive. 43// 44// While [google.type.DateTime][google.type.DateTime] allows zero years, DateTimeRange does not. 45// Year must always be non-zero. 46// 47// When both start and end are set, either both or neither must have a 48// time_offset. When set, time_offset can be specified by either utc_offset or 49// time_zone and must match for start and end, that is if start has utc_offset 50// set then end must also have utc_offset set. The values of utc_offset or 51// time_zone need not be the same for start and end. 52// 53// When both start and end are set, start must be chronologically less than or 54// equal to end. When start and end are equal, the range is empty. 55// 56// The semantics of start and end are the same as those of 57// [google.type.DateTime][google.type.DateTime]. 58message DateTimeRange { 59 // DateTime at which the date range begins. If unset, the range has no 60 // beginning bound. 61 google.type.DateTime start = 1; 62 63 // DateTime at which the date range ends. If unset, the range has no ending 64 // bound. 65 google.type.DateTime end = 2; 66} 67