Debian Codegraph @

biglake/v1/biglake-gen.go

raw symbols SCIP
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package biglake provides access to the BigLake API.
8 //
9 // For product documentation, see: https://cloud.google.com/bigquery/
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/biglake/v1"
27 // ...
28 // ctx := context.Background()
29 // biglakeService, err := biglake.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // By default, all available scopes (see "Constants") are used to authenticate.
38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
39 //
40 // biglakeService, err := biglake.NewService(ctx, option.WithScopes(biglake.CloudPlatformScope))
41 //
42 // To use an API key for authentication (note: some APIs do not support API
43 // keys), use [google.golang.org/api/option.WithAPIKey]:
44 //
45 // biglakeService, err := biglake.NewService(ctx, option.WithAPIKey("AIza..."))
46 //
47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
48 // flow, use [google.golang.org/api/option.WithTokenSource]:
49 //
50 // config := &oauth2.Config{...}
51 // // ...
52 // token, err := config.Exchange(ctx, ...)
53 // biglakeService, err := biglake.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
54 //
55 // See [google.golang.org/api/option.ClientOption] for details on options.
56 package biglake // import "google.golang.org/api/biglake/v1"
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "log/slog"
66 "net/http"
67 "net/url"
68 "strconv"
69 "strings"
70
71 "github.com/googleapis/gax-go/v2/internallog"
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80 // Always reference these packages, just in case the auto-generated code
81 // below doesn't.
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95 var _ = internallog.New
96
97 const apiId = "biglake:v1"
98 const apiName = "biglake"
99 const apiVersion = "v1"
100 const basePath = "https://biglake.googleapis.com/"
101 const basePathTemplate = "https://biglake.UNIVERSE_DOMAIN/"
102 const mtlsBasePath = "https://biglake.mtls.googleapis.com/"
103
104 // OAuth2 scopes used by this API.
105 const (
106 // View and manage your data in Google BigQuery and see the email address for
107 // your Google Account
108 BigqueryScope = "https://www.googleapis.com/auth/bigquery"
109
110 // See, edit, configure, and delete your Google Cloud data and see the email
111 // address for your Google Account.
112 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
113 )
114
115 // NewService creates a new Service.
116 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
117 scopesOption := internaloption.WithDefaultScopes(
118 "https://www.googleapis.com/auth/bigquery",
119 "https://www.googleapis.com/auth/cloud-platform",
120 )
121 // NOTE: prepend, so we don't override user-specified scopes.
122 opts = append([]option.ClientOption{scopesOption}, opts...)
123 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
124 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
125 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
126 opts = append(opts, internaloption.EnableNewAuthLibrary())
127 client, endpoint, err := htransport.NewClient(ctx, opts...)
128 if err != nil {
129 return nil, err
130 }
131 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
132 s.Projects = NewProjectsService(s)
133 if endpoint != "" {
134 s.BasePath = endpoint
135 }
136 return s, nil
137 }
138
139 // New creates a new Service. It uses the provided http.Client for requests.
140 //
141 // Deprecated: please use NewService instead.
142 // To provide a custom HTTP client, use option.WithHTTPClient.
143 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
144 func New(client *http.Client) (*Service, error) {
145 if client == nil {
146 return nil, errors.New("client is nil")
147 }
148 return NewService(context.TODO(), option.WithHTTPClient(client))
149 }
150
151 type Service struct {
152 client *http.Client
153 logger *slog.Logger
154 BasePath string // API endpoint base URL
155 UserAgent string // optional additional User-Agent fragment
156
157 Projects *ProjectsService
158 }
159
160 func (s *Service) userAgent() string {
161 if s.UserAgent == "" {
162 return googleapi.UserAgent
163 }
164 return googleapi.UserAgent + " " + s.UserAgent
165 }
166
167 func NewProjectsService(s *Service) *ProjectsService {
168 rs := &ProjectsService{s: s}
169 rs.Catalogs = NewProjectsCatalogsService(s)
170 rs.Locations = NewProjectsLocationsService(s)
171 return rs
172 }
173
174 type ProjectsService struct {
175 s *Service
176
177 Catalogs *ProjectsCatalogsService
178
179 Locations *ProjectsLocationsService
180 }
181
182 func NewProjectsCatalogsService(s *Service) *ProjectsCatalogsService {
183 rs := &ProjectsCatalogsService{s: s}
184 rs.Namespaces = NewProjectsCatalogsNamespacesService(s)
185 return rs
186 }
187
188 type ProjectsCatalogsService struct {
189 s *Service
190
191 Namespaces *ProjectsCatalogsNamespacesService
192 }
193
194 func NewProjectsCatalogsNamespacesService(s *Service) *ProjectsCatalogsNamespacesService {
195 rs := &ProjectsCatalogsNamespacesService{s: s}
196 rs.Tables = NewProjectsCatalogsNamespacesTablesService(s)
197 return rs
198 }
199
200 type ProjectsCatalogsNamespacesService struct {
201 s *Service
202
203 Tables *ProjectsCatalogsNamespacesTablesService
204 }
205
206 func NewProjectsCatalogsNamespacesTablesService(s *Service) *ProjectsCatalogsNamespacesTablesService {
207 rs := &ProjectsCatalogsNamespacesTablesService{s: s}
208 return rs
209 }
210
211 type ProjectsCatalogsNamespacesTablesService struct {
212 s *Service
213 }
214
215 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
216 rs := &ProjectsLocationsService{s: s}
217 rs.Catalogs = NewProjectsLocationsCatalogsService(s)
218 return rs
219 }
220
221 type ProjectsLocationsService struct {
222 s *Service
223
224 Catalogs *ProjectsLocationsCatalogsService
225 }
226
227 func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsService {
228 rs := &ProjectsLocationsCatalogsService{s: s}
229 rs.Databases = NewProjectsLocationsCatalogsDatabasesService(s)
230 return rs
231 }
232
233 type ProjectsLocationsCatalogsService struct {
234 s *Service
235
236 Databases *ProjectsLocationsCatalogsDatabasesService
237 }
238
239 func NewProjectsLocationsCatalogsDatabasesService(s *Service) *ProjectsLocationsCatalogsDatabasesService {
240 rs := &ProjectsLocationsCatalogsDatabasesService{s: s}
241 rs.Tables = NewProjectsLocationsCatalogsDatabasesTablesService(s)
242 return rs
243 }
244
245 type ProjectsLocationsCatalogsDatabasesService struct {
246 s *Service
247
248 Tables *ProjectsLocationsCatalogsDatabasesTablesService
249 }
250
251 func NewProjectsLocationsCatalogsDatabasesTablesService(s *Service) *ProjectsLocationsCatalogsDatabasesTablesService {
252 rs := &ProjectsLocationsCatalogsDatabasesTablesService{s: s}
253 return rs
254 }
255
256 type ProjectsLocationsCatalogsDatabasesTablesService struct {
257 s *Service
258 }
259
260 // AuditConfig: Specifies the audit configuration for a service. The
261 // configuration determines which permission types are logged, and what
262 // identities, if any, are exempted from logging. An AuditConfig must have one
263 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
264 // and a specific service, the union of the two AuditConfigs is used for that
265 // service: the log_types specified in each AuditConfig are enabled, and the
266 // exempted_members in each AuditLogConfig are exempted. Example Policy with
267 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
268 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
269 // "user:[email protected]" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
270 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
271 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
272 // "DATA_WRITE", "exempted_members": [ "user:[email protected]" ] } ] } ] } For
273 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
274 // logging. It also exempts `[email protected]` from DATA_READ logging, and
275 // `[email protected]` from DATA_WRITE logging.
276 type AuditConfig struct {
277 // AuditLogConfigs: The configuration for logging of each type of permission.
278 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
279 // Service: Specifies a service that will be enabled for audit logging. For
280 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
281 // is a special value that covers all services.
282 Service string `json:"service,omitempty"`
283 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
284 // unconditionally include in API requests. By default, fields with empty or
285 // default values are omitted from API requests. See
286 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
287 // details.
288 ForceSendFields []string `json:"-"`
289 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
290 // API requests with the JSON null value. By default, fields with empty values
291 // are omitted from API requests. See
292 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
293 NullFields []string `json:"-"`
294 }
295
296 func (s AuditConfig) MarshalJSON() ([]byte, error) {
297 type NoMethod AuditConfig
298 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
299 }
300
301 // AuditLogConfig: Provides the configuration for logging a type of
302 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
303 // "exempted_members": [ "user:[email protected]" ] }, { "log_type":
304 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
305 // exempting [email protected] from DATA_READ logging.
306 type AuditLogConfig struct {
307 // ExemptedMembers: Specifies the identities that do not cause logging for this
308 // type of permission. Follows the same format of Binding.members.
309 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
310 // LogType: The log type that this config enables.
311 //
312 // Possible values:
313 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
314 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
315 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
316 // "DATA_READ" - Data reads. Example: CloudSQL Users list
317 LogType string `json:"logType,omitempty"`
318 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
319 // unconditionally include in API requests. By default, fields with empty or
320 // default values are omitted from API requests. See
321 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
322 // details.
323 ForceSendFields []string `json:"-"`
324 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in
325 // API requests with the JSON null value. By default, fields with empty values
326 // are omitted from API requests. See
327 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
328 NullFields []string `json:"-"`
329 }
330
331 func (s AuditLogConfig) MarshalJSON() ([]byte, error) {
332 type NoMethod AuditLogConfig
333 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
334 }
335
336 // Binding: Associates `members`, or principals, with a `role`.
337 type Binding struct {
338 // Condition: The condition that is associated with this binding. If the
339 // condition evaluates to `true`, then this binding applies to the current
340 // request. If the condition evaluates to `false`, then this binding does not
341 // apply to the current request. However, a different role binding might grant
342 // the same role to one or more of the principals in this binding. To learn
343 // which resources support conditions in their IAM policies, see the IAM
344 // documentation
345 // (https://cloud.google.com/iam/help/conditions/resource-policies).
346 Condition *Expr `json:"condition,omitempty"`
347 // Members: Specifies the principals requesting access for a Google Cloud
348 // resource. `members` can have the following values: * `allUsers`: A special
349 // identifier that represents anyone who is on the internet; with or without a
350 // Google account. * `allAuthenticatedUsers`: A special identifier that
351 // represents anyone who is authenticated with a Google account or a service
352 // account. Does not include identities that come from external identity
353 // providers (IdPs) through identity federation. * `user:{emailid}`: An email
354 // address that represents a specific Google account. For example,
355 // `[email protected]` . * `serviceAccount:{emailid}`: An email address that
356 // represents a Google service account. For example,
357 // `[email protected]`. *
358 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
359 // identifier for a Kubernetes service account
360 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
361 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
362 // `group:{emailid}`: An email address that represents a Google group. For
363 // example, `[email protected]`. * `domain:{domain}`: The G Suite domain
364 // (primary) that represents all the users of that domain. For example,
365 // `google.com` or `example.com`. *
366 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
367 // ject/{subject_attribute_value}`: A single identity in a workforce identity
368 // pool. *
369 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
370 // group/{group_id}`: All workforce identities in a group. *
371 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
372 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with
373 // a specific attribute value. *
374 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
375 // *`: All identities in a workforce identity pool. *
376 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
377 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
378 // identity in a workload identity pool. *
379 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
380 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
381 // group. *
382 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
383 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
384 // `: All identities in a workload identity pool with a certain attribute. *
385 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
386 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
387 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
388 // unique identifier) representing a user that has been recently deleted. For
389 // example, `[email protected]?uid=123456789012345678901`. If the user is
390 // recovered, this value reverts to `user:{emailid}` and the recovered user
391 // retains the role in the binding. *
392 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
393 // unique identifier) representing a service account that has been recently
394 // deleted. For example,
395 // `[email protected]?uid=123456789012345678901`. If the
396 // service account is undeleted, this value reverts to
397 // `serviceAccount:{emailid}` and the undeleted service account retains the
398 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
399 // address (plus unique identifier) representing a Google group that has been
400 // recently deleted. For example,
401 // `[email protected]?uid=123456789012345678901`. If the group is recovered,
402 // this value reverts to `group:{emailid}` and the recovered group retains the
403 // role in the binding. *
404 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
405 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a
406 // workforce identity pool. For example,
407 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
408 // ol-id/subject/my-subject-attribute-value`.
409 Members []string `json:"members,omitempty"`
410 // Role: Role that is assigned to the list of `members`, or principals. For
411 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
412 // of the IAM roles and permissions, see the IAM documentation
413 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the
414 // available pre-defined roles, see here
415 // (https://cloud.google.com/iam/docs/understanding-roles).
416 Role string `json:"role,omitempty"`
417 // ForceSendFields is a list of field names (e.g. "Condition") to
418 // unconditionally include in API requests. By default, fields with empty or
419 // default values are omitted from API requests. See
420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
421 // details.
422 ForceSendFields []string `json:"-"`
423 // NullFields is a list of field names (e.g. "Condition") to include in API
424 // requests with the JSON null value. By default, fields with empty values are
425 // omitted from API requests. See
426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
427 NullFields []string `json:"-"`
428 }
429
430 func (s Binding) MarshalJSON() ([]byte, error) {
431 type NoMethod Binding
432 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
433 }
434
435 // Catalog: Catalog is the container of databases.
436 type Catalog struct {
437 // CreateTime: Output only. The creation time of the catalog.
438 CreateTime string `json:"createTime,omitempty"`
439 // DeleteTime: Output only. The deletion time of the catalog. Only set after
440 // the catalog is deleted.
441 DeleteTime string `json:"deleteTime,omitempty"`
442 // ExpireTime: Output only. The time when this catalog is considered expired.
443 // Only set after the catalog is deleted.
444 ExpireTime string `json:"expireTime,omitempty"`
445 // Name: Output only. The resource name. Format:
446 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
447 Name string `json:"name,omitempty"`
448 // UpdateTime: Output only. The last modification time of the catalog.
449 UpdateTime string `json:"updateTime,omitempty"`
450
451 // ServerResponse contains the HTTP response code and headers from the server.
452 googleapi.ServerResponse `json:"-"`
453 // ForceSendFields is a list of field names (e.g. "CreateTime") to
454 // unconditionally include in API requests. By default, fields with empty or
455 // default values are omitted from API requests. See
456 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
457 // details.
458 ForceSendFields []string `json:"-"`
459 // NullFields is a list of field names (e.g. "CreateTime") to include in API
460 // requests with the JSON null value. By default, fields with empty values are
461 // omitted from API requests. See
462 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
463 NullFields []string `json:"-"`
464 }
465
466 func (s Catalog) MarshalJSON() ([]byte, error) {
467 type NoMethod Catalog
468 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
469 }
470
471 // Database: Database is the container of tables.
472 type Database struct {
473 // CreateTime: Output only. The creation time of the database.
474 CreateTime string `json:"createTime,omitempty"`
475 // DeleteTime: Output only. The deletion time of the database. Only set after
476 // the database is deleted.
477 DeleteTime string `json:"deleteTime,omitempty"`
478 // ExpireTime: Output only. The time when this database is considered expired.
479 // Only set after the database is deleted.
480 ExpireTime string `json:"expireTime,omitempty"`
481 // HiveOptions: Options of a Hive database.
482 HiveOptions *HiveDatabaseOptions `json:"hiveOptions,omitempty"`
483 // Name: Output only. The resource name. Format:
484 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
485 // /databases/{database_id}
486 Name string `json:"name,omitempty"`
487 // Type: The database type.
488 //
489 // Possible values:
490 // "TYPE_UNSPECIFIED" - The type is not specified.
491 // "HIVE" - Represents a database storing tables compatible with Hive
492 // Metastore tables.
493 Type string `json:"type,omitempty"`
494 // UpdateTime: Output only. The last modification time of the database.
495 UpdateTime string `json:"updateTime,omitempty"`
496
497 // ServerResponse contains the HTTP response code and headers from the server.
498 googleapi.ServerResponse `json:"-"`
499 // ForceSendFields is a list of field names (e.g. "CreateTime") to
500 // unconditionally include in API requests. By default, fields with empty or
501 // default values are omitted from API requests. See
502 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
503 // details.
504 ForceSendFields []string `json:"-"`
505 // NullFields is a list of field names (e.g. "CreateTime") to include in API
506 // requests with the JSON null value. By default, fields with empty values are
507 // omitted from API requests. See
508 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
509 NullFields []string `json:"-"`
510 }
511
512 func (s Database) MarshalJSON() ([]byte, error) {
513 type NoMethod Database
514 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
515 }
516
517 // Expr: Represents a textual expression in the Common Expression Language
518 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
519 // of CEL are documented at https://github.com/google/cel-spec. Example
520 // (Comparison): title: "Summary size limit" description: "Determines if a
521 // summary is less than 100 chars" expression: "document.summary.size() < 100"
522 // Example (Equality): title: "Requestor is owner" description: "Determines if
523 // requestor is the document owner" expression: "document.owner ==
524 // request.auth.claims.email" Example (Logic): title: "Public documents"
525 // description: "Determine whether the document should be publicly visible"
526 // expression: "document.type != 'private' && document.type != 'internal'"
527 // Example (Data Manipulation): title: "Notification string" description:
528 // "Create a notification string with a timestamp." expression: "'New message
529 // received at ' + string(document.create_time)" The exact variables and
530 // functions that may be referenced within an expression are determined by the
531 // service that evaluates it. See the service documentation for additional
532 // information.
533 type Expr struct {
534 // Description: Optional. Description of the expression. This is a longer text
535 // which describes the expression, e.g. when hovered over it in a UI.
536 Description string `json:"description,omitempty"`
537 // Expression: Textual representation of an expression in Common Expression
538 // Language syntax.
539 Expression string `json:"expression,omitempty"`
540 // Location: Optional. String indicating the location of the expression for
541 // error reporting, e.g. a file name and a position in the file.
542 Location string `json:"location,omitempty"`
543 // Title: Optional. Title for the expression, i.e. a short string describing
544 // its purpose. This can be used e.g. in UIs which allow to enter the
545 // expression.
546 Title string `json:"title,omitempty"`
547 // ForceSendFields is a list of field names (e.g. "Description") to
548 // unconditionally include in API requests. By default, fields with empty or
549 // default values are omitted from API requests. See
550 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
551 // details.
552 ForceSendFields []string `json:"-"`
553 // NullFields is a list of field names (e.g. "Description") to include in API
554 // requests with the JSON null value. By default, fields with empty values are
555 // omitted from API requests. See
556 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
557 NullFields []string `json:"-"`
558 }
559
560 func (s Expr) MarshalJSON() ([]byte, error) {
561 type NoMethod Expr
562 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
563 }
564
565 // HiveDatabaseOptions: Options of a Hive database.
566 type HiveDatabaseOptions struct {
567 // LocationUri: Cloud Storage folder URI where the database data is stored,
568 // starting with "gs://".
569 LocationUri string `json:"locationUri,omitempty"`
570 // Parameters: Stores user supplied Hive database parameters.
571 Parameters map[string]string `json:"parameters,omitempty"`
572 // ForceSendFields is a list of field names (e.g. "LocationUri") to
573 // unconditionally include in API requests. By default, fields with empty or
574 // default values are omitted from API requests. See
575 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
576 // details.
577 ForceSendFields []string `json:"-"`
578 // NullFields is a list of field names (e.g. "LocationUri") to include in API
579 // requests with the JSON null value. By default, fields with empty values are
580 // omitted from API requests. See
581 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
582 NullFields []string `json:"-"`
583 }
584
585 func (s HiveDatabaseOptions) MarshalJSON() ([]byte, error) {
586 type NoMethod HiveDatabaseOptions
587 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
588 }
589
590 // HiveTableOptions: Options of a Hive table.
591 type HiveTableOptions struct {
592 // Parameters: Stores user supplied Hive table parameters.
593 Parameters map[string]string `json:"parameters,omitempty"`
594 // StorageDescriptor: Stores physical storage information of the data.
595 StorageDescriptor *StorageDescriptor `json:"storageDescriptor,omitempty"`
596 // TableType: Hive table type. For example, MANAGED_TABLE, EXTERNAL_TABLE.
597 TableType string `json:"tableType,omitempty"`
598 // ForceSendFields is a list of field names (e.g. "Parameters") to
599 // unconditionally include in API requests. By default, fields with empty or
600 // default values are omitted from API requests. See
601 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
602 // details.
603 ForceSendFields []string `json:"-"`
604 // NullFields is a list of field names (e.g. "Parameters") to include in API
605 // requests with the JSON null value. By default, fields with empty values are
606 // omitted from API requests. See
607 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
608 NullFields []string `json:"-"`
609 }
610
611 func (s HiveTableOptions) MarshalJSON() ([]byte, error) {
612 type NoMethod HiveTableOptions
613 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
614 }
615
616 // ListCatalogsResponse: Response message for the ListCatalogs method.
617 type ListCatalogsResponse struct {
618 // Catalogs: The catalogs from the specified project.
619 Catalogs []*Catalog `json:"catalogs,omitempty"`
620 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
621 // next page. If this field is omitted, there are no subsequent pages.
622 NextPageToken string `json:"nextPageToken,omitempty"`
623
624 // ServerResponse contains the HTTP response code and headers from the server.
625 googleapi.ServerResponse `json:"-"`
626 // ForceSendFields is a list of field names (e.g. "Catalogs") to
627 // unconditionally include in API requests. By default, fields with empty or
628 // default values are omitted from API requests. See
629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
630 // details.
631 ForceSendFields []string `json:"-"`
632 // NullFields is a list of field names (e.g. "Catalogs") to include in API
633 // requests with the JSON null value. By default, fields with empty values are
634 // omitted from API requests. See
635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
636 NullFields []string `json:"-"`
637 }
638
639 func (s ListCatalogsResponse) MarshalJSON() ([]byte, error) {
640 type NoMethod ListCatalogsResponse
641 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
642 }
643
644 // ListDatabasesResponse: Response message for the ListDatabases method.
645 type ListDatabasesResponse struct {
646 // Databases: The databases from the specified catalog.
647 Databases []*Database `json:"databases,omitempty"`
648 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
649 // next page. If this field is omitted, there are no subsequent pages.
650 NextPageToken string `json:"nextPageToken,omitempty"`
651
652 // ServerResponse contains the HTTP response code and headers from the server.
653 googleapi.ServerResponse `json:"-"`
654 // ForceSendFields is a list of field names (e.g. "Databases") to
655 // unconditionally include in API requests. By default, fields with empty or
656 // default values are omitted from API requests. See
657 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
658 // details.
659 ForceSendFields []string `json:"-"`
660 // NullFields is a list of field names (e.g. "Databases") to include in API
661 // requests with the JSON null value. By default, fields with empty values are
662 // omitted from API requests. See
663 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
664 NullFields []string `json:"-"`
665 }
666
667 func (s ListDatabasesResponse) MarshalJSON() ([]byte, error) {
668 type NoMethod ListDatabasesResponse
669 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
670 }
671
672 // ListTablesResponse: Response message for the ListTables method.
673 type ListTablesResponse struct {
674 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
675 // next page. If this field is omitted, there are no subsequent pages.
676 NextPageToken string `json:"nextPageToken,omitempty"`
677 // Tables: The tables from the specified database.
678 Tables []*Table `json:"tables,omitempty"`
679
680 // ServerResponse contains the HTTP response code and headers from the server.
681 googleapi.ServerResponse `json:"-"`
682 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
683 // unconditionally include in API requests. By default, fields with empty or
684 // default values are omitted from API requests. See
685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
686 // details.
687 ForceSendFields []string `json:"-"`
688 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
689 // requests with the JSON null value. By default, fields with empty values are
690 // omitted from API requests. See
691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
692 NullFields []string `json:"-"`
693 }
694
695 func (s ListTablesResponse) MarshalJSON() ([]byte, error) {
696 type NoMethod ListTablesResponse
697 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
698 }
699
700 // Policy: An Identity and Access Management (IAM) policy, which specifies
701 // access controls for Google Cloud resources. A `Policy` is a collection of
702 // `bindings`. A `binding` binds one or more `members`, or principals, to a
703 // single `role`. Principals can be user accounts, service accounts, Google
704 // groups, and domains (such as G Suite). A `role` is a named list of
705 // permissions; each `role` can be an IAM predefined role or a user-created
706 // custom role. For some types of Google Cloud resources, a `binding` can also
707 // specify a `condition`, which is a logical expression that allows access to a
708 // resource only if the expression evaluates to `true`. A condition can add
709 // constraints based on attributes of the request, the resource, or both. To
710 // learn which resources support conditions in their IAM policies, see the IAM
711 // documentation
712 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
713 // example:** ``` { "bindings": [ { "role":
714 // "roles/resourcemanager.organizationAdmin", "members": [
715 // "user:[email protected]", "group:[email protected]", "domain:google.com",
716 // "serviceAccount:[email protected]" ] }, { "role":
717 // "roles/resourcemanager.organizationViewer", "members": [
718 // "user:[email protected]" ], "condition": { "title": "expirable access",
719 // "description": "Does not grant access after Sep 2020", "expression":
720 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
721 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
722 // members: - user:[email protected] - group:[email protected] -
723 // domain:google.com - serviceAccount:[email protected]
724 // role: roles/resourcemanager.organizationAdmin - members: -
725 // user:[email protected] role: roles/resourcemanager.organizationViewer
726 // condition: title: expirable access description: Does not grant access after
727 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
728 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
729 // see the IAM documentation (https://cloud.google.com/iam/docs/).
730 type Policy struct {
731 // AuditConfigs: Specifies cloud audit logging configuration for this policy.
732 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
733 // Bindings: Associates a list of `members`, or principals, with a `role`.
734 // Optionally, may specify a `condition` that determines how and when the
735 // `bindings` are applied. Each of the `bindings` must contain at least one
736 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
737 // up to 250 of these principals can be Google groups. Each occurrence of a
738 // principal counts towards these limits. For example, if the `bindings` grant
739 // 50 different roles to `user:[email protected]`, and not to any other
740 // principal, then you can add another 1,450 principals to the `bindings` in
741 // the `Policy`.
742 Bindings []*Binding `json:"bindings,omitempty"`
743 // Etag: `etag` is used for optimistic concurrency control as a way to help
744 // prevent simultaneous updates of a policy from overwriting each other. It is
745 // strongly suggested that systems make use of the `etag` in the
746 // read-modify-write cycle to perform policy updates in order to avoid race
747 // conditions: An `etag` is returned in the response to `getIamPolicy`, and
748 // systems are expected to put that etag in the request to `setIamPolicy` to
749 // ensure that their change will be applied to the same version of the policy.
750 // **Important:** If you use IAM Conditions, you must include the `etag` field
751 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
752 // you to overwrite a version `3` policy with a version `1` policy, and all of
753 // the conditions in the version `3` policy are lost.
754 Etag string `json:"etag,omitempty"`
755 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
756 // `3`. Requests that specify an invalid value are rejected. Any operation that
757 // affects conditional role bindings must specify version `3`. This requirement
758 // applies to the following operations: * Getting a policy that includes a
759 // conditional role binding * Adding a conditional role binding to a policy *
760 // Changing a conditional role binding in a policy * Removing any role binding,
761 // with or without a condition, from a policy that includes conditions
762 // **Important:** If you use IAM Conditions, you must include the `etag` field
763 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
764 // you to overwrite a version `3` policy with a version `1` policy, and all of
765 // the conditions in the version `3` policy are lost. If a policy does not
766 // include any conditions, operations on that policy may specify any valid
767 // version or leave the field unset. To learn which resources support
768 // conditions in their IAM policies, see the IAM documentation
769 // (https://cloud.google.com/iam/help/conditions/resource-policies).
770 Version int64 `json:"version,omitempty"`
771
772 // ServerResponse contains the HTTP response code and headers from the server.
773 googleapi.ServerResponse `json:"-"`
774 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
775 // unconditionally include in API requests. By default, fields with empty or
776 // default values are omitted from API requests. See
777 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
778 // details.
779 ForceSendFields []string `json:"-"`
780 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API
781 // requests with the JSON null value. By default, fields with empty values are
782 // omitted from API requests. See
783 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
784 NullFields []string `json:"-"`
785 }
786
787 func (s Policy) MarshalJSON() ([]byte, error) {
788 type NoMethod Policy
789 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
790 }
791
792 // RenameTableRequest: Request message for the RenameTable method in
793 // MetastoreService
794 type RenameTableRequest struct {
795 // NewName: Required. The new `name` for the specified table, must be in the
796 // same database. Format:
797 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
798 // /databases/{database_id}/tables/{table_id}
799 NewName string `json:"newName,omitempty"`
800 // ForceSendFields is a list of field names (e.g. "NewName") to unconditionally
801 // include in API requests. By default, fields with empty or default values are
802 // omitted from API requests. See
803 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
804 // details.
805 ForceSendFields []string `json:"-"`
806 // NullFields is a list of field names (e.g. "NewName") to include in API
807 // requests with the JSON null value. By default, fields with empty values are
808 // omitted from API requests. See
809 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
810 NullFields []string `json:"-"`
811 }
812
813 func (s RenameTableRequest) MarshalJSON() ([]byte, error) {
814 type NoMethod RenameTableRequest
815 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
816 }
817
818 // SerDeInfo: Serializer and deserializer information.
819 type SerDeInfo struct {
820 // SerializationLib: The fully qualified Java class name of the serialization
821 // library.
822 SerializationLib string `json:"serializationLib,omitempty"`
823 // ForceSendFields is a list of field names (e.g. "SerializationLib") to
824 // unconditionally include in API requests. By default, fields with empty or
825 // default values are omitted from API requests. See
826 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
827 // details.
828 ForceSendFields []string `json:"-"`
829 // NullFields is a list of field names (e.g. "SerializationLib") to include in
830 // API requests with the JSON null value. By default, fields with empty values
831 // are omitted from API requests. See
832 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
833 NullFields []string `json:"-"`
834 }
835
836 func (s SerDeInfo) MarshalJSON() ([]byte, error) {
837 type NoMethod SerDeInfo
838 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
839 }
840
841 // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
842 type SetIamPolicyRequest struct {
843 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The
844 // size of the policy is limited to a few 10s of KB. An empty policy is a valid
845 // policy but certain Google Cloud services (such as Projects) might reject
846 // them.
847 Policy *Policy `json:"policy,omitempty"`
848 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
849 // modify. Only the fields in the mask will be modified. If no mask is
850 // provided, the following default mask is used: `paths: "bindings, etag"
851 UpdateMask string `json:"updateMask,omitempty"`
852 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
853 // include in API requests. By default, fields with empty or default values are
854 // omitted from API requests. See
855 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
856 // details.
857 ForceSendFields []string `json:"-"`
858 // NullFields is a list of field names (e.g. "Policy") to include in API
859 // requests with the JSON null value. By default, fields with empty values are
860 // omitted from API requests. See
861 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
862 NullFields []string `json:"-"`
863 }
864
865 func (s SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
866 type NoMethod SetIamPolicyRequest
867 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
868 }
869
870 // StorageDescriptor: Stores physical storage information of the data.
871 type StorageDescriptor struct {
872 // InputFormat: The fully qualified Java class name of the input format.
873 InputFormat string `json:"inputFormat,omitempty"`
874 // LocationUri: Cloud Storage folder URI where the table data is stored,
875 // starting with "gs://".
876 LocationUri string `json:"locationUri,omitempty"`
877 // OutputFormat: The fully qualified Java class name of the output format.
878 OutputFormat string `json:"outputFormat,omitempty"`
879 // SerdeInfo: Serializer and deserializer information.
880 SerdeInfo *SerDeInfo `json:"serdeInfo,omitempty"`
881 // ForceSendFields is a list of field names (e.g. "InputFormat") to
882 // unconditionally include in API requests. By default, fields with empty or
883 // default values are omitted from API requests. See
884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
885 // details.
886 ForceSendFields []string `json:"-"`
887 // NullFields is a list of field names (e.g. "InputFormat") to include in API
888 // requests with the JSON null value. By default, fields with empty values are
889 // omitted from API requests. See
890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
891 NullFields []string `json:"-"`
892 }
893
894 func (s StorageDescriptor) MarshalJSON() ([]byte, error) {
895 type NoMethod StorageDescriptor
896 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
897 }
898
899 // Table: Represents a table.
900 type Table struct {
901 // CreateTime: Output only. The creation time of the table.
902 CreateTime string `json:"createTime,omitempty"`
903 // DeleteTime: Output only. The deletion time of the table. Only set after the
904 // table is deleted.
905 DeleteTime string `json:"deleteTime,omitempty"`
906 // Etag: The checksum of a table object computed by the server based on the
907 // value of other fields. It may be sent on update requests to ensure the
908 // client has an up-to-date value before proceeding. It is only checked for
909 // update table operations.
910 Etag string `json:"etag,omitempty"`
911 // ExpireTime: Output only. The time when this table is considered expired.
912 // Only set after the table is deleted.
913 ExpireTime string `json:"expireTime,omitempty"`
914 // HiveOptions: Options of a Hive table.
915 HiveOptions *HiveTableOptions `json:"hiveOptions,omitempty"`
916 // Name: Output only. The resource name. Format:
917 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
918 // /databases/{database_id}/tables/{table_id}
919 Name string `json:"name,omitempty"`
920 // Type: The table type.
921 //
922 // Possible values:
923 // "TYPE_UNSPECIFIED" - The type is not specified.
924 // "HIVE" - Represents a table compatible with Hive Metastore tables.
925 Type string `json:"type,omitempty"`
926 // UpdateTime: Output only. The last modification time of the table.
927 UpdateTime string `json:"updateTime,omitempty"`
928
929 // ServerResponse contains the HTTP response code and headers from the server.
930 googleapi.ServerResponse `json:"-"`
931 // ForceSendFields is a list of field names (e.g. "CreateTime") to
932 // unconditionally include in API requests. By default, fields with empty or
933 // default values are omitted from API requests. See
934 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
935 // details.
936 ForceSendFields []string `json:"-"`
937 // NullFields is a list of field names (e.g. "CreateTime") to include in API
938 // requests with the JSON null value. By default, fields with empty values are
939 // omitted from API requests. See
940 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
941 NullFields []string `json:"-"`
942 }
943
944 func (s Table) MarshalJSON() ([]byte, error) {
945 type NoMethod Table
946 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
947 }
948
949 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
950 type TestIamPermissionsRequest struct {
951 // Permissions: The set of permissions to check for the `resource`. Permissions
952 // with wildcards (such as `*` or `storage.*`) are not allowed. For more
953 // information see IAM Overview
954 // (https://cloud.google.com/iam/docs/overview#permissions).
955 Permissions []string `json:"permissions,omitempty"`
956 // ForceSendFields is a list of field names (e.g. "Permissions") to
957 // unconditionally include in API requests. By default, fields with empty or
958 // default values are omitted from API requests. See
959 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
960 // details.
961 ForceSendFields []string `json:"-"`
962 // NullFields is a list of field names (e.g. "Permissions") to include in API
963 // requests with the JSON null value. By default, fields with empty values are
964 // omitted from API requests. See
965 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
966 NullFields []string `json:"-"`
967 }
968
969 func (s TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
970 type NoMethod TestIamPermissionsRequest
971 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
972 }
973
974 // TestIamPermissionsResponse: Response message for `TestIamPermissions`
975 // method.
976 type TestIamPermissionsResponse struct {
977 // Permissions: A subset of `TestPermissionsRequest.permissions` that the
978 // caller is allowed.
979 Permissions []string `json:"permissions,omitempty"`
980
981 // ServerResponse contains the HTTP response code and headers from the server.
982 googleapi.ServerResponse `json:"-"`
983 // ForceSendFields is a list of field names (e.g. "Permissions") to
984 // unconditionally include in API requests. By default, fields with empty or
985 // default values are omitted from API requests. See
986 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
987 // details.
988 ForceSendFields []string `json:"-"`
989 // NullFields is a list of field names (e.g. "Permissions") to include in API
990 // requests with the JSON null value. By default, fields with empty values are
991 // omitted from API requests. See
992 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
993 NullFields []string `json:"-"`
994 }
995
996 func (s TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
997 type NoMethod TestIamPermissionsResponse
998 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
999 }
1000
1001 type ProjectsCatalogsGetIamPolicyCall struct {
1002 s *Service
1003 resource string
1004 urlParams_ gensupport.URLParams
1005 ifNoneMatch_ string
1006 ctx_ context.Context
1007 header_ http.Header
1008 }
1009
1010 // GetIamPolicy: Gets the IAM policy for the specified Catalog.
1011 //
1012 // - resource: REQUIRED: The resource for which the policy is being requested.
1013 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1014 // for the appropriate value for this field.
1015 func (r *ProjectsCatalogsService) GetIamPolicy(resource string) *ProjectsCatalogsGetIamPolicyCall {
1016 c := &ProjectsCatalogsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1017 c.resource = resource
1018 return c
1019 }
1020
1021 // OptionsRequestedPolicyVersion sets the optional parameter
1022 // "options.requestedPolicyVersion": The maximum policy version that will be
1023 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
1024 // an invalid value will be rejected. Requests for policies with any
1025 // conditional role bindings must specify version 3. Policies with no
1026 // conditional role bindings may specify any valid value or leave the field
1027 // unset. The policy in the response might use the policy version that you
1028 // specified, or it might use a lower policy version. For example, if you
1029 // specify version 3, but the policy has no conditional role bindings, the
1030 // response uses version 1. To learn which resources support conditions in
1031 // their IAM policies, see the IAM documentation
1032 // (https://cloud.google.com/iam/help/conditions/resource-policies).
1033 func (c *ProjectsCatalogsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsCatalogsGetIamPolicyCall {
1034 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1035 return c
1036 }
1037
1038 // Fields allows partial responses to be retrieved. See
1039 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1040 // details.
1041 func (c *ProjectsCatalogsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsGetIamPolicyCall {
1042 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1043 return c
1044 }
1045
1046 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1047 // object's ETag matches the given value. This is useful for getting updates
1048 // only after the object has changed since the last request.
1049 func (c *ProjectsCatalogsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsCatalogsGetIamPolicyCall {
1050 c.ifNoneMatch_ = entityTag
1051 return c
1052 }
1053
1054 // Context sets the context to be used in this call's Do method.
1055 func (c *ProjectsCatalogsGetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsGetIamPolicyCall {
1056 c.ctx_ = ctx
1057 return c
1058 }
1059
1060 // Header returns a http.Header that can be modified by the caller to add
1061 // headers to the request.
1062 func (c *ProjectsCatalogsGetIamPolicyCall) Header() http.Header {
1063 if c.header_ == nil {
1064 c.header_ = make(http.Header)
1065 }
1066 return c.header_
1067 }
1068
1069 func (c *ProjectsCatalogsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1070 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1071 if c.ifNoneMatch_ != "" {
1072 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1073 }
1074 c.urlParams_.Set("alt", alt)
1075 c.urlParams_.Set("prettyPrint", "false")
1076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
1077 urls += "?" + c.urlParams_.Encode()
1078 req, err := http.NewRequest("GET", urls, nil)
1079 if err != nil {
1080 return nil, err
1081 }
1082 req.Header = reqHeaders
1083 googleapi.Expand(req.URL, map[string]string{
1084 "resource": c.resource,
1085 })
1086 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
1087 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1088 }
1089
1090 // Do executes the "biglake.projects.catalogs.getIamPolicy" call.
1091 // Any non-2xx status code is an error. Response headers are in either
1092 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1093 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1094 // whether the returned error was because http.StatusNotModified was returned.
1095 func (c *ProjectsCatalogsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1096 gensupport.SetOptions(c.urlParams_, opts...)
1097 res, err := c.doRequest("json")
1098 if res != nil && res.StatusCode == http.StatusNotModified {
1099 if res.Body != nil {
1100 res.Body.Close()
1101 }
1102 return nil, gensupport.WrapError(&googleapi.Error{
1103 Code: res.StatusCode,
1104 Header: res.Header,
1105 })
1106 }
1107 if err != nil {
1108 return nil, err
1109 }
1110 defer googleapi.CloseBody(res)
1111 if err := googleapi.CheckResponse(res); err != nil {
1112 return nil, gensupport.WrapError(err)
1113 }
1114 ret := &Policy{
1115 ServerResponse: googleapi.ServerResponse{
1116 Header: res.Header,
1117 HTTPStatusCode: res.StatusCode,
1118 },
1119 }
1120 target := &ret
1121 b, err := gensupport.DecodeResponseBytes(target, res)
1122 if err != nil {
1123 return nil, err
1124 }
1125 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.getIamPolicy", "response", internallog.HTTPResponse(res, b))
1126 return ret, nil
1127 }
1128
1129 type ProjectsCatalogsSetIamPolicyCall struct {
1130 s *Service
1131 resource string
1132 setiampolicyrequest *SetIamPolicyRequest
1133 urlParams_ gensupport.URLParams
1134 ctx_ context.Context
1135 header_ http.Header
1136 }
1137
1138 // SetIamPolicy: Sets the IAM policy for the specified catalog.
1139 //
1140 // - resource: REQUIRED: The resource for which the policy is being specified.
1141 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1142 // for the appropriate value for this field.
1143 func (r *ProjectsCatalogsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsCatalogsSetIamPolicyCall {
1144 c := &ProjectsCatalogsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1145 c.resource = resource
1146 c.setiampolicyrequest = setiampolicyrequest
1147 return c
1148 }
1149
1150 // Fields allows partial responses to be retrieved. See
1151 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1152 // details.
1153 func (c *ProjectsCatalogsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsSetIamPolicyCall {
1154 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1155 return c
1156 }
1157
1158 // Context sets the context to be used in this call's Do method.
1159 func (c *ProjectsCatalogsSetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsSetIamPolicyCall {
1160 c.ctx_ = ctx
1161 return c
1162 }
1163
1164 // Header returns a http.Header that can be modified by the caller to add
1165 // headers to the request.
1166 func (c *ProjectsCatalogsSetIamPolicyCall) Header() http.Header {
1167 if c.header_ == nil {
1168 c.header_ = make(http.Header)
1169 }
1170 return c.header_
1171 }
1172
1173 func (c *ProjectsCatalogsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1174 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1175 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
1176 if err != nil {
1177 return nil, err
1178 }
1179 c.urlParams_.Set("alt", alt)
1180 c.urlParams_.Set("prettyPrint", "false")
1181 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
1182 urls += "?" + c.urlParams_.Encode()
1183 req, err := http.NewRequest("POST", urls, body)
1184 if err != nil {
1185 return nil, err
1186 }
1187 req.Header = reqHeaders
1188 googleapi.Expand(req.URL, map[string]string{
1189 "resource": c.resource,
1190 })
1191 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
1192 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1193 }
1194
1195 // Do executes the "biglake.projects.catalogs.setIamPolicy" call.
1196 // Any non-2xx status code is an error. Response headers are in either
1197 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1198 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1199 // whether the returned error was because http.StatusNotModified was returned.
1200 func (c *ProjectsCatalogsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1201 gensupport.SetOptions(c.urlParams_, opts...)
1202 res, err := c.doRequest("json")
1203 if res != nil && res.StatusCode == http.StatusNotModified {
1204 if res.Body != nil {
1205 res.Body.Close()
1206 }
1207 return nil, gensupport.WrapError(&googleapi.Error{
1208 Code: res.StatusCode,
1209 Header: res.Header,
1210 })
1211 }
1212 if err != nil {
1213 return nil, err
1214 }
1215 defer googleapi.CloseBody(res)
1216 if err := googleapi.CheckResponse(res); err != nil {
1217 return nil, gensupport.WrapError(err)
1218 }
1219 ret := &Policy{
1220 ServerResponse: googleapi.ServerResponse{
1221 Header: res.Header,
1222 HTTPStatusCode: res.StatusCode,
1223 },
1224 }
1225 target := &ret
1226 b, err := gensupport.DecodeResponseBytes(target, res)
1227 if err != nil {
1228 return nil, err
1229 }
1230 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.setIamPolicy", "response", internallog.HTTPResponse(res, b))
1231 return ret, nil
1232 }
1233
1234 type ProjectsCatalogsTestIamPermissionsCall struct {
1235 s *Service
1236 resource string
1237 testiampermissionsrequest *TestIamPermissionsRequest
1238 urlParams_ gensupport.URLParams
1239 ctx_ context.Context
1240 header_ http.Header
1241 }
1242
1243 // TestIamPermissions: Tests the IAM permissions for the specified catalog.
1244 //
1245 // - resource: REQUIRED: The resource for which the policy detail is being
1246 // requested. See Resource names
1247 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
1248 // value for this field.
1249 func (r *ProjectsCatalogsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsCatalogsTestIamPermissionsCall {
1250 c := &ProjectsCatalogsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1251 c.resource = resource
1252 c.testiampermissionsrequest = testiampermissionsrequest
1253 return c
1254 }
1255
1256 // Fields allows partial responses to be retrieved. See
1257 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1258 // details.
1259 func (c *ProjectsCatalogsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsCatalogsTestIamPermissionsCall {
1260 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1261 return c
1262 }
1263
1264 // Context sets the context to be used in this call's Do method.
1265 func (c *ProjectsCatalogsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsCatalogsTestIamPermissionsCall {
1266 c.ctx_ = ctx
1267 return c
1268 }
1269
1270 // Header returns a http.Header that can be modified by the caller to add
1271 // headers to the request.
1272 func (c *ProjectsCatalogsTestIamPermissionsCall) Header() http.Header {
1273 if c.header_ == nil {
1274 c.header_ = make(http.Header)
1275 }
1276 return c.header_
1277 }
1278
1279 func (c *ProjectsCatalogsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
1280 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1281 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
1282 if err != nil {
1283 return nil, err
1284 }
1285 c.urlParams_.Set("alt", alt)
1286 c.urlParams_.Set("prettyPrint", "false")
1287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
1288 urls += "?" + c.urlParams_.Encode()
1289 req, err := http.NewRequest("POST", urls, body)
1290 if err != nil {
1291 return nil, err
1292 }
1293 req.Header = reqHeaders
1294 googleapi.Expand(req.URL, map[string]string{
1295 "resource": c.resource,
1296 })
1297 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
1298 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1299 }
1300
1301 // Do executes the "biglake.projects.catalogs.testIamPermissions" call.
1302 // Any non-2xx status code is an error. Response headers are in either
1303 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
1304 // returned at all) in error.(*googleapi.Error).Header. Use
1305 // googleapi.IsNotModified to check whether the returned error was because
1306 // http.StatusNotModified was returned.
1307 func (c *ProjectsCatalogsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
1308 gensupport.SetOptions(c.urlParams_, opts...)
1309 res, err := c.doRequest("json")
1310 if res != nil && res.StatusCode == http.StatusNotModified {
1311 if res.Body != nil {
1312 res.Body.Close()
1313 }
1314 return nil, gensupport.WrapError(&googleapi.Error{
1315 Code: res.StatusCode,
1316 Header: res.Header,
1317 })
1318 }
1319 if err != nil {
1320 return nil, err
1321 }
1322 defer googleapi.CloseBody(res)
1323 if err := googleapi.CheckResponse(res); err != nil {
1324 return nil, gensupport.WrapError(err)
1325 }
1326 ret := &TestIamPermissionsResponse{
1327 ServerResponse: googleapi.ServerResponse{
1328 Header: res.Header,
1329 HTTPStatusCode: res.StatusCode,
1330 },
1331 }
1332 target := &ret
1333 b, err := gensupport.DecodeResponseBytes(target, res)
1334 if err != nil {
1335 return nil, err
1336 }
1337 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.testIamPermissions", "response", internallog.HTTPResponse(res, b))
1338 return ret, nil
1339 }
1340
1341 type ProjectsCatalogsNamespacesGetIamPolicyCall struct {
1342 s *Service
1343 resource string
1344 urlParams_ gensupport.URLParams
1345 ifNoneMatch_ string
1346 ctx_ context.Context
1347 header_ http.Header
1348 }
1349
1350 // GetIamPolicy: Gets the IAM policy for the specified Catalog.
1351 //
1352 // - resource: REQUIRED: The resource for which the policy is being requested.
1353 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1354 // for the appropriate value for this field.
1355 func (r *ProjectsCatalogsNamespacesService) GetIamPolicy(resource string) *ProjectsCatalogsNamespacesGetIamPolicyCall {
1356 c := &ProjectsCatalogsNamespacesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1357 c.resource = resource
1358 return c
1359 }
1360
1361 // OptionsRequestedPolicyVersion sets the optional parameter
1362 // "options.requestedPolicyVersion": The maximum policy version that will be
1363 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
1364 // an invalid value will be rejected. Requests for policies with any
1365 // conditional role bindings must specify version 3. Policies with no
1366 // conditional role bindings may specify any valid value or leave the field
1367 // unset. The policy in the response might use the policy version that you
1368 // specified, or it might use a lower policy version. For example, if you
1369 // specify version 3, but the policy has no conditional role bindings, the
1370 // response uses version 1. To learn which resources support conditions in
1371 // their IAM policies, see the IAM documentation
1372 // (https://cloud.google.com/iam/help/conditions/resource-policies).
1373 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsCatalogsNamespacesGetIamPolicyCall {
1374 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1375 return c
1376 }
1377
1378 // Fields allows partial responses to be retrieved. See
1379 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1380 // details.
1381 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesGetIamPolicyCall {
1382 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1383 return c
1384 }
1385
1386 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1387 // object's ETag matches the given value. This is useful for getting updates
1388 // only after the object has changed since the last request.
1389 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsCatalogsNamespacesGetIamPolicyCall {
1390 c.ifNoneMatch_ = entityTag
1391 return c
1392 }
1393
1394 // Context sets the context to be used in this call's Do method.
1395 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesGetIamPolicyCall {
1396 c.ctx_ = ctx
1397 return c
1398 }
1399
1400 // Header returns a http.Header that can be modified by the caller to add
1401 // headers to the request.
1402 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) Header() http.Header {
1403 if c.header_ == nil {
1404 c.header_ = make(http.Header)
1405 }
1406 return c.header_
1407 }
1408
1409 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1410 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1411 if c.ifNoneMatch_ != "" {
1412 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1413 }
1414 c.urlParams_.Set("alt", alt)
1415 c.urlParams_.Set("prettyPrint", "false")
1416 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
1417 urls += "?" + c.urlParams_.Encode()
1418 req, err := http.NewRequest("GET", urls, nil)
1419 if err != nil {
1420 return nil, err
1421 }
1422 req.Header = reqHeaders
1423 googleapi.Expand(req.URL, map[string]string{
1424 "resource": c.resource,
1425 })
1426 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
1427 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1428 }
1429
1430 // Do executes the "biglake.projects.catalogs.namespaces.getIamPolicy" call.
1431 // Any non-2xx status code is an error. Response headers are in either
1432 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1433 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1434 // whether the returned error was because http.StatusNotModified was returned.
1435 func (c *ProjectsCatalogsNamespacesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1436 gensupport.SetOptions(c.urlParams_, opts...)
1437 res, err := c.doRequest("json")
1438 if res != nil && res.StatusCode == http.StatusNotModified {
1439 if res.Body != nil {
1440 res.Body.Close()
1441 }
1442 return nil, gensupport.WrapError(&googleapi.Error{
1443 Code: res.StatusCode,
1444 Header: res.Header,
1445 })
1446 }
1447 if err != nil {
1448 return nil, err
1449 }
1450 defer googleapi.CloseBody(res)
1451 if err := googleapi.CheckResponse(res); err != nil {
1452 return nil, gensupport.WrapError(err)
1453 }
1454 ret := &Policy{
1455 ServerResponse: googleapi.ServerResponse{
1456 Header: res.Header,
1457 HTTPStatusCode: res.StatusCode,
1458 },
1459 }
1460 target := &ret
1461 b, err := gensupport.DecodeResponseBytes(target, res)
1462 if err != nil {
1463 return nil, err
1464 }
1465 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.getIamPolicy", "response", internallog.HTTPResponse(res, b))
1466 return ret, nil
1467 }
1468
1469 type ProjectsCatalogsNamespacesSetIamPolicyCall struct {
1470 s *Service
1471 resource string
1472 setiampolicyrequest *SetIamPolicyRequest
1473 urlParams_ gensupport.URLParams
1474 ctx_ context.Context
1475 header_ http.Header
1476 }
1477
1478 // SetIamPolicy: Sets the IAM policy for the specified catalog.
1479 //
1480 // - resource: REQUIRED: The resource for which the policy is being specified.
1481 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1482 // for the appropriate value for this field.
1483 func (r *ProjectsCatalogsNamespacesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsCatalogsNamespacesSetIamPolicyCall {
1484 c := &ProjectsCatalogsNamespacesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1485 c.resource = resource
1486 c.setiampolicyrequest = setiampolicyrequest
1487 return c
1488 }
1489
1490 // Fields allows partial responses to be retrieved. See
1491 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1492 // details.
1493 func (c *ProjectsCatalogsNamespacesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesSetIamPolicyCall {
1494 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1495 return c
1496 }
1497
1498 // Context sets the context to be used in this call's Do method.
1499 func (c *ProjectsCatalogsNamespacesSetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesSetIamPolicyCall {
1500 c.ctx_ = ctx
1501 return c
1502 }
1503
1504 // Header returns a http.Header that can be modified by the caller to add
1505 // headers to the request.
1506 func (c *ProjectsCatalogsNamespacesSetIamPolicyCall) Header() http.Header {
1507 if c.header_ == nil {
1508 c.header_ = make(http.Header)
1509 }
1510 return c.header_
1511 }
1512
1513 func (c *ProjectsCatalogsNamespacesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1514 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1515 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
1516 if err != nil {
1517 return nil, err
1518 }
1519 c.urlParams_.Set("alt", alt)
1520 c.urlParams_.Set("prettyPrint", "false")
1521 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
1522 urls += "?" + c.urlParams_.Encode()
1523 req, err := http.NewRequest("POST", urls, body)
1524 if err != nil {
1525 return nil, err
1526 }
1527 req.Header = reqHeaders
1528 googleapi.Expand(req.URL, map[string]string{
1529 "resource": c.resource,
1530 })
1531 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
1532 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1533 }
1534
1535 // Do executes the "biglake.projects.catalogs.namespaces.setIamPolicy" call.
1536 // Any non-2xx status code is an error. Response headers are in either
1537 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1538 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1539 // whether the returned error was because http.StatusNotModified was returned.
1540 func (c *ProjectsCatalogsNamespacesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1541 gensupport.SetOptions(c.urlParams_, opts...)
1542 res, err := c.doRequest("json")
1543 if res != nil && res.StatusCode == http.StatusNotModified {
1544 if res.Body != nil {
1545 res.Body.Close()
1546 }
1547 return nil, gensupport.WrapError(&googleapi.Error{
1548 Code: res.StatusCode,
1549 Header: res.Header,
1550 })
1551 }
1552 if err != nil {
1553 return nil, err
1554 }
1555 defer googleapi.CloseBody(res)
1556 if err := googleapi.CheckResponse(res); err != nil {
1557 return nil, gensupport.WrapError(err)
1558 }
1559 ret := &Policy{
1560 ServerResponse: googleapi.ServerResponse{
1561 Header: res.Header,
1562 HTTPStatusCode: res.StatusCode,
1563 },
1564 }
1565 target := &ret
1566 b, err := gensupport.DecodeResponseBytes(target, res)
1567 if err != nil {
1568 return nil, err
1569 }
1570 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.setIamPolicy", "response", internallog.HTTPResponse(res, b))
1571 return ret, nil
1572 }
1573
1574 type ProjectsCatalogsNamespacesTestIamPermissionsCall struct {
1575 s *Service
1576 resource string
1577 testiampermissionsrequest *TestIamPermissionsRequest
1578 urlParams_ gensupport.URLParams
1579 ctx_ context.Context
1580 header_ http.Header
1581 }
1582
1583 // TestIamPermissions: Tests the IAM permissions for the specified namespace.
1584 //
1585 // - resource: REQUIRED: The resource for which the policy detail is being
1586 // requested. See Resource names
1587 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
1588 // value for this field.
1589 func (r *ProjectsCatalogsNamespacesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsCatalogsNamespacesTestIamPermissionsCall {
1590 c := &ProjectsCatalogsNamespacesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1591 c.resource = resource
1592 c.testiampermissionsrequest = testiampermissionsrequest
1593 return c
1594 }
1595
1596 // Fields allows partial responses to be retrieved. See
1597 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1598 // details.
1599 func (c *ProjectsCatalogsNamespacesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesTestIamPermissionsCall {
1600 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1601 return c
1602 }
1603
1604 // Context sets the context to be used in this call's Do method.
1605 func (c *ProjectsCatalogsNamespacesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesTestIamPermissionsCall {
1606 c.ctx_ = ctx
1607 return c
1608 }
1609
1610 // Header returns a http.Header that can be modified by the caller to add
1611 // headers to the request.
1612 func (c *ProjectsCatalogsNamespacesTestIamPermissionsCall) Header() http.Header {
1613 if c.header_ == nil {
1614 c.header_ = make(http.Header)
1615 }
1616 return c.header_
1617 }
1618
1619 func (c *ProjectsCatalogsNamespacesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
1620 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1621 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
1622 if err != nil {
1623 return nil, err
1624 }
1625 c.urlParams_.Set("alt", alt)
1626 c.urlParams_.Set("prettyPrint", "false")
1627 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
1628 urls += "?" + c.urlParams_.Encode()
1629 req, err := http.NewRequest("POST", urls, body)
1630 if err != nil {
1631 return nil, err
1632 }
1633 req.Header = reqHeaders
1634 googleapi.Expand(req.URL, map[string]string{
1635 "resource": c.resource,
1636 })
1637 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
1638 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1639 }
1640
1641 // Do executes the "biglake.projects.catalogs.namespaces.testIamPermissions" call.
1642 // Any non-2xx status code is an error. Response headers are in either
1643 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
1644 // returned at all) in error.(*googleapi.Error).Header. Use
1645 // googleapi.IsNotModified to check whether the returned error was because
1646 // http.StatusNotModified was returned.
1647 func (c *ProjectsCatalogsNamespacesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
1648 gensupport.SetOptions(c.urlParams_, opts...)
1649 res, err := c.doRequest("json")
1650 if res != nil && res.StatusCode == http.StatusNotModified {
1651 if res.Body != nil {
1652 res.Body.Close()
1653 }
1654 return nil, gensupport.WrapError(&googleapi.Error{
1655 Code: res.StatusCode,
1656 Header: res.Header,
1657 })
1658 }
1659 if err != nil {
1660 return nil, err
1661 }
1662 defer googleapi.CloseBody(res)
1663 if err := googleapi.CheckResponse(res); err != nil {
1664 return nil, gensupport.WrapError(err)
1665 }
1666 ret := &TestIamPermissionsResponse{
1667 ServerResponse: googleapi.ServerResponse{
1668 Header: res.Header,
1669 HTTPStatusCode: res.StatusCode,
1670 },
1671 }
1672 target := &ret
1673 b, err := gensupport.DecodeResponseBytes(target, res)
1674 if err != nil {
1675 return nil, err
1676 }
1677 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.testIamPermissions", "response", internallog.HTTPResponse(res, b))
1678 return ret, nil
1679 }
1680
1681 type ProjectsCatalogsNamespacesTablesGetIamPolicyCall struct {
1682 s *Service
1683 resource string
1684 urlParams_ gensupport.URLParams
1685 ifNoneMatch_ string
1686 ctx_ context.Context
1687 header_ http.Header
1688 }
1689
1690 // GetIamPolicy: Gets the IAM policy for the specified Catalog.
1691 //
1692 // - resource: REQUIRED: The resource for which the policy is being requested.
1693 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1694 // for the appropriate value for this field.
1695 func (r *ProjectsCatalogsNamespacesTablesService) GetIamPolicy(resource string) *ProjectsCatalogsNamespacesTablesGetIamPolicyCall {
1696 c := &ProjectsCatalogsNamespacesTablesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1697 c.resource = resource
1698 return c
1699 }
1700
1701 // OptionsRequestedPolicyVersion sets the optional parameter
1702 // "options.requestedPolicyVersion": The maximum policy version that will be
1703 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
1704 // an invalid value will be rejected. Requests for policies with any
1705 // conditional role bindings must specify version 3. Policies with no
1706 // conditional role bindings may specify any valid value or leave the field
1707 // unset. The policy in the response might use the policy version that you
1708 // specified, or it might use a lower policy version. For example, if you
1709 // specify version 3, but the policy has no conditional role bindings, the
1710 // response uses version 1. To learn which resources support conditions in
1711 // their IAM policies, see the IAM documentation
1712 // (https://cloud.google.com/iam/help/conditions/resource-policies).
1713 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsCatalogsNamespacesTablesGetIamPolicyCall {
1714 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1715 return c
1716 }
1717
1718 // Fields allows partial responses to be retrieved. See
1719 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1720 // details.
1721 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesTablesGetIamPolicyCall {
1722 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1723 return c
1724 }
1725
1726 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1727 // object's ETag matches the given value. This is useful for getting updates
1728 // only after the object has changed since the last request.
1729 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsCatalogsNamespacesTablesGetIamPolicyCall {
1730 c.ifNoneMatch_ = entityTag
1731 return c
1732 }
1733
1734 // Context sets the context to be used in this call's Do method.
1735 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesTablesGetIamPolicyCall {
1736 c.ctx_ = ctx
1737 return c
1738 }
1739
1740 // Header returns a http.Header that can be modified by the caller to add
1741 // headers to the request.
1742 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) Header() http.Header {
1743 if c.header_ == nil {
1744 c.header_ = make(http.Header)
1745 }
1746 return c.header_
1747 }
1748
1749 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1750 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1751 if c.ifNoneMatch_ != "" {
1752 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1753 }
1754 c.urlParams_.Set("alt", alt)
1755 c.urlParams_.Set("prettyPrint", "false")
1756 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
1757 urls += "?" + c.urlParams_.Encode()
1758 req, err := http.NewRequest("GET", urls, nil)
1759 if err != nil {
1760 return nil, err
1761 }
1762 req.Header = reqHeaders
1763 googleapi.Expand(req.URL, map[string]string{
1764 "resource": c.resource,
1765 })
1766 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
1767 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1768 }
1769
1770 // Do executes the "biglake.projects.catalogs.namespaces.tables.getIamPolicy" call.
1771 // Any non-2xx status code is an error. Response headers are in either
1772 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1773 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1774 // whether the returned error was because http.StatusNotModified was returned.
1775 func (c *ProjectsCatalogsNamespacesTablesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1776 gensupport.SetOptions(c.urlParams_, opts...)
1777 res, err := c.doRequest("json")
1778 if res != nil && res.StatusCode == http.StatusNotModified {
1779 if res.Body != nil {
1780 res.Body.Close()
1781 }
1782 return nil, gensupport.WrapError(&googleapi.Error{
1783 Code: res.StatusCode,
1784 Header: res.Header,
1785 })
1786 }
1787 if err != nil {
1788 return nil, err
1789 }
1790 defer googleapi.CloseBody(res)
1791 if err := googleapi.CheckResponse(res); err != nil {
1792 return nil, gensupport.WrapError(err)
1793 }
1794 ret := &Policy{
1795 ServerResponse: googleapi.ServerResponse{
1796 Header: res.Header,
1797 HTTPStatusCode: res.StatusCode,
1798 },
1799 }
1800 target := &ret
1801 b, err := gensupport.DecodeResponseBytes(target, res)
1802 if err != nil {
1803 return nil, err
1804 }
1805 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.getIamPolicy", "response", internallog.HTTPResponse(res, b))
1806 return ret, nil
1807 }
1808
1809 type ProjectsCatalogsNamespacesTablesSetIamPolicyCall struct {
1810 s *Service
1811 resource string
1812 setiampolicyrequest *SetIamPolicyRequest
1813 urlParams_ gensupport.URLParams
1814 ctx_ context.Context
1815 header_ http.Header
1816 }
1817
1818 // SetIamPolicy: Sets the IAM policy for the specified catalog.
1819 //
1820 // - resource: REQUIRED: The resource for which the policy is being specified.
1821 // See Resource names (https://cloud.google.com/apis/design/resource_names)
1822 // for the appropriate value for this field.
1823 func (r *ProjectsCatalogsNamespacesTablesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsCatalogsNamespacesTablesSetIamPolicyCall {
1824 c := &ProjectsCatalogsNamespacesTablesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1825 c.resource = resource
1826 c.setiampolicyrequest = setiampolicyrequest
1827 return c
1828 }
1829
1830 // Fields allows partial responses to be retrieved. See
1831 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1832 // details.
1833 func (c *ProjectsCatalogsNamespacesTablesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesTablesSetIamPolicyCall {
1834 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1835 return c
1836 }
1837
1838 // Context sets the context to be used in this call's Do method.
1839 func (c *ProjectsCatalogsNamespacesTablesSetIamPolicyCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesTablesSetIamPolicyCall {
1840 c.ctx_ = ctx
1841 return c
1842 }
1843
1844 // Header returns a http.Header that can be modified by the caller to add
1845 // headers to the request.
1846 func (c *ProjectsCatalogsNamespacesTablesSetIamPolicyCall) Header() http.Header {
1847 if c.header_ == nil {
1848 c.header_ = make(http.Header)
1849 }
1850 return c.header_
1851 }
1852
1853 func (c *ProjectsCatalogsNamespacesTablesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1855 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
1856 if err != nil {
1857 return nil, err
1858 }
1859 c.urlParams_.Set("alt", alt)
1860 c.urlParams_.Set("prettyPrint", "false")
1861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
1862 urls += "?" + c.urlParams_.Encode()
1863 req, err := http.NewRequest("POST", urls, body)
1864 if err != nil {
1865 return nil, err
1866 }
1867 req.Header = reqHeaders
1868 googleapi.Expand(req.URL, map[string]string{
1869 "resource": c.resource,
1870 })
1871 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
1872 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1873 }
1874
1875 // Do executes the "biglake.projects.catalogs.namespaces.tables.setIamPolicy" call.
1876 // Any non-2xx status code is an error. Response headers are in either
1877 // *Policy.ServerResponse.Header or (if a response was returned at all) in
1878 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1879 // whether the returned error was because http.StatusNotModified was returned.
1880 func (c *ProjectsCatalogsNamespacesTablesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1881 gensupport.SetOptions(c.urlParams_, opts...)
1882 res, err := c.doRequest("json")
1883 if res != nil && res.StatusCode == http.StatusNotModified {
1884 if res.Body != nil {
1885 res.Body.Close()
1886 }
1887 return nil, gensupport.WrapError(&googleapi.Error{
1888 Code: res.StatusCode,
1889 Header: res.Header,
1890 })
1891 }
1892 if err != nil {
1893 return nil, err
1894 }
1895 defer googleapi.CloseBody(res)
1896 if err := googleapi.CheckResponse(res); err != nil {
1897 return nil, gensupport.WrapError(err)
1898 }
1899 ret := &Policy{
1900 ServerResponse: googleapi.ServerResponse{
1901 Header: res.Header,
1902 HTTPStatusCode: res.StatusCode,
1903 },
1904 }
1905 target := &ret
1906 b, err := gensupport.DecodeResponseBytes(target, res)
1907 if err != nil {
1908 return nil, err
1909 }
1910 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.setIamPolicy", "response", internallog.HTTPResponse(res, b))
1911 return ret, nil
1912 }
1913
1914 type ProjectsCatalogsNamespacesTablesTestIamPermissionsCall struct {
1915 s *Service
1916 resource string
1917 testiampermissionsrequest *TestIamPermissionsRequest
1918 urlParams_ gensupport.URLParams
1919 ctx_ context.Context
1920 header_ http.Header
1921 }
1922
1923 // TestIamPermissions: Tests the IAM permissions for the specified table.
1924 //
1925 // - resource: REQUIRED: The resource for which the policy detail is being
1926 // requested. See Resource names
1927 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
1928 // value for this field.
1929 func (r *ProjectsCatalogsNamespacesTablesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall {
1930 c := &ProjectsCatalogsNamespacesTablesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1931 c.resource = resource
1932 c.testiampermissionsrequest = testiampermissionsrequest
1933 return c
1934 }
1935
1936 // Fields allows partial responses to be retrieved. See
1937 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1938 // details.
1939 func (c *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall {
1940 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1941 return c
1942 }
1943
1944 // Context sets the context to be used in this call's Do method.
1945 func (c *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall {
1946 c.ctx_ = ctx
1947 return c
1948 }
1949
1950 // Header returns a http.Header that can be modified by the caller to add
1951 // headers to the request.
1952 func (c *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall) Header() http.Header {
1953 if c.header_ == nil {
1954 c.header_ = make(http.Header)
1955 }
1956 return c.header_
1957 }
1958
1959 func (c *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
1960 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1961 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
1962 if err != nil {
1963 return nil, err
1964 }
1965 c.urlParams_.Set("alt", alt)
1966 c.urlParams_.Set("prettyPrint", "false")
1967 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
1968 urls += "?" + c.urlParams_.Encode()
1969 req, err := http.NewRequest("POST", urls, body)
1970 if err != nil {
1971 return nil, err
1972 }
1973 req.Header = reqHeaders
1974 googleapi.Expand(req.URL, map[string]string{
1975 "resource": c.resource,
1976 })
1977 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
1978 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1979 }
1980
1981 // Do executes the "biglake.projects.catalogs.namespaces.tables.testIamPermissions" call.
1982 // Any non-2xx status code is an error. Response headers are in either
1983 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
1984 // returned at all) in error.(*googleapi.Error).Header. Use
1985 // googleapi.IsNotModified to check whether the returned error was because
1986 // http.StatusNotModified was returned.
1987 func (c *ProjectsCatalogsNamespacesTablesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
1988 gensupport.SetOptions(c.urlParams_, opts...)
1989 res, err := c.doRequest("json")
1990 if res != nil && res.StatusCode == http.StatusNotModified {
1991 if res.Body != nil {
1992 res.Body.Close()
1993 }
1994 return nil, gensupport.WrapError(&googleapi.Error{
1995 Code: res.StatusCode,
1996 Header: res.Header,
1997 })
1998 }
1999 if err != nil {
2000 return nil, err
2001 }
2002 defer googleapi.CloseBody(res)
2003 if err := googleapi.CheckResponse(res); err != nil {
2004 return nil, gensupport.WrapError(err)
2005 }
2006 ret := &TestIamPermissionsResponse{
2007 ServerResponse: googleapi.ServerResponse{
2008 Header: res.Header,
2009 HTTPStatusCode: res.StatusCode,
2010 },
2011 }
2012 target := &ret
2013 b, err := gensupport.DecodeResponseBytes(target, res)
2014 if err != nil {
2015 return nil, err
2016 }
2017 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.catalogs.namespaces.tables.testIamPermissions", "response", internallog.HTTPResponse(res, b))
2018 return ret, nil
2019 }
2020
2021 type ProjectsLocationsCatalogsCreateCall struct {
2022 s *Service
2023 parent string
2024 catalog *Catalog
2025 urlParams_ gensupport.URLParams
2026 ctx_ context.Context
2027 header_ http.Header
2028 }
2029
2030 // Create: Creates a new catalog.
2031 //
2032 // - parent: The parent resource where this catalog will be created. Format:
2033 // projects/{project_id_or_number}/locations/{location_id}.
2034 func (r *ProjectsLocationsCatalogsService) Create(parent string, catalog *Catalog) *ProjectsLocationsCatalogsCreateCall {
2035 c := &ProjectsLocationsCatalogsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2036 c.parent = parent
2037 c.catalog = catalog
2038 return c
2039 }
2040
2041 // CatalogId sets the optional parameter "catalogId": Required. The ID to use
2042 // for the catalog, which will become the final component of the catalog's
2043 // resource name.
2044 func (c *ProjectsLocationsCatalogsCreateCall) CatalogId(catalogId string) *ProjectsLocationsCatalogsCreateCall {
2045 c.urlParams_.Set("catalogId", catalogId)
2046 return c
2047 }
2048
2049 // Fields allows partial responses to be retrieved. See
2050 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2051 // details.
2052 func (c *ProjectsLocationsCatalogsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCreateCall {
2053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2054 return c
2055 }
2056
2057 // Context sets the context to be used in this call's Do method.
2058 func (c *ProjectsLocationsCatalogsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCreateCall {
2059 c.ctx_ = ctx
2060 return c
2061 }
2062
2063 // Header returns a http.Header that can be modified by the caller to add
2064 // headers to the request.
2065 func (c *ProjectsLocationsCatalogsCreateCall) Header() http.Header {
2066 if c.header_ == nil {
2067 c.header_ = make(http.Header)
2068 }
2069 return c.header_
2070 }
2071
2072 func (c *ProjectsLocationsCatalogsCreateCall) doRequest(alt string) (*http.Response, error) {
2073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2074 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.catalog)
2075 if err != nil {
2076 return nil, err
2077 }
2078 c.urlParams_.Set("alt", alt)
2079 c.urlParams_.Set("prettyPrint", "false")
2080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/catalogs")
2081 urls += "?" + c.urlParams_.Encode()
2082 req, err := http.NewRequest("POST", urls, body)
2083 if err != nil {
2084 return nil, err
2085 }
2086 req.Header = reqHeaders
2087 googleapi.Expand(req.URL, map[string]string{
2088 "parent": c.parent,
2089 })
2090 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2091 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2092 }
2093
2094 // Do executes the "biglake.projects.locations.catalogs.create" call.
2095 // Any non-2xx status code is an error. Response headers are in either
2096 // *Catalog.ServerResponse.Header or (if a response was returned at all) in
2097 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2098 // whether the returned error was because http.StatusNotModified was returned.
2099 func (c *ProjectsLocationsCatalogsCreateCall) Do(opts ...googleapi.CallOption) (*Catalog, error) {
2100 gensupport.SetOptions(c.urlParams_, opts...)
2101 res, err := c.doRequest("json")
2102 if res != nil && res.StatusCode == http.StatusNotModified {
2103 if res.Body != nil {
2104 res.Body.Close()
2105 }
2106 return nil, gensupport.WrapError(&googleapi.Error{
2107 Code: res.StatusCode,
2108 Header: res.Header,
2109 })
2110 }
2111 if err != nil {
2112 return nil, err
2113 }
2114 defer googleapi.CloseBody(res)
2115 if err := googleapi.CheckResponse(res); err != nil {
2116 return nil, gensupport.WrapError(err)
2117 }
2118 ret := &Catalog{
2119 ServerResponse: googleapi.ServerResponse{
2120 Header: res.Header,
2121 HTTPStatusCode: res.StatusCode,
2122 },
2123 }
2124 target := &ret
2125 b, err := gensupport.DecodeResponseBytes(target, res)
2126 if err != nil {
2127 return nil, err
2128 }
2129 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.create", "response", internallog.HTTPResponse(res, b))
2130 return ret, nil
2131 }
2132
2133 type ProjectsLocationsCatalogsDeleteCall struct {
2134 s *Service
2135 name string
2136 urlParams_ gensupport.URLParams
2137 ctx_ context.Context
2138 header_ http.Header
2139 }
2140
2141 // Delete: Deletes an existing catalog specified by the catalog ID.
2142 //
2143 // - name: The name of the catalog to delete. Format:
2144 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2145 // d}.
2146 func (r *ProjectsLocationsCatalogsService) Delete(name string) *ProjectsLocationsCatalogsDeleteCall {
2147 c := &ProjectsLocationsCatalogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2148 c.name = name
2149 return c
2150 }
2151
2152 // Fields allows partial responses to be retrieved. See
2153 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2154 // details.
2155 func (c *ProjectsLocationsCatalogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDeleteCall {
2156 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2157 return c
2158 }
2159
2160 // Context sets the context to be used in this call's Do method.
2161 func (c *ProjectsLocationsCatalogsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDeleteCall {
2162 c.ctx_ = ctx
2163 return c
2164 }
2165
2166 // Header returns a http.Header that can be modified by the caller to add
2167 // headers to the request.
2168 func (c *ProjectsLocationsCatalogsDeleteCall) Header() http.Header {
2169 if c.header_ == nil {
2170 c.header_ = make(http.Header)
2171 }
2172 return c.header_
2173 }
2174
2175 func (c *ProjectsLocationsCatalogsDeleteCall) doRequest(alt string) (*http.Response, error) {
2176 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2177 c.urlParams_.Set("alt", alt)
2178 c.urlParams_.Set("prettyPrint", "false")
2179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2180 urls += "?" + c.urlParams_.Encode()
2181 req, err := http.NewRequest("DELETE", urls, nil)
2182 if err != nil {
2183 return nil, err
2184 }
2185 req.Header = reqHeaders
2186 googleapi.Expand(req.URL, map[string]string{
2187 "name": c.name,
2188 })
2189 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.delete", "request", internallog.HTTPRequest(req, nil))
2190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2191 }
2192
2193 // Do executes the "biglake.projects.locations.catalogs.delete" call.
2194 // Any non-2xx status code is an error. Response headers are in either
2195 // *Catalog.ServerResponse.Header or (if a response was returned at all) in
2196 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2197 // whether the returned error was because http.StatusNotModified was returned.
2198 func (c *ProjectsLocationsCatalogsDeleteCall) Do(opts ...googleapi.CallOption) (*Catalog, error) {
2199 gensupport.SetOptions(c.urlParams_, opts...)
2200 res, err := c.doRequest("json")
2201 if res != nil && res.StatusCode == http.StatusNotModified {
2202 if res.Body != nil {
2203 res.Body.Close()
2204 }
2205 return nil, gensupport.WrapError(&googleapi.Error{
2206 Code: res.StatusCode,
2207 Header: res.Header,
2208 })
2209 }
2210 if err != nil {
2211 return nil, err
2212 }
2213 defer googleapi.CloseBody(res)
2214 if err := googleapi.CheckResponse(res); err != nil {
2215 return nil, gensupport.WrapError(err)
2216 }
2217 ret := &Catalog{
2218 ServerResponse: googleapi.ServerResponse{
2219 Header: res.Header,
2220 HTTPStatusCode: res.StatusCode,
2221 },
2222 }
2223 target := &ret
2224 b, err := gensupport.DecodeResponseBytes(target, res)
2225 if err != nil {
2226 return nil, err
2227 }
2228 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.delete", "response", internallog.HTTPResponse(res, b))
2229 return ret, nil
2230 }
2231
2232 type ProjectsLocationsCatalogsGetCall struct {
2233 s *Service
2234 name string
2235 urlParams_ gensupport.URLParams
2236 ifNoneMatch_ string
2237 ctx_ context.Context
2238 header_ http.Header
2239 }
2240
2241 // Get: Gets the catalog specified by the resource name.
2242 //
2243 // - name: The name of the catalog to retrieve. Format:
2244 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2245 // d}.
2246 func (r *ProjectsLocationsCatalogsService) Get(name string) *ProjectsLocationsCatalogsGetCall {
2247 c := &ProjectsLocationsCatalogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2248 c.name = name
2249 return c
2250 }
2251
2252 // Fields allows partial responses to be retrieved. See
2253 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2254 // details.
2255 func (c *ProjectsLocationsCatalogsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetCall {
2256 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2257 return c
2258 }
2259
2260 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2261 // object's ETag matches the given value. This is useful for getting updates
2262 // only after the object has changed since the last request.
2263 func (c *ProjectsLocationsCatalogsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetCall {
2264 c.ifNoneMatch_ = entityTag
2265 return c
2266 }
2267
2268 // Context sets the context to be used in this call's Do method.
2269 func (c *ProjectsLocationsCatalogsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetCall {
2270 c.ctx_ = ctx
2271 return c
2272 }
2273
2274 // Header returns a http.Header that can be modified by the caller to add
2275 // headers to the request.
2276 func (c *ProjectsLocationsCatalogsGetCall) Header() http.Header {
2277 if c.header_ == nil {
2278 c.header_ = make(http.Header)
2279 }
2280 return c.header_
2281 }
2282
2283 func (c *ProjectsLocationsCatalogsGetCall) doRequest(alt string) (*http.Response, error) {
2284 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2285 if c.ifNoneMatch_ != "" {
2286 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2287 }
2288 c.urlParams_.Set("alt", alt)
2289 c.urlParams_.Set("prettyPrint", "false")
2290 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2291 urls += "?" + c.urlParams_.Encode()
2292 req, err := http.NewRequest("GET", urls, nil)
2293 if err != nil {
2294 return nil, err
2295 }
2296 req.Header = reqHeaders
2297 googleapi.Expand(req.URL, map[string]string{
2298 "name": c.name,
2299 })
2300 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.get", "request", internallog.HTTPRequest(req, nil))
2301 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2302 }
2303
2304 // Do executes the "biglake.projects.locations.catalogs.get" call.
2305 // Any non-2xx status code is an error. Response headers are in either
2306 // *Catalog.ServerResponse.Header or (if a response was returned at all) in
2307 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2308 // whether the returned error was because http.StatusNotModified was returned.
2309 func (c *ProjectsLocationsCatalogsGetCall) Do(opts ...googleapi.CallOption) (*Catalog, error) {
2310 gensupport.SetOptions(c.urlParams_, opts...)
2311 res, err := c.doRequest("json")
2312 if res != nil && res.StatusCode == http.StatusNotModified {
2313 if res.Body != nil {
2314 res.Body.Close()
2315 }
2316 return nil, gensupport.WrapError(&googleapi.Error{
2317 Code: res.StatusCode,
2318 Header: res.Header,
2319 })
2320 }
2321 if err != nil {
2322 return nil, err
2323 }
2324 defer googleapi.CloseBody(res)
2325 if err := googleapi.CheckResponse(res); err != nil {
2326 return nil, gensupport.WrapError(err)
2327 }
2328 ret := &Catalog{
2329 ServerResponse: googleapi.ServerResponse{
2330 Header: res.Header,
2331 HTTPStatusCode: res.StatusCode,
2332 },
2333 }
2334 target := &ret
2335 b, err := gensupport.DecodeResponseBytes(target, res)
2336 if err != nil {
2337 return nil, err
2338 }
2339 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.get", "response", internallog.HTTPResponse(res, b))
2340 return ret, nil
2341 }
2342
2343 type ProjectsLocationsCatalogsListCall struct {
2344 s *Service
2345 parent string
2346 urlParams_ gensupport.URLParams
2347 ifNoneMatch_ string
2348 ctx_ context.Context
2349 header_ http.Header
2350 }
2351
2352 // List: List all catalogs in a specified project.
2353 //
2354 // - parent: The parent, which owns this collection of catalogs. Format:
2355 // projects/{project_id_or_number}/locations/{location_id}.
2356 func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall {
2357 c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2358 c.parent = parent
2359 return c
2360 }
2361
2362 // PageSize sets the optional parameter "pageSize": The maximum number of
2363 // catalogs to return. The service may return fewer than this value. If
2364 // unspecified, at most 50 catalogs will be returned. The maximum value is
2365 // 1000; values above 1000 will be coerced to 1000.
2366 func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall {
2367 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2368 return c
2369 }
2370
2371 // PageToken sets the optional parameter "pageToken": A page token, received
2372 // from a previous `ListCatalogs` call. Provide this to retrieve the subsequent
2373 // page. When paginating, all other parameters provided to `ListCatalogs` must
2374 // match the call that provided the page token.
2375 func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall {
2376 c.urlParams_.Set("pageToken", pageToken)
2377 return c
2378 }
2379
2380 // Fields allows partial responses to be retrieved. See
2381 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2382 // details.
2383 func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall {
2384 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2385 return c
2386 }
2387
2388 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2389 // object's ETag matches the given value. This is useful for getting updates
2390 // only after the object has changed since the last request.
2391 func (c *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall {
2392 c.ifNoneMatch_ = entityTag
2393 return c
2394 }
2395
2396 // Context sets the context to be used in this call's Do method.
2397 func (c *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall {
2398 c.ctx_ = ctx
2399 return c
2400 }
2401
2402 // Header returns a http.Header that can be modified by the caller to add
2403 // headers to the request.
2404 func (c *ProjectsLocationsCatalogsListCall) Header() http.Header {
2405 if c.header_ == nil {
2406 c.header_ = make(http.Header)
2407 }
2408 return c.header_
2409 }
2410
2411 func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Response, error) {
2412 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2413 if c.ifNoneMatch_ != "" {
2414 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2415 }
2416 c.urlParams_.Set("alt", alt)
2417 c.urlParams_.Set("prettyPrint", "false")
2418 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/catalogs")
2419 urls += "?" + c.urlParams_.Encode()
2420 req, err := http.NewRequest("GET", urls, nil)
2421 if err != nil {
2422 return nil, err
2423 }
2424 req.Header = reqHeaders
2425 googleapi.Expand(req.URL, map[string]string{
2426 "parent": c.parent,
2427 })
2428 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.list", "request", internallog.HTTPRequest(req, nil))
2429 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2430 }
2431
2432 // Do executes the "biglake.projects.locations.catalogs.list" call.
2433 // Any non-2xx status code is an error. Response headers are in either
2434 // *ListCatalogsResponse.ServerResponse.Header or (if a response was returned
2435 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2436 // check whether the returned error was because http.StatusNotModified was
2437 // returned.
2438 func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*ListCatalogsResponse, error) {
2439 gensupport.SetOptions(c.urlParams_, opts...)
2440 res, err := c.doRequest("json")
2441 if res != nil && res.StatusCode == http.StatusNotModified {
2442 if res.Body != nil {
2443 res.Body.Close()
2444 }
2445 return nil, gensupport.WrapError(&googleapi.Error{
2446 Code: res.StatusCode,
2447 Header: res.Header,
2448 })
2449 }
2450 if err != nil {
2451 return nil, err
2452 }
2453 defer googleapi.CloseBody(res)
2454 if err := googleapi.CheckResponse(res); err != nil {
2455 return nil, gensupport.WrapError(err)
2456 }
2457 ret := &ListCatalogsResponse{
2458 ServerResponse: googleapi.ServerResponse{
2459 Header: res.Header,
2460 HTTPStatusCode: res.StatusCode,
2461 },
2462 }
2463 target := &ret
2464 b, err := gensupport.DecodeResponseBytes(target, res)
2465 if err != nil {
2466 return nil, err
2467 }
2468 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.list", "response", internallog.HTTPResponse(res, b))
2469 return ret, nil
2470 }
2471
2472 // Pages invokes f for each page of results.
2473 // A non-nil error returned from f will halt the iteration.
2474 // The provided context supersedes any context provided to the Context method.
2475 func (c *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*ListCatalogsResponse) error) error {
2476 c.ctx_ = ctx
2477 defer c.PageToken(c.urlParams_.Get("pageToken"))
2478 for {
2479 x, err := c.Do()
2480 if err != nil {
2481 return err
2482 }
2483 if err := f(x); err != nil {
2484 return err
2485 }
2486 if x.NextPageToken == "" {
2487 return nil
2488 }
2489 c.PageToken(x.NextPageToken)
2490 }
2491 }
2492
2493 type ProjectsLocationsCatalogsDatabasesCreateCall struct {
2494 s *Service
2495 parent string
2496 database *Database
2497 urlParams_ gensupport.URLParams
2498 ctx_ context.Context
2499 header_ http.Header
2500 }
2501
2502 // Create: Creates a new database.
2503 //
2504 // - parent: The parent resource where this database will be created. Format:
2505 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2506 // d}.
2507 func (r *ProjectsLocationsCatalogsDatabasesService) Create(parent string, database *Database) *ProjectsLocationsCatalogsDatabasesCreateCall {
2508 c := &ProjectsLocationsCatalogsDatabasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2509 c.parent = parent
2510 c.database = database
2511 return c
2512 }
2513
2514 // DatabaseId sets the optional parameter "databaseId": Required. The ID to use
2515 // for the database, which will become the final component of the database's
2516 // resource name.
2517 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) DatabaseId(databaseId string) *ProjectsLocationsCatalogsDatabasesCreateCall {
2518 c.urlParams_.Set("databaseId", databaseId)
2519 return c
2520 }
2521
2522 // Fields allows partial responses to be retrieved. See
2523 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2524 // details.
2525 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesCreateCall {
2526 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2527 return c
2528 }
2529
2530 // Context sets the context to be used in this call's Do method.
2531 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesCreateCall {
2532 c.ctx_ = ctx
2533 return c
2534 }
2535
2536 // Header returns a http.Header that can be modified by the caller to add
2537 // headers to the request.
2538 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) Header() http.Header {
2539 if c.header_ == nil {
2540 c.header_ = make(http.Header)
2541 }
2542 return c.header_
2543 }
2544
2545 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) doRequest(alt string) (*http.Response, error) {
2546 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2547 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database)
2548 if err != nil {
2549 return nil, err
2550 }
2551 c.urlParams_.Set("alt", alt)
2552 c.urlParams_.Set("prettyPrint", "false")
2553 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databases")
2554 urls += "?" + c.urlParams_.Encode()
2555 req, err := http.NewRequest("POST", urls, body)
2556 if err != nil {
2557 return nil, err
2558 }
2559 req.Header = reqHeaders
2560 googleapi.Expand(req.URL, map[string]string{
2561 "parent": c.parent,
2562 })
2563 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2564 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2565 }
2566
2567 // Do executes the "biglake.projects.locations.catalogs.databases.create" call.
2568 // Any non-2xx status code is an error. Response headers are in either
2569 // *Database.ServerResponse.Header or (if a response was returned at all) in
2570 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2571 // whether the returned error was because http.StatusNotModified was returned.
2572 func (c *ProjectsLocationsCatalogsDatabasesCreateCall) Do(opts ...googleapi.CallOption) (*Database, error) {
2573 gensupport.SetOptions(c.urlParams_, opts...)
2574 res, err := c.doRequest("json")
2575 if res != nil && res.StatusCode == http.StatusNotModified {
2576 if res.Body != nil {
2577 res.Body.Close()
2578 }
2579 return nil, gensupport.WrapError(&googleapi.Error{
2580 Code: res.StatusCode,
2581 Header: res.Header,
2582 })
2583 }
2584 if err != nil {
2585 return nil, err
2586 }
2587 defer googleapi.CloseBody(res)
2588 if err := googleapi.CheckResponse(res); err != nil {
2589 return nil, gensupport.WrapError(err)
2590 }
2591 ret := &Database{
2592 ServerResponse: googleapi.ServerResponse{
2593 Header: res.Header,
2594 HTTPStatusCode: res.StatusCode,
2595 },
2596 }
2597 target := &ret
2598 b, err := gensupport.DecodeResponseBytes(target, res)
2599 if err != nil {
2600 return nil, err
2601 }
2602 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.create", "response", internallog.HTTPResponse(res, b))
2603 return ret, nil
2604 }
2605
2606 type ProjectsLocationsCatalogsDatabasesDeleteCall struct {
2607 s *Service
2608 name string
2609 urlParams_ gensupport.URLParams
2610 ctx_ context.Context
2611 header_ http.Header
2612 }
2613
2614 // Delete: Deletes an existing database specified by the database ID.
2615 //
2616 // - name: The name of the database to delete. Format:
2617 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2618 // d}/databases/{database_id}.
2619 func (r *ProjectsLocationsCatalogsDatabasesService) Delete(name string) *ProjectsLocationsCatalogsDatabasesDeleteCall {
2620 c := &ProjectsLocationsCatalogsDatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2621 c.name = name
2622 return c
2623 }
2624
2625 // Fields allows partial responses to be retrieved. See
2626 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2627 // details.
2628 func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesDeleteCall {
2629 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2630 return c
2631 }
2632
2633 // Context sets the context to be used in this call's Do method.
2634 func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesDeleteCall {
2635 c.ctx_ = ctx
2636 return c
2637 }
2638
2639 // Header returns a http.Header that can be modified by the caller to add
2640 // headers to the request.
2641 func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) Header() http.Header {
2642 if c.header_ == nil {
2643 c.header_ = make(http.Header)
2644 }
2645 return c.header_
2646 }
2647
2648 func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) doRequest(alt string) (*http.Response, error) {
2649 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2650 c.urlParams_.Set("alt", alt)
2651 c.urlParams_.Set("prettyPrint", "false")
2652 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2653 urls += "?" + c.urlParams_.Encode()
2654 req, err := http.NewRequest("DELETE", urls, nil)
2655 if err != nil {
2656 return nil, err
2657 }
2658 req.Header = reqHeaders
2659 googleapi.Expand(req.URL, map[string]string{
2660 "name": c.name,
2661 })
2662 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.delete", "request", internallog.HTTPRequest(req, nil))
2663 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2664 }
2665
2666 // Do executes the "biglake.projects.locations.catalogs.databases.delete" call.
2667 // Any non-2xx status code is an error. Response headers are in either
2668 // *Database.ServerResponse.Header or (if a response was returned at all) in
2669 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2670 // whether the returned error was because http.StatusNotModified was returned.
2671 func (c *ProjectsLocationsCatalogsDatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Database, error) {
2672 gensupport.SetOptions(c.urlParams_, opts...)
2673 res, err := c.doRequest("json")
2674 if res != nil && res.StatusCode == http.StatusNotModified {
2675 if res.Body != nil {
2676 res.Body.Close()
2677 }
2678 return nil, gensupport.WrapError(&googleapi.Error{
2679 Code: res.StatusCode,
2680 Header: res.Header,
2681 })
2682 }
2683 if err != nil {
2684 return nil, err
2685 }
2686 defer googleapi.CloseBody(res)
2687 if err := googleapi.CheckResponse(res); err != nil {
2688 return nil, gensupport.WrapError(err)
2689 }
2690 ret := &Database{
2691 ServerResponse: googleapi.ServerResponse{
2692 Header: res.Header,
2693 HTTPStatusCode: res.StatusCode,
2694 },
2695 }
2696 target := &ret
2697 b, err := gensupport.DecodeResponseBytes(target, res)
2698 if err != nil {
2699 return nil, err
2700 }
2701 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.delete", "response", internallog.HTTPResponse(res, b))
2702 return ret, nil
2703 }
2704
2705 type ProjectsLocationsCatalogsDatabasesGetCall struct {
2706 s *Service
2707 name string
2708 urlParams_ gensupport.URLParams
2709 ifNoneMatch_ string
2710 ctx_ context.Context
2711 header_ http.Header
2712 }
2713
2714 // Get: Gets the database specified by the resource name.
2715 //
2716 // - name: The name of the database to retrieve. Format:
2717 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2718 // d}/databases/{database_id}.
2719 func (r *ProjectsLocationsCatalogsDatabasesService) Get(name string) *ProjectsLocationsCatalogsDatabasesGetCall {
2720 c := &ProjectsLocationsCatalogsDatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2721 c.name = name
2722 return c
2723 }
2724
2725 // Fields allows partial responses to be retrieved. See
2726 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2727 // details.
2728 func (c *ProjectsLocationsCatalogsDatabasesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesGetCall {
2729 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2730 return c
2731 }
2732
2733 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2734 // object's ETag matches the given value. This is useful for getting updates
2735 // only after the object has changed since the last request.
2736 func (c *ProjectsLocationsCatalogsDatabasesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsDatabasesGetCall {
2737 c.ifNoneMatch_ = entityTag
2738 return c
2739 }
2740
2741 // Context sets the context to be used in this call's Do method.
2742 func (c *ProjectsLocationsCatalogsDatabasesGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesGetCall {
2743 c.ctx_ = ctx
2744 return c
2745 }
2746
2747 // Header returns a http.Header that can be modified by the caller to add
2748 // headers to the request.
2749 func (c *ProjectsLocationsCatalogsDatabasesGetCall) Header() http.Header {
2750 if c.header_ == nil {
2751 c.header_ = make(http.Header)
2752 }
2753 return c.header_
2754 }
2755
2756 func (c *ProjectsLocationsCatalogsDatabasesGetCall) doRequest(alt string) (*http.Response, error) {
2757 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2758 if c.ifNoneMatch_ != "" {
2759 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2760 }
2761 c.urlParams_.Set("alt", alt)
2762 c.urlParams_.Set("prettyPrint", "false")
2763 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2764 urls += "?" + c.urlParams_.Encode()
2765 req, err := http.NewRequest("GET", urls, nil)
2766 if err != nil {
2767 return nil, err
2768 }
2769 req.Header = reqHeaders
2770 googleapi.Expand(req.URL, map[string]string{
2771 "name": c.name,
2772 })
2773 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.get", "request", internallog.HTTPRequest(req, nil))
2774 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2775 }
2776
2777 // Do executes the "biglake.projects.locations.catalogs.databases.get" call.
2778 // Any non-2xx status code is an error. Response headers are in either
2779 // *Database.ServerResponse.Header or (if a response was returned at all) in
2780 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2781 // whether the returned error was because http.StatusNotModified was returned.
2782 func (c *ProjectsLocationsCatalogsDatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) {
2783 gensupport.SetOptions(c.urlParams_, opts...)
2784 res, err := c.doRequest("json")
2785 if res != nil && res.StatusCode == http.StatusNotModified {
2786 if res.Body != nil {
2787 res.Body.Close()
2788 }
2789 return nil, gensupport.WrapError(&googleapi.Error{
2790 Code: res.StatusCode,
2791 Header: res.Header,
2792 })
2793 }
2794 if err != nil {
2795 return nil, err
2796 }
2797 defer googleapi.CloseBody(res)
2798 if err := googleapi.CheckResponse(res); err != nil {
2799 return nil, gensupport.WrapError(err)
2800 }
2801 ret := &Database{
2802 ServerResponse: googleapi.ServerResponse{
2803 Header: res.Header,
2804 HTTPStatusCode: res.StatusCode,
2805 },
2806 }
2807 target := &ret
2808 b, err := gensupport.DecodeResponseBytes(target, res)
2809 if err != nil {
2810 return nil, err
2811 }
2812 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.get", "response", internallog.HTTPResponse(res, b))
2813 return ret, nil
2814 }
2815
2816 type ProjectsLocationsCatalogsDatabasesListCall struct {
2817 s *Service
2818 parent string
2819 urlParams_ gensupport.URLParams
2820 ifNoneMatch_ string
2821 ctx_ context.Context
2822 header_ http.Header
2823 }
2824
2825 // List: List all databases in a specified catalog.
2826 //
2827 // - parent: The parent, which owns this collection of databases. Format:
2828 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2829 // d}.
2830 func (r *ProjectsLocationsCatalogsDatabasesService) List(parent string) *ProjectsLocationsCatalogsDatabasesListCall {
2831 c := &ProjectsLocationsCatalogsDatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2832 c.parent = parent
2833 return c
2834 }
2835
2836 // PageSize sets the optional parameter "pageSize": The maximum number of
2837 // databases to return. The service may return fewer than this value. If
2838 // unspecified, at most 50 databases will be returned. The maximum value is
2839 // 1000; values above 1000 will be coerced to 1000.
2840 func (c *ProjectsLocationsCatalogsDatabasesListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsDatabasesListCall {
2841 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2842 return c
2843 }
2844
2845 // PageToken sets the optional parameter "pageToken": A page token, received
2846 // from a previous `ListDatabases` call. Provide this to retrieve the
2847 // subsequent page. When paginating, all other parameters provided to
2848 // `ListDatabases` must match the call that provided the page token.
2849 func (c *ProjectsLocationsCatalogsDatabasesListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsDatabasesListCall {
2850 c.urlParams_.Set("pageToken", pageToken)
2851 return c
2852 }
2853
2854 // Fields allows partial responses to be retrieved. See
2855 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2856 // details.
2857 func (c *ProjectsLocationsCatalogsDatabasesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesListCall {
2858 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2859 return c
2860 }
2861
2862 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2863 // object's ETag matches the given value. This is useful for getting updates
2864 // only after the object has changed since the last request.
2865 func (c *ProjectsLocationsCatalogsDatabasesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsDatabasesListCall {
2866 c.ifNoneMatch_ = entityTag
2867 return c
2868 }
2869
2870 // Context sets the context to be used in this call's Do method.
2871 func (c *ProjectsLocationsCatalogsDatabasesListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesListCall {
2872 c.ctx_ = ctx
2873 return c
2874 }
2875
2876 // Header returns a http.Header that can be modified by the caller to add
2877 // headers to the request.
2878 func (c *ProjectsLocationsCatalogsDatabasesListCall) Header() http.Header {
2879 if c.header_ == nil {
2880 c.header_ = make(http.Header)
2881 }
2882 return c.header_
2883 }
2884
2885 func (c *ProjectsLocationsCatalogsDatabasesListCall) doRequest(alt string) (*http.Response, error) {
2886 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2887 if c.ifNoneMatch_ != "" {
2888 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2889 }
2890 c.urlParams_.Set("alt", alt)
2891 c.urlParams_.Set("prettyPrint", "false")
2892 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/databases")
2893 urls += "?" + c.urlParams_.Encode()
2894 req, err := http.NewRequest("GET", urls, nil)
2895 if err != nil {
2896 return nil, err
2897 }
2898 req.Header = reqHeaders
2899 googleapi.Expand(req.URL, map[string]string{
2900 "parent": c.parent,
2901 })
2902 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.list", "request", internallog.HTTPRequest(req, nil))
2903 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2904 }
2905
2906 // Do executes the "biglake.projects.locations.catalogs.databases.list" call.
2907 // Any non-2xx status code is an error. Response headers are in either
2908 // *ListDatabasesResponse.ServerResponse.Header or (if a response was returned
2909 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2910 // check whether the returned error was because http.StatusNotModified was
2911 // returned.
2912 func (c *ProjectsLocationsCatalogsDatabasesListCall) Do(opts ...googleapi.CallOption) (*ListDatabasesResponse, error) {
2913 gensupport.SetOptions(c.urlParams_, opts...)
2914 res, err := c.doRequest("json")
2915 if res != nil && res.StatusCode == http.StatusNotModified {
2916 if res.Body != nil {
2917 res.Body.Close()
2918 }
2919 return nil, gensupport.WrapError(&googleapi.Error{
2920 Code: res.StatusCode,
2921 Header: res.Header,
2922 })
2923 }
2924 if err != nil {
2925 return nil, err
2926 }
2927 defer googleapi.CloseBody(res)
2928 if err := googleapi.CheckResponse(res); err != nil {
2929 return nil, gensupport.WrapError(err)
2930 }
2931 ret := &ListDatabasesResponse{
2932 ServerResponse: googleapi.ServerResponse{
2933 Header: res.Header,
2934 HTTPStatusCode: res.StatusCode,
2935 },
2936 }
2937 target := &ret
2938 b, err := gensupport.DecodeResponseBytes(target, res)
2939 if err != nil {
2940 return nil, err
2941 }
2942 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.list", "response", internallog.HTTPResponse(res, b))
2943 return ret, nil
2944 }
2945
2946 // Pages invokes f for each page of results.
2947 // A non-nil error returned from f will halt the iteration.
2948 // The provided context supersedes any context provided to the Context method.
2949 func (c *ProjectsLocationsCatalogsDatabasesListCall) Pages(ctx context.Context, f func(*ListDatabasesResponse) error) error {
2950 c.ctx_ = ctx
2951 defer c.PageToken(c.urlParams_.Get("pageToken"))
2952 for {
2953 x, err := c.Do()
2954 if err != nil {
2955 return err
2956 }
2957 if err := f(x); err != nil {
2958 return err
2959 }
2960 if x.NextPageToken == "" {
2961 return nil
2962 }
2963 c.PageToken(x.NextPageToken)
2964 }
2965 }
2966
2967 type ProjectsLocationsCatalogsDatabasesPatchCall struct {
2968 s *Service
2969 name string
2970 database *Database
2971 urlParams_ gensupport.URLParams
2972 ctx_ context.Context
2973 header_ http.Header
2974 }
2975
2976 // Patch: Updates an existing database specified by the database ID.
2977 //
2978 // - name: Output only. The resource name. Format:
2979 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
2980 // d}/databases/{database_id}.
2981 func (r *ProjectsLocationsCatalogsDatabasesService) Patch(name string, database *Database) *ProjectsLocationsCatalogsDatabasesPatchCall {
2982 c := &ProjectsLocationsCatalogsDatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2983 c.name = name
2984 c.database = database
2985 return c
2986 }
2987
2988 // UpdateMask sets the optional parameter "updateMask": The list of fields to
2989 // update. For the `FieldMask` definition, see
2990 // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
2991 // If not set, defaults to all of the fields that are allowed to update.
2992 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsDatabasesPatchCall {
2993 c.urlParams_.Set("updateMask", updateMask)
2994 return c
2995 }
2996
2997 // Fields allows partial responses to be retrieved. See
2998 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2999 // details.
3000 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesPatchCall {
3001 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3002 return c
3003 }
3004
3005 // Context sets the context to be used in this call's Do method.
3006 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesPatchCall {
3007 c.ctx_ = ctx
3008 return c
3009 }
3010
3011 // Header returns a http.Header that can be modified by the caller to add
3012 // headers to the request.
3013 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) Header() http.Header {
3014 if c.header_ == nil {
3015 c.header_ = make(http.Header)
3016 }
3017 return c.header_
3018 }
3019
3020 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) doRequest(alt string) (*http.Response, error) {
3021 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3022 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.database)
3023 if err != nil {
3024 return nil, err
3025 }
3026 c.urlParams_.Set("alt", alt)
3027 c.urlParams_.Set("prettyPrint", "false")
3028 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3029 urls += "?" + c.urlParams_.Encode()
3030 req, err := http.NewRequest("PATCH", urls, body)
3031 if err != nil {
3032 return nil, err
3033 }
3034 req.Header = reqHeaders
3035 googleapi.Expand(req.URL, map[string]string{
3036 "name": c.name,
3037 })
3038 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3039 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3040 }
3041
3042 // Do executes the "biglake.projects.locations.catalogs.databases.patch" call.
3043 // Any non-2xx status code is an error. Response headers are in either
3044 // *Database.ServerResponse.Header or (if a response was returned at all) in
3045 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3046 // whether the returned error was because http.StatusNotModified was returned.
3047 func (c *ProjectsLocationsCatalogsDatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Database, error) {
3048 gensupport.SetOptions(c.urlParams_, opts...)
3049 res, err := c.doRequest("json")
3050 if res != nil && res.StatusCode == http.StatusNotModified {
3051 if res.Body != nil {
3052 res.Body.Close()
3053 }
3054 return nil, gensupport.WrapError(&googleapi.Error{
3055 Code: res.StatusCode,
3056 Header: res.Header,
3057 })
3058 }
3059 if err != nil {
3060 return nil, err
3061 }
3062 defer googleapi.CloseBody(res)
3063 if err := googleapi.CheckResponse(res); err != nil {
3064 return nil, gensupport.WrapError(err)
3065 }
3066 ret := &Database{
3067 ServerResponse: googleapi.ServerResponse{
3068 Header: res.Header,
3069 HTTPStatusCode: res.StatusCode,
3070 },
3071 }
3072 target := &ret
3073 b, err := gensupport.DecodeResponseBytes(target, res)
3074 if err != nil {
3075 return nil, err
3076 }
3077 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.patch", "response", internallog.HTTPResponse(res, b))
3078 return ret, nil
3079 }
3080
3081 type ProjectsLocationsCatalogsDatabasesTablesCreateCall struct {
3082 s *Service
3083 parent string
3084 table *Table
3085 urlParams_ gensupport.URLParams
3086 ctx_ context.Context
3087 header_ http.Header
3088 }
3089
3090 // Create: Creates a new table.
3091 //
3092 // - parent: The parent resource where this table will be created. Format:
3093 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3094 // d}/databases/{database_id}.
3095 func (r *ProjectsLocationsCatalogsDatabasesTablesService) Create(parent string, table *Table) *ProjectsLocationsCatalogsDatabasesTablesCreateCall {
3096 c := &ProjectsLocationsCatalogsDatabasesTablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3097 c.parent = parent
3098 c.table = table
3099 return c
3100 }
3101
3102 // TableId sets the optional parameter "tableId": Required. The ID to use for
3103 // the table, which will become the final component of the table's resource
3104 // name.
3105 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) TableId(tableId string) *ProjectsLocationsCatalogsDatabasesTablesCreateCall {
3106 c.urlParams_.Set("tableId", tableId)
3107 return c
3108 }
3109
3110 // Fields allows partial responses to be retrieved. See
3111 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3112 // details.
3113 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesCreateCall {
3114 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3115 return c
3116 }
3117
3118 // Context sets the context to be used in this call's Do method.
3119 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesCreateCall {
3120 c.ctx_ = ctx
3121 return c
3122 }
3123
3124 // Header returns a http.Header that can be modified by the caller to add
3125 // headers to the request.
3126 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) Header() http.Header {
3127 if c.header_ == nil {
3128 c.header_ = make(http.Header)
3129 }
3130 return c.header_
3131 }
3132
3133 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) doRequest(alt string) (*http.Response, error) {
3134 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3135 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table)
3136 if err != nil {
3137 return nil, err
3138 }
3139 c.urlParams_.Set("alt", alt)
3140 c.urlParams_.Set("prettyPrint", "false")
3141 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tables")
3142 urls += "?" + c.urlParams_.Encode()
3143 req, err := http.NewRequest("POST", urls, body)
3144 if err != nil {
3145 return nil, err
3146 }
3147 req.Header = reqHeaders
3148 googleapi.Expand(req.URL, map[string]string{
3149 "parent": c.parent,
3150 })
3151 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3152 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3153 }
3154
3155 // Do executes the "biglake.projects.locations.catalogs.databases.tables.create" call.
3156 // Any non-2xx status code is an error. Response headers are in either
3157 // *Table.ServerResponse.Header or (if a response was returned at all) in
3158 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3159 // whether the returned error was because http.StatusNotModified was returned.
3160 func (c *ProjectsLocationsCatalogsDatabasesTablesCreateCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3161 gensupport.SetOptions(c.urlParams_, opts...)
3162 res, err := c.doRequest("json")
3163 if res != nil && res.StatusCode == http.StatusNotModified {
3164 if res.Body != nil {
3165 res.Body.Close()
3166 }
3167 return nil, gensupport.WrapError(&googleapi.Error{
3168 Code: res.StatusCode,
3169 Header: res.Header,
3170 })
3171 }
3172 if err != nil {
3173 return nil, err
3174 }
3175 defer googleapi.CloseBody(res)
3176 if err := googleapi.CheckResponse(res); err != nil {
3177 return nil, gensupport.WrapError(err)
3178 }
3179 ret := &Table{
3180 ServerResponse: googleapi.ServerResponse{
3181 Header: res.Header,
3182 HTTPStatusCode: res.StatusCode,
3183 },
3184 }
3185 target := &ret
3186 b, err := gensupport.DecodeResponseBytes(target, res)
3187 if err != nil {
3188 return nil, err
3189 }
3190 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.create", "response", internallog.HTTPResponse(res, b))
3191 return ret, nil
3192 }
3193
3194 type ProjectsLocationsCatalogsDatabasesTablesDeleteCall struct {
3195 s *Service
3196 name string
3197 urlParams_ gensupport.URLParams
3198 ctx_ context.Context
3199 header_ http.Header
3200 }
3201
3202 // Delete: Deletes an existing table specified by the table ID.
3203 //
3204 // - name: The name of the table to delete. Format:
3205 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3206 // d}/databases/{database_id}/tables/{table_id}.
3207 func (r *ProjectsLocationsCatalogsDatabasesTablesService) Delete(name string) *ProjectsLocationsCatalogsDatabasesTablesDeleteCall {
3208 c := &ProjectsLocationsCatalogsDatabasesTablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3209 c.name = name
3210 return c
3211 }
3212
3213 // Fields allows partial responses to be retrieved. See
3214 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3215 // details.
3216 func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesDeleteCall {
3217 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3218 return c
3219 }
3220
3221 // Context sets the context to be used in this call's Do method.
3222 func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesDeleteCall {
3223 c.ctx_ = ctx
3224 return c
3225 }
3226
3227 // Header returns a http.Header that can be modified by the caller to add
3228 // headers to the request.
3229 func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) Header() http.Header {
3230 if c.header_ == nil {
3231 c.header_ = make(http.Header)
3232 }
3233 return c.header_
3234 }
3235
3236 func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) doRequest(alt string) (*http.Response, error) {
3237 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3238 c.urlParams_.Set("alt", alt)
3239 c.urlParams_.Set("prettyPrint", "false")
3240 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3241 urls += "?" + c.urlParams_.Encode()
3242 req, err := http.NewRequest("DELETE", urls, nil)
3243 if err != nil {
3244 return nil, err
3245 }
3246 req.Header = reqHeaders
3247 googleapi.Expand(req.URL, map[string]string{
3248 "name": c.name,
3249 })
3250 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.delete", "request", internallog.HTTPRequest(req, nil))
3251 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3252 }
3253
3254 // Do executes the "biglake.projects.locations.catalogs.databases.tables.delete" call.
3255 // Any non-2xx status code is an error. Response headers are in either
3256 // *Table.ServerResponse.Header or (if a response was returned at all) in
3257 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3258 // whether the returned error was because http.StatusNotModified was returned.
3259 func (c *ProjectsLocationsCatalogsDatabasesTablesDeleteCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3260 gensupport.SetOptions(c.urlParams_, opts...)
3261 res, err := c.doRequest("json")
3262 if res != nil && res.StatusCode == http.StatusNotModified {
3263 if res.Body != nil {
3264 res.Body.Close()
3265 }
3266 return nil, gensupport.WrapError(&googleapi.Error{
3267 Code: res.StatusCode,
3268 Header: res.Header,
3269 })
3270 }
3271 if err != nil {
3272 return nil, err
3273 }
3274 defer googleapi.CloseBody(res)
3275 if err := googleapi.CheckResponse(res); err != nil {
3276 return nil, gensupport.WrapError(err)
3277 }
3278 ret := &Table{
3279 ServerResponse: googleapi.ServerResponse{
3280 Header: res.Header,
3281 HTTPStatusCode: res.StatusCode,
3282 },
3283 }
3284 target := &ret
3285 b, err := gensupport.DecodeResponseBytes(target, res)
3286 if err != nil {
3287 return nil, err
3288 }
3289 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.delete", "response", internallog.HTTPResponse(res, b))
3290 return ret, nil
3291 }
3292
3293 type ProjectsLocationsCatalogsDatabasesTablesGetCall struct {
3294 s *Service
3295 name string
3296 urlParams_ gensupport.URLParams
3297 ifNoneMatch_ string
3298 ctx_ context.Context
3299 header_ http.Header
3300 }
3301
3302 // Get: Gets the table specified by the resource name.
3303 //
3304 // - name: The name of the table to retrieve. Format:
3305 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3306 // d}/databases/{database_id}/tables/{table_id}.
3307 func (r *ProjectsLocationsCatalogsDatabasesTablesService) Get(name string) *ProjectsLocationsCatalogsDatabasesTablesGetCall {
3308 c := &ProjectsLocationsCatalogsDatabasesTablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3309 c.name = name
3310 return c
3311 }
3312
3313 // Fields allows partial responses to be retrieved. See
3314 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3315 // details.
3316 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesGetCall {
3317 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3318 return c
3319 }
3320
3321 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3322 // object's ETag matches the given value. This is useful for getting updates
3323 // only after the object has changed since the last request.
3324 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsDatabasesTablesGetCall {
3325 c.ifNoneMatch_ = entityTag
3326 return c
3327 }
3328
3329 // Context sets the context to be used in this call's Do method.
3330 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesGetCall {
3331 c.ctx_ = ctx
3332 return c
3333 }
3334
3335 // Header returns a http.Header that can be modified by the caller to add
3336 // headers to the request.
3337 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) Header() http.Header {
3338 if c.header_ == nil {
3339 c.header_ = make(http.Header)
3340 }
3341 return c.header_
3342 }
3343
3344 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) doRequest(alt string) (*http.Response, error) {
3345 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3346 if c.ifNoneMatch_ != "" {
3347 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3348 }
3349 c.urlParams_.Set("alt", alt)
3350 c.urlParams_.Set("prettyPrint", "false")
3351 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3352 urls += "?" + c.urlParams_.Encode()
3353 req, err := http.NewRequest("GET", urls, nil)
3354 if err != nil {
3355 return nil, err
3356 }
3357 req.Header = reqHeaders
3358 googleapi.Expand(req.URL, map[string]string{
3359 "name": c.name,
3360 })
3361 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.get", "request", internallog.HTTPRequest(req, nil))
3362 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3363 }
3364
3365 // Do executes the "biglake.projects.locations.catalogs.databases.tables.get" call.
3366 // Any non-2xx status code is an error. Response headers are in either
3367 // *Table.ServerResponse.Header or (if a response was returned at all) in
3368 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3369 // whether the returned error was because http.StatusNotModified was returned.
3370 func (c *ProjectsLocationsCatalogsDatabasesTablesGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3371 gensupport.SetOptions(c.urlParams_, opts...)
3372 res, err := c.doRequest("json")
3373 if res != nil && res.StatusCode == http.StatusNotModified {
3374 if res.Body != nil {
3375 res.Body.Close()
3376 }
3377 return nil, gensupport.WrapError(&googleapi.Error{
3378 Code: res.StatusCode,
3379 Header: res.Header,
3380 })
3381 }
3382 if err != nil {
3383 return nil, err
3384 }
3385 defer googleapi.CloseBody(res)
3386 if err := googleapi.CheckResponse(res); err != nil {
3387 return nil, gensupport.WrapError(err)
3388 }
3389 ret := &Table{
3390 ServerResponse: googleapi.ServerResponse{
3391 Header: res.Header,
3392 HTTPStatusCode: res.StatusCode,
3393 },
3394 }
3395 target := &ret
3396 b, err := gensupport.DecodeResponseBytes(target, res)
3397 if err != nil {
3398 return nil, err
3399 }
3400 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.get", "response", internallog.HTTPResponse(res, b))
3401 return ret, nil
3402 }
3403
3404 type ProjectsLocationsCatalogsDatabasesTablesListCall struct {
3405 s *Service
3406 parent string
3407 urlParams_ gensupport.URLParams
3408 ifNoneMatch_ string
3409 ctx_ context.Context
3410 header_ http.Header
3411 }
3412
3413 // List: List all tables in a specified database.
3414 //
3415 // - parent: The parent, which owns this collection of tables. Format:
3416 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3417 // d}/databases/{database_id}.
3418 func (r *ProjectsLocationsCatalogsDatabasesTablesService) List(parent string) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3419 c := &ProjectsLocationsCatalogsDatabasesTablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3420 c.parent = parent
3421 return c
3422 }
3423
3424 // PageSize sets the optional parameter "pageSize": The maximum number of
3425 // tables to return. The service may return fewer than this value. If
3426 // unspecified, at most 50 tables will be returned. The maximum value is 1000;
3427 // values above 1000 will be coerced to 1000.
3428 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3429 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3430 return c
3431 }
3432
3433 // PageToken sets the optional parameter "pageToken": A page token, received
3434 // from a previous `ListTables` call. Provide this to retrieve the subsequent
3435 // page. When paginating, all other parameters provided to `ListTables` must
3436 // match the call that provided the page token.
3437 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3438 c.urlParams_.Set("pageToken", pageToken)
3439 return c
3440 }
3441
3442 // View sets the optional parameter "view": The view for the returned tables.
3443 //
3444 // Possible values:
3445 //
3446 // "TABLE_VIEW_UNSPECIFIED" - Default value. The API will default to the
3447 //
3448 // BASIC view.
3449 //
3450 // "BASIC" - Include only table names. This is the default value.
3451 // "FULL" - Include everything.
3452 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) View(view string) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3453 c.urlParams_.Set("view", view)
3454 return c
3455 }
3456
3457 // Fields allows partial responses to be retrieved. See
3458 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3459 // details.
3460 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3461 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3462 return c
3463 }
3464
3465 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3466 // object's ETag matches the given value. This is useful for getting updates
3467 // only after the object has changed since the last request.
3468 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3469 c.ifNoneMatch_ = entityTag
3470 return c
3471 }
3472
3473 // Context sets the context to be used in this call's Do method.
3474 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesListCall {
3475 c.ctx_ = ctx
3476 return c
3477 }
3478
3479 // Header returns a http.Header that can be modified by the caller to add
3480 // headers to the request.
3481 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) Header() http.Header {
3482 if c.header_ == nil {
3483 c.header_ = make(http.Header)
3484 }
3485 return c.header_
3486 }
3487
3488 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) doRequest(alt string) (*http.Response, error) {
3489 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3490 if c.ifNoneMatch_ != "" {
3491 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3492 }
3493 c.urlParams_.Set("alt", alt)
3494 c.urlParams_.Set("prettyPrint", "false")
3495 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tables")
3496 urls += "?" + c.urlParams_.Encode()
3497 req, err := http.NewRequest("GET", urls, nil)
3498 if err != nil {
3499 return nil, err
3500 }
3501 req.Header = reqHeaders
3502 googleapi.Expand(req.URL, map[string]string{
3503 "parent": c.parent,
3504 })
3505 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.list", "request", internallog.HTTPRequest(req, nil))
3506 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3507 }
3508
3509 // Do executes the "biglake.projects.locations.catalogs.databases.tables.list" call.
3510 // Any non-2xx status code is an error. Response headers are in either
3511 // *ListTablesResponse.ServerResponse.Header or (if a response was returned at
3512 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3513 // check whether the returned error was because http.StatusNotModified was
3514 // returned.
3515 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) Do(opts ...googleapi.CallOption) (*ListTablesResponse, error) {
3516 gensupport.SetOptions(c.urlParams_, opts...)
3517 res, err := c.doRequest("json")
3518 if res != nil && res.StatusCode == http.StatusNotModified {
3519 if res.Body != nil {
3520 res.Body.Close()
3521 }
3522 return nil, gensupport.WrapError(&googleapi.Error{
3523 Code: res.StatusCode,
3524 Header: res.Header,
3525 })
3526 }
3527 if err != nil {
3528 return nil, err
3529 }
3530 defer googleapi.CloseBody(res)
3531 if err := googleapi.CheckResponse(res); err != nil {
3532 return nil, gensupport.WrapError(err)
3533 }
3534 ret := &ListTablesResponse{
3535 ServerResponse: googleapi.ServerResponse{
3536 Header: res.Header,
3537 HTTPStatusCode: res.StatusCode,
3538 },
3539 }
3540 target := &ret
3541 b, err := gensupport.DecodeResponseBytes(target, res)
3542 if err != nil {
3543 return nil, err
3544 }
3545 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.list", "response", internallog.HTTPResponse(res, b))
3546 return ret, nil
3547 }
3548
3549 // Pages invokes f for each page of results.
3550 // A non-nil error returned from f will halt the iteration.
3551 // The provided context supersedes any context provided to the Context method.
3552 func (c *ProjectsLocationsCatalogsDatabasesTablesListCall) Pages(ctx context.Context, f func(*ListTablesResponse) error) error {
3553 c.ctx_ = ctx
3554 defer c.PageToken(c.urlParams_.Get("pageToken"))
3555 for {
3556 x, err := c.Do()
3557 if err != nil {
3558 return err
3559 }
3560 if err := f(x); err != nil {
3561 return err
3562 }
3563 if x.NextPageToken == "" {
3564 return nil
3565 }
3566 c.PageToken(x.NextPageToken)
3567 }
3568 }
3569
3570 type ProjectsLocationsCatalogsDatabasesTablesPatchCall struct {
3571 s *Service
3572 name string
3573 table *Table
3574 urlParams_ gensupport.URLParams
3575 ctx_ context.Context
3576 header_ http.Header
3577 }
3578
3579 // Patch: Updates an existing table specified by the table ID.
3580 //
3581 // - name: Output only. The resource name. Format:
3582 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3583 // d}/databases/{database_id}/tables/{table_id}.
3584 func (r *ProjectsLocationsCatalogsDatabasesTablesService) Patch(name string, table *Table) *ProjectsLocationsCatalogsDatabasesTablesPatchCall {
3585 c := &ProjectsLocationsCatalogsDatabasesTablesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3586 c.name = name
3587 c.table = table
3588 return c
3589 }
3590
3591 // UpdateMask sets the optional parameter "updateMask": The list of fields to
3592 // update. For the `FieldMask` definition, see
3593 // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
3594 // If not set, defaults to all of the fields that are allowed to update.
3595 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsDatabasesTablesPatchCall {
3596 c.urlParams_.Set("updateMask", updateMask)
3597 return c
3598 }
3599
3600 // Fields allows partial responses to be retrieved. See
3601 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3602 // details.
3603 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesPatchCall {
3604 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3605 return c
3606 }
3607
3608 // Context sets the context to be used in this call's Do method.
3609 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesPatchCall {
3610 c.ctx_ = ctx
3611 return c
3612 }
3613
3614 // Header returns a http.Header that can be modified by the caller to add
3615 // headers to the request.
3616 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) Header() http.Header {
3617 if c.header_ == nil {
3618 c.header_ = make(http.Header)
3619 }
3620 return c.header_
3621 }
3622
3623 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) doRequest(alt string) (*http.Response, error) {
3624 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3625 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.table)
3626 if err != nil {
3627 return nil, err
3628 }
3629 c.urlParams_.Set("alt", alt)
3630 c.urlParams_.Set("prettyPrint", "false")
3631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3632 urls += "?" + c.urlParams_.Encode()
3633 req, err := http.NewRequest("PATCH", urls, body)
3634 if err != nil {
3635 return nil, err
3636 }
3637 req.Header = reqHeaders
3638 googleapi.Expand(req.URL, map[string]string{
3639 "name": c.name,
3640 })
3641 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3642 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3643 }
3644
3645 // Do executes the "biglake.projects.locations.catalogs.databases.tables.patch" call.
3646 // Any non-2xx status code is an error. Response headers are in either
3647 // *Table.ServerResponse.Header or (if a response was returned at all) in
3648 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3649 // whether the returned error was because http.StatusNotModified was returned.
3650 func (c *ProjectsLocationsCatalogsDatabasesTablesPatchCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3651 gensupport.SetOptions(c.urlParams_, opts...)
3652 res, err := c.doRequest("json")
3653 if res != nil && res.StatusCode == http.StatusNotModified {
3654 if res.Body != nil {
3655 res.Body.Close()
3656 }
3657 return nil, gensupport.WrapError(&googleapi.Error{
3658 Code: res.StatusCode,
3659 Header: res.Header,
3660 })
3661 }
3662 if err != nil {
3663 return nil, err
3664 }
3665 defer googleapi.CloseBody(res)
3666 if err := googleapi.CheckResponse(res); err != nil {
3667 return nil, gensupport.WrapError(err)
3668 }
3669 ret := &Table{
3670 ServerResponse: googleapi.ServerResponse{
3671 Header: res.Header,
3672 HTTPStatusCode: res.StatusCode,
3673 },
3674 }
3675 target := &ret
3676 b, err := gensupport.DecodeResponseBytes(target, res)
3677 if err != nil {
3678 return nil, err
3679 }
3680 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.patch", "response", internallog.HTTPResponse(res, b))
3681 return ret, nil
3682 }
3683
3684 type ProjectsLocationsCatalogsDatabasesTablesRenameCall struct {
3685 s *Service
3686 name string
3687 renametablerequest *RenameTableRequest
3688 urlParams_ gensupport.URLParams
3689 ctx_ context.Context
3690 header_ http.Header
3691 }
3692
3693 // Rename: Renames an existing table specified by the table ID.
3694 //
3695 // - name: The table's `name` field is used to identify the table to rename.
3696 // Format:
3697 // projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_i
3698 // d}/databases/{database_id}/tables/{table_id}.
3699 func (r *ProjectsLocationsCatalogsDatabasesTablesService) Rename(name string, renametablerequest *RenameTableRequest) *ProjectsLocationsCatalogsDatabasesTablesRenameCall {
3700 c := &ProjectsLocationsCatalogsDatabasesTablesRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3701 c.name = name
3702 c.renametablerequest = renametablerequest
3703 return c
3704 }
3705
3706 // Fields allows partial responses to be retrieved. See
3707 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3708 // details.
3709 func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsDatabasesTablesRenameCall {
3710 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3711 return c
3712 }
3713
3714 // Context sets the context to be used in this call's Do method.
3715 func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) Context(ctx context.Context) *ProjectsLocationsCatalogsDatabasesTablesRenameCall {
3716 c.ctx_ = ctx
3717 return c
3718 }
3719
3720 // Header returns a http.Header that can be modified by the caller to add
3721 // headers to the request.
3722 func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) Header() http.Header {
3723 if c.header_ == nil {
3724 c.header_ = make(http.Header)
3725 }
3726 return c.header_
3727 }
3728
3729 func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) doRequest(alt string) (*http.Response, error) {
3730 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3731 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renametablerequest)
3732 if err != nil {
3733 return nil, err
3734 }
3735 c.urlParams_.Set("alt", alt)
3736 c.urlParams_.Set("prettyPrint", "false")
3737 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rename")
3738 urls += "?" + c.urlParams_.Encode()
3739 req, err := http.NewRequest("POST", urls, body)
3740 if err != nil {
3741 return nil, err
3742 }
3743 req.Header = reqHeaders
3744 googleapi.Expand(req.URL, map[string]string{
3745 "name": c.name,
3746 })
3747 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.rename", "request", internallog.HTTPRequest(req, body.Bytes()))
3748 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3749 }
3750
3751 // Do executes the "biglake.projects.locations.catalogs.databases.tables.rename" call.
3752 // Any non-2xx status code is an error. Response headers are in either
3753 // *Table.ServerResponse.Header or (if a response was returned at all) in
3754 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3755 // whether the returned error was because http.StatusNotModified was returned.
3756 func (c *ProjectsLocationsCatalogsDatabasesTablesRenameCall) Do(opts ...googleapi.CallOption) (*Table, error) {
3757 gensupport.SetOptions(c.urlParams_, opts...)
3758 res, err := c.doRequest("json")
3759 if res != nil && res.StatusCode == http.StatusNotModified {
3760 if res.Body != nil {
3761 res.Body.Close()
3762 }
3763 return nil, gensupport.WrapError(&googleapi.Error{
3764 Code: res.StatusCode,
3765 Header: res.Header,
3766 })
3767 }
3768 if err != nil {
3769 return nil, err
3770 }
3771 defer googleapi.CloseBody(res)
3772 if err := googleapi.CheckResponse(res); err != nil {
3773 return nil, gensupport.WrapError(err)
3774 }
3775 ret := &Table{
3776 ServerResponse: googleapi.ServerResponse{
3777 Header: res.Header,
3778 HTTPStatusCode: res.StatusCode,
3779 },
3780 }
3781 target := &ret
3782 b, err := gensupport.DecodeResponseBytes(target, res)
3783 if err != nil {
3784 return nil, err
3785 }
3786 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "biglake.projects.locations.catalogs.databases.tables.rename", "response", internallog.HTTPResponse(res, b))
3787 return ret, nil
3788 }