OLD | NEW |
1 // Generated by the protocol buffer compiler. DO NOT EDIT! | 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 // source: google/protobuf/timestamp.proto | 2 // source: google/protobuf/timestamp.proto |
3 #pragma warning disable 1591, 0612, 3021 | 3 #pragma warning disable 1591, 0612, 3021 |
4 #region Designer generated code | 4 #region Designer generated code |
5 | 5 |
6 using pb = global::Google.Protobuf; | 6 using pb = global::Google.Protobuf; |
7 using pbc = global::Google.Protobuf.Collections; | 7 using pbc = global::Google.Protobuf.Collections; |
8 using pbr = global::Google.Protobuf.Reflection; | 8 using pbr = global::Google.Protobuf.Reflection; |
9 using scg = global::System.Collections.Generic; | 9 using scg = global::System.Collections.Generic; |
10 namespace Google.Protobuf.WellKnownTypes { | 10 namespace Google.Protobuf.WellKnownTypes { |
11 | 11 |
12 /// <summary>Holder for reflection information generated from google/protobuf/
timestamp.proto</summary> | 12 /// <summary>Holder for reflection information generated from google/protobuf/
timestamp.proto</summary> |
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |
14 public static partial class TimestampReflection { | 13 public static partial class TimestampReflection { |
15 | 14 |
16 #region Descriptor | 15 #region Descriptor |
17 /// <summary>File descriptor for google/protobuf/timestamp.proto</summary> | 16 /// <summary>File descriptor for google/protobuf/timestamp.proto</summary> |
18 public static pbr::FileDescriptor Descriptor { | 17 public static pbr::FileDescriptor Descriptor { |
19 get { return descriptor; } | 18 get { return descriptor; } |
20 } | 19 } |
21 private static pbr::FileDescriptor descriptor; | 20 private static pbr::FileDescriptor descriptor; |
22 | 21 |
23 static TimestampReflection() { | 22 static TimestampReflection() { |
24 byte[] descriptorData = global::System.Convert.FromBase64String( | 23 byte[] descriptorData = global::System.Convert.FromBase64String( |
25 string.Concat( | 24 string.Concat( |
26 "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", | 25 "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", |
27 "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", | 26 "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", |
28 "AiABKAVCgQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3Rv", | 27 "AiABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", |
29 "UAFaK2dpdGh1Yi5jb20vZ29sYW5nL3Byb3RvYnVmL3B0eXBlcy90aW1lc3Rh", | 28 "AVorZ2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL3RpbWVzdGFt", |
30 "bXCgAQH4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", | 29 "cPgBAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", |
31 "ZXNiBnByb3RvMw==")); | 30 "cHJvdG8z")); |
32 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | 31 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
33 new pbr::FileDescriptor[] { }, | 32 new pbr::FileDescriptor[] { }, |
34 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | 33 new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { |
35 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKno
wnTypes.Timestamp), global::Google.Protobuf.WellKnownTypes.Timestamp.Parser, new
[]{ "Seconds", "Nanos" }, null, null, null) | 34 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKno
wnTypes.Timestamp), global::Google.Protobuf.WellKnownTypes.Timestamp.Parser, new
[]{ "Seconds", "Nanos" }, null, null, null) |
36 })); | 35 })); |
37 } | 36 } |
38 #endregion | 37 #endregion |
39 | 38 |
40 } | 39 } |
41 #region Messages | 40 #region Messages |
42 /// <summary> | 41 /// <summary> |
43 /// A Timestamp represents a point in time independent of any time zone | 42 /// A Timestamp represents a point in time independent of any time zone |
44 /// or calendar, represented as seconds and fractions of seconds at | 43 /// or calendar, represented as seconds and fractions of seconds at |
45 /// nanosecond resolution in UTC Epoch time. It is encoded using the | 44 /// nanosecond resolution in UTC Epoch time. It is encoded using the |
46 /// Proleptic Gregorian Calendar which extends the Gregorian calendar | 45 /// Proleptic Gregorian Calendar which extends the Gregorian calendar |
47 /// backwards to year one. It is encoded assuming all minutes are 60 | 46 /// backwards to year one. It is encoded assuming all minutes are 60 |
48 /// seconds long, i.e. leap seconds are "smeared" so that no leap second | 47 /// seconds long, i.e. leap seconds are "smeared" so that no leap second |
49 /// table is needed for interpretation. Range is from | 48 /// table is needed for interpretation. Range is from |
50 /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. | 49 /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. |
51 /// By restricting to that range, we ensure that we can convert to | 50 /// By restricting to that range, we ensure that we can convert to |
52 /// and from RFC 3339 date strings. | 51 /// and from RFC 3339 date strings. |
53 /// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc33
39.txt). | 52 /// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc333
9.txt). |
54 /// | 53 /// |
55 /// Example 1: Compute Timestamp from POSIX `time()`. | 54 /// Example 1: Compute Timestamp from POSIX `time()`. |
56 /// | 55 /// |
57 /// Timestamp timestamp; | 56 /// Timestamp timestamp; |
58 /// timestamp.set_seconds(time(NULL)); | 57 /// timestamp.set_seconds(time(NULL)); |
59 /// timestamp.set_nanos(0); | 58 /// timestamp.set_nanos(0); |
60 /// | 59 /// |
61 /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. | 60 /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. |
62 /// | 61 /// |
63 /// struct timeval tv; | 62 /// struct timeval tv; |
64 /// gettimeofday(&tv, NULL); | 63 /// gettimeofday(&tv, NULL); |
65 /// | 64 /// |
66 /// Timestamp timestamp; | 65 /// Timestamp timestamp; |
67 /// timestamp.set_seconds(tv.tv_sec); | 66 /// timestamp.set_seconds(tv.tv_sec); |
68 /// timestamp.set_nanos(tv.tv_usec * 1000); | 67 /// timestamp.set_nanos(tv.tv_usec * 1000); |
69 /// | 68 /// |
70 /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. | 69 /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. |
71 /// | 70 /// |
72 /// FILETIME ft; | 71 /// FILETIME ft; |
73 /// GetSystemTimeAsFileTime(&ft); | 72 /// GetSystemTimeAsFileTime(&ft); |
74 /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDa
teTime; | 73 /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDat
eTime; |
75 /// | 74 /// |
76 /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:
00Z | 75 /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:0
0Z |
77 /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. | 76 /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. |
78 /// Timestamp timestamp; | 77 /// Timestamp timestamp; |
79 /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); | 78 /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); |
80 /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); | 79 /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); |
81 /// | 80 /// |
82 /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. | 81 /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. |
83 /// | 82 /// |
84 /// long millis = System.currentTimeMillis(); | 83 /// long millis = System.currentTimeMillis(); |
85 /// | 84 /// |
86 /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000
) | 85 /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) |
87 /// .setNanos((int) ((millis % 1000) * 1000000)).build(); | 86 /// .setNanos((int) ((millis % 1000) * 1000000)).build(); |
88 /// | 87 /// |
89 /// Example 5: Compute Timestamp from current time in Python. | 88 /// Example 5: Compute Timestamp from current time in Python. |
90 /// | 89 /// |
91 /// now = time.time() | 90 /// timestamp = Timestamp() |
92 /// seconds = int(now) | 91 /// timestamp.GetCurrentTime() |
93 /// nanos = int((now - seconds) * 10**9) | |
94 /// timestamp = Timestamp(seconds=seconds, nanos=nanos) | |
95 /// </summary> | 92 /// </summary> |
96 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |
97 public sealed partial class Timestamp : pb::IMessage<Timestamp> { | 93 public sealed partial class Timestamp : pb::IMessage<Timestamp> { |
98 private static readonly pb::MessageParser<Timestamp> _parser = new pb::Messa
geParser<Timestamp>(() => new Timestamp()); | 94 private static readonly pb::MessageParser<Timestamp> _parser = new pb::Messa
geParser<Timestamp>(() => new Timestamp()); |
| 95 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
99 public static pb::MessageParser<Timestamp> Parser { get { return _parser; }
} | 96 public static pb::MessageParser<Timestamp> Parser { get { return _parser; }
} |
100 | 97 |
| 98 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
101 public static pbr::MessageDescriptor Descriptor { | 99 public static pbr::MessageDescriptor Descriptor { |
102 get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.De
scriptor.MessageTypes[0]; } | 100 get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.De
scriptor.MessageTypes[0]; } |
103 } | 101 } |
104 | 102 |
| 103 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
105 pbr::MessageDescriptor pb::IMessage.Descriptor { | 104 pbr::MessageDescriptor pb::IMessage.Descriptor { |
106 get { return Descriptor; } | 105 get { return Descriptor; } |
107 } | 106 } |
108 | 107 |
| 108 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
109 public Timestamp() { | 109 public Timestamp() { |
110 OnConstruction(); | 110 OnConstruction(); |
111 } | 111 } |
112 | 112 |
113 partial void OnConstruction(); | 113 partial void OnConstruction(); |
114 | 114 |
| 115 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
115 public Timestamp(Timestamp other) : this() { | 116 public Timestamp(Timestamp other) : this() { |
116 seconds_ = other.seconds_; | 117 seconds_ = other.seconds_; |
117 nanos_ = other.nanos_; | 118 nanos_ = other.nanos_; |
118 } | 119 } |
119 | 120 |
| 121 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
120 public Timestamp Clone() { | 122 public Timestamp Clone() { |
121 return new Timestamp(this); | 123 return new Timestamp(this); |
122 } | 124 } |
123 | 125 |
124 /// <summary>Field number for the "seconds" field.</summary> | 126 /// <summary>Field number for the "seconds" field.</summary> |
125 public const int SecondsFieldNumber = 1; | 127 public const int SecondsFieldNumber = 1; |
126 private long seconds_; | 128 private long seconds_; |
127 /// <summary> | 129 /// <summary> |
128 /// Represents seconds of UTC time since Unix epoch | 130 /// Represents seconds of UTC time since Unix epoch |
129 /// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to | 131 /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to |
130 /// 9999-12-31T23:59:59Z inclusive. | 132 /// 9999-12-31T23:59:59Z inclusive. |
131 /// </summary> | 133 /// </summary> |
| 134 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
132 public long Seconds { | 135 public long Seconds { |
133 get { return seconds_; } | 136 get { return seconds_; } |
134 set { | 137 set { |
135 seconds_ = value; | 138 seconds_ = value; |
136 } | 139 } |
137 } | 140 } |
138 | 141 |
139 /// <summary>Field number for the "nanos" field.</summary> | 142 /// <summary>Field number for the "nanos" field.</summary> |
140 public const int NanosFieldNumber = 2; | 143 public const int NanosFieldNumber = 2; |
141 private int nanos_; | 144 private int nanos_; |
142 /// <summary> | 145 /// <summary> |
143 /// Non-negative fractions of a second at nanosecond resolution. Negative | 146 /// Non-negative fractions of a second at nanosecond resolution. Negative |
144 /// second values with fractions must still have non-negative nanos values | 147 /// second values with fractions must still have non-negative nanos values |
145 /// that count forward in time. Must be from 0 to 999,999,999 | 148 /// that count forward in time. Must be from 0 to 999,999,999 |
146 /// inclusive. | 149 /// inclusive. |
147 /// </summary> | 150 /// </summary> |
| 151 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
148 public int Nanos { | 152 public int Nanos { |
149 get { return nanos_; } | 153 get { return nanos_; } |
150 set { | 154 set { |
151 nanos_ = value; | 155 nanos_ = value; |
152 } | 156 } |
153 } | 157 } |
154 | 158 |
| 159 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
155 public override bool Equals(object other) { | 160 public override bool Equals(object other) { |
156 return Equals(other as Timestamp); | 161 return Equals(other as Timestamp); |
157 } | 162 } |
158 | 163 |
| 164 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
159 public bool Equals(Timestamp other) { | 165 public bool Equals(Timestamp other) { |
160 if (ReferenceEquals(other, null)) { | 166 if (ReferenceEquals(other, null)) { |
161 return false; | 167 return false; |
162 } | 168 } |
163 if (ReferenceEquals(other, this)) { | 169 if (ReferenceEquals(other, this)) { |
164 return true; | 170 return true; |
165 } | 171 } |
166 if (Seconds != other.Seconds) return false; | 172 if (Seconds != other.Seconds) return false; |
167 if (Nanos != other.Nanos) return false; | 173 if (Nanos != other.Nanos) return false; |
168 return true; | 174 return true; |
169 } | 175 } |
170 | 176 |
| 177 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
171 public override int GetHashCode() { | 178 public override int GetHashCode() { |
172 int hash = 1; | 179 int hash = 1; |
173 if (Seconds != 0L) hash ^= Seconds.GetHashCode(); | 180 if (Seconds != 0L) hash ^= Seconds.GetHashCode(); |
174 if (Nanos != 0) hash ^= Nanos.GetHashCode(); | 181 if (Nanos != 0) hash ^= Nanos.GetHashCode(); |
175 return hash; | 182 return hash; |
176 } | 183 } |
177 | 184 |
| 185 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
178 public override string ToString() { | 186 public override string ToString() { |
179 return pb::JsonFormatter.ToDiagnosticString(this); | 187 return pb::JsonFormatter.ToDiagnosticString(this); |
180 } | 188 } |
181 | 189 |
| 190 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
182 public void WriteTo(pb::CodedOutputStream output) { | 191 public void WriteTo(pb::CodedOutputStream output) { |
183 if (Seconds != 0L) { | 192 if (Seconds != 0L) { |
184 output.WriteRawTag(8); | 193 output.WriteRawTag(8); |
185 output.WriteInt64(Seconds); | 194 output.WriteInt64(Seconds); |
186 } | 195 } |
187 if (Nanos != 0) { | 196 if (Nanos != 0) { |
188 output.WriteRawTag(16); | 197 output.WriteRawTag(16); |
189 output.WriteInt32(Nanos); | 198 output.WriteInt32(Nanos); |
190 } | 199 } |
191 } | 200 } |
192 | 201 |
| 202 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
193 public int CalculateSize() { | 203 public int CalculateSize() { |
194 int size = 0; | 204 int size = 0; |
195 if (Seconds != 0L) { | 205 if (Seconds != 0L) { |
196 size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds); | 206 size += 1 + pb::CodedOutputStream.ComputeInt64Size(Seconds); |
197 } | 207 } |
198 if (Nanos != 0) { | 208 if (Nanos != 0) { |
199 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); | 209 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Nanos); |
200 } | 210 } |
201 return size; | 211 return size; |
202 } | 212 } |
203 | 213 |
| 214 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
204 public void MergeFrom(Timestamp other) { | 215 public void MergeFrom(Timestamp other) { |
205 if (other == null) { | 216 if (other == null) { |
206 return; | 217 return; |
207 } | 218 } |
208 if (other.Seconds != 0L) { | 219 if (other.Seconds != 0L) { |
209 Seconds = other.Seconds; | 220 Seconds = other.Seconds; |
210 } | 221 } |
211 if (other.Nanos != 0) { | 222 if (other.Nanos != 0) { |
212 Nanos = other.Nanos; | 223 Nanos = other.Nanos; |
213 } | 224 } |
214 } | 225 } |
215 | 226 |
| 227 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
216 public void MergeFrom(pb::CodedInputStream input) { | 228 public void MergeFrom(pb::CodedInputStream input) { |
217 uint tag; | 229 uint tag; |
218 while ((tag = input.ReadTag()) != 0) { | 230 while ((tag = input.ReadTag()) != 0) { |
219 switch(tag) { | 231 switch(tag) { |
220 default: | 232 default: |
221 input.SkipLastField(); | 233 input.SkipLastField(); |
222 break; | 234 break; |
223 case 8: { | 235 case 8: { |
224 Seconds = input.ReadInt64(); | 236 Seconds = input.ReadInt64(); |
225 break; | 237 break; |
226 } | 238 } |
227 case 16: { | 239 case 16: { |
228 Nanos = input.ReadInt32(); | 240 Nanos = input.ReadInt32(); |
229 break; | 241 break; |
230 } | 242 } |
231 } | 243 } |
232 } | 244 } |
233 } | 245 } |
234 | 246 |
235 } | 247 } |
236 | 248 |
237 #endregion | 249 #endregion |
238 | 250 |
239 } | 251 } |
240 | 252 |
241 #endregion Designer generated code | 253 #endregion Designer generated code |
OLD | NEW |