google-cloud-bigquery 1.54.0 → 1.57.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbfaf1f9de532a42e02ae04ce9a3373b337b401491a746a10e103c708b01d069
4
- data.tar.gz: 3d7dd0f1213c69fcb79fee23f342f3e435c66842af1cc7569bf7c861f5f54773
3
+ metadata.gz: dbe17241cff1bf35169627f5be2bc589b24e4830077b1966192d74cb478efcc0
4
+ data.tar.gz: a6060857441bd335b1a8c67509f742d586026e043269d48893c22e4ffe3a3b9f
5
5
  SHA512:
6
- metadata.gz: 4144ce5964844c6f8aebc2e12049639a6e42c65d74458617b88836b7bccded75c061315548c49d0030f1667a8890496911e9d8334d518adc40c0b416dc968ffe
7
- data.tar.gz: 46d49fb84f11c0b97211ba5099a11be5001a21b20df26a21a4a31843633abba9869dad0cb4f80a9674156c5a4d78d84af2cfef9b77ee52395987e8e7637ce7b9
6
+ metadata.gz: 361370e039788d37aaebe2c3dc368e3715e7f09c65ffc85727285c1cdfe608412e09352570e3f1c88abb52b52c851646540c67e3c023c344ef1d8f37cab78086
7
+ data.tar.gz: 8b86e329d6843a4d4387f1c1daf1ed3feaabe47284ad4e8320ce3c9e39a492fadbecfe46006e1b0a38fedbe94250795aa0968a2148c94e0f1bf25a4514ad2d92
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Release History
2
2
 
3
+ ### 1.57.0 (2025-08-28)
4
+
5
+ #### Features
6
+
7
+ * Add support for reference_file_schema_uri for LoadJobConfig and ExternalDataSource ([#30859](https://github.com/googleapis/google-cloud-ruby/issues/30859))
8
+
9
+ ### 1.56.0 (2025-08-27)
10
+
11
+ #### Features
12
+
13
+ * Add support for preserve_ascii_control_characters in CSVOptions and LoadJobConfiguration ([#30857](https://github.com/googleapis/google-cloud-ruby/issues/30857))
14
+
15
+ ### 1.55.0 (2025-08-26)
16
+
17
+ #### Features
18
+
19
+ * Add support for IAM Condition in Dataset Access ([#30854](https://github.com/googleapis/google-cloud-ruby/issues/30854))
20
+
3
21
  ### 1.54.0 (2025-08-15)
4
22
 
5
23
  #### Features
@@ -0,0 +1,218 @@
1
+ # Copyright 2025 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/bigquery_v2"
16
+
17
+ module Google
18
+ module Cloud
19
+ module Bigquery
20
+ ##
21
+ # # Condition
22
+ #
23
+ # Represents a textual expression in the Common Expression Language (CEL) syntax.
24
+ # CEL is a C-like expression language. The syntax and semantics of CEL are documented
25
+ # at https://github.com/google/cel-spec
26
+ #
27
+ # Used to define condition for {Dataset::Access} rules
28
+ #
29
+ class Condition
30
+ ##
31
+ # Returns the textual representation of an expression in Common Expression Language syntax.
32
+ #
33
+ # @return [String] The expression of the condition.
34
+ #
35
+ # @example
36
+ # condition = Google::Cloud::Bigquery::Condition.new(
37
+ # "resource.name.startsWith('projects/my-project')"
38
+ # )
39
+ # puts condition.expression # => "resource.name.startsWith('projects/my-project')"
40
+ #
41
+ def expression
42
+ @expression
43
+ end
44
+
45
+ ##
46
+ # Sets the textual representation of an expression in Common Expression Language syntax.
47
+ #
48
+ # @param [String] val The expression to set.
49
+ #
50
+ # @raise [ArgumentError] if the expression is nil or empty.
51
+ #
52
+ # @example
53
+ # condition = Google::Cloud::Bigquery::Condition.new(
54
+ # "resource.name.startsWith('projects/my-project')"
55
+ # )
56
+ # condition.expression = "document.summary.size() < 100"
57
+ #
58
+ def expression= val
59
+ if val.nil? || val.strip.empty?
60
+ raise ArgumentError, "Expression cannot be nil or empty"
61
+ end
62
+ @expression = val
63
+ end
64
+
65
+ ##
66
+ # Returns the optional description of the expression. This is a longer text which describes
67
+ # the expression, e.g. when hovered over it in a UI.
68
+ #
69
+ # @return [String, nil] The description of the condition. nil if not set.
70
+ #
71
+ # @example
72
+ # condition = Google::Cloud::Bigquery::Condition.new(
73
+ # "document.summary.size() < 100",
74
+ # description: "Checks if summary is less than 100 chars"
75
+ # )
76
+ # puts condition.description # => "Checks if summary is less than 100 chars"
77
+ #
78
+ def description
79
+ @description
80
+ end
81
+
82
+ ##
83
+ # Sets the optional description of the expression. This is a longer text which describes
84
+ # the expression, e.g. when hovered over it in a UI.
85
+ #
86
+ # @param [String, nil] val The description to set. nil to unset.
87
+ #
88
+ # @example
89
+ # condition = Google::Cloud::Bigquery::Condition.new(
90
+ # "document.summary.size() < 100"
91
+ # )
92
+ # condition.description = "Checks if summary is less than 100 chars"
93
+ #
94
+ def description= val
95
+ @description = val
96
+ end
97
+
98
+ ##
99
+ # Returns the optional string indicating the location of the expression for error reporting,
100
+ # e.g. a file name and a position in the file.
101
+ #
102
+ # @return [String, nil] The location of the condition. nil if not set.
103
+ #
104
+ # @example
105
+ # condition = Google::Cloud::Bigquery::Condition.new(
106
+ # "document.summary.size() < 100",
107
+ # location: "document/summary"
108
+ # )
109
+ # puts condition.location # => "document/summary"
110
+ #
111
+ def location
112
+ @location
113
+ end
114
+
115
+ ##
116
+ # Sets the optional string indicating the location of the expression for error reporting,
117
+ # e.g. a file name and a position in the file.
118
+ #
119
+ # @param [String, nil] val The location to set. nil to unset.
120
+ #
121
+ # @example
122
+ # condition = Google::Cloud::Bigquery::Condition.new(
123
+ # "document.summary.size() < 100"
124
+ # )
125
+ # condition.location = "document/summary"
126
+ #
127
+ def location= val
128
+ @location = val
129
+ end
130
+
131
+ ##
132
+ # Returns the optional title for the expression, i.e. a short string describing its purpose.
133
+ # This can be used e.g. in UIs which allow to enter the expression.
134
+ #
135
+ # @return [String, nil] The title of the condition. nil if not set.
136
+ #
137
+ # @example
138
+ # condition = Google::Cloud::Bigquery::Condition.new(
139
+ # "document.summary.size() < 100",
140
+ # title: "Summary size limit"
141
+ # )
142
+ # puts condition.title # => "Summary size limit"
143
+ #
144
+ def title
145
+ @title
146
+ end
147
+
148
+ ##
149
+ # Sets the optional title for the expression, i.e. a short string describing its purpose.
150
+ # This can be used e.g. in UIs which allow to enter the expression.
151
+ #
152
+ # @param [String, nil] val The title to set. nil to unset.
153
+ #
154
+ # @example
155
+ # condition = Google::Cloud::Bigquery::Condition.new(
156
+ # "document.summary.size() < 100"
157
+ # )
158
+ # condition.title = "Summary size limit"
159
+ #
160
+ def title= val
161
+ @title = val
162
+ end
163
+
164
+ ##
165
+ # Create a new Condition object.
166
+ #
167
+ # @param [String] expression The expression in CEL syntax.
168
+ # @param [String] description Optional description of the expression.
169
+ # @param [String] location Optional location of the expression for error reporting.
170
+ # @param [String] title Optional title for the expression.
171
+ #
172
+ # @raise [ArgumentError] if expression is nil or empty.
173
+ #
174
+ # @example
175
+ # condition = Google::Cloud::Bigquery::Condition.new(
176
+ # "document.summary.size() < 100",
177
+ # description: "Determines if a summary is less than 100 chars",
178
+ # location: "document/summary",
179
+ # title: "Summary size limit"
180
+ # )
181
+ #
182
+ # @see https://cloud.google.com/bigquery/docs/reference/auditlogs/rest/Shared.Types/Expr
183
+ #
184
+ def initialize expression, description: nil, location: nil, title: nil
185
+ if expression.nil? || expression.strip.empty?
186
+ raise ArgumentError, "Expression cannot be nil or empty"
187
+ end
188
+ @expression = expression
189
+ @description = description
190
+ @location = location
191
+ @title = title
192
+ end
193
+
194
+ ##
195
+ # @private Convert the Condition object to a Google API Client object.
196
+ #
197
+ # @return [Google::Apis::BigqueryV2::Expr] The Google API Client object representing the condition.
198
+ #
199
+ # @example
200
+ # condition = Google::Cloud::Bigquery::Condition.new(
201
+ # "resource.name.startsWith('projects/my-project')"
202
+ # )
203
+ # gapi_condition = condition.to_gapi
204
+ #
205
+ # @see https://cloud.google.com/bigquery/docs/reference/auditlogs/rest/Shared.Types/Expr
206
+ #
207
+ def to_gapi
208
+ gapi = Google::Apis::BigqueryV2::Expr.new
209
+ gapi.description = @description unless @description.nil?
210
+ gapi.expression = @expression
211
+ gapi.location = @location unless @location.nil?
212
+ gapi.title = @title unless @title.nil?
213
+ gapi
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end