google-cloud-spanner 3.55.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. google/cloud/spanner.py +47 -0
  2. google/cloud/spanner_admin_database_v1/__init__.py +146 -0
  3. google/cloud/spanner_admin_database_v1/gapic_metadata.json +418 -0
  4. google/cloud/spanner_admin_database_v1/gapic_version.py +16 -0
  5. google/cloud/spanner_admin_database_v1/py.typed +2 -0
  6. google/cloud/spanner_admin_database_v1/services/__init__.py +15 -0
  7. google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py +22 -0
  8. google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +4097 -0
  9. google/cloud/spanner_admin_database_v1/services/database_admin/client.py +4602 -0
  10. google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py +989 -0
  11. google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py +38 -0
  12. google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py +820 -0
  13. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +1303 -0
  14. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +1688 -0
  15. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +6512 -0
  16. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest_base.py +1650 -0
  17. google/cloud/spanner_admin_database_v1/types/__init__.py +144 -0
  18. google/cloud/spanner_admin_database_v1/types/backup.py +1106 -0
  19. google/cloud/spanner_admin_database_v1/types/backup_schedule.py +369 -0
  20. google/cloud/spanner_admin_database_v1/types/common.py +180 -0
  21. google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +1303 -0
  22. google/cloud/spanner_admin_instance_v1/__init__.py +110 -0
  23. google/cloud/spanner_admin_instance_v1/gapic_metadata.json +343 -0
  24. google/cloud/spanner_admin_instance_v1/gapic_version.py +16 -0
  25. google/cloud/spanner_admin_instance_v1/py.typed +2 -0
  26. google/cloud/spanner_admin_instance_v1/services/__init__.py +15 -0
  27. google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py +22 -0
  28. google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +3466 -0
  29. google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +3881 -0
  30. google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py +856 -0
  31. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py +38 -0
  32. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py +545 -0
  33. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +1347 -0
  34. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +1539 -0
  35. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest.py +4834 -0
  36. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest_base.py +1198 -0
  37. google/cloud/spanner_admin_instance_v1/types/__init__.py +104 -0
  38. google/cloud/spanner_admin_instance_v1/types/common.py +99 -0
  39. google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +2375 -0
  40. google/cloud/spanner_dbapi/__init__.py +93 -0
  41. google/cloud/spanner_dbapi/_helpers.py +113 -0
  42. google/cloud/spanner_dbapi/batch_dml_executor.py +135 -0
  43. google/cloud/spanner_dbapi/checksum.py +80 -0
  44. google/cloud/spanner_dbapi/client_side_statement_executor.py +140 -0
  45. google/cloud/spanner_dbapi/client_side_statement_parser.py +106 -0
  46. google/cloud/spanner_dbapi/connection.py +818 -0
  47. google/cloud/spanner_dbapi/cursor.py +609 -0
  48. google/cloud/spanner_dbapi/exceptions.py +172 -0
  49. google/cloud/spanner_dbapi/parse_utils.py +392 -0
  50. google/cloud/spanner_dbapi/parsed_statement.py +63 -0
  51. google/cloud/spanner_dbapi/parser.py +258 -0
  52. google/cloud/spanner_dbapi/partition_helper.py +41 -0
  53. google/cloud/spanner_dbapi/transaction_helper.py +294 -0
  54. google/cloud/spanner_dbapi/types.py +106 -0
  55. google/cloud/spanner_dbapi/utils.py +147 -0
  56. google/cloud/spanner_dbapi/version.py +20 -0
  57. google/cloud/spanner_v1/__init__.py +154 -0
  58. google/cloud/spanner_v1/_helpers.py +751 -0
  59. google/cloud/spanner_v1/_opentelemetry_tracing.py +165 -0
  60. google/cloud/spanner_v1/backup.py +397 -0
  61. google/cloud/spanner_v1/batch.py +433 -0
  62. google/cloud/spanner_v1/client.py +538 -0
  63. google/cloud/spanner_v1/data_types.py +350 -0
  64. google/cloud/spanner_v1/database.py +1968 -0
  65. google/cloud/spanner_v1/database_sessions_manager.py +249 -0
  66. google/cloud/spanner_v1/gapic_metadata.json +268 -0
  67. google/cloud/spanner_v1/gapic_version.py +16 -0
  68. google/cloud/spanner_v1/instance.py +735 -0
  69. google/cloud/spanner_v1/keyset.py +193 -0
  70. google/cloud/spanner_v1/merged_result_set.py +146 -0
  71. google/cloud/spanner_v1/metrics/constants.py +71 -0
  72. google/cloud/spanner_v1/metrics/metrics_capture.py +75 -0
  73. google/cloud/spanner_v1/metrics/metrics_exporter.py +384 -0
  74. google/cloud/spanner_v1/metrics/metrics_interceptor.py +156 -0
  75. google/cloud/spanner_v1/metrics/metrics_tracer.py +588 -0
  76. google/cloud/spanner_v1/metrics/metrics_tracer_factory.py +328 -0
  77. google/cloud/spanner_v1/metrics/spanner_metrics_tracer_factory.py +172 -0
  78. google/cloud/spanner_v1/param_types.py +110 -0
  79. google/cloud/spanner_v1/pool.py +813 -0
  80. google/cloud/spanner_v1/py.typed +2 -0
  81. google/cloud/spanner_v1/request_id_header.py +64 -0
  82. google/cloud/spanner_v1/services/__init__.py +15 -0
  83. google/cloud/spanner_v1/services/spanner/__init__.py +22 -0
  84. google/cloud/spanner_v1/services/spanner/async_client.py +2205 -0
  85. google/cloud/spanner_v1/services/spanner/client.py +2624 -0
  86. google/cloud/spanner_v1/services/spanner/pagers.py +196 -0
  87. google/cloud/spanner_v1/services/spanner/transports/__init__.py +38 -0
  88. google/cloud/spanner_v1/services/spanner/transports/base.py +520 -0
  89. google/cloud/spanner_v1/services/spanner/transports/grpc.py +911 -0
  90. google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +1144 -0
  91. google/cloud/spanner_v1/services/spanner/transports/rest.py +3468 -0
  92. google/cloud/spanner_v1/services/spanner/transports/rest_base.py +981 -0
  93. google/cloud/spanner_v1/session.py +631 -0
  94. google/cloud/spanner_v1/session_options.py +133 -0
  95. google/cloud/spanner_v1/snapshot.py +1057 -0
  96. google/cloud/spanner_v1/streamed.py +402 -0
  97. google/cloud/spanner_v1/table.py +181 -0
  98. google/cloud/spanner_v1/testing/__init__.py +0 -0
  99. google/cloud/spanner_v1/testing/database_test.py +121 -0
  100. google/cloud/spanner_v1/testing/interceptors.py +118 -0
  101. google/cloud/spanner_v1/testing/mock_database_admin.py +38 -0
  102. google/cloud/spanner_v1/testing/mock_spanner.py +261 -0
  103. google/cloud/spanner_v1/testing/spanner_database_admin_pb2_grpc.py +1267 -0
  104. google/cloud/spanner_v1/testing/spanner_pb2_grpc.py +882 -0
  105. google/cloud/spanner_v1/transaction.py +747 -0
  106. google/cloud/spanner_v1/types/__init__.py +118 -0
  107. google/cloud/spanner_v1/types/commit_response.py +94 -0
  108. google/cloud/spanner_v1/types/keys.py +248 -0
  109. google/cloud/spanner_v1/types/mutation.py +201 -0
  110. google/cloud/spanner_v1/types/query_plan.py +220 -0
  111. google/cloud/spanner_v1/types/result_set.py +379 -0
  112. google/cloud/spanner_v1/types/spanner.py +1815 -0
  113. google/cloud/spanner_v1/types/transaction.py +818 -0
  114. google/cloud/spanner_v1/types/type.py +288 -0
  115. google_cloud_spanner-3.55.0.dist-info/LICENSE +202 -0
  116. google_cloud_spanner-3.55.0.dist-info/METADATA +318 -0
  117. google_cloud_spanner-3.55.0.dist-info/RECORD +119 -0
  118. google_cloud_spanner-3.55.0.dist-info/WHEEL +5 -0
  119. google_cloud_spanner-3.55.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,288 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 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
+ #
16
+ from __future__ import annotations
17
+
18
+ from typing import MutableMapping, MutableSequence
19
+
20
+ import proto # type: ignore
21
+
22
+
23
+ __protobuf__ = proto.module(
24
+ package="google.spanner.v1",
25
+ manifest={
26
+ "TypeCode",
27
+ "TypeAnnotationCode",
28
+ "Type",
29
+ "StructType",
30
+ },
31
+ )
32
+
33
+
34
+ class TypeCode(proto.Enum):
35
+ r"""``TypeCode`` is used as part of [Type][google.spanner.v1.Type] to
36
+ indicate the type of a Cloud Spanner value.
37
+
38
+ Each legal value of a type can be encoded to or decoded from a JSON
39
+ value, using the encodings described below. All Cloud Spanner values
40
+ can be ``null``, regardless of type; ``null``\ s are always encoded
41
+ as a JSON ``null``.
42
+
43
+ Values:
44
+ TYPE_CODE_UNSPECIFIED (0):
45
+ Not specified.
46
+ BOOL (1):
47
+ Encoded as JSON ``true`` or ``false``.
48
+ INT64 (2):
49
+ Encoded as ``string``, in decimal format.
50
+ FLOAT64 (3):
51
+ Encoded as ``number``, or the strings ``"NaN"``,
52
+ ``"Infinity"``, or ``"-Infinity"``.
53
+ FLOAT32 (15):
54
+ Encoded as ``number``, or the strings ``"NaN"``,
55
+ ``"Infinity"``, or ``"-Infinity"``.
56
+ TIMESTAMP (4):
57
+ Encoded as ``string`` in RFC 3339 timestamp format. The time
58
+ zone must be present, and must be ``"Z"``.
59
+
60
+ If the schema has the column option
61
+ ``allow_commit_timestamp=true``, the placeholder string
62
+ ``"spanner.commit_timestamp()"`` can be used to instruct the
63
+ system to insert the commit timestamp associated with the
64
+ transaction commit.
65
+ DATE (5):
66
+ Encoded as ``string`` in RFC 3339 date format.
67
+ STRING (6):
68
+ Encoded as ``string``.
69
+ BYTES (7):
70
+ Encoded as a base64-encoded ``string``, as described in RFC
71
+ 4648, section 4.
72
+ ARRAY (8):
73
+ Encoded as ``list``, where the list elements are represented
74
+ according to
75
+ [array_element_type][google.spanner.v1.Type.array_element_type].
76
+ STRUCT (9):
77
+ Encoded as ``list``, where list element ``i`` is represented
78
+ according to
79
+ [struct_type.fields[i]][google.spanner.v1.StructType.fields].
80
+ NUMERIC (10):
81
+ Encoded as ``string``, in decimal format or scientific
82
+ notation format. Decimal format: ``[+-]Digits[.[Digits]]``
83
+ or ``[+-][Digits].Digits``
84
+
85
+ Scientific notation:
86
+ ``[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]`` or
87
+ ``[+-][Digits].Digits[ExponentIndicator[+-]Digits]``
88
+ (ExponentIndicator is ``"e"`` or ``"E"``)
89
+ JSON (11):
90
+ Encoded as a JSON-formatted ``string`` as described in RFC
91
+ 7159. The following rules are applied when parsing JSON
92
+ input:
93
+
94
+ - Whitespace characters are not preserved.
95
+ - If a JSON object has duplicate keys, only the first key
96
+ is preserved.
97
+ - Members of a JSON object are not guaranteed to have their
98
+ order preserved.
99
+ - JSON array elements will have their order preserved.
100
+ PROTO (13):
101
+ Encoded as a base64-encoded ``string``, as described in RFC
102
+ 4648, section 4.
103
+ ENUM (14):
104
+ Encoded as ``string``, in decimal format.
105
+ INTERVAL (16):
106
+ Encoded as ``string``, in ``ISO8601`` duration format -
107
+ ``P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S`` where ``n`` is an
108
+ integer. For example, ``P1Y2M3DT4H5M6.5S`` represents time
109
+ duration of 1 year, 2 months, 3 days, 4 hours, 5 minutes,
110
+ and 6.5 seconds.
111
+ UUID (17):
112
+ Encoded as ``string``, in lower-case hexa-decimal format, as
113
+ described in RFC 9562, section 4.
114
+ """
115
+ TYPE_CODE_UNSPECIFIED = 0
116
+ BOOL = 1
117
+ INT64 = 2
118
+ FLOAT64 = 3
119
+ FLOAT32 = 15
120
+ TIMESTAMP = 4
121
+ DATE = 5
122
+ STRING = 6
123
+ BYTES = 7
124
+ ARRAY = 8
125
+ STRUCT = 9
126
+ NUMERIC = 10
127
+ JSON = 11
128
+ PROTO = 13
129
+ ENUM = 14
130
+ INTERVAL = 16
131
+ UUID = 17
132
+
133
+
134
+ class TypeAnnotationCode(proto.Enum):
135
+ r"""``TypeAnnotationCode`` is used as a part of
136
+ [Type][google.spanner.v1.Type] to disambiguate SQL types that should
137
+ be used for a given Cloud Spanner value. Disambiguation is needed
138
+ because the same Cloud Spanner type can be mapped to different SQL
139
+ types depending on SQL dialect. TypeAnnotationCode doesn't affect
140
+ the way value is serialized.
141
+
142
+ Values:
143
+ TYPE_ANNOTATION_CODE_UNSPECIFIED (0):
144
+ Not specified.
145
+ PG_NUMERIC (2):
146
+ PostgreSQL compatible NUMERIC type. This annotation needs to
147
+ be applied to [Type][google.spanner.v1.Type] instances
148
+ having [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type
149
+ code to specify that values of this type should be treated
150
+ as PostgreSQL NUMERIC values. Currently this annotation is
151
+ always needed for
152
+ [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client
153
+ interacts with PostgreSQL-enabled Spanner databases.
154
+ PG_JSONB (3):
155
+ PostgreSQL compatible JSONB type. This annotation needs to
156
+ be applied to [Type][google.spanner.v1.Type] instances
157
+ having [JSON][google.spanner.v1.TypeCode.JSON] type code to
158
+ specify that values of this type should be treated as
159
+ PostgreSQL JSONB values. Currently this annotation is always
160
+ needed for [JSON][google.spanner.v1.TypeCode.JSON] when a
161
+ client interacts with PostgreSQL-enabled Spanner databases.
162
+ PG_OID (4):
163
+ PostgreSQL compatible OID type. This
164
+ annotation can be used by a client interacting
165
+ with PostgreSQL-enabled Spanner database to
166
+ specify that a value should be treated using the
167
+ semantics of the OID type.
168
+ """
169
+ TYPE_ANNOTATION_CODE_UNSPECIFIED = 0
170
+ PG_NUMERIC = 2
171
+ PG_JSONB = 3
172
+ PG_OID = 4
173
+
174
+
175
+ class Type(proto.Message):
176
+ r"""``Type`` indicates the type of a Cloud Spanner value, as might be
177
+ stored in a table cell or returned from an SQL query.
178
+
179
+ Attributes:
180
+ code (google.cloud.spanner_v1.types.TypeCode):
181
+ Required. The [TypeCode][google.spanner.v1.TypeCode] for
182
+ this type.
183
+ array_element_type (google.cloud.spanner_v1.types.Type):
184
+ If [code][google.spanner.v1.Type.code] ==
185
+ [ARRAY][google.spanner.v1.TypeCode.ARRAY], then
186
+ ``array_element_type`` is the type of the array elements.
187
+ struct_type (google.cloud.spanner_v1.types.StructType):
188
+ If [code][google.spanner.v1.Type.code] ==
189
+ [STRUCT][google.spanner.v1.TypeCode.STRUCT], then
190
+ ``struct_type`` provides type information for the struct's
191
+ fields.
192
+ type_annotation (google.cloud.spanner_v1.types.TypeAnnotationCode):
193
+ The
194
+ [TypeAnnotationCode][google.spanner.v1.TypeAnnotationCode]
195
+ that disambiguates SQL type that Spanner will use to
196
+ represent values of this type during query processing. This
197
+ is necessary for some type codes because a single
198
+ [TypeCode][google.spanner.v1.TypeCode] can be mapped to
199
+ different SQL types depending on the SQL dialect.
200
+ [type_annotation][google.spanner.v1.Type.type_annotation]
201
+ typically is not needed to process the content of a value
202
+ (it doesn't affect serialization) and clients can ignore it
203
+ on the read path.
204
+ proto_type_fqn (str):
205
+ If [code][google.spanner.v1.Type.code] ==
206
+ [PROTO][google.spanner.v1.TypeCode.PROTO] or
207
+ [code][google.spanner.v1.Type.code] ==
208
+ [ENUM][google.spanner.v1.TypeCode.ENUM], then
209
+ ``proto_type_fqn`` is the fully qualified name of the proto
210
+ type representing the proto/enum definition.
211
+ """
212
+
213
+ code: "TypeCode" = proto.Field(
214
+ proto.ENUM,
215
+ number=1,
216
+ enum="TypeCode",
217
+ )
218
+ array_element_type: "Type" = proto.Field(
219
+ proto.MESSAGE,
220
+ number=2,
221
+ message="Type",
222
+ )
223
+ struct_type: "StructType" = proto.Field(
224
+ proto.MESSAGE,
225
+ number=3,
226
+ message="StructType",
227
+ )
228
+ type_annotation: "TypeAnnotationCode" = proto.Field(
229
+ proto.ENUM,
230
+ number=4,
231
+ enum="TypeAnnotationCode",
232
+ )
233
+ proto_type_fqn: str = proto.Field(
234
+ proto.STRING,
235
+ number=5,
236
+ )
237
+
238
+
239
+ class StructType(proto.Message):
240
+ r"""``StructType`` defines the fields of a
241
+ [STRUCT][google.spanner.v1.TypeCode.STRUCT] type.
242
+
243
+ Attributes:
244
+ fields (MutableSequence[google.cloud.spanner_v1.types.StructType.Field]):
245
+ The list of fields that make up this struct. Order is
246
+ significant, because values of this struct type are
247
+ represented as lists, where the order of field values
248
+ matches the order of fields in the
249
+ [StructType][google.spanner.v1.StructType]. In turn, the
250
+ order of fields matches the order of columns in a read
251
+ request, or the order of fields in the ``SELECT`` clause of
252
+ a query.
253
+ """
254
+
255
+ class Field(proto.Message):
256
+ r"""Message representing a single field of a struct.
257
+
258
+ Attributes:
259
+ name (str):
260
+ The name of the field. For reads, this is the column name.
261
+ For SQL queries, it is the column alias (e.g., ``"Word"`` in
262
+ the query ``"SELECT 'hello' AS Word"``), or the column name
263
+ (e.g., ``"ColName"`` in the query
264
+ ``"SELECT ColName FROM Table"``). Some columns might have an
265
+ empty name (e.g., ``"SELECT UPPER(ColName)"``). Note that a
266
+ query result can contain multiple fields with the same name.
267
+ type_ (google.cloud.spanner_v1.types.Type):
268
+ The type of the field.
269
+ """
270
+
271
+ name: str = proto.Field(
272
+ proto.STRING,
273
+ number=1,
274
+ )
275
+ type_: "Type" = proto.Field(
276
+ proto.MESSAGE,
277
+ number=2,
278
+ message="Type",
279
+ )
280
+
281
+ fields: MutableSequence[Field] = proto.RepeatedField(
282
+ proto.MESSAGE,
283
+ number=1,
284
+ message=Field,
285
+ )
286
+
287
+
288
+ __all__ = tuple(sorted(__protobuf__.manifest))
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.