-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathMissingValueInterpretation.php
More file actions
65 lines (57 loc) · 2.07 KB
/
MissingValueInterpretation.php
File metadata and controls
65 lines (57 loc) · 2.07 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
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/bigquery/storage/v1/storage.proto
namespace Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest;
use UnexpectedValueException;
/**
* An enum to indicate how to interpret missing values of fields that are
* present in user schema but missing in rows. A missing value can represent a
* NULL or a column default value defined in BigQuery table schema.
*
* Protobuf type <code>google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation</code>
*/
class MissingValueInterpretation
{
/**
* Invalid missing value interpretation. Requests with this value will be
* rejected.
*
* Generated from protobuf enum <code>MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0;</code>
*/
const MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0;
/**
* Missing value is interpreted as NULL.
*
* Generated from protobuf enum <code>NULL_VALUE = 1;</code>
*/
const NULL_VALUE = 1;
/**
* Missing value is interpreted as column default value if declared in the
* table schema, NULL otherwise.
*
* Generated from protobuf enum <code>DEFAULT_VALUE = 2;</code>
*/
const DEFAULT_VALUE = 2;
private static $valueToName = [
self::MISSING_VALUE_INTERPRETATION_UNSPECIFIED => 'MISSING_VALUE_INTERPRETATION_UNSPECIFIED',
self::NULL_VALUE => 'NULL_VALUE',
self::DEFAULT_VALUE => 'DEFAULT_VALUE',
];
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);
}
}