// Copyright 2020-2025 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: google/type/datetime.proto

package _type

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	durationpb "google.golang.org/protobuf/types/known/durationpb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Represents civil time (or occasionally physical time).
//
// This type can represent a civil time in one of a few possible ways:
//
//   - When utc_offset is set and time_zone is unset: a civil time on a calendar
//     day with a particular offset from UTC.
//   - When time_zone is set and utc_offset is unset: a civil time on a calendar
//     day in a particular time zone.
//   - When neither time_zone nor utc_offset is set: a civil time on a calendar
//     day in local time.
//
// The date is relative to the Proleptic Gregorian Calendar.
//
// If year is 0, the DateTime is considered not to have a specific year. month
// and day must have valid, non-zero values.
//
// This type may also be used to represent a physical time if all the date and
// time fields are set and either case of the `time_offset` oneof is set.
// Consider using `Timestamp` message for physical time instead. If your use
// case also would like to store the user's timezone, that can be done in
// another field.
//
// This type is more flexible than some applications may want. Make sure to
// document and validate your application's limitations.
type DateTime struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a
	// datetime without a year.
	Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"`
	// Required. Month of year. Must be from 1 to 12.
	Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"`
	// Required. Day of month. Must be from 1 to 31 and valid for the year and
	// month.
	Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"`
	// Required. Hours of day in 24 hour format. Should be from 0 to 23. An API
	// may choose to allow the value "24:00:00" for scenarios like business
	// closing time.
	Hours int32 `protobuf:"varint,4,opt,name=hours,proto3" json:"hours,omitempty"`
	// Required. Minutes of hour of day. Must be from 0 to 59.
	Minutes int32 `protobuf:"varint,5,opt,name=minutes,proto3" json:"minutes,omitempty"`
	// Required. Seconds of minutes of the time. Must normally be from 0 to 59. An
	// API may allow the value 60 if it allows leap-seconds.
	Seconds int32 `protobuf:"varint,6,opt,name=seconds,proto3" json:"seconds,omitempty"`
	// Required. Fractions of seconds in nanoseconds. Must be from 0 to
	// 999,999,999.
	Nanos int32 `protobuf:"varint,7,opt,name=nanos,proto3" json:"nanos,omitempty"`
	// Optional. Specifies either the UTC offset or the time zone of the DateTime.
	// Choose carefully between them, considering that time zone data may change
	// in the future (for example, a country modifies their DST start/end dates,
	// and future DateTimes in the affected range had already been stored).
	// If omitted, the DateTime is considered to be in local time.
	//
	// Types that are valid to be assigned to TimeOffset:
	//
	//	*DateTime_UtcOffset
	//	*DateTime_TimeZone
	TimeOffset    isDateTime_TimeOffset `protobuf_oneof:"time_offset"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *DateTime) Reset() {
	*x = DateTime{}
	mi := &file_google_type_datetime_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *DateTime) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*DateTime) ProtoMessage() {}

func (x *DateTime) ProtoReflect() protoreflect.Message {
	mi := &file_google_type_datetime_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use DateTime.ProtoReflect.Descriptor instead.
func (*DateTime) Descriptor() ([]byte, []int) {
	return file_google_type_datetime_proto_rawDescGZIP(), []int{0}
}

func (x *DateTime) GetYear() int32 {
	if x != nil {
		return x.Year
	}
	return 0
}

func (x *DateTime) GetMonth() int32 {
	if x != nil {
		return x.Month
	}
	return 0
}

func (x *DateTime) GetDay() int32 {
	if x != nil {
		return x.Day
	}
	return 0
}

func (x *DateTime) GetHours() int32 {
	if x != nil {
		return x.Hours
	}
	return 0
}

func (x *DateTime) GetMinutes() int32 {
	if x != nil {
		return x.Minutes
	}
	return 0
}

func (x *DateTime) GetSeconds() int32 {
	if x != nil {
		return x.Seconds
	}
	return 0
}

func (x *DateTime) GetNanos() int32 {
	if x != nil {
		return x.Nanos
	}
	return 0
}

func (x *DateTime) GetTimeOffset() isDateTime_TimeOffset {
	if x != nil {
		return x.TimeOffset
	}
	return nil
}

func (x *DateTime) GetUtcOffset() *durationpb.Duration {
	if x != nil {
		if x, ok := x.TimeOffset.(*DateTime_UtcOffset); ok {
			return x.UtcOffset
		}
	}
	return nil
}

func (x *DateTime) GetTimeZone() *TimeZone {
	if x != nil {
		if x, ok := x.TimeOffset.(*DateTime_TimeZone); ok {
			return x.TimeZone
		}
	}
	return nil
}

type isDateTime_TimeOffset interface {
	isDateTime_TimeOffset()
}

type DateTime_UtcOffset struct {
	// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
	// For example, a UTC offset of -4:00 would be represented as
	// { seconds: -14400 }.
	UtcOffset *durationpb.Duration `protobuf:"bytes,8,opt,name=utc_offset,json=utcOffset,proto3,oneof"`
}

type DateTime_TimeZone struct {
	// Time zone.
	TimeZone *TimeZone `protobuf:"bytes,9,opt,name=time_zone,json=timeZone,proto3,oneof"`
}

func (*DateTime_UtcOffset) isDateTime_TimeOffset() {}

func (*DateTime_TimeZone) isDateTime_TimeOffset() {}

// Represents a time zone from the
// [IANA Time Zone Database](https://www.iana.org/time-zones).
type TimeZone struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// IANA Time Zone Database time zone, e.g. "America/New_York".
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Optional. IANA Time Zone Database version number, e.g. "2019a".
	Version       string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *TimeZone) Reset() {
	*x = TimeZone{}
	mi := &file_google_type_datetime_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *TimeZone) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*TimeZone) ProtoMessage() {}

func (x *TimeZone) ProtoReflect() protoreflect.Message {
	mi := &file_google_type_datetime_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use TimeZone.ProtoReflect.Descriptor instead.
func (*TimeZone) Descriptor() ([]byte, []int) {
	return file_google_type_datetime_proto_rawDescGZIP(), []int{1}
}

func (x *TimeZone) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *TimeZone) GetVersion() string {
	if x != nil {
		return x.Version
	}
	return ""
}

var File_google_type_datetime_proto protoreflect.FileDescriptor

const file_google_type_datetime_proto_rawDesc = "" +
	"\n" +
	"\x1agoogle/type/datetime.proto\x12\vgoogle.type\x1a\x1egoogle/protobuf/duration.proto\"\xa7\x02\n" +
	"\bDateTime\x12\x12\n" +
	"\x04year\x18\x01 \x01(\x05R\x04year\x12\x14\n" +
	"\x05month\x18\x02 \x01(\x05R\x05month\x12\x10\n" +
	"\x03day\x18\x03 \x01(\x05R\x03day\x12\x14\n" +
	"\x05hours\x18\x04 \x01(\x05R\x05hours\x12\x18\n" +
	"\aminutes\x18\x05 \x01(\x05R\aminutes\x12\x18\n" +
	"\aseconds\x18\x06 \x01(\x05R\aseconds\x12\x14\n" +
	"\x05nanos\x18\a \x01(\x05R\x05nanos\x12:\n" +
	"\n" +
	"utc_offset\x18\b \x01(\v2\x19.google.protobuf.DurationH\x00R\tutcOffset\x124\n" +
	"\ttime_zone\x18\t \x01(\v2\x15.google.type.TimeZoneH\x00R\btimeZoneB\r\n" +
	"\vtime_offset\"4\n" +
	"\bTimeZone\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" +
	"\aversion\x18\x02 \x01(\tR\aversionB\xa2\x01\n" +
	"\x0fcom.google.typeB\rDatetimeProtoP\x01Z0github.com/bufbuild/buf-examples/gen/google/type\xf8\x01\x01\xa2\x02\x03GTX\xaa\x02\vGoogle.Type\xca\x02\vGoogle\\Type\xe2\x02\x17Google\\Type\\GPBMetadata\xea\x02\fGoogle::Typeb\x06proto3"

var (
	file_google_type_datetime_proto_rawDescOnce sync.Once
	file_google_type_datetime_proto_rawDescData []byte
)

func file_google_type_datetime_proto_rawDescGZIP() []byte {
	file_google_type_datetime_proto_rawDescOnce.Do(func() {
		file_google_type_datetime_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_type_datetime_proto_rawDesc), len(file_google_type_datetime_proto_rawDesc)))
	})
	return file_google_type_datetime_proto_rawDescData
}

var file_google_type_datetime_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_google_type_datetime_proto_goTypes = []any{
	(*DateTime)(nil),            // 0: google.type.DateTime
	(*TimeZone)(nil),            // 1: google.type.TimeZone
	(*durationpb.Duration)(nil), // 2: google.protobuf.Duration
}
var file_google_type_datetime_proto_depIdxs = []int32{
	2, // 0: google.type.DateTime.utc_offset:type_name -> google.protobuf.Duration
	1, // 1: google.type.DateTime.time_zone:type_name -> google.type.TimeZone
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_google_type_datetime_proto_init() }
func file_google_type_datetime_proto_init() {
	if File_google_type_datetime_proto != nil {
		return
	}
	file_google_type_datetime_proto_msgTypes[0].OneofWrappers = []any{
		(*DateTime_UtcOffset)(nil),
		(*DateTime_TimeZone)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_type_datetime_proto_rawDesc), len(file_google_type_datetime_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_google_type_datetime_proto_goTypes,
		DependencyIndexes: file_google_type_datetime_proto_depIdxs,
		MessageInfos:      file_google_type_datetime_proto_msgTypes,
	}.Build()
	File_google_type_datetime_proto = out.File
	file_google_type_datetime_proto_goTypes = nil
	file_google_type_datetime_proto_depIdxs = nil
}
