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