1# -*- coding: utf-8 -*-
2# Copyright 2024 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16from __future__ import annotations
17
18from typing import MutableMapping, MutableSequence
19
20from google.protobuf import descriptor_pb2 # type: ignore
21import proto # type: ignore
22
23__protobuf__ = proto.module(
24 package="google.cloud.bigquery.storage.v1",
25 manifest={
26 "ProtoSchema",
27 "ProtoRows",
28 },
29)
30
31
32class ProtoSchema(proto.Message):
33 r"""ProtoSchema describes the schema of the serialized protocol
34 buffer data rows.
35
36 Attributes:
37 proto_descriptor (google.protobuf.descriptor_pb2.DescriptorProto):
38 Descriptor for input message. The provided descriptor must
39 be self contained, such that data rows sent can be fully
40 decoded using only the single descriptor. For data rows that
41 are compositions of multiple independent messages, this
42 means the descriptor may need to be transformed to only use
43 nested types:
44 https://developers.google.com/protocol-buffers/docs/proto#nested
45
46 For additional information for how proto types and values
47 map onto BigQuery see:
48 https://cloud.google.com/bigquery/docs/write-api#data_type_conversions
49 """
50
51 proto_descriptor: descriptor_pb2.DescriptorProto = proto.Field(
52 proto.MESSAGE,
53 number=1,
54 message=descriptor_pb2.DescriptorProto,
55 )
56
57
58class ProtoRows(proto.Message):
59 r"""
60
61 Attributes:
62 serialized_rows (MutableSequence[bytes]):
63 A sequence of rows serialized as a Protocol
64 Buffer.
65 See
66 https://developers.google.com/protocol-buffers/docs/overview
67 for more information on deserializing this
68 field.
69 """
70
71 serialized_rows: MutableSequence[bytes] = proto.RepeatedField(
72 proto.BYTES,
73 number=1,
74 )
75
76
77__all__ = tuple(sorted(__protobuf__.manifest))