-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathPicosTimestampPrecision.php
More file actions
74 lines (66 loc) · 2.63 KB
/
PicosTimestampPrecision.php
File metadata and controls
74 lines (66 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/bigquery/storage/v1/arrow.proto
namespace Google\Cloud\BigQuery\Storage\V1\ArrowSerializationOptions;
use UnexpectedValueException;
/**
* The precision of the timestamp value in the Avro message. This precision
* will **only** be applied to the column(s) with the `TIMESTAMP_PICOS` type.
*
* Protobuf type <code>google.cloud.bigquery.storage.v1.ArrowSerializationOptions.PicosTimestampPrecision</code>
*/
class PicosTimestampPrecision
{
/**
* Unspecified timestamp precision. The default precision is microseconds.
*
* Generated from protobuf enum <code>PICOS_TIMESTAMP_PRECISION_UNSPECIFIED = 0;</code>
*/
const PICOS_TIMESTAMP_PRECISION_UNSPECIFIED = 0;
/**
* Timestamp values returned by Read API will be truncated to microsecond
* level precision. The value will be encoded as Arrow TIMESTAMP type in a
* 64 bit integer.
*
* Generated from protobuf enum <code>TIMESTAMP_PRECISION_MICROS = 1;</code>
*/
const TIMESTAMP_PRECISION_MICROS = 1;
/**
* Timestamp values returned by Read API will be truncated to nanosecond
* level precision. The value will be encoded as Arrow TIMESTAMP type in a
* 64 bit integer.
*
* Generated from protobuf enum <code>TIMESTAMP_PRECISION_NANOS = 2;</code>
*/
const TIMESTAMP_PRECISION_NANOS = 2;
/**
* Read API will return full precision picosecond value. The value will be
* encoded as a string which conforms to ISO 8601 format.
*
* Generated from protobuf enum <code>TIMESTAMP_PRECISION_PICOS = 3;</code>
*/
const TIMESTAMP_PRECISION_PICOS = 3;
private static $valueToName = [
self::PICOS_TIMESTAMP_PRECISION_UNSPECIFIED => 'PICOS_TIMESTAMP_PRECISION_UNSPECIFIED',
self::TIMESTAMP_PRECISION_MICROS => 'TIMESTAMP_PRECISION_MICROS',
self::TIMESTAMP_PRECISION_NANOS => 'TIMESTAMP_PRECISION_NANOS',
self::TIMESTAMP_PRECISION_PICOS => 'TIMESTAMP_PRECISION_PICOS',
];
public static function name($value)
{
if (!isset(self::$valueToName[$value])) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no name defined for value %s', __CLASS__, $value));
}
return self::$valueToName[$value];
}
public static function value($name)
{
$const = __CLASS__ . '::' . strtoupper($name);
if (!defined($const)) {
throw new UnexpectedValueException(sprintf(
'Enum %s has no value defined for name %s', __CLASS__, $name));
}
return constant($const);
}
}