datetime.pb.go 14 KB

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