Skip to content

Commit 94f7b6a

Browse files
1 parent 9e6e61f commit 94f7b6a

3 files changed

Lines changed: 140 additions & 12 deletions

File tree

src/Bigquery/BigtableColumn.php

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ class BigtableColumn extends \Google\Model
2323
* Optional. The encoding of the values when the type is not STRING.
2424
* Acceptable encoding values are: TEXT - indicates values are alphanumeric
2525
* text strings. BINARY - indicates values are encoded using HBase
26-
* Bytes.toBytes family of functions. 'encoding' can also be set at the column
27-
* family level. However, the setting at this level takes precedence if
28-
* 'encoding' is set at both levels.
26+
* Bytes.toBytes family of functions. PROTO_BINARY - indicates values are
27+
* encoded using serialized proto messages. This can only be used in
28+
* combination with JSON type. 'encoding' can also be set at the column family
29+
* level. However, the setting at this level takes precedence if 'encoding' is
30+
* set at both levels.
2931
*
3032
* @var string
3133
*/
@@ -47,6 +49,8 @@ class BigtableColumn extends \Google\Model
4749
* @var bool
4850
*/
4951
public $onlyReadLatest;
52+
protected $protoConfigType = BigtableProtoConfig::class;
53+
protected $protoConfigDataType = '';
5054
/**
5155
* [Required] Qualifier of the column. Columns in the parent column family
5256
* that has this exact qualifier are exposed as `.` field. If the qualifier is
@@ -81,9 +85,11 @@ class BigtableColumn extends \Google\Model
8185
* Optional. The encoding of the values when the type is not STRING.
8286
* Acceptable encoding values are: TEXT - indicates values are alphanumeric
8387
* text strings. BINARY - indicates values are encoded using HBase
84-
* Bytes.toBytes family of functions. 'encoding' can also be set at the column
85-
* family level. However, the setting at this level takes precedence if
86-
* 'encoding' is set at both levels.
88+
* Bytes.toBytes family of functions. PROTO_BINARY - indicates values are
89+
* encoded using serialized proto messages. This can only be used in
90+
* combination with JSON type. 'encoding' can also be set at the column family
91+
* level. However, the setting at this level takes precedence if 'encoding' is
92+
* set at both levels.
8793
*
8894
* @param string $encoding
8995
*/
@@ -135,6 +141,23 @@ public function getOnlyReadLatest()
135141
{
136142
return $this->onlyReadLatest;
137143
}
144+
/**
145+
* Optional. Protobuf-specific configurations, only takes effect when the
146+
* encoding is PROTO_BINARY.
147+
*
148+
* @param BigtableProtoConfig $protoConfig
149+
*/
150+
public function setProtoConfig(BigtableProtoConfig $protoConfig)
151+
{
152+
$this->protoConfig = $protoConfig;
153+
}
154+
/**
155+
* @return BigtableProtoConfig
156+
*/
157+
public function getProtoConfig()
158+
{
159+
return $this->protoConfig;
160+
}
138161
/**
139162
* [Required] Qualifier of the column. Columns in the parent column family
140163
* that has this exact qualifier are exposed as `.` field. If the qualifier is

src/Bigquery/BigtableColumnFamily.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ class BigtableColumnFamily extends \Google\Collection
2626
* Optional. The encoding of the values when the type is not STRING.
2727
* Acceptable encoding values are: TEXT - indicates values are alphanumeric
2828
* text strings. BINARY - indicates values are encoded using HBase
29-
* Bytes.toBytes family of functions. This can be overridden for a specific
30-
* column by listing that column in 'columns' and specifying an encoding for
31-
* it.
29+
* Bytes.toBytes family of functions. PROTO_BINARY - indicates values are
30+
* encoded using serialized proto messages. This can only be used in
31+
* combination with JSON type. This can be overridden for a specific column by
32+
* listing that column in 'columns' and specifying an encoding for it.
3233
*
3334
* @var string
3435
*/
@@ -48,6 +49,8 @@ class BigtableColumnFamily extends \Google\Collection
4849
* @var bool
4950
*/
5051
public $onlyReadLatest;
52+
protected $protoConfigType = BigtableProtoConfig::class;
53+
protected $protoConfigDataType = '';
5154
/**
5255
* Optional. The type to convert the value in cells of this column family. The
5356
* values are expected to be encoded using HBase Bytes.toBytes function when
@@ -83,9 +86,10 @@ public function getColumns()
8386
* Optional. The encoding of the values when the type is not STRING.
8487
* Acceptable encoding values are: TEXT - indicates values are alphanumeric
8588
* text strings. BINARY - indicates values are encoded using HBase
86-
* Bytes.toBytes family of functions. This can be overridden for a specific
87-
* column by listing that column in 'columns' and specifying an encoding for
88-
* it.
89+
* Bytes.toBytes family of functions. PROTO_BINARY - indicates values are
90+
* encoded using serialized proto messages. This can only be used in
91+
* combination with JSON type. This can be overridden for a specific column by
92+
* listing that column in 'columns' and specifying an encoding for it.
8993
*
9094
* @param string $encoding
9195
*/
@@ -135,6 +139,23 @@ public function getOnlyReadLatest()
135139
{
136140
return $this->onlyReadLatest;
137141
}
142+
/**
143+
* Optional. Protobuf-specific configurations, only takes effect when the
144+
* encoding is PROTO_BINARY.
145+
*
146+
* @param BigtableProtoConfig $protoConfig
147+
*/
148+
public function setProtoConfig(BigtableProtoConfig $protoConfig)
149+
{
150+
$this->protoConfig = $protoConfig;
151+
}
152+
/**
153+
* @return BigtableProtoConfig
154+
*/
155+
public function getProtoConfig()
156+
{
157+
return $this->protoConfig;
158+
}
138159
/**
139160
* Optional. The type to convert the value in cells of this column family. The
140161
* values are expected to be encoded using HBase Bytes.toBytes function when
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Bigquery;
19+
20+
class BigtableProtoConfig extends \Google\Model
21+
{
22+
/**
23+
* Optional. The fully qualified proto message name of the protobuf. In the
24+
* format of "foo.bar.Message".
25+
*
26+
* @var string
27+
*/
28+
public $protoMessageName;
29+
/**
30+
* Optional. The ID of the Bigtable SchemaBundle resource associated with this
31+
* protobuf. The ID should be referred to within the parent table, e.g., `foo`
32+
* rather than
33+
* `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/foo`.
34+
* See [more details on Bigtable
35+
* SchemaBundles](https://docs.cloud.google.com/bigtable/docs/create-manage-
36+
* protobuf-schemas).
37+
*
38+
* @var string
39+
*/
40+
public $schemaBundleId;
41+
42+
/**
43+
* Optional. The fully qualified proto message name of the protobuf. In the
44+
* format of "foo.bar.Message".
45+
*
46+
* @param string $protoMessageName
47+
*/
48+
public function setProtoMessageName($protoMessageName)
49+
{
50+
$this->protoMessageName = $protoMessageName;
51+
}
52+
/**
53+
* @return string
54+
*/
55+
public function getProtoMessageName()
56+
{
57+
return $this->protoMessageName;
58+
}
59+
/**
60+
* Optional. The ID of the Bigtable SchemaBundle resource associated with this
61+
* protobuf. The ID should be referred to within the parent table, e.g., `foo`
62+
* rather than
63+
* `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/foo`.
64+
* See [more details on Bigtable
65+
* SchemaBundles](https://docs.cloud.google.com/bigtable/docs/create-manage-
66+
* protobuf-schemas).
67+
*
68+
* @param string $schemaBundleId
69+
*/
70+
public function setSchemaBundleId($schemaBundleId)
71+
{
72+
$this->schemaBundleId = $schemaBundleId;
73+
}
74+
/**
75+
* @return string
76+
*/
77+
public function getSchemaBundleId()
78+
{
79+
return $this->schemaBundleId;
80+
}
81+
}
82+
83+
// Adding a class alias for backwards compatibility with the previous class name.
84+
class_alias(BigtableProtoConfig::class, 'Google_Service_Bigquery_BigtableProtoConfig');

0 commit comments

Comments
 (0)