• 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             "AiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3Rv",
30             "UAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Rp",
31             "bWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93",
32             "blR5cGVzYgZwcm90bzM="));
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 Java `Instant.now()`.
95   ///
96   ///     Instant now = Instant.now();
97   ///
98   ///     Timestamp timestamp =
99   ///         Timestamp.newBuilder().setSeconds(now.getEpochSecond())
100   ///             .setNanos(now.getNano()).build();
101   ///
102   /// Example 6: Compute Timestamp from current time in Python.
103   ///
104   ///     timestamp = Timestamp()
105   ///     timestamp.GetCurrentTime()
106   ///
107   /// # JSON Mapping
108   ///
109   /// In JSON format, the Timestamp type is encoded as a string in the
110   /// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
111   /// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
112   /// where {year} is always expressed using four digits while {month}, {day},
113   /// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
114   /// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
115   /// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
116   /// is required. A proto3 JSON serializer should always use UTC (as indicated by
117   /// "Z") when printing the Timestamp type and a proto3 JSON parser should be
118   /// able to accept both UTC and other timezones (as indicated by an offset).
119   ///
120   /// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
121   /// 01:30 UTC on January 15, 2017.
122   ///
123   /// In JavaScript, one can convert a Date object to this format using the
124   /// standard
125   /// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
126   /// method. In Python, a standard `datetime.datetime` object can be converted
127   /// to this format using
128   /// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
129   /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
130   /// the Joda Time's [`ISODateTimeFormat.dateTime()`](
131   /// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
132   /// ) to obtain a formatter capable of generating timestamps in this format.
133   /// </summary>
134   public sealed partial class Timestamp : pb::IMessage<Timestamp>
135   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
136       , pb::IBufferMessage
137   #endif
138   {
139     private static readonly pb::MessageParser<Timestamp> _parser = new pb::MessageParser<Timestamp>(() => new Timestamp());
140     private pb::UnknownFieldSet _unknownFields;
141     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
142     public static pb::MessageParser<Timestamp> Parser { get { return _parser; } }
143 
144     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
145     public static pbr::MessageDescriptor Descriptor {
146       get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor.MessageTypes[0]; }
147     }
148 
149     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
150     pbr::MessageDescriptor pb::IMessage.Descriptor {
151       get { return Descriptor; }
152     }
153 
154     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Timestamp()155     public Timestamp() {
156       OnConstruction();
157     }
158 
OnConstruction()159     partial void OnConstruction();
160 
161     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Timestamp(Timestamp other)162     public Timestamp(Timestamp other) : this() {
163       seconds_ = other.seconds_;
164       nanos_ = other.nanos_;
165       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
166     }
167 
168     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Clone()169     public Timestamp Clone() {
170       return new Timestamp(this);
171     }
172 
173     /// <summary>Field number for the "seconds" field.</summary>
174     public const int SecondsFieldNumber = 1;
175     private long seconds_;
176     /// <summary>
177     /// Represents seconds of UTC time since Unix epoch
178     /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
179     /// 9999-12-31T23:59:59Z inclusive.
180     /// </summary>
181     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
182     public long Seconds {
183       get { return seconds_; }
184       set {
185         seconds_ = value;
186       }
187     }
188 
189     /// <summary>Field number for the "nanos" field.</summary>
190     public const int NanosFieldNumber = 2;
191     private int nanos_;
192     /// <summary>
193     /// Non-negative fractions of a second at nanosecond resolution. Negative
194     /// second values with fractions must still have non-negative nanos values
195     /// that count forward in time. Must be from 0 to 999,999,999
196     /// inclusive.
197     /// </summary>
198     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
199     public int Nanos {
200       get { return nanos_; }
201       set {
202         nanos_ = value;
203       }
204     }
205 
206     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(object other)207     public override bool Equals(object other) {
208       return Equals(other as Timestamp);
209     }
210 
211     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Equals(Timestamp other)212     public bool Equals(Timestamp other) {
213       if (ReferenceEquals(other, null)) {
214         return false;
215       }
216       if (ReferenceEquals(other, this)) {
217         return true;
218       }
219       if (Seconds != other.Seconds) return false;
220       if (Nanos != other.Nanos) return false;
221       return Equals(_unknownFields, other._unknownFields);
222     }
223 
224     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
GetHashCode()225     public override int GetHashCode() {
226       int hash = 1;
227       if (Seconds != 0L) hash ^= Seconds.GetHashCode();
228       if (Nanos != 0) hash ^= Nanos.GetHashCode();
229       if (_unknownFields != null) {
230         hash ^= _unknownFields.GetHashCode();
231       }
232       return hash;
233     }
234 
235     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
ToString()236     public override string ToString() {
237       return pb::JsonFormatter.ToDiagnosticString(this);
238     }
239 
240     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
WriteTo(pb::CodedOutputStream output)241     public void WriteTo(pb::CodedOutputStream output) {
242     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
243       output.WriteRawMessage(this);
244     #else
245       if (Seconds != 0L) {
246         output.WriteRawTag(8);
247         output.WriteInt64(Seconds);
248       }
249       if (Nanos != 0) {
250         output.WriteRawTag(16);
251         output.WriteInt32(Nanos);
252       }
253       if (_unknownFields != null) {
254         _unknownFields.WriteTo(output);
255       }
256     #endif
257     }
258 
259     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
260     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)261     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
262       if (Seconds != 0L) {
263         output.WriteRawTag(8);
264         output.WriteInt64(Seconds);
265       }
266       if (Nanos != 0) {
267         output.WriteRawTag(16);
268         output.WriteInt32(Nanos);
269       }
270       if (_unknownFields != null) {
271         _unknownFields.WriteTo(ref output);
272       }
273     }
274     #endif
275 
276     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
CalculateSize()277     public int CalculateSize() {
278       int size = 0;
279       if (Seconds != 0L) {
280         size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds);
281       }
282       if (Nanos != 0) {
283         size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos);
284       }
285       if (_unknownFields != null) {
286         size += _unknownFields.CalculateSize();
287       }
288       return size;
289     }
290 
291     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(Timestamp other)292     public void MergeFrom(Timestamp other) {
293       if (other == null) {
294         return;
295       }
296       if (other.Seconds != 0L) {
297         Seconds = other.Seconds;
298       }
299       if (other.Nanos != 0) {
300         Nanos = other.Nanos;
301       }
302       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
303     }
304 
305     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
MergeFrom(pb::CodedInputStream input)306     public void MergeFrom(pb::CodedInputStream input) {
307     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
308       input.ReadRawMessage(this);
309     #else
310       uint tag;
311       while ((tag = input.ReadTag()) != 0) {
312         switch(tag) {
313           default:
314             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
315             break;
316           case 8: {
317             Seconds = input.ReadInt64();
318             break;
319           }
320           case 16: {
321             Nanos = input.ReadInt32();
322             break;
323           }
324         }
325       }
326     #endif
327     }
328 
329     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
330     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)331     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
332       uint tag;
333       while ((tag = input.ReadTag()) != 0) {
334         switch(tag) {
335           default:
336             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
337             break;
338           case 8: {
339             Seconds = input.ReadInt64();
340             break;
341           }
342           case 16: {
343             Nanos = input.ReadInt32();
344             break;
345           }
346         }
347       }
348     }
349     #endif
350 
351   }
352 
353   #endregion
354 
355 }
356 
357 #endregion Designer generated code
358