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, 8981 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(&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(&ft); 79 /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 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://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() 132 /// ) to obtain a formatter capable of generating timestamps in this format. 133 /// </summary> 134 [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] 135 public sealed partial class Timestamp : pb::IMessage<Timestamp> 136 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 137 , pb::IBufferMessage 138 #endif 139 { 140 private static readonly pb::MessageParser<Timestamp> _parser = new pb::MessageParser<Timestamp>(() => new Timestamp()); 141 private pb::UnknownFieldSet _unknownFields; 142 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 143 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] 144 public static pb::MessageParser<Timestamp> Parser { get { return _parser; } } 145 146 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 147 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] 148 public static pbr::MessageDescriptor Descriptor { 149 get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor.MessageTypes[0]; } 150 } 151 152 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 153 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] 154 pbr::MessageDescriptor pb::IMessage.Descriptor { 155 get { return Descriptor; } 156 } 157 158 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 159 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] Timestamp()160 public Timestamp() { 161 OnConstruction(); 162 } 163 OnConstruction()164 partial void OnConstruction(); 165 166 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 167 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] Timestamp(Timestamp other)168 public Timestamp(Timestamp other) : this() { 169 seconds_ = other.seconds_; 170 nanos_ = other.nanos_; 171 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); 172 } 173 174 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 175 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] Clone()176 public Timestamp Clone() { 177 return new Timestamp(this); 178 } 179 180 /// <summary>Field number for the "seconds" field.</summary> 181 public const int SecondsFieldNumber = 1; 182 private long seconds_; 183 /// <summary> 184 /// Represents seconds of UTC time since Unix epoch 185 /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 186 /// 9999-12-31T23:59:59Z inclusive. 187 /// </summary> 188 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 189 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] 190 public long Seconds { 191 get { return seconds_; } 192 set { 193 seconds_ = value; 194 } 195 } 196 197 /// <summary>Field number for the "nanos" field.</summary> 198 public const int NanosFieldNumber = 2; 199 private int nanos_; 200 /// <summary> 201 /// Non-negative fractions of a second at nanosecond resolution. Negative 202 /// second values with fractions must still have non-negative nanos values 203 /// that count forward in time. Must be from 0 to 999,999,999 204 /// inclusive. 205 /// </summary> 206 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 207 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] 208 public int Nanos { 209 get { return nanos_; } 210 set { 211 nanos_ = value; 212 } 213 } 214 215 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 216 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] Equals(object other)217 public override bool Equals(object other) { 218 return Equals(other as Timestamp); 219 } 220 221 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 222 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] Equals(Timestamp other)223 public bool Equals(Timestamp other) { 224 if (ReferenceEquals(other, null)) { 225 return false; 226 } 227 if (ReferenceEquals(other, this)) { 228 return true; 229 } 230 if (Seconds != other.Seconds) return false; 231 if (Nanos != other.Nanos) return false; 232 return Equals(_unknownFields, other._unknownFields); 233 } 234 235 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 236 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] GetHashCode()237 public override int GetHashCode() { 238 int hash = 1; 239 if (Seconds != 0L) hash ^= Seconds.GetHashCode(); 240 if (Nanos != 0) hash ^= Nanos.GetHashCode(); 241 if (_unknownFields != null) { 242 hash ^= _unknownFields.GetHashCode(); 243 } 244 return hash; 245 } 246 247 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 248 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] ToString()249 public override string ToString() { 250 return pb::JsonFormatter.ToDiagnosticString(this); 251 } 252 253 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 254 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] WriteTo(pb::CodedOutputStream output)255 public void WriteTo(pb::CodedOutputStream output) { 256 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 257 output.WriteRawMessage(this); 258 #else 259 if (Seconds != 0L) { 260 output.WriteRawTag(8); 261 output.WriteInt64(Seconds); 262 } 263 if (Nanos != 0) { 264 output.WriteRawTag(16); 265 output.WriteInt32(Nanos); 266 } 267 if (_unknownFields != null) { 268 _unknownFields.WriteTo(output); 269 } 270 #endif 271 } 272 273 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 274 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 275 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] IBufferMessage.InternalWriteTo(ref pb::WriteContext output)276 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { 277 if (Seconds != 0L) { 278 output.WriteRawTag(8); 279 output.WriteInt64(Seconds); 280 } 281 if (Nanos != 0) { 282 output.WriteRawTag(16); 283 output.WriteInt32(Nanos); 284 } 285 if (_unknownFields != null) { 286 _unknownFields.WriteTo(ref output); 287 } 288 } 289 #endif 290 291 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 292 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] CalculateSize()293 public int CalculateSize() { 294 int size = 0; 295 if (Seconds != 0L) { 296 size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds); 297 } 298 if (Nanos != 0) { 299 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); 300 } 301 if (_unknownFields != null) { 302 size += _unknownFields.CalculateSize(); 303 } 304 return size; 305 } 306 307 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 308 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] MergeFrom(Timestamp other)309 public void MergeFrom(Timestamp other) { 310 if (other == null) { 311 return; 312 } 313 if (other.Seconds != 0L) { 314 Seconds = other.Seconds; 315 } 316 if (other.Nanos != 0) { 317 Nanos = other.Nanos; 318 } 319 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); 320 } 321 322 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 323 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] MergeFrom(pb::CodedInputStream input)324 public void MergeFrom(pb::CodedInputStream input) { 325 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 326 input.ReadRawMessage(this); 327 #else 328 uint tag; 329 while ((tag = input.ReadTag()) != 0) { 330 if ((tag & 7) == 4) { 331 // Abort on any end group tag. 332 return; 333 } 334 switch(tag) { 335 default: 336 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, 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 #endif 349 } 350 351 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE 352 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] 353 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)354 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { 355 uint tag; 356 while ((tag = input.ReadTag()) != 0) { 357 if ((tag & 7) == 4) { 358 // Abort on any end group tag. 359 return; 360 } 361 switch(tag) { 362 default: 363 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); 364 break; 365 case 8: { 366 Seconds = input.ReadInt64(); 367 break; 368 } 369 case 16: { 370 Nanos = input.ReadInt32(); 371 break; 372 } 373 } 374 } 375 } 376 #endif 377 378 } 379 380 #endregion 381 382 } 383 384 #endregion Designer generated code 385