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