• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: google/protobuf/timestamp.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021
6 #region Designer generated code
7 
8 using pb = global::Google.Protobuf;
9 using pbc = global::Google.Protobuf.Collections;
10 using pbr = global::Google.Protobuf.Reflection;
11 using scg = global::System.Collections.Generic;
12 namespace Google.Protobuf.WellKnownTypes {
13 
14   /// <summary>Holder for reflection information generated from google/protobuf/timestamp.proto</summary>
15   public static partial class TimestampReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for google/protobuf/timestamp.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
TimestampReflection()24     static TimestampReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv",
28             "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY",
29             "AiABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q",
30             "AVorZ2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL3RpbWVzdGFt",
31             "cPgBAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG",
32             "cHJvdG8z"));
33       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
34           new pbr::FileDescriptor[] { },
35           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
36             new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), global::Google.Protobuf.WellKnownTypes.Timestamp.Parser, new[]{ "Seconds", "Nanos" }, null, null, null, null)
37           }));
38     }
39     #endregion
40 
41   }
42   #region Messages
43   /// <summary>
44   /// A Timestamp represents a point in time independent of any time zone or local
45   /// calendar, encoded as a count of seconds and fractions of seconds at
46   /// nanosecond resolution. The count is relative to an epoch at UTC midnight on
47   /// January 1, 1970, in the proleptic Gregorian calendar which extends the
48   /// Gregorian calendar backwards to year one.
49   ///
50   /// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
51   /// second table is needed for interpretation, using a [24-hour linear
52   /// smear](https://developers.google.com/time/smear).
53   ///
54   /// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
55   /// restricting to that range, we ensure that we can convert to and from [RFC
56   /// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
57   ///
58   /// # Examples
59   ///
60   /// Example 1: Compute Timestamp from POSIX `time()`.
61   ///
62   ///     Timestamp timestamp;
63   ///     timestamp.set_seconds(time(NULL));
64   ///     timestamp.set_nanos(0);
65   ///
66   /// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
67   ///
68   ///     struct timeval tv;
69   ///     gettimeofday(&amp;tv, NULL);
70   ///
71   ///     Timestamp timestamp;
72   ///     timestamp.set_seconds(tv.tv_sec);
73   ///     timestamp.set_nanos(tv.tv_usec * 1000);
74   ///
75   /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
76   ///
77   ///     FILETIME ft;
78   ///     GetSystemTimeAsFileTime(&amp;ft);
79   ///     UINT64 ticks = (((UINT64)ft.dwHighDateTime) &lt;&lt; 32) | ft.dwLowDateTime;
80   ///
81   ///     // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
82   ///     // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
83   ///     Timestamp timestamp;
84   ///     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
85   ///     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
86   ///
87   /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
88   ///
89   ///     long millis = System.currentTimeMillis();
90   ///
91   ///     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
92   ///         .setNanos((int) ((millis % 1000) * 1000000)).build();
93   ///
94   /// Example 5: Compute Timestamp from current time in Python.
95   ///
96   ///     timestamp = Timestamp()
97   ///     timestamp.GetCurrentTime()
98   ///
99   /// # JSON Mapping
100   ///
101   /// In JSON format, the Timestamp type is encoded as a string in the
102   /// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
103   /// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
104   /// where {year} is always expressed using four digits while {month}, {day},
105   /// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
106   /// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
107   /// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
108   /// is required. A proto3 JSON serializer should always use UTC (as indicated by
109   /// "Z") when printing the Timestamp type and a proto3 JSON parser should be
110   /// able to accept both UTC and other timezones (as indicated by an offset).
111   ///
112   /// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
113   /// 01:30 UTC on January 15, 2017.
114   ///
115   /// In JavaScript, one can convert a Date object to this format using the
116   /// standard
117   /// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
118   /// method. In Python, a standard `datetime.datetime` object can be converted
119   /// to this format using
120   /// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
121   /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
122   /// the Joda Time's [`ISODateTimeFormat.dateTime()`](
123   /// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
124   /// ) to obtain a formatter capable of generating timestamps in this format.
125   /// </summary>
126   public sealed partial class Timestamp : pb::IMessage<Timestamp> {
127     private static readonly pb::MessageParser<Timestamp> _parser = new pb::MessageParser<Timestamp>(() => new Timestamp());
128     private pb::UnknownFieldSet _unknownFields;
129     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
130     public static pb::MessageParser<Timestamp> Parser { get { return _parser; } }
131 
132     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
133     public static pbr::MessageDescriptor Descriptor {
134       get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor.MessageTypes[0]; }
135     }
136 
137     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
138     pbr::MessageDescriptor pb::IMessage.Descriptor {
139       get { return Descriptor; }
140     }
141 
142     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Timestamp()143     public Timestamp() {
144       OnConstruction();
145     }
146 
OnConstruction()147     partial void OnConstruction();
148 
149     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Timestamp(Timestamp other)150     public Timestamp(Timestamp other) : this() {
151       seconds_ = other.seconds_;
152       nanos_ = other.nanos_;
153       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
154     }
155 
156     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Clone()157     public Timestamp Clone() {
158       return new Timestamp(this);
159     }
160 
161     /// <summary>Field number for the "seconds" field.</summary>
162     public const int SecondsFieldNumber = 1;
163     private long seconds_;
164     /// <summary>
165     /// Represents seconds of UTC time since Unix epoch
166     /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
167     /// 9999-12-31T23:59:59Z inclusive.
168     /// </summary>
169     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
170     public long Seconds {
171       get { return seconds_; }
172       set {
173         seconds_ = value;
174       }
175     }
176 
177     /// <summary>Field number for the "nanos" field.</summary>
178     public const int NanosFieldNumber = 2;
179     private int nanos_;
180     /// <summary>
181     /// Non-negative fractions of a second at nanosecond resolution. Negative
182     /// second values with fractions must still have non-negative nanos values
183     /// that count forward in time. Must be from 0 to 999,999,999
184     /// inclusive.
185     /// </summary>
186     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
187     public int Nanos {
188       get { return nanos_; }
189       set {
190         nanos_ = value;
191       }
192     }
193 
194     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(object other)195     public override bool Equals(object other) {
196       return Equals(other as Timestamp);
197     }
198 
199     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(Timestamp other)200     public bool Equals(Timestamp other) {
201       if (ReferenceEquals(other, null)) {
202         return false;
203       }
204       if (ReferenceEquals(other, this)) {
205         return true;
206       }
207       if (Seconds != other.Seconds) return false;
208       if (Nanos != other.Nanos) return false;
209       return Equals(_unknownFields, other._unknownFields);
210     }
211 
212     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
GetHashCode()213     public override int GetHashCode() {
214       int hash = 1;
215       if (Seconds != 0L) hash ^= Seconds.GetHashCode();
216       if (Nanos != 0) hash ^= Nanos.GetHashCode();
217       if (_unknownFields != null) {
218         hash ^= _unknownFields.GetHashCode();
219       }
220       return hash;
221     }
222 
223     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ToString()224     public override string ToString() {
225       return pb::JsonFormatter.ToDiagnosticString(this);
226     }
227 
228     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
WriteTo(pb::CodedOutputStream output)229     public void WriteTo(pb::CodedOutputStream output) {
230       if (Seconds != 0L) {
231         output.WriteRawTag(8);
232         output.WriteInt64(Seconds);
233       }
234       if (Nanos != 0) {
235         output.WriteRawTag(16);
236         output.WriteInt32(Nanos);
237       }
238       if (_unknownFields != null) {
239         _unknownFields.WriteTo(output);
240       }
241     }
242 
243     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
CalculateSize()244     public int CalculateSize() {
245       int size = 0;
246       if (Seconds != 0L) {
247         size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds);
248       }
249       if (Nanos != 0) {
250         size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos);
251       }
252       if (_unknownFields != null) {
253         size += _unknownFields.CalculateSize();
254       }
255       return size;
256     }
257 
258     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(Timestamp other)259     public void MergeFrom(Timestamp other) {
260       if (other == null) {
261         return;
262       }
263       if (other.Seconds != 0L) {
264         Seconds = other.Seconds;
265       }
266       if (other.Nanos != 0) {
267         Nanos = other.Nanos;
268       }
269       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
270     }
271 
272     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(pb::CodedInputStream input)273     public void MergeFrom(pb::CodedInputStream input) {
274       uint tag;
275       while ((tag = input.ReadTag()) != 0) {
276         switch(tag) {
277           default:
278             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
279             break;
280           case 8: {
281             Seconds = input.ReadInt64();
282             break;
283           }
284           case 16: {
285             Nanos = input.ReadInt32();
286             break;
287           }
288         }
289       }
290     }
291 
292   }
293 
294   #endregion
295 
296 }
297 
298 #endregion Designer generated code
299