1// Copyright 2021 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// Code generated by protoc-gen-go. DO NOT EDIT.
16// versions:
17// 	protoc-gen-go v1.26.0
18// 	protoc        v3.12.2
19// source: google/type/datetime.proto
20
21package datetime
22
23import (
24	reflect "reflect"
25	sync "sync"
26
27	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29	durationpb "google.golang.org/protobuf/types/known/durationpb"
30)
31
32const (
33	// Verify that this generated code is sufficiently up-to-date.
34	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
35	// Verify that runtime/protoimpl is sufficiently up-to-date.
36	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
37)
38
39// Represents civil time (or occasionally physical time).
40//
41// This type can represent a civil time in one of a few possible ways:
42//
43//  * When utc_offset is set and time_zone is unset: a civil time on a calendar
44//    day with a particular offset from UTC.
45//  * When time_zone is set and utc_offset is unset: a civil time on a calendar
46//    day in a particular time zone.
47//  * When neither time_zone nor utc_offset is set: a civil time on a calendar
48//    day in local time.
49//
50// The date is relative to the Proleptic Gregorian Calendar.
51//
52// If year is 0, the DateTime is considered not to have a specific year. month
53// and day must have valid, non-zero values.
54//
55// This type may also be used to represent a physical time if all the date and
56// time fields are set and either case of the `time_offset` oneof is set.
57// Consider using `Timestamp` message for physical time instead. If your use
58// case also would like to store the user's timezone, that can be done in
59// another field.
60//
61// This type is more flexible than some applications may want. Make sure to
62// document and validate your application's limitations.
63type DateTime struct {
64	state         protoimpl.MessageState
65	sizeCache     protoimpl.SizeCache
66	unknownFields protoimpl.UnknownFields
67
68	// Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a
69	// datetime without a year.
70	Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"`
71	// Required. Month of year. Must be from 1 to 12.
72	Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"`
73	// Required. Day of month. Must be from 1 to 31 and valid for the year and
74	// month.
75	Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"`
76	// Required. Hours of day in 24 hour format. Should be from 0 to 23. An API
77	// may choose to allow the value "24:00:00" for scenarios like business
78	// closing time.
79	Hours int32 `protobuf:"varint,4,opt,name=hours,proto3" json:"hours,omitempty"`
80	// Required. Minutes of hour of day. Must be from 0 to 59.
81	Minutes int32 `protobuf:"varint,5,opt,name=minutes,proto3" json:"minutes,omitempty"`
82	// Required. Seconds of minutes of the time. Must normally be from 0 to 59. An
83	// API may allow the value 60 if it allows leap-seconds.
84	Seconds int32 `protobuf:"varint,6,opt,name=seconds,proto3" json:"seconds,omitempty"`
85	// Required. Fractions of seconds in nanoseconds. Must be from 0 to
86	// 999,999,999.
87	Nanos int32 `protobuf:"varint,7,opt,name=nanos,proto3" json:"nanos,omitempty"`
88	// Optional. Specifies either the UTC offset or the time zone of the DateTime.
89	// Choose carefully between them, considering that time zone data may change
90	// in the future (for example, a country modifies their DST start/end dates,
91	// and future DateTimes in the affected range had already been stored).
92	// If omitted, the DateTime is considered to be in local time.
93	//
94	// Types that are assignable to TimeOffset:
95	//	*DateTime_UtcOffset
96	//	*DateTime_TimeZone
97	TimeOffset isDateTime_TimeOffset `protobuf_oneof:"time_offset"`
98}
99
100func (x *DateTime) Reset() {
101	*x = DateTime{}
102	if protoimpl.UnsafeEnabled {
103		mi := &file_google_type_datetime_proto_msgTypes[0]
104		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
105		ms.StoreMessageInfo(mi)
106	}
107}
108
109func (x *DateTime) String() string {
110	return protoimpl.X.MessageStringOf(x)
111}
112
113func (*DateTime) ProtoMessage() {}
114
115func (x *DateTime) ProtoReflect() protoreflect.Message {
116	mi := &file_google_type_datetime_proto_msgTypes[0]
117	if protoimpl.UnsafeEnabled && x != nil {
118		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
119		if ms.LoadMessageInfo() == nil {
120			ms.StoreMessageInfo(mi)
121		}
122		return ms
123	}
124	return mi.MessageOf(x)
125}
126
127// Deprecated: Use DateTime.ProtoReflect.Descriptor instead.
128func (*DateTime) Descriptor() ([]byte, []int) {
129	return file_google_type_datetime_proto_rawDescGZIP(), []int{0}
130}
131
132func (x *DateTime) GetYear() int32 {
133	if x != nil {
134		return x.Year
135	}
136	return 0
137}
138
139func (x *DateTime) GetMonth() int32 {
140	if x != nil {
141		return x.Month
142	}
143	return 0
144}
145
146func (x *DateTime) GetDay() int32 {
147	if x != nil {
148		return x.Day
149	}
150	return 0
151}
152
153func (x *DateTime) GetHours() int32 {
154	if x != nil {
155		return x.Hours
156	}
157	return 0
158}
159
160func (x *DateTime) GetMinutes() int32 {
161	if x != nil {
162		return x.Minutes
163	}
164	return 0
165}
166
167func (x *DateTime) GetSeconds() int32 {
168	if x != nil {
169		return x.Seconds
170	}
171	return 0
172}
173
174func (x *DateTime) GetNanos() int32 {
175	if x != nil {
176		return x.Nanos
177	}
178	return 0
179}
180
181func (m *DateTime) GetTimeOffset() isDateTime_TimeOffset {
182	if m != nil {
183		return m.TimeOffset
184	}
185	return nil
186}
187
188func (x *DateTime) GetUtcOffset() *durationpb.Duration {
189	if x, ok := x.GetTimeOffset().(*DateTime_UtcOffset); ok {
190		return x.UtcOffset
191	}
192	return nil
193}
194
195func (x *DateTime) GetTimeZone() *TimeZone {
196	if x, ok := x.GetTimeOffset().(*DateTime_TimeZone); ok {
197		return x.TimeZone
198	}
199	return nil
200}
201
202type isDateTime_TimeOffset interface {
203	isDateTime_TimeOffset()
204}
205
206type DateTime_UtcOffset struct {
207	// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
208	// For example, a UTC offset of -4:00 would be represented as
209	// { seconds: -14400 }.
210	UtcOffset *durationpb.Duration `protobuf:"bytes,8,opt,name=utc_offset,json=utcOffset,proto3,oneof"`
211}
212
213type DateTime_TimeZone struct {
214	// Time zone.
215	TimeZone *TimeZone `protobuf:"bytes,9,opt,name=time_zone,json=timeZone,proto3,oneof"`
216}
217
218func (*DateTime_UtcOffset) isDateTime_TimeOffset() {}
219
220func (*DateTime_TimeZone) isDateTime_TimeOffset() {}
221
222// Represents a time zone from the
223// [IANA Time Zone Database](https://www.iana.org/time-zones).
224type TimeZone struct {
225	state         protoimpl.MessageState
226	sizeCache     protoimpl.SizeCache
227	unknownFields protoimpl.UnknownFields
228
229	// IANA Time Zone Database time zone, e.g. "America/New_York".
230	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
231	// Optional. IANA Time Zone Database version number, e.g. "2019a".
232	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
233}
234
235func (x *TimeZone) Reset() {
236	*x = TimeZone{}
237	if protoimpl.UnsafeEnabled {
238		mi := &file_google_type_datetime_proto_msgTypes[1]
239		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
240		ms.StoreMessageInfo(mi)
241	}
242}
243
244func (x *TimeZone) String() string {
245	return protoimpl.X.MessageStringOf(x)
246}
247
248func (*TimeZone) ProtoMessage() {}
249
250func (x *TimeZone) ProtoReflect() protoreflect.Message {
251	mi := &file_google_type_datetime_proto_msgTypes[1]
252	if protoimpl.UnsafeEnabled && x != nil {
253		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
254		if ms.LoadMessageInfo() == nil {
255			ms.StoreMessageInfo(mi)
256		}
257		return ms
258	}
259	return mi.MessageOf(x)
260}
261
262// Deprecated: Use TimeZone.ProtoReflect.Descriptor instead.
263func (*TimeZone) Descriptor() ([]byte, []int) {
264	return file_google_type_datetime_proto_rawDescGZIP(), []int{1}
265}
266
267func (x *TimeZone) GetId() string {
268	if x != nil {
269		return x.Id
270	}
271	return ""
272}
273
274func (x *TimeZone) GetVersion() string {
275	if x != nil {
276		return x.Version
277	}
278	return ""
279}
280
281var File_google_type_datetime_proto protoreflect.FileDescriptor
282
283var file_google_type_datetime_proto_rawDesc = []byte{
284	0x0a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61,
285	0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6f,
286	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
287	0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74,
288	0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x02, 0x0a, 0x08, 0x44, 0x61,
289	0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01,
290	0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f,
291	0x6e, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
292	0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64,
293	0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
294	0x05, 0x52, 0x05, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x75,
295	0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x75, 0x74,
296	0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20,
297	0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05,
298	0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e,
299	0x6f, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x75, 0x74, 0x63, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
300	0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
301	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
302	0x6e, 0x48, 0x00, 0x52, 0x09, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x34,
303	0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
304	0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
305	0x54, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65,
306	0x5a, 0x6f, 0x6e, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x66, 0x66,
307	0x73, 0x65, 0x74, 0x22, 0x34, 0x0a, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12,
308	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
309	0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
310	0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
311	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x44, 0x61,
312	0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67,
313	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67,
314	0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
315	0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69,
316	0x6d, 0x65, 0x3b, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0xf8, 0x01, 0x01, 0xa2, 0x02,
317	0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
318}
319
320var (
321	file_google_type_datetime_proto_rawDescOnce sync.Once
322	file_google_type_datetime_proto_rawDescData = file_google_type_datetime_proto_rawDesc
323)
324
325func file_google_type_datetime_proto_rawDescGZIP() []byte {
326	file_google_type_datetime_proto_rawDescOnce.Do(func() {
327		file_google_type_datetime_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_datetime_proto_rawDescData)
328	})
329	return file_google_type_datetime_proto_rawDescData
330}
331
332var file_google_type_datetime_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
333var file_google_type_datetime_proto_goTypes = []interface{}{
334	(*DateTime)(nil),            // 0: google.type.DateTime
335	(*TimeZone)(nil),            // 1: google.type.TimeZone
336	(*durationpb.Duration)(nil), // 2: google.protobuf.Duration
337}
338var file_google_type_datetime_proto_depIdxs = []int32{
339	2, // 0: google.type.DateTime.utc_offset:type_name -> google.protobuf.Duration
340	1, // 1: google.type.DateTime.time_zone:type_name -> google.type.TimeZone
341	2, // [2:2] is the sub-list for method output_type
342	2, // [2:2] is the sub-list for method input_type
343	2, // [2:2] is the sub-list for extension type_name
344	2, // [2:2] is the sub-list for extension extendee
345	0, // [0:2] is the sub-list for field type_name
346}
347
348func init() { file_google_type_datetime_proto_init() }
349func file_google_type_datetime_proto_init() {
350	if File_google_type_datetime_proto != nil {
351		return
352	}
353	if !protoimpl.UnsafeEnabled {
354		file_google_type_datetime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
355			switch v := v.(*DateTime); i {
356			case 0:
357				return &v.state
358			case 1:
359				return &v.sizeCache
360			case 2:
361				return &v.unknownFields
362			default:
363				return nil
364			}
365		}
366		file_google_type_datetime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
367			switch v := v.(*TimeZone); i {
368			case 0:
369				return &v.state
370			case 1:
371				return &v.sizeCache
372			case 2:
373				return &v.unknownFields
374			default:
375				return nil
376			}
377		}
378	}
379	file_google_type_datetime_proto_msgTypes[0].OneofWrappers = []interface{}{
380		(*DateTime_UtcOffset)(nil),
381		(*DateTime_TimeZone)(nil),
382	}
383	type x struct{}
384	out := protoimpl.TypeBuilder{
385		File: protoimpl.DescBuilder{
386			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
387			RawDescriptor: file_google_type_datetime_proto_rawDesc,
388			NumEnums:      0,
389			NumMessages:   2,
390			NumExtensions: 0,
391			NumServices:   0,
392		},
393		GoTypes:           file_google_type_datetime_proto_goTypes,
394		DependencyIndexes: file_google_type_datetime_proto_depIdxs,
395		MessageInfos:      file_google_type_datetime_proto_msgTypes,
396	}.Build()
397	File_google_type_datetime_proto = out.File
398	file_google_type_datetime_proto_rawDesc = nil
399	file_google_type_datetime_proto_goTypes = nil
400	file_google_type_datetime_proto_depIdxs = nil
401}
402