...

Source file src/google.golang.org/genproto/googleapis/type/datetime/datetime.pb.go

Documentation: google.golang.org/genproto/googleapis/type/datetime

     1  // Copyright 2024 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        v4.24.4
    19  // source: google/type/datetime.proto
    20  
    21  package datetime
    22  
    23  import (
    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  
    32  const (
    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.
    63  type 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  	//
    96  	//	*DateTime_UtcOffset
    97  	//	*DateTime_TimeZone
    98  	TimeOffset isDateTime_TimeOffset `protobuf_oneof:"time_offset"`
    99  }
   100  
   101  func (x *DateTime) Reset() {
   102  	*x = DateTime{}
   103  	if protoimpl.UnsafeEnabled {
   104  		mi := &file_google_type_datetime_proto_msgTypes[0]
   105  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   106  		ms.StoreMessageInfo(mi)
   107  	}
   108  }
   109  
   110  func (x *DateTime) String() string {
   111  	return protoimpl.X.MessageStringOf(x)
   112  }
   113  
   114  func (*DateTime) ProtoMessage() {}
   115  
   116  func (x *DateTime) ProtoReflect() protoreflect.Message {
   117  	mi := &file_google_type_datetime_proto_msgTypes[0]
   118  	if protoimpl.UnsafeEnabled && x != nil {
   119  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   120  		if ms.LoadMessageInfo() == nil {
   121  			ms.StoreMessageInfo(mi)
   122  		}
   123  		return ms
   124  	}
   125  	return mi.MessageOf(x)
   126  }
   127  
   128  // Deprecated: Use DateTime.ProtoReflect.Descriptor instead.
   129  func (*DateTime) Descriptor() ([]byte, []int) {
   130  	return file_google_type_datetime_proto_rawDescGZIP(), []int{0}
   131  }
   132  
   133  func (x *DateTime) GetYear() int32 {
   134  	if x != nil {
   135  		return x.Year
   136  	}
   137  	return 0
   138  }
   139  
   140  func (x *DateTime) GetMonth() int32 {
   141  	if x != nil {
   142  		return x.Month
   143  	}
   144  	return 0
   145  }
   146  
   147  func (x *DateTime) GetDay() int32 {
   148  	if x != nil {
   149  		return x.Day
   150  	}
   151  	return 0
   152  }
   153  
   154  func (x *DateTime) GetHours() int32 {
   155  	if x != nil {
   156  		return x.Hours
   157  	}
   158  	return 0
   159  }
   160  
   161  func (x *DateTime) GetMinutes() int32 {
   162  	if x != nil {
   163  		return x.Minutes
   164  	}
   165  	return 0
   166  }
   167  
   168  func (x *DateTime) GetSeconds() int32 {
   169  	if x != nil {
   170  		return x.Seconds
   171  	}
   172  	return 0
   173  }
   174  
   175  func (x *DateTime) GetNanos() int32 {
   176  	if x != nil {
   177  		return x.Nanos
   178  	}
   179  	return 0
   180  }
   181  
   182  func (m *DateTime) GetTimeOffset() isDateTime_TimeOffset {
   183  	if m != nil {
   184  		return m.TimeOffset
   185  	}
   186  	return nil
   187  }
   188  
   189  func (x *DateTime) GetUtcOffset() *durationpb.Duration {
   190  	if x, ok := x.GetTimeOffset().(*DateTime_UtcOffset); ok {
   191  		return x.UtcOffset
   192  	}
   193  	return nil
   194  }
   195  
   196  func (x *DateTime) GetTimeZone() *TimeZone {
   197  	if x, ok := x.GetTimeOffset().(*DateTime_TimeZone); ok {
   198  		return x.TimeZone
   199  	}
   200  	return nil
   201  }
   202  
   203  type isDateTime_TimeOffset interface {
   204  	isDateTime_TimeOffset()
   205  }
   206  
   207  type DateTime_UtcOffset struct {
   208  	// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
   209  	// For example, a UTC offset of -4:00 would be represented as
   210  	// { seconds: -14400 }.
   211  	UtcOffset *durationpb.Duration `protobuf:"bytes,8,opt,name=utc_offset,json=utcOffset,proto3,oneof"`
   212  }
   213  
   214  type DateTime_TimeZone struct {
   215  	// Time zone.
   216  	TimeZone *TimeZone `protobuf:"bytes,9,opt,name=time_zone,json=timeZone,proto3,oneof"`
   217  }
   218  
   219  func (*DateTime_UtcOffset) isDateTime_TimeOffset() {}
   220  
   221  func (*DateTime_TimeZone) isDateTime_TimeOffset() {}
   222  
   223  // Represents a time zone from the
   224  // [IANA Time Zone Database](https://www.iana.org/time-zones).
   225  type TimeZone struct {
   226  	state         protoimpl.MessageState
   227  	sizeCache     protoimpl.SizeCache
   228  	unknownFields protoimpl.UnknownFields
   229  
   230  	// IANA Time Zone Database time zone, e.g. "America/New_York".
   231  	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
   232  	// Optional. IANA Time Zone Database version number, e.g. "2019a".
   233  	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
   234  }
   235  
   236  func (x *TimeZone) Reset() {
   237  	*x = TimeZone{}
   238  	if protoimpl.UnsafeEnabled {
   239  		mi := &file_google_type_datetime_proto_msgTypes[1]
   240  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   241  		ms.StoreMessageInfo(mi)
   242  	}
   243  }
   244  
   245  func (x *TimeZone) String() string {
   246  	return protoimpl.X.MessageStringOf(x)
   247  }
   248  
   249  func (*TimeZone) ProtoMessage() {}
   250  
   251  func (x *TimeZone) ProtoReflect() protoreflect.Message {
   252  	mi := &file_google_type_datetime_proto_msgTypes[1]
   253  	if protoimpl.UnsafeEnabled && x != nil {
   254  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   255  		if ms.LoadMessageInfo() == nil {
   256  			ms.StoreMessageInfo(mi)
   257  		}
   258  		return ms
   259  	}
   260  	return mi.MessageOf(x)
   261  }
   262  
   263  // Deprecated: Use TimeZone.ProtoReflect.Descriptor instead.
   264  func (*TimeZone) Descriptor() ([]byte, []int) {
   265  	return file_google_type_datetime_proto_rawDescGZIP(), []int{1}
   266  }
   267  
   268  func (x *TimeZone) GetId() string {
   269  	if x != nil {
   270  		return x.Id
   271  	}
   272  	return ""
   273  }
   274  
   275  func (x *TimeZone) GetVersion() string {
   276  	if x != nil {
   277  		return x.Version
   278  	}
   279  	return ""
   280  }
   281  
   282  var File_google_type_datetime_proto protoreflect.FileDescriptor
   283  
   284  var file_google_type_datetime_proto_rawDesc = []byte{
   285  	0x0a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61,
   286  	0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6f,
   287  	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
   288  	0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74,
   289  	0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x02, 0x0a, 0x08, 0x44, 0x61,
   290  	0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x65, 0x61, 0x72, 0x18, 0x01,
   291  	0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f,
   292  	0x6e, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
   293  	0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64,
   294  	0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
   295  	0x05, 0x52, 0x05, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x75,
   296  	0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x75, 0x74,
   297  	0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20,
   298  	0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05,
   299  	0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e,
   300  	0x6f, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x75, 0x74, 0x63, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
   301  	0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
   302  	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
   303  	0x6e, 0x48, 0x00, 0x52, 0x09, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x34,
   304  	0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
   305  	0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
   306  	0x54, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65,
   307  	0x5a, 0x6f, 0x6e, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x66, 0x66,
   308  	0x73, 0x65, 0x74, 0x22, 0x34, 0x0a, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12,
   309  	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
   310  	0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
   311  	0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
   312  	0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x44, 0x61,
   313  	0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67,
   314  	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67,
   315  	0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
   316  	0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69,
   317  	0x6d, 0x65, 0x3b, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0xf8, 0x01, 0x01, 0xa2, 0x02,
   318  	0x03, 0x47, 0x54, 0x50, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   319  }
   320  
   321  var (
   322  	file_google_type_datetime_proto_rawDescOnce sync.Once
   323  	file_google_type_datetime_proto_rawDescData = file_google_type_datetime_proto_rawDesc
   324  )
   325  
   326  func file_google_type_datetime_proto_rawDescGZIP() []byte {
   327  	file_google_type_datetime_proto_rawDescOnce.Do(func() {
   328  		file_google_type_datetime_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_datetime_proto_rawDescData)
   329  	})
   330  	return file_google_type_datetime_proto_rawDescData
   331  }
   332  
   333  var file_google_type_datetime_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   334  var file_google_type_datetime_proto_goTypes = []interface{}{
   335  	(*DateTime)(nil),            // 0: google.type.DateTime
   336  	(*TimeZone)(nil),            // 1: google.type.TimeZone
   337  	(*durationpb.Duration)(nil), // 2: google.protobuf.Duration
   338  }
   339  var file_google_type_datetime_proto_depIdxs = []int32{
   340  	2, // 0: google.type.DateTime.utc_offset:type_name -> google.protobuf.Duration
   341  	1, // 1: google.type.DateTime.time_zone:type_name -> google.type.TimeZone
   342  	2, // [2:2] is the sub-list for method output_type
   343  	2, // [2:2] is the sub-list for method input_type
   344  	2, // [2:2] is the sub-list for extension type_name
   345  	2, // [2:2] is the sub-list for extension extendee
   346  	0, // [0:2] is the sub-list for field type_name
   347  }
   348  
   349  func init() { file_google_type_datetime_proto_init() }
   350  func file_google_type_datetime_proto_init() {
   351  	if File_google_type_datetime_proto != nil {
   352  		return
   353  	}
   354  	if !protoimpl.UnsafeEnabled {
   355  		file_google_type_datetime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   356  			switch v := v.(*DateTime); i {
   357  			case 0:
   358  				return &v.state
   359  			case 1:
   360  				return &v.sizeCache
   361  			case 2:
   362  				return &v.unknownFields
   363  			default:
   364  				return nil
   365  			}
   366  		}
   367  		file_google_type_datetime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   368  			switch v := v.(*TimeZone); i {
   369  			case 0:
   370  				return &v.state
   371  			case 1:
   372  				return &v.sizeCache
   373  			case 2:
   374  				return &v.unknownFields
   375  			default:
   376  				return nil
   377  			}
   378  		}
   379  	}
   380  	file_google_type_datetime_proto_msgTypes[0].OneofWrappers = []interface{}{
   381  		(*DateTime_UtcOffset)(nil),
   382  		(*DateTime_TimeZone)(nil),
   383  	}
   384  	type x struct{}
   385  	out := protoimpl.TypeBuilder{
   386  		File: protoimpl.DescBuilder{
   387  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   388  			RawDescriptor: file_google_type_datetime_proto_rawDesc,
   389  			NumEnums:      0,
   390  			NumMessages:   2,
   391  			NumExtensions: 0,
   392  			NumServices:   0,
   393  		},
   394  		GoTypes:           file_google_type_datetime_proto_goTypes,
   395  		DependencyIndexes: file_google_type_datetime_proto_depIdxs,
   396  		MessageInfos:      file_google_type_datetime_proto_msgTypes,
   397  	}.Build()
   398  	File_google_type_datetime_proto = out.File
   399  	file_google_type_datetime_proto_rawDesc = nil
   400  	file_google_type_datetime_proto_goTypes = nil
   401  	file_google_type_datetime_proto_depIdxs = nil
   402  }
   403  

View as plain text