OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.toolresults.v1beta3; | 3 library googleapis_beta.toolresults.v1beta3; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 3790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3801 * calendar, represented as seconds and fractions of seconds at nanosecond | 3801 * calendar, represented as seconds and fractions of seconds at nanosecond |
3802 * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian | 3802 * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian |
3803 * Calendar which extends the Gregorian calendar backwards to year one. It is | 3803 * Calendar which extends the Gregorian calendar backwards to year one. It is |
3804 * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are | 3804 * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are |
3805 * "smeared" so that no leap second table is needed for interpretation. Range is | 3805 * "smeared" so that no leap second table is needed for interpretation. Range is |
3806 * from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting | 3806 * from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting |
3807 * to that range, we ensure that we can convert to and from RFC 3339 date | 3807 * to that range, we ensure that we can convert to and from RFC 3339 date |
3808 * strings. See | 3808 * strings. See |
3809 * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). | 3809 * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). |
3810 * | 3810 * |
| 3811 * # Examples |
| 3812 * |
3811 * Example 1: Compute Timestamp from POSIX `time()`. | 3813 * Example 1: Compute Timestamp from POSIX `time()`. |
3812 * | 3814 * |
3813 * Timestamp timestamp; timestamp.set_seconds(time(NULL)); | 3815 * Timestamp timestamp; timestamp.set_seconds(time(NULL)); |
3814 * timestamp.set_nanos(0); | 3816 * timestamp.set_nanos(0); |
3815 * | 3817 * |
3816 * Example 2: Compute Timestamp from POSIX `gettimeofday()`. | 3818 * Example 2: Compute Timestamp from POSIX `gettimeofday()`. |
3817 * | 3819 * |
3818 * struct timeval tv; gettimeofday(&tv, NULL); | 3820 * struct timeval tv; gettimeofday(&tv, NULL); |
3819 * | 3821 * |
3820 * Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); | 3822 * Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); |
(...skipping 14 matching lines...) Expand all Loading... |
3835 * long millis = System.currentTimeMillis(); | 3837 * long millis = System.currentTimeMillis(); |
3836 * | 3838 * |
3837 * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) | 3839 * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) |
3838 * .setNanos((int) ((millis % 1000) * 1000000)).build(); | 3840 * .setNanos((int) ((millis % 1000) * 1000000)).build(); |
3839 * | 3841 * |
3840 * | 3842 * |
3841 * | 3843 * |
3842 * Example 5: Compute Timestamp from current time in Python. | 3844 * Example 5: Compute Timestamp from current time in Python. |
3843 * | 3845 * |
3844 * timestamp = Timestamp() timestamp.GetCurrentTime() | 3846 * timestamp = Timestamp() timestamp.GetCurrentTime() |
| 3847 * |
| 3848 * # JSON Mapping |
| 3849 * |
| 3850 * In JSON format, the Timestamp type is encoded as a string in the [RFC |
| 3851 * 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is |
| 3852 * "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is |
| 3853 * always expressed using four digits while {month}, {day}, {hour}, {min}, and |
| 3854 * {sec} are zero-padded to two digits each. The fractional seconds, which can |
| 3855 * go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" |
| 3856 * suffix indicates the timezone ("UTC"); the timezone is required, though only |
| 3857 * UTC (as indicated by "Z") is presently supported. |
| 3858 * |
| 3859 * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC |
| 3860 * on January 15, 2017. |
| 3861 * |
| 3862 * In JavaScript, one can convert a Date object to this format using the |
| 3863 * standard |
| 3864 * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
ence/Global_Objects/Date/toISOString] |
| 3865 * method. In Python, a standard `datetime.datetime` object can be converted to |
| 3866 * this format using |
| 3867 * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with |
| 3868 * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use |
| 3869 * the Joda Time's [`ISODateTimeFormat.dateTime()`]( |
| 3870 * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeForm
at.html#dateTime()) |
| 3871 * to obtain a formatter capable of generating timestamps in this format. |
3845 */ | 3872 */ |
3846 class Timestamp { | 3873 class Timestamp { |
3847 /** | 3874 /** |
3848 * Non-negative fractions of a second at nanosecond resolution. Negative | 3875 * Non-negative fractions of a second at nanosecond resolution. Negative |
3849 * second values with fractions must still have non-negative nanos values that | 3876 * second values with fractions must still have non-negative nanos values that |
3850 * count forward in time. Must be from 0 to 999,999,999 inclusive. | 3877 * count forward in time. Must be from 0 to 999,999,999 inclusive. |
3851 */ | 3878 */ |
3852 core.int nanos; | 3879 core.int nanos; |
3853 /** | 3880 /** |
3854 * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must | 3881 * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4060 } | 4087 } |
4061 if (output != null) { | 4088 if (output != null) { |
4062 _json["output"] = (output).toJson(); | 4089 _json["output"] = (output).toJson(); |
4063 } | 4090 } |
4064 if (testCase != null) { | 4091 if (testCase != null) { |
4065 _json["testCase"] = (testCase).toJson(); | 4092 _json["testCase"] = (testCase).toJson(); |
4066 } | 4093 } |
4067 return _json; | 4094 return _json; |
4068 } | 4095 } |
4069 } | 4096 } |
OLD | NEW |