Debian Codegraph @

looker/v1/looker-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 looker provides access to the Looker (Google Cloud core) API.
8 //
9 // For product documentation, see: https://cloud.google.com/looker/docs/reference/rest/
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/looker/v1"
27 // ...
28 // ctx := context.Background()
29 // lookerService, err := looker.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 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // lookerService, err := looker.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // lookerService, err := looker.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package looker // import "google.golang.org/api/looker/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "looker:v1"
93 const apiName = "looker"
94 const apiVersion = "v1"
95 const basePath = "https://looker.googleapis.com/"
96 const basePathTemplate = "https://looker.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://looker.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, edit, configure, and delete your Google Cloud data and see the email
102 // address for your Google Account.
103 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
104 )
105
106 // NewService creates a new Service.
107 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108 scopesOption := internaloption.WithDefaultScopes(
109 "https://www.googleapis.com/auth/cloud-platform",
110 )
111 // NOTE: prepend, so we don't override user-specified scopes.
112 opts = append([]option.ClientOption{scopesOption}, opts...)
113 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
114 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
115 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
116 opts = append(opts, internaloption.EnableNewAuthLibrary())
117 client, endpoint, err := htransport.NewClient(ctx, opts...)
118 if err != nil {
119 return nil, err
120 }
121 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
122 s.Projects = NewProjectsService(s)
123 if endpoint != "" {
124 s.BasePath = endpoint
125 }
126 return s, nil
127 }
128
129 // New creates a new Service. It uses the provided http.Client for requests.
130 //
131 // Deprecated: please use NewService instead.
132 // To provide a custom HTTP client, use option.WithHTTPClient.
133 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
134 func New(client *http.Client) (*Service, error) {
135 if client == nil {
136 return nil, errors.New("client is nil")
137 }
138 return NewService(context.TODO(), option.WithHTTPClient(client))
139 }
140
141 type Service struct {
142 client *http.Client
143 logger *slog.Logger
144 BasePath string // API endpoint base URL
145 UserAgent string // optional additional User-Agent fragment
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Instances = NewProjectsLocationsInstancesService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 Instances *ProjectsLocationsInstancesService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
185 rs := &ProjectsLocationsInstancesService{s: s}
186 rs.Backups = NewProjectsLocationsInstancesBackupsService(s)
187 return rs
188 }
189
190 type ProjectsLocationsInstancesService struct {
191 s *Service
192
193 Backups *ProjectsLocationsInstancesBackupsService
194 }
195
196 func NewProjectsLocationsInstancesBackupsService(s *Service) *ProjectsLocationsInstancesBackupsService {
197 rs := &ProjectsLocationsInstancesBackupsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsInstancesBackupsService struct {
202 s *Service
203 }
204
205 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
206 rs := &ProjectsLocationsOperationsService{s: s}
207 return rs
208 }
209
210 type ProjectsLocationsOperationsService struct {
211 s *Service
212 }
213
214 // AdminSettings: Looker instance Admin settings fields.
215 type AdminSettings struct {
216 // AllowedEmailDomains: Email domain allowlist for the instance.
217 AllowedEmailDomains []string `json:"allowedEmailDomains,omitempty"`
218 // ForceSendFields is a list of field names (e.g. "AllowedEmailDomains") to
219 // unconditionally include in API requests. By default, fields with empty or
220 // default values are omitted from API requests. See
221 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
222 // details.
223 ForceSendFields []string `json:"-"`
224 // NullFields is a list of field names (e.g. "AllowedEmailDomains") to include
225 // in API requests with the JSON null value. By default, fields with empty
226 // values are omitted from API requests. See
227 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
228 NullFields []string `json:"-"`
229 }
230
231 func (s AdminSettings) MarshalJSON() ([]byte, error) {
232 type NoMethod AdminSettings
233 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
234 }
235
236 // CancelOperationRequest: The request message for Operations.CancelOperation.
237 type CancelOperationRequest struct {
238 }
239
240 // ControlledEgressConfig: Controlled egress configuration.
241 type ControlledEgressConfig struct {
242 // EgressFqdns: Optional. List of fully qualified domain names to be added to
243 // the allowlist for outbound traffic.
244 EgressFqdns []string `json:"egressFqdns,omitempty"`
245 // MarketplaceEnabled: Optional. Whether marketplace is enabled.
246 MarketplaceEnabled bool `json:"marketplaceEnabled,omitempty"`
247 // WebProxyIps: Output only. The list of IP addresses used by Secure Web Proxy
248 // for outbound traffic.
249 WebProxyIps []string `json:"webProxyIps,omitempty"`
250 // ForceSendFields is a list of field names (e.g. "EgressFqdns") to
251 // unconditionally include in API requests. By default, fields with empty or
252 // default values are omitted from API requests. See
253 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
254 // details.
255 ForceSendFields []string `json:"-"`
256 // NullFields is a list of field names (e.g. "EgressFqdns") to include in API
257 // requests with the JSON null value. By default, fields with empty values are
258 // omitted from API requests. See
259 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
260 NullFields []string `json:"-"`
261 }
262
263 func (s ControlledEgressConfig) MarshalJSON() ([]byte, error) {
264 type NoMethod ControlledEgressConfig
265 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
266 }
267
268 // CustomDomain: Custom domain information.
269 type CustomDomain struct {
270 // Domain: Domain name.
271 Domain string `json:"domain,omitempty"`
272 // State: Domain state.
273 //
274 // Possible values:
275 // "CUSTOM_DOMAIN_STATE_UNSPECIFIED" - Unspecified state.
276 // "UNVERIFIED" - DNS record is not created.
277 // "VERIFIED" - DNS record is created.
278 // "MODIFYING" - Calling SLM to update.
279 // "AVAILABLE" - ManagedCertificate is ready.
280 // "UNAVAILABLE" - ManagedCertificate is not ready.
281 // "UNKNOWN" - Status is not known.
282 State string `json:"state,omitempty"`
283 // ForceSendFields is a list of field names (e.g. "Domain") to unconditionally
284 // include in API requests. By default, fields with empty or default values are
285 // 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. "Domain") to include in API
290 // requests with the JSON null value. By default, fields with empty values are
291 // 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 CustomDomain) MarshalJSON() ([]byte, error) {
297 type NoMethod CustomDomain
298 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
299 }
300
301 // Date: Represents a whole or partial calendar date, such as a birthday. The
302 // time of day and time zone are either specified elsewhere or are
303 // insignificant. The date is relative to the Gregorian Calendar. This can
304 // represent one of the following: * A full date, with non-zero year, month,
305 // and day values. * A month and day, with a zero year (for example, an
306 // anniversary). * A year on its own, with a zero month and a zero day. * A
307 // year and month, with a zero day (for example, a credit card expiration
308 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
309 // google.protobuf.Timestamp
310 type Date struct {
311 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
312 // or 0 to specify a year by itself or a year and month where the day isn't
313 // significant.
314 Day int64 `json:"day,omitempty"`
315 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
316 // a month and day.
317 Month int64 `json:"month,omitempty"`
318 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
319 // without a year.
320 Year int64 `json:"year,omitempty"`
321 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
322 // include in API requests. By default, fields with empty or default values are
323 // omitted from API requests. See
324 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
325 // details.
326 ForceSendFields []string `json:"-"`
327 // NullFields is a list of field names (e.g. "Day") to include in API requests
328 // with the JSON null value. By default, fields with empty values are omitted
329 // from API requests. See
330 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
331 NullFields []string `json:"-"`
332 }
333
334 func (s Date) MarshalJSON() ([]byte, error) {
335 type NoMethod Date
336 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
337 }
338
339 // DenyMaintenancePeriod: Specifies the maintenance denial period.
340 type DenyMaintenancePeriod struct {
341 // EndDate: Required. End date of the deny maintenance period.
342 EndDate *Date `json:"endDate,omitempty"`
343 // StartDate: Required. Start date of the deny maintenance period.
344 StartDate *Date `json:"startDate,omitempty"`
345 // Time: Required. Time in UTC when the period starts and ends.
346 Time *TimeOfDay `json:"time,omitempty"`
347 // ForceSendFields is a list of field names (e.g. "EndDate") to unconditionally
348 // include in API requests. By default, fields with empty or default values are
349 // omitted from API requests. See
350 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
351 // details.
352 ForceSendFields []string `json:"-"`
353 // NullFields is a list of field names (e.g. "EndDate") to include in API
354 // requests with the JSON null value. By default, fields with empty values are
355 // omitted from API requests. See
356 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
357 NullFields []string `json:"-"`
358 }
359
360 func (s DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
361 type NoMethod DenyMaintenancePeriod
362 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
363 }
364
365 // Empty: A generic empty message that you can re-use to avoid defining
366 // duplicated empty messages in your APIs. A typical example is to use it as
367 // the request or the response type of an API method. For instance: service Foo
368 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
369 type Empty struct {
370 // ServerResponse contains the HTTP response code and headers from the server.
371 googleapi.ServerResponse `json:"-"`
372 }
373
374 // EncryptionConfig: Encryption configuration (i.e. CMEK).
375 type EncryptionConfig struct {
376 // KmsKeyName: Name of the CMEK key in KMS (input parameter).
377 KmsKeyName string `json:"kmsKeyName,omitempty"`
378 // KmsKeyNameVersion: Output only. Full name and version of the CMEK key
379 // currently in use to encrypt Looker data. Format:
380 // `projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}/cry
381 // ptoKeyVersions/{version}`. Empty if CMEK is not configured in this instance.
382 KmsKeyNameVersion string `json:"kmsKeyNameVersion,omitempty"`
383 // KmsKeyState: Output only. Status of the CMEK key.
384 //
385 // Possible values:
386 // "KMS_KEY_STATE_UNSPECIFIED" - CMEK status not specified.
387 // "VALID" - CMEK key is currently valid.
388 // "REVOKED" - CMEK key is currently revoked (instance should in restricted
389 // mode).
390 KmsKeyState string `json:"kmsKeyState,omitempty"`
391 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
392 // unconditionally include in API requests. By default, fields with empty or
393 // default values are omitted from API requests. See
394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
395 // details.
396 ForceSendFields []string `json:"-"`
397 // NullFields is a list of field names (e.g. "KmsKeyName") to include in API
398 // requests with the JSON null value. By default, fields with empty values are
399 // omitted from API requests. See
400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
401 NullFields []string `json:"-"`
402 }
403
404 func (s EncryptionConfig) MarshalJSON() ([]byte, error) {
405 type NoMethod EncryptionConfig
406 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
407 }
408
409 // ExportEncryptionConfig: Configuration for Encryption - e.g. CMEK.
410 type ExportEncryptionConfig struct {
411 // KmsKeyName: Required. Name of the CMEK key in KMS.
412 KmsKeyName string `json:"kmsKeyName,omitempty"`
413 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
414 // unconditionally include in API requests. By default, fields with empty or
415 // default values are omitted from API requests. See
416 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
417 // details.
418 ForceSendFields []string `json:"-"`
419 // NullFields is a list of field names (e.g. "KmsKeyName") to include in API
420 // requests with the JSON null value. By default, fields with empty values are
421 // omitted from API requests. See
422 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
423 NullFields []string `json:"-"`
424 }
425
426 func (s ExportEncryptionConfig) MarshalJSON() ([]byte, error) {
427 type NoMethod ExportEncryptionConfig
428 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
429 }
430
431 // ExportInstanceRequest: Request options for exporting data of an Instance.
432 type ExportInstanceRequest struct {
433 // EncryptionConfig: Required. Encryption configuration (CMEK). For CMEK
434 // enabled instances it should be same as looker CMEK.
435 EncryptionConfig *ExportEncryptionConfig `json:"encryptionConfig,omitempty"`
436 // GcsUri: The path to the folder in Google Cloud Storage where the export will
437 // be stored. The URI is in the form `gs://bucketName/folderName`.
438 GcsUri string `json:"gcsUri,omitempty"`
439 // ForceSendFields is a list of field names (e.g. "EncryptionConfig") to
440 // unconditionally include in API requests. By default, fields with empty or
441 // default values are omitted from API requests. See
442 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
443 // details.
444 ForceSendFields []string `json:"-"`
445 // NullFields is a list of field names (e.g. "EncryptionConfig") to include in
446 // API requests with the JSON null value. By default, fields with empty values
447 // are omitted from API requests. See
448 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
449 NullFields []string `json:"-"`
450 }
451
452 func (s ExportInstanceRequest) MarshalJSON() ([]byte, error) {
453 type NoMethod ExportInstanceRequest
454 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
455 }
456
457 // ExportMetadata: ExportMetadata represents the metadata of the exported
458 // artifacts. The metadata.json file in export artifact can be parsed as this
459 // message
460 type ExportMetadata struct {
461 // ExportEncryptionKey: Encryption key that was used to encrypt the export
462 // artifacts.
463 ExportEncryptionKey *ExportMetadataEncryptionKey `json:"exportEncryptionKey,omitempty"`
464 // FilePaths: List of files created as part of export artifact (excluding the
465 // metadata). The paths are relative to the folder containing the metadata.
466 FilePaths []string `json:"filePaths,omitempty"`
467 // LookerEncryptionKey: Looker encryption key, encrypted with the provided
468 // export encryption key. This value will only be populated if the looker
469 // instance uses Looker managed encryption instead of CMEK.
470 LookerEncryptionKey string `json:"lookerEncryptionKey,omitempty"`
471 // LookerInstance: Name of the exported instance. Format:
472 // projects/{project}/locations/{location}/instances/{instance}
473 LookerInstance string `json:"lookerInstance,omitempty"`
474 // LookerPlatformEdition: Platform edition of the exported instance.
475 LookerPlatformEdition string `json:"lookerPlatformEdition,omitempty"`
476 // LookerVersion: Version of instance when the export was created.
477 LookerVersion string `json:"lookerVersion,omitempty"`
478 // Source: The source type of the migration.
479 //
480 // Possible values:
481 // "SOURCE_UNSPECIFIED" - Source not specified
482 // "LOOKER_CORE" - Source of export is Looker Core
483 // "LOOKER_ORIGINAL" - Source of export is Looker Original
484 Source string `json:"source,omitempty"`
485 // ForceSendFields is a list of field names (e.g. "ExportEncryptionKey") to
486 // unconditionally include in API requests. By default, fields with empty or
487 // default values are omitted from API requests. See
488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
489 // details.
490 ForceSendFields []string `json:"-"`
491 // NullFields is a list of field names (e.g. "ExportEncryptionKey") to include
492 // in API requests with the JSON null value. By default, fields with empty
493 // values are omitted from API requests. See
494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
495 NullFields []string `json:"-"`
496 }
497
498 func (s ExportMetadata) MarshalJSON() ([]byte, error) {
499 type NoMethod ExportMetadata
500 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
501 }
502
503 // ExportMetadataEncryptionKey: Encryption key details for the exported
504 // artifact.
505 type ExportMetadataEncryptionKey struct {
506 // Cmek: Name of the CMEK.
507 Cmek string `json:"cmek,omitempty"`
508 // Version: Version of the CMEK.
509 Version string `json:"version,omitempty"`
510 // ForceSendFields is a list of field names (e.g. "Cmek") to unconditionally
511 // include in API requests. By default, fields with empty or default values are
512 // omitted from API requests. See
513 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
514 // details.
515 ForceSendFields []string `json:"-"`
516 // NullFields is a list of field names (e.g. "Cmek") to include in API requests
517 // with the JSON null value. By default, fields with empty values are omitted
518 // from API requests. See
519 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
520 NullFields []string `json:"-"`
521 }
522
523 func (s ExportMetadataEncryptionKey) MarshalJSON() ([]byte, error) {
524 type NoMethod ExportMetadataEncryptionKey
525 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
526 }
527
528 // ImportInstanceRequest: Requestion options for importing looker data to an
529 // Instance
530 type ImportInstanceRequest struct {
531 // GcsUri: Path to the import folder in Google Cloud Storage, in the form
532 // `gs://bucketName/folderName`.
533 GcsUri string `json:"gcsUri,omitempty"`
534 // ForceSendFields is a list of field names (e.g. "GcsUri") to unconditionally
535 // include in API requests. By default, fields with empty or default values are
536 // omitted from API requests. See
537 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
538 // details.
539 ForceSendFields []string `json:"-"`
540 // NullFields is a list of field names (e.g. "GcsUri") to include in API
541 // requests with the JSON null value. By default, fields with empty values are
542 // omitted from API requests. See
543 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
544 NullFields []string `json:"-"`
545 }
546
547 func (s ImportInstanceRequest) MarshalJSON() ([]byte, error) {
548 type NoMethod ImportInstanceRequest
549 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
550 }
551
552 // IngressIpAllowlistConfig: Ingress IP allowlist configuration.
553 type IngressIpAllowlistConfig struct {
554 // AllowlistRules: Optional. List of IP range rules to allow ingress traffic.
555 AllowlistRules []*IngressIpAllowlistRule `json:"allowlistRules,omitempty"`
556 // Enabled: Optional. Whether ingress IP allowlist functionality is enabled on
557 // the Looker instance.
558 Enabled bool `json:"enabled,omitempty"`
559 // GoogleServicesEnabled: Optional. Whether google service connections are
560 // enabled for the instance.
561 GoogleServicesEnabled bool `json:"googleServicesEnabled,omitempty"`
562 // ForceSendFields is a list of field names (e.g. "AllowlistRules") to
563 // unconditionally include in API requests. By default, fields with empty or
564 // default values are omitted from API requests. See
565 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
566 // details.
567 ForceSendFields []string `json:"-"`
568 // NullFields is a list of field names (e.g. "AllowlistRules") to include in
569 // API requests with the JSON null value. By default, fields with empty values
570 // are omitted from API requests. See
571 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
572 NullFields []string `json:"-"`
573 }
574
575 func (s IngressIpAllowlistConfig) MarshalJSON() ([]byte, error) {
576 type NoMethod IngressIpAllowlistConfig
577 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
578 }
579
580 // IngressIpAllowlistRule: Ingress IP allowlist rule.
581 type IngressIpAllowlistRule struct {
582 // Description: Optional. Description for the IP range.
583 Description string `json:"description,omitempty"`
584 // IpRange: Optional. The IP range to allow ingress traffic from.
585 IpRange string `json:"ipRange,omitempty"`
586 // ForceSendFields is a list of field names (e.g. "Description") to
587 // unconditionally include in API requests. By default, fields with empty or
588 // default values are omitted from API requests. See
589 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
590 // details.
591 ForceSendFields []string `json:"-"`
592 // NullFields is a list of field names (e.g. "Description") to include in API
593 // requests with the JSON null value. By default, fields with empty values are
594 // omitted from API requests. See
595 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
596 NullFields []string `json:"-"`
597 }
598
599 func (s IngressIpAllowlistRule) MarshalJSON() ([]byte, error) {
600 type NoMethod IngressIpAllowlistRule
601 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
602 }
603
604 // Instance: A Looker instance.
605 type Instance struct {
606 // AdminSettings: Looker Instance Admin settings.
607 AdminSettings *AdminSettings `json:"adminSettings,omitempty"`
608 // CatalogIntegrationOptOut: Optional. Indicates whether catalog integration is
609 // disabled for the Looker instance.
610 CatalogIntegrationOptOut bool `json:"catalogIntegrationOptOut,omitempty"`
611 // ClassType: Optional. Storage class of the instance.
612 //
613 // Possible values:
614 // "CLASS_TYPE_UNSPECIFIED" - Unspecified storage class.
615 // "R1" - Filestore.
616 // "P1" - PD SSD.
617 ClassType string `json:"classType,omitempty"`
618 // ConsumerNetwork: Network name in the consumer project. Format:
619 // `projects/{project}/global/networks/{network}`. Note that the consumer
620 // network may be in a different GCP project than the consumer project that is
621 // hosting the Looker Instance.
622 ConsumerNetwork string `json:"consumerNetwork,omitempty"`
623 // ControlledEgressConfig: Optional. Controlled egress configuration.
624 ControlledEgressConfig *ControlledEgressConfig `json:"controlledEgressConfig,omitempty"`
625 // ControlledEgressEnabled: Optional. Whether controlled egress is enabled on
626 // the Looker instance.
627 ControlledEgressEnabled bool `json:"controlledEgressEnabled,omitempty"`
628 // CreateTime: Output only. The time when the Looker instance provisioning was
629 // first requested.
630 CreateTime string `json:"createTime,omitempty"`
631 // CustomDomain: Custom domain configuration for the instance.
632 CustomDomain *CustomDomain `json:"customDomain,omitempty"`
633 // DenyMaintenancePeriod: Maintenance denial period for this instance.
634 DenyMaintenancePeriod *DenyMaintenancePeriod `json:"denyMaintenancePeriod,omitempty"`
635 // EgressPublicIp: Output only. Public Egress IP (IPv4).
636 EgressPublicIp string `json:"egressPublicIp,omitempty"`
637 // EncryptionConfig: Encryption configuration (CMEK). Only set if CMEK has been
638 // enabled on the instance.
639 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
640 // FipsEnabled: Optional. Whether FIPS is enabled on the Looker instance.
641 FipsEnabled bool `json:"fipsEnabled,omitempty"`
642 // GeminiEnabled: Optional. Whether Gemini feature is enabled on the Looker
643 // instance or not.
644 GeminiEnabled bool `json:"geminiEnabled,omitempty"`
645 // IngressIpAllowlistConfig: Optional. Ingress IP allowlist configuration for
646 // the Looker instance.
647 IngressIpAllowlistConfig *IngressIpAllowlistConfig `json:"ingressIpAllowlistConfig,omitempty"`
648 // IngressPrivateIp: Output only. Private Ingress IP (IPv4).
649 IngressPrivateIp string `json:"ingressPrivateIp,omitempty"`
650 // IngressPublicIp: Output only. Public Ingress IP (IPv4).
651 IngressPublicIp string `json:"ingressPublicIp,omitempty"`
652 // LastDenyMaintenancePeriod: Output only. Last computed maintenance denial
653 // period for this instance.
654 LastDenyMaintenancePeriod *DenyMaintenancePeriod `json:"lastDenyMaintenancePeriod,omitempty"`
655 // LinkedLspProjectNumber: Optional. Linked Google Cloud Project Number for
656 // Looker Studio Pro.
657 LinkedLspProjectNumber int64 `json:"linkedLspProjectNumber,omitempty,string"`
658 // LookerUri: Output only. Looker instance URI which can be used to access the
659 // Looker Instance UI.
660 LookerUri string `json:"lookerUri,omitempty"`
661 // LookerVersion: Output only. The Looker version that the instance is using.
662 LookerVersion string `json:"lookerVersion,omitempty"`
663 // MaintenanceSchedule: Maintenance schedule for this instance.
664 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"`
665 // MaintenanceWindow: Maintenance window for this instance.
666 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
667 // Name: Output only. Format:
668 // `projects/{project}/locations/{location}/instances/{instance}`.
669 Name string `json:"name,omitempty"`
670 // OauthConfig: Looker instance OAuth login settings.
671 OauthConfig *OAuthConfig `json:"oauthConfig,omitempty"`
672 // PeriodicExportConfig: Optional. Configuration for periodic export.
673 PeriodicExportConfig *PeriodicExportConfig `json:"periodicExportConfig,omitempty"`
674 // PlatformEdition: Platform edition.
675 //
676 // Possible values:
677 // "PLATFORM_EDITION_UNSPECIFIED" - Platform edition is unspecified.
678 // "LOOKER_CORE_TRIAL" - Trial.
679 // "LOOKER_CORE_STANDARD" - Standard.
680 // "LOOKER_CORE_STANDARD_ANNUAL" - Subscription Standard.
681 // "LOOKER_CORE_ENTERPRISE_ANNUAL" - Subscription Enterprise.
682 // "LOOKER_CORE_EMBED_ANNUAL" - Subscription Embed.
683 // "LOOKER_CORE_NONPROD_STANDARD_ANNUAL" - Nonprod Subscription Standard.
684 // "LOOKER_CORE_NONPROD_ENTERPRISE_ANNUAL" - Nonprod Subscription Enterprise.
685 // "LOOKER_CORE_NONPROD_EMBED_ANNUAL" - Nonprod Subscription Embed.
686 // "LOOKER_CORE_TRIAL_STANDARD" - Trial Standard.
687 // "LOOKER_CORE_TRIAL_ENTERPRISE" - Trial Enterprise.
688 // "LOOKER_CORE_TRIAL_EMBED" - Trial Embed.
689 PlatformEdition string `json:"platformEdition,omitempty"`
690 // PrivateIpEnabled: Whether private IP is enabled on the Looker instance.
691 PrivateIpEnabled bool `json:"privateIpEnabled,omitempty"`
692 // PscConfig: Optional. PSC configuration. Used when `psc_enabled` is true.
693 PscConfig *PscConfig `json:"pscConfig,omitempty"`
694 // PscEnabled: Optional. Whether to use Private Service Connect (PSC) for
695 // private IP connectivity. If true, neither `public_ip_enabled` nor
696 // `private_ip_enabled` can be true.
697 PscEnabled bool `json:"pscEnabled,omitempty"`
698 // PublicIpEnabled: Whether public IP is enabled on the Looker instance.
699 PublicIpEnabled bool `json:"publicIpEnabled,omitempty"`
700 // ReservedRange: Name of a reserved IP address range within the
701 // Instance.consumer_network, to be used for private services access
702 // connection. May or may not be specified in a create request.
703 ReservedRange string `json:"reservedRange,omitempty"`
704 // SatisfiesPzi: Output only. Reserved for future use.
705 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
706 // SatisfiesPzs: Output only. Reserved for future use.
707 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
708 // State: Output only. The state of the instance.
709 //
710 // Possible values:
711 // "STATE_UNSPECIFIED" - State is unspecified.
712 // "ACTIVE" - Instance is active and ready for use.
713 // "CREATING" - Instance provisioning is in progress.
714 // "FAILED" - Instance is in a failed state.
715 // "SUSPENDED" - Instance was suspended.
716 // "UPDATING" - Instance update is in progress.
717 // "DELETING" - Instance delete is in progress.
718 // "EXPORTING" - Instance is being exported.
719 // "IMPORTING" - Instance is importing data.
720 State string `json:"state,omitempty"`
721 // UpdateTime: Output only. The time when the Looker instance was last updated.
722 UpdateTime string `json:"updateTime,omitempty"`
723 // UserMetadata: Optional. User metadata.
724 UserMetadata *UserMetadata `json:"userMetadata,omitempty"`
725
726 // ServerResponse contains the HTTP response code and headers from the server.
727 googleapi.ServerResponse `json:"-"`
728 // ForceSendFields is a list of field names (e.g. "AdminSettings") to
729 // unconditionally include in API requests. By default, fields with empty or
730 // default values are omitted from API requests. See
731 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
732 // details.
733 ForceSendFields []string `json:"-"`
734 // NullFields is a list of field names (e.g. "AdminSettings") to include in API
735 // requests with the JSON null value. By default, fields with empty values are
736 // omitted from API requests. See
737 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
738 NullFields []string `json:"-"`
739 }
740
741 func (s Instance) MarshalJSON() ([]byte, error) {
742 type NoMethod Instance
743 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
744 }
745
746 // InstanceBackup: The details of a backup resource.
747 type InstanceBackup struct {
748 // CreateTime: Output only. The time when the backup was started.
749 CreateTime string `json:"createTime,omitempty"`
750 // EncryptionConfig: Output only. Current status of the CMEK encryption
751 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
752 // ExpireTime: Output only. The time when the backup will be deleted.
753 ExpireTime string `json:"expireTime,omitempty"`
754 // Name: Immutable. The relative resource name of the backup, in the following
755 // form:
756 // `projects/{project_number}/locations/{location_id}/instances/{instance_id}/ba
757 // ckups/{backup}`
758 Name string `json:"name,omitempty"`
759 // State: Output only. The current state of the backup.
760 //
761 // Possible values:
762 // "STATE_UNSPECIFIED" - The state of the backup is unknown.
763 // "CREATING" - The backup is being created.
764 // "DELETING" - The backup is being deleted.
765 // "ACTIVE" - The backup is active and ready to use.
766 // "FAILED" - The backup failed.
767 State string `json:"state,omitempty"`
768
769 // ServerResponse contains the HTTP response code and headers from the server.
770 googleapi.ServerResponse `json:"-"`
771 // ForceSendFields is a list of field names (e.g. "CreateTime") to
772 // unconditionally include in API requests. By default, fields with empty or
773 // default values are omitted from API requests. See
774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
775 // details.
776 ForceSendFields []string `json:"-"`
777 // NullFields is a list of field names (e.g. "CreateTime") to include in API
778 // requests with the JSON null value. By default, fields with empty values are
779 // omitted from API requests. See
780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
781 NullFields []string `json:"-"`
782 }
783
784 func (s InstanceBackup) MarshalJSON() ([]byte, error) {
785 type NoMethod InstanceBackup
786 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
787 }
788
789 // ListInstanceBackupsResponse: Response from listing Looker instance backups.
790 type ListInstanceBackupsResponse struct {
791 // InstanceBackups: The list of instances matching the request filters, up to
792 // the requested `page_size`.
793 InstanceBackups []*InstanceBackup `json:"instanceBackups,omitempty"`
794 // NextPageToken: If provided, a page token that can look up the next
795 // `page_size` results. If empty, the results list is exhausted.
796 NextPageToken string `json:"nextPageToken,omitempty"`
797 // Unreachable: Locations that could not be reached.
798 Unreachable []string `json:"unreachable,omitempty"`
799
800 // ServerResponse contains the HTTP response code and headers from the server.
801 googleapi.ServerResponse `json:"-"`
802 // ForceSendFields is a list of field names (e.g. "InstanceBackups") to
803 // unconditionally include in API requests. By default, fields with empty or
804 // default values are omitted from API requests. See
805 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
806 // details.
807 ForceSendFields []string `json:"-"`
808 // NullFields is a list of field names (e.g. "InstanceBackups") to include in
809 // API requests with the JSON null value. By default, fields with empty values
810 // are omitted from API requests. See
811 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
812 NullFields []string `json:"-"`
813 }
814
815 func (s ListInstanceBackupsResponse) MarshalJSON() ([]byte, error) {
816 type NoMethod ListInstanceBackupsResponse
817 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
818 }
819
820 // ListInstancesResponse: Response from ListInstances.
821 type ListInstancesResponse struct {
822 // Instances: The list of instances matching the request filters, up to the
823 // requested ListInstancesRequest.pageSize.
824 Instances []*Instance `json:"instances,omitempty"`
825 // NextPageToken: If provided, a page token that can look up the next
826 // ListInstancesRequest.pageSize results. If empty, the results list is
827 // exhausted.
828 NextPageToken string `json:"nextPageToken,omitempty"`
829 // Unreachable: Locations that could not be reached.
830 Unreachable []string `json:"unreachable,omitempty"`
831
832 // ServerResponse contains the HTTP response code and headers from the server.
833 googleapi.ServerResponse `json:"-"`
834 // ForceSendFields is a list of field names (e.g. "Instances") to
835 // unconditionally include in API requests. By default, fields with empty or
836 // default values are omitted from API requests. See
837 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
838 // details.
839 ForceSendFields []string `json:"-"`
840 // NullFields is a list of field names (e.g. "Instances") to include in API
841 // requests with the JSON null value. By default, fields with empty values are
842 // omitted from API requests. See
843 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
844 NullFields []string `json:"-"`
845 }
846
847 func (s ListInstancesResponse) MarshalJSON() ([]byte, error) {
848 type NoMethod ListInstancesResponse
849 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
850 }
851
852 // ListLocationsResponse: The response message for Locations.ListLocations.
853 type ListLocationsResponse struct {
854 // Locations: A list of locations that matches the specified filter in the
855 // request.
856 Locations []*Location `json:"locations,omitempty"`
857 // NextPageToken: The standard List next-page token.
858 NextPageToken string `json:"nextPageToken,omitempty"`
859
860 // ServerResponse contains the HTTP response code and headers from the server.
861 googleapi.ServerResponse `json:"-"`
862 // ForceSendFields is a list of field names (e.g. "Locations") to
863 // unconditionally include in API requests. By default, fields with empty or
864 // default values are omitted from API requests. See
865 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
866 // details.
867 ForceSendFields []string `json:"-"`
868 // NullFields is a list of field names (e.g. "Locations") to include in API
869 // requests with the JSON null value. By default, fields with empty values are
870 // omitted from API requests. See
871 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
872 NullFields []string `json:"-"`
873 }
874
875 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
876 type NoMethod ListLocationsResponse
877 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
878 }
879
880 // ListOperationsResponse: The response message for Operations.ListOperations.
881 type ListOperationsResponse struct {
882 // NextPageToken: The standard List next-page token.
883 NextPageToken string `json:"nextPageToken,omitempty"`
884 // Operations: A list of operations that matches the specified filter in the
885 // request.
886 Operations []*Operation `json:"operations,omitempty"`
887 // Unreachable: Unordered list. Unreachable resources. Populated when the
888 // request sets `ListOperationsRequest.return_partial_success` and reads across
889 // collections. For example, when attempting to list all resources across all
890 // supported locations.
891 Unreachable []string `json:"unreachable,omitempty"`
892
893 // ServerResponse contains the HTTP response code and headers from the server.
894 googleapi.ServerResponse `json:"-"`
895 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
896 // unconditionally include in API requests. By default, fields with empty or
897 // default values are omitted from API requests. See
898 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
899 // details.
900 ForceSendFields []string `json:"-"`
901 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
902 // requests with the JSON null value. By default, fields with empty values are
903 // omitted from API requests. See
904 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
905 NullFields []string `json:"-"`
906 }
907
908 func (s ListOperationsResponse) MarshalJSON() ([]byte, error) {
909 type NoMethod ListOperationsResponse
910 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
911 }
912
913 // Location: A resource that represents a Google Cloud location.
914 type Location struct {
915 // DisplayName: The friendly name for this location, typically a nearby city
916 // name. For example, "Tokyo".
917 DisplayName string `json:"displayName,omitempty"`
918 // Labels: Cross-service attributes for the location. For example
919 // {"cloud.googleapis.com/region": "us-east1"}
920 Labels map[string]string `json:"labels,omitempty"`
921 // LocationId: The canonical id for this location. For example: "us-east1".
922 LocationId string `json:"locationId,omitempty"`
923 // Metadata: Service-specific metadata. For example the available capacity at
924 // the given location.
925 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
926 // Name: Resource name for the location, which may vary between
927 // implementations. For example:
928 // "projects/example-project/locations/us-east1"
929 Name string `json:"name,omitempty"`
930
931 // ServerResponse contains the HTTP response code and headers from the server.
932 googleapi.ServerResponse `json:"-"`
933 // ForceSendFields is a list of field names (e.g. "DisplayName") to
934 // unconditionally include in API requests. By default, fields with empty or
935 // default values are omitted from API requests. See
936 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
937 // details.
938 ForceSendFields []string `json:"-"`
939 // NullFields is a list of field names (e.g. "DisplayName") to include in API
940 // requests with the JSON null value. By default, fields with empty values are
941 // omitted from API requests. See
942 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
943 NullFields []string `json:"-"`
944 }
945
946 func (s Location) MarshalJSON() ([]byte, error) {
947 type NoMethod Location
948 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
949 }
950
951 // MaintenanceSchedule: Published upcoming future maintenance schedule.
952 type MaintenanceSchedule struct {
953 // EndTime: The scheduled end time for the maintenance.
954 EndTime string `json:"endTime,omitempty"`
955 // StartTime: The scheduled start time for the maintenance.
956 StartTime string `json:"startTime,omitempty"`
957 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
958 // include in API requests. By default, fields with empty or default values are
959 // omitted from API requests. See
960 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
961 // details.
962 ForceSendFields []string `json:"-"`
963 // NullFields is a list of field names (e.g. "EndTime") to include in API
964 // requests with the JSON null value. By default, fields with empty values are
965 // omitted from API requests. See
966 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
967 NullFields []string `json:"-"`
968 }
969
970 func (s MaintenanceSchedule) MarshalJSON() ([]byte, error) {
971 type NoMethod MaintenanceSchedule
972 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
973 }
974
975 // MaintenanceWindow: Specifies the recurring maintenance window.
976 type MaintenanceWindow struct {
977 // DayOfWeek: Required. Day of the week for this MaintenanceWindow (in UTC).
978 //
979 // Possible values:
980 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified.
981 // "MONDAY" - Monday
982 // "TUESDAY" - Tuesday
983 // "WEDNESDAY" - Wednesday
984 // "THURSDAY" - Thursday
985 // "FRIDAY" - Friday
986 // "SATURDAY" - Saturday
987 // "SUNDAY" - Sunday
988 DayOfWeek string `json:"dayOfWeek,omitempty"`
989 // StartTime: Required. Time in UTC when the period starts. Maintenance will be
990 // scheduled within 60 minutes.
991 StartTime *TimeOfDay `json:"startTime,omitempty"`
992 // ForceSendFields is a list of field names (e.g. "DayOfWeek") to
993 // unconditionally include in API requests. By default, fields with empty or
994 // default values are omitted from API requests. See
995 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
996 // details.
997 ForceSendFields []string `json:"-"`
998 // NullFields is a list of field names (e.g. "DayOfWeek") to include in API
999 // requests with the JSON null value. By default, fields with empty values are
1000 // omitted from API requests. See
1001 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1002 NullFields []string `json:"-"`
1003 }
1004
1005 func (s MaintenanceWindow) MarshalJSON() ([]byte, error) {
1006 type NoMethod MaintenanceWindow
1007 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1008 }
1009
1010 // OAuthConfig: Looker instance OAuth login settings.
1011 type OAuthConfig struct {
1012 // ClientId: Input only. Client ID from an external OAuth application. This is
1013 // an input-only field, and thus will not be set in any responses.
1014 ClientId string `json:"clientId,omitempty"`
1015 // ClientSecret: Input only. Client secret from an external OAuth application.
1016 // This is an input-only field, and thus will not be set in any responses.
1017 ClientSecret string `json:"clientSecret,omitempty"`
1018 // SharedOauthClientEnabled: Optional. Whether to use the shared OAuth client.
1019 // Instances specifying this field do not need to provide client_id and
1020 // client_secret.
1021 SharedOauthClientEnabled bool `json:"sharedOauthClientEnabled,omitempty"`
1022 // ForceSendFields is a list of field names (e.g. "ClientId") to
1023 // unconditionally include in API requests. By default, fields with empty or
1024 // default values are omitted from API requests. See
1025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1026 // details.
1027 ForceSendFields []string `json:"-"`
1028 // NullFields is a list of field names (e.g. "ClientId") to include in API
1029 // requests with the JSON null value. By default, fields with empty values are
1030 // omitted from API requests. See
1031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1032 NullFields []string `json:"-"`
1033 }
1034
1035 func (s OAuthConfig) MarshalJSON() ([]byte, error) {
1036 type NoMethod OAuthConfig
1037 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1038 }
1039
1040 // Operation: This resource represents a long-running operation that is the
1041 // result of a network API call.
1042 type Operation struct {
1043 // Done: If the value is `false`, it means the operation is still in progress.
1044 // If `true`, the operation is completed, and either `error` or `response` is
1045 // available.
1046 Done bool `json:"done,omitempty"`
1047 // Error: The error result of the operation in case of failure or cancellation.
1048 Error *Status `json:"error,omitempty"`
1049 // Metadata: Service-specific metadata associated with the operation. It
1050 // typically contains progress information and common metadata such as create
1051 // time. Some services might not provide such metadata. Any method that returns
1052 // a long-running operation should document the metadata type, if any.
1053 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1054 // Name: The server-assigned name, which is only unique within the same service
1055 // that originally returns it. If you use the default HTTP mapping, the `name`
1056 // should be a resource name ending with `operations/{unique_id}`.
1057 Name string `json:"name,omitempty"`
1058 // Response: The normal, successful response of the operation. If the original
1059 // method returns no data on success, such as `Delete`, the response is
1060 // `google.protobuf.Empty`. If the original method is standard
1061 // `Get`/`Create`/`Update`, the response should be the resource. For other
1062 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
1063 // original method name. For example, if the original method name is
1064 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
1065 Response googleapi.RawMessage `json:"response,omitempty"`
1066
1067 // ServerResponse contains the HTTP response code and headers from the server.
1068 googleapi.ServerResponse `json:"-"`
1069 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
1070 // include in API requests. By default, fields with empty or default values are
1071 // omitted from API requests. See
1072 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1073 // details.
1074 ForceSendFields []string `json:"-"`
1075 // NullFields is a list of field names (e.g. "Done") to include in API requests
1076 // with the JSON null value. By default, fields with empty values are omitted
1077 // from API requests. See
1078 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1079 NullFields []string `json:"-"`
1080 }
1081
1082 func (s Operation) MarshalJSON() ([]byte, error) {
1083 type NoMethod Operation
1084 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1085 }
1086
1087 // OperationMetadata: Represents the metadata of the long-running operation.
1088 type OperationMetadata struct {
1089 // ApiVersion: API version used to start the operation.
1090 ApiVersion string `json:"apiVersion,omitempty"`
1091 // CreateTime: The time the operation was created.
1092 CreateTime string `json:"createTime,omitempty"`
1093 // EndTime: The time the operation finished running.
1094 EndTime string `json:"endTime,omitempty"`
1095 // RequestedCancellation: Identifies whether the user has requested
1096 // cancellation of the operation. Operations that have successfully been
1097 // cancelled have Operation.error value with a google.rpc.Status.code of 1,
1098 // corresponding to `Code.CANCELLED`.
1099 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1100 // StatusMessage: Human-readable status of the operation, if any.
1101 StatusMessage string `json:"statusMessage,omitempty"`
1102 // Target: Server-defined resource path for the target of the operation.
1103 Target string `json:"target,omitempty"`
1104 // Verb: Name of the verb executed by the operation.
1105 Verb string `json:"verb,omitempty"`
1106 // ForceSendFields is a list of field names (e.g. "ApiVersion") to
1107 // unconditionally include in API requests. By default, fields with empty or
1108 // default values are omitted from API requests. See
1109 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1110 // details.
1111 ForceSendFields []string `json:"-"`
1112 // NullFields is a list of field names (e.g. "ApiVersion") to include in API
1113 // requests with the JSON null value. By default, fields with empty values are
1114 // omitted from API requests. See
1115 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1116 NullFields []string `json:"-"`
1117 }
1118
1119 func (s OperationMetadata) MarshalJSON() ([]byte, error) {
1120 type NoMethod OperationMetadata
1121 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1122 }
1123
1124 // PeriodicExportConfig: Configuration for periodic export.
1125 type PeriodicExportConfig struct {
1126 // GcsUri: Required. Cloud Storage bucket URI for periodic export. Format:
1127 // gs://{bucket_name}
1128 GcsUri string `json:"gcsUri,omitempty"`
1129 // KmsKey: Required. Name of the CMEK key in KMS. Format:
1130 // projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypt
1131 // o_key}
1132 KmsKey string `json:"kmsKey,omitempty"`
1133 // StartTime: Required. Time in UTC to start the periodic export job.
1134 StartTime *TimeOfDay `json:"startTime,omitempty"`
1135 // ForceSendFields is a list of field names (e.g. "GcsUri") to unconditionally
1136 // include in API requests. By default, fields with empty or default values are
1137 // omitted from API requests. See
1138 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1139 // details.
1140 ForceSendFields []string `json:"-"`
1141 // NullFields is a list of field names (e.g. "GcsUri") to include in API
1142 // requests with the JSON null value. By default, fields with empty values are
1143 // omitted from API requests. See
1144 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1145 NullFields []string `json:"-"`
1146 }
1147
1148 func (s PeriodicExportConfig) MarshalJSON() ([]byte, error) {
1149 type NoMethod PeriodicExportConfig
1150 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1151 }
1152
1153 // PscConfig: Information for Private Service Connect (PSC) setup for a Looker
1154 // instance.
1155 type PscConfig struct {
1156 // AllowedVpcs: Optional. List of VPCs that are allowed ingress into looker.
1157 // Format: projects/{project}/global/networks/{network}
1158 AllowedVpcs []string `json:"allowedVpcs,omitempty"`
1159 // LookerServiceAttachmentUri: Output only. URI of the Looker service
1160 // attachment.
1161 LookerServiceAttachmentUri string `json:"lookerServiceAttachmentUri,omitempty"`
1162 // ServiceAttachments: Optional. List of egress service attachment
1163 // configurations.
1164 ServiceAttachments []*ServiceAttachment `json:"serviceAttachments,omitempty"`
1165 // ForceSendFields is a list of field names (e.g. "AllowedVpcs") to
1166 // unconditionally include in API requests. By default, fields with empty or
1167 // default values are omitted from API requests. See
1168 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1169 // details.
1170 ForceSendFields []string `json:"-"`
1171 // NullFields is a list of field names (e.g. "AllowedVpcs") to include in API
1172 // requests with the JSON null value. By default, fields with empty values are
1173 // omitted from API requests. See
1174 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1175 NullFields []string `json:"-"`
1176 }
1177
1178 func (s PscConfig) MarshalJSON() ([]byte, error) {
1179 type NoMethod PscConfig
1180 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1181 }
1182
1183 // RestartInstanceRequest: Request options for restarting an instance.
1184 type RestartInstanceRequest struct {
1185 }
1186
1187 // RestoreInstanceRequest: Request options for restoring an instance
1188 type RestoreInstanceRequest struct {
1189 // Backup: Required. Backup being used to restore the instance Format:
1190 // projects/{project}/locations/{location}/instances/{instance}/backups/{backup}
1191 Backup string `json:"backup,omitempty"`
1192 // ForceSendFields is a list of field names (e.g. "Backup") to unconditionally
1193 // include in API requests. By default, fields with empty or default values are
1194 // omitted from API requests. See
1195 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1196 // details.
1197 ForceSendFields []string `json:"-"`
1198 // NullFields is a list of field names (e.g. "Backup") to include in API
1199 // requests with the JSON null value. By default, fields with empty values are
1200 // omitted from API requests. See
1201 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1202 NullFields []string `json:"-"`
1203 }
1204
1205 func (s RestoreInstanceRequest) MarshalJSON() ([]byte, error) {
1206 type NoMethod RestoreInstanceRequest
1207 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1208 }
1209
1210 // ServiceAttachment: Service attachment configuration.
1211 type ServiceAttachment struct {
1212 // ConnectionStatus: Output only. Connection status.
1213 //
1214 // Possible values:
1215 // "UNKNOWN" - Connection status is unspecified.
1216 // "ACCEPTED" - Connection is established and functioning normally.
1217 // "PENDING" - Connection is not established (Looker tenant project hasn't
1218 // been allowlisted).
1219 // "REJECTED" - Connection is not established (Looker tenant project is
1220 // explicitly in reject list).
1221 // "NEEDS_ATTENTION" - Issue with target service attachment, e.g. NAT subnet
1222 // is exhausted.
1223 // "CLOSED" - Target service attachment does not exist. This status is a
1224 // terminal state.
1225 ConnectionStatus string `json:"connectionStatus,omitempty"`
1226 // FailureReason: Output only. Reason the service attachment creation failed.
1227 // This value will only be populated if the service attachment encounters an
1228 // issue during provisioning.
1229 FailureReason string `json:"failureReason,omitempty"`
1230 // LocalFqdn: Optional. Fully qualified domain name that will be used in the
1231 // private DNS record created for the service attachment.
1232 LocalFqdn string `json:"localFqdn,omitempty"`
1233 // LocalFqdns: Optional. List of fully qualified domain names that will be used
1234 // in the private DNS record created for the service attachment.
1235 LocalFqdns []string `json:"localFqdns,omitempty"`
1236 // TargetServiceAttachmentUri: Required. URI of the service attachment to
1237 // connect to. Format:
1238 // projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
1239 TargetServiceAttachmentUri string `json:"targetServiceAttachmentUri,omitempty"`
1240 // ForceSendFields is a list of field names (e.g. "ConnectionStatus") to
1241 // unconditionally include in API requests. By default, fields with empty or
1242 // default values are omitted from API requests. See
1243 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1244 // details.
1245 ForceSendFields []string `json:"-"`
1246 // NullFields is a list of field names (e.g. "ConnectionStatus") to include in
1247 // API requests with the JSON null value. By default, fields with empty values
1248 // are omitted from API requests. See
1249 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1250 NullFields []string `json:"-"`
1251 }
1252
1253 func (s ServiceAttachment) MarshalJSON() ([]byte, error) {
1254 type NoMethod ServiceAttachment
1255 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1256 }
1257
1258 // Status: The `Status` type defines a logical error model that is suitable for
1259 // different programming environments, including REST APIs and RPC APIs. It is
1260 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
1261 // pieces of data: error code, error message, and error details. You can find
1262 // out more about this error model and how to work with it in the API Design
1263 // Guide (https://cloud.google.com/apis/design/errors).
1264 type Status struct {
1265 // Code: The status code, which should be an enum value of google.rpc.Code.
1266 Code int64 `json:"code,omitempty"`
1267 // Details: A list of messages that carry the error details. There is a common
1268 // set of message types for APIs to use.
1269 Details []googleapi.RawMessage `json:"details,omitempty"`
1270 // Message: A developer-facing error message, which should be in English. Any
1271 // user-facing error message should be localized and sent in the
1272 // google.rpc.Status.details field, or localized by the client.
1273 Message string `json:"message,omitempty"`
1274 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1275 // include in API requests. By default, fields with empty or default values are
1276 // omitted from API requests. See
1277 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1278 // details.
1279 ForceSendFields []string `json:"-"`
1280 // NullFields is a list of field names (e.g. "Code") to include in API requests
1281 // with the JSON null value. By default, fields with empty values are omitted
1282 // from API requests. See
1283 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1284 NullFields []string `json:"-"`
1285 }
1286
1287 func (s Status) MarshalJSON() ([]byte, error) {
1288 type NoMethod Status
1289 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1290 }
1291
1292 // TimeOfDay: Represents a time of day. The date and time zone are either not
1293 // significant or are specified elsewhere. An API may choose to allow leap
1294 // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
1295 type TimeOfDay struct {
1296 // Hours: Hours of a day in 24 hour format. Must be greater than or equal to 0
1297 // and typically must be less than or equal to 23. An API may choose to allow
1298 // the value "24:00:00" for scenarios like business closing time.
1299 Hours int64 `json:"hours,omitempty"`
1300 // Minutes: Minutes of an hour. Must be greater than or equal to 0 and less
1301 // than or equal to 59.
1302 Minutes int64 `json:"minutes,omitempty"`
1303 // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal
1304 // to 0 and less than or equal to 999,999,999.
1305 Nanos int64 `json:"nanos,omitempty"`
1306 // Seconds: Seconds of a minute. Must be greater than or equal to 0 and
1307 // typically must be less than or equal to 59. An API may allow the value 60 if
1308 // it allows leap-seconds.
1309 Seconds int64 `json:"seconds,omitempty"`
1310 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally
1311 // include in API requests. By default, fields with empty or default values are
1312 // omitted from API requests. See
1313 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1314 // details.
1315 ForceSendFields []string `json:"-"`
1316 // NullFields is a list of field names (e.g. "Hours") to include in API
1317 // requests with the JSON null value. By default, fields with empty values are
1318 // omitted from API requests. See
1319 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1320 NullFields []string `json:"-"`
1321 }
1322
1323 func (s TimeOfDay) MarshalJSON() ([]byte, error) {
1324 type NoMethod TimeOfDay
1325 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1326 }
1327
1328 // UserMetadata: Metadata about users for a Looker instance.
1329 type UserMetadata struct {
1330 // AdditionalDeveloperUserCount: Optional. The number of additional developer
1331 // users the instance owner has purchased.
1332 AdditionalDeveloperUserCount int64 `json:"additionalDeveloperUserCount,omitempty"`
1333 // AdditionalStandardUserCount: Optional. The number of additional standard
1334 // users the instance owner has purchased.
1335 AdditionalStandardUserCount int64 `json:"additionalStandardUserCount,omitempty"`
1336 // AdditionalViewerUserCount: Optional. The number of additional viewer users
1337 // the instance owner has purchased.
1338 AdditionalViewerUserCount int64 `json:"additionalViewerUserCount,omitempty"`
1339 // ForceSendFields is a list of field names (e.g.
1340 // "AdditionalDeveloperUserCount") to unconditionally include in API requests.
1341 // By default, fields with empty or default values are omitted from API
1342 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
1343 // for more details.
1344 ForceSendFields []string `json:"-"`
1345 // NullFields is a list of field names (e.g. "AdditionalDeveloperUserCount") to
1346 // include in API requests with the JSON null value. By default, fields with
1347 // empty values are omitted from API requests. See
1348 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1349 NullFields []string `json:"-"`
1350 }
1351
1352 func (s UserMetadata) MarshalJSON() ([]byte, error) {
1353 type NoMethod UserMetadata
1354 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1355 }
1356
1357 type ProjectsLocationsGetCall struct {
1358 s *Service
1359 name string
1360 urlParams_ gensupport.URLParams
1361 ifNoneMatch_ string
1362 ctx_ context.Context
1363 header_ http.Header
1364 }
1365
1366 // Get: Gets information about a location.
1367 //
1368 // - name: Resource name for the location.
1369 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1370 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1371 c.name = name
1372 return c
1373 }
1374
1375 // Fields allows partial responses to be retrieved. See
1376 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1377 // details.
1378 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1379 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1380 return c
1381 }
1382
1383 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1384 // object's ETag matches the given value. This is useful for getting updates
1385 // only after the object has changed since the last request.
1386 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1387 c.ifNoneMatch_ = entityTag
1388 return c
1389 }
1390
1391 // Context sets the context to be used in this call's Do method.
1392 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1393 c.ctx_ = ctx
1394 return c
1395 }
1396
1397 // Header returns a http.Header that can be modified by the caller to add
1398 // headers to the request.
1399 func (c *ProjectsLocationsGetCall) Header() http.Header {
1400 if c.header_ == nil {
1401 c.header_ = make(http.Header)
1402 }
1403 return c.header_
1404 }
1405
1406 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1407 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1408 if c.ifNoneMatch_ != "" {
1409 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1410 }
1411 c.urlParams_.Set("alt", alt)
1412 c.urlParams_.Set("prettyPrint", "false")
1413 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1414 urls += "?" + c.urlParams_.Encode()
1415 req, err := http.NewRequest("GET", urls, nil)
1416 if err != nil {
1417 return nil, err
1418 }
1419 req.Header = reqHeaders
1420 googleapi.Expand(req.URL, map[string]string{
1421 "name": c.name,
1422 })
1423 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
1424 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1425 }
1426
1427 // Do executes the "looker.projects.locations.get" call.
1428 // Any non-2xx status code is an error. Response headers are in either
1429 // *Location.ServerResponse.Header or (if a response was returned at all) in
1430 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1431 // whether the returned error was because http.StatusNotModified was returned.
1432 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1433 gensupport.SetOptions(c.urlParams_, opts...)
1434 res, err := c.doRequest("json")
1435 if res != nil && res.StatusCode == http.StatusNotModified {
1436 if res.Body != nil {
1437 res.Body.Close()
1438 }
1439 return nil, gensupport.WrapError(&googleapi.Error{
1440 Code: res.StatusCode,
1441 Header: res.Header,
1442 })
1443 }
1444 if err != nil {
1445 return nil, err
1446 }
1447 defer googleapi.CloseBody(res)
1448 if err := googleapi.CheckResponse(res); err != nil {
1449 return nil, gensupport.WrapError(err)
1450 }
1451 ret := &Location{
1452 ServerResponse: googleapi.ServerResponse{
1453 Header: res.Header,
1454 HTTPStatusCode: res.StatusCode,
1455 },
1456 }
1457 target := &ret
1458 b, err := gensupport.DecodeResponseBytes(target, res)
1459 if err != nil {
1460 return nil, err
1461 }
1462 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.get", "response", internallog.HTTPResponse(res, b))
1463 return ret, nil
1464 }
1465
1466 type ProjectsLocationsListCall struct {
1467 s *Service
1468 name string
1469 urlParams_ gensupport.URLParams
1470 ifNoneMatch_ string
1471 ctx_ context.Context
1472 header_ http.Header
1473 }
1474
1475 // List: Lists information about the supported locations for this service. This
1476 // method lists locations based on the resource scope provided in the
1477 // [ListLocationsRequest.name] field: * **Global locations**: If `name` is
1478 // empty, the method lists the public locations available to all projects. *
1479 // **Project-specific locations**: If `name` follows the format
1480 // `projects/{project}`, the method lists locations visible to that specific
1481 // project. This includes public, private, or other project-specific locations
1482 // enabled for the project. For gRPC and client library implementations, the
1483 // resource name is passed as the `name` field. For direct service calls, the
1484 // resource name is incorporated into the request path based on the specific
1485 // service implementation and version.
1486 //
1487 // - name: The resource that owns the locations collection, if applicable.
1488 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1489 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1490 c.name = name
1491 return c
1492 }
1493
1494 // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not
1495 // use this field. It is unsupported and is ignored unless explicitly
1496 // documented otherwise. This is primarily for internal usage.
1497 func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall {
1498 c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...))
1499 return c
1500 }
1501
1502 // Filter sets the optional parameter "filter": A filter to narrow down results
1503 // to a preferred subset. The filtering language accepts strings like
1504 // "displayName=tokyo", and is documented in more detail in AIP-160
1505 // (https://google.aip.dev/160).
1506 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1507 c.urlParams_.Set("filter", filter)
1508 return c
1509 }
1510
1511 // PageSize sets the optional parameter "pageSize": The maximum number of
1512 // results to return. If not set, the service selects a default.
1513 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1514 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1515 return c
1516 }
1517
1518 // PageToken sets the optional parameter "pageToken": A page token received
1519 // from the `next_page_token` field in the response. Send that page token to
1520 // receive the subsequent page.
1521 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1522 c.urlParams_.Set("pageToken", pageToken)
1523 return c
1524 }
1525
1526 // Fields allows partial responses to be retrieved. See
1527 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1528 // details.
1529 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1530 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1531 return c
1532 }
1533
1534 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1535 // object's ETag matches the given value. This is useful for getting updates
1536 // only after the object has changed since the last request.
1537 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1538 c.ifNoneMatch_ = entityTag
1539 return c
1540 }
1541
1542 // Context sets the context to be used in this call's Do method.
1543 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1544 c.ctx_ = ctx
1545 return c
1546 }
1547
1548 // Header returns a http.Header that can be modified by the caller to add
1549 // headers to the request.
1550 func (c *ProjectsLocationsListCall) Header() http.Header {
1551 if c.header_ == nil {
1552 c.header_ = make(http.Header)
1553 }
1554 return c.header_
1555 }
1556
1557 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1558 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1559 if c.ifNoneMatch_ != "" {
1560 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1561 }
1562 c.urlParams_.Set("alt", alt)
1563 c.urlParams_.Set("prettyPrint", "false")
1564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1565 urls += "?" + c.urlParams_.Encode()
1566 req, err := http.NewRequest("GET", urls, nil)
1567 if err != nil {
1568 return nil, err
1569 }
1570 req.Header = reqHeaders
1571 googleapi.Expand(req.URL, map[string]string{
1572 "name": c.name,
1573 })
1574 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
1575 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1576 }
1577
1578 // Do executes the "looker.projects.locations.list" call.
1579 // Any non-2xx status code is an error. Response headers are in either
1580 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
1581 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1582 // check whether the returned error was because http.StatusNotModified was
1583 // returned.
1584 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1585 gensupport.SetOptions(c.urlParams_, opts...)
1586 res, err := c.doRequest("json")
1587 if res != nil && res.StatusCode == http.StatusNotModified {
1588 if res.Body != nil {
1589 res.Body.Close()
1590 }
1591 return nil, gensupport.WrapError(&googleapi.Error{
1592 Code: res.StatusCode,
1593 Header: res.Header,
1594 })
1595 }
1596 if err != nil {
1597 return nil, err
1598 }
1599 defer googleapi.CloseBody(res)
1600 if err := googleapi.CheckResponse(res); err != nil {
1601 return nil, gensupport.WrapError(err)
1602 }
1603 ret := &ListLocationsResponse{
1604 ServerResponse: googleapi.ServerResponse{
1605 Header: res.Header,
1606 HTTPStatusCode: res.StatusCode,
1607 },
1608 }
1609 target := &ret
1610 b, err := gensupport.DecodeResponseBytes(target, res)
1611 if err != nil {
1612 return nil, err
1613 }
1614 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.list", "response", internallog.HTTPResponse(res, b))
1615 return ret, nil
1616 }
1617
1618 // Pages invokes f for each page of results.
1619 // A non-nil error returned from f will halt the iteration.
1620 // The provided context supersedes any context provided to the Context method.
1621 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1622 c.ctx_ = ctx
1623 defer c.PageToken(c.urlParams_.Get("pageToken"))
1624 for {
1625 x, err := c.Do()
1626 if err != nil {
1627 return err
1628 }
1629 if err := f(x); err != nil {
1630 return err
1631 }
1632 if x.NextPageToken == "" {
1633 return nil
1634 }
1635 c.PageToken(x.NextPageToken)
1636 }
1637 }
1638
1639 type ProjectsLocationsInstancesCreateCall struct {
1640 s *Service
1641 parent string
1642 instance *Instance
1643 urlParams_ gensupport.URLParams
1644 ctx_ context.Context
1645 header_ http.Header
1646 }
1647
1648 // Create: Creates a new Instance in a given project and location.
1649 //
1650 // - parent: Format: `projects/{project}/locations/{location}`.
1651 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
1652 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1653 c.parent = parent
1654 c.instance = instance
1655 return c
1656 }
1657
1658 // InstanceId sets the optional parameter "instanceId": Required. The unique
1659 // instance identifier. Must contain only lowercase letters, numbers, or
1660 // hyphens, with the first character a letter and the last a letter or a
1661 // number. 63 characters maximum.
1662 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
1663 c.urlParams_.Set("instanceId", instanceId)
1664 return c
1665 }
1666
1667 // Fields allows partial responses to be retrieved. See
1668 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1669 // details.
1670 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
1671 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1672 return c
1673 }
1674
1675 // Context sets the context to be used in this call's Do method.
1676 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
1677 c.ctx_ = ctx
1678 return c
1679 }
1680
1681 // Header returns a http.Header that can be modified by the caller to add
1682 // headers to the request.
1683 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
1684 if c.header_ == nil {
1685 c.header_ = make(http.Header)
1686 }
1687 return c.header_
1688 }
1689
1690 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
1691 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1692 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance)
1693 if err != nil {
1694 return nil, err
1695 }
1696 c.urlParams_.Set("alt", alt)
1697 c.urlParams_.Set("prettyPrint", "false")
1698 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
1699 urls += "?" + c.urlParams_.Encode()
1700 req, err := http.NewRequest("POST", urls, body)
1701 if err != nil {
1702 return nil, err
1703 }
1704 req.Header = reqHeaders
1705 googleapi.Expand(req.URL, map[string]string{
1706 "parent": c.parent,
1707 })
1708 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.create", "request", internallog.HTTPRequest(req, body.Bytes()))
1709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1710 }
1711
1712 // Do executes the "looker.projects.locations.instances.create" call.
1713 // Any non-2xx status code is an error. Response headers are in either
1714 // *Operation.ServerResponse.Header or (if a response was returned at all) in
1715 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1716 // whether the returned error was because http.StatusNotModified was returned.
1717 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1718 gensupport.SetOptions(c.urlParams_, opts...)
1719 res, err := c.doRequest("json")
1720 if res != nil && res.StatusCode == http.StatusNotModified {
1721 if res.Body != nil {
1722 res.Body.Close()
1723 }
1724 return nil, gensupport.WrapError(&googleapi.Error{
1725 Code: res.StatusCode,
1726 Header: res.Header,
1727 })
1728 }
1729 if err != nil {
1730 return nil, err
1731 }
1732 defer googleapi.CloseBody(res)
1733 if err := googleapi.CheckResponse(res); err != nil {
1734 return nil, gensupport.WrapError(err)
1735 }
1736 ret := &Operation{
1737 ServerResponse: googleapi.ServerResponse{
1738 Header: res.Header,
1739 HTTPStatusCode: res.StatusCode,
1740 },
1741 }
1742 target := &ret
1743 b, err := gensupport.DecodeResponseBytes(target, res)
1744 if err != nil {
1745 return nil, err
1746 }
1747 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.create", "response", internallog.HTTPResponse(res, b))
1748 return ret, nil
1749 }
1750
1751 type ProjectsLocationsInstancesDeleteCall struct {
1752 s *Service
1753 name string
1754 urlParams_ gensupport.URLParams
1755 ctx_ context.Context
1756 header_ http.Header
1757 }
1758
1759 // Delete: Delete instance.
1760 //
1761 // - name: Format:
1762 // `projects/{project}/locations/{location}/instances/{instance}`.
1763 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
1764 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1765 c.name = name
1766 return c
1767 }
1768
1769 // Force sets the optional parameter "force": Whether to force cascading
1770 // delete.
1771 func (c *ProjectsLocationsInstancesDeleteCall) Force(force bool) *ProjectsLocationsInstancesDeleteCall {
1772 c.urlParams_.Set("force", fmt.Sprint(force))
1773 return c
1774 }
1775
1776 // Fields allows partial responses to be retrieved. See
1777 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1778 // details.
1779 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
1780 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1781 return c
1782 }
1783
1784 // Context sets the context to be used in this call's Do method.
1785 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
1786 c.ctx_ = ctx
1787 return c
1788 }
1789
1790 // Header returns a http.Header that can be modified by the caller to add
1791 // headers to the request.
1792 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
1793 if c.header_ == nil {
1794 c.header_ = make(http.Header)
1795 }
1796 return c.header_
1797 }
1798
1799 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
1800 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1801 c.urlParams_.Set("alt", alt)
1802 c.urlParams_.Set("prettyPrint", "false")
1803 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1804 urls += "?" + c.urlParams_.Encode()
1805 req, err := http.NewRequest("DELETE", urls, nil)
1806 if err != nil {
1807 return nil, err
1808 }
1809 req.Header = reqHeaders
1810 googleapi.Expand(req.URL, map[string]string{
1811 "name": c.name,
1812 })
1813 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.delete", "request", internallog.HTTPRequest(req, nil))
1814 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1815 }
1816
1817 // Do executes the "looker.projects.locations.instances.delete" call.
1818 // Any non-2xx status code is an error. Response headers are in either
1819 // *Operation.ServerResponse.Header or (if a response was returned at all) in
1820 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1821 // whether the returned error was because http.StatusNotModified was returned.
1822 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1823 gensupport.SetOptions(c.urlParams_, opts...)
1824 res, err := c.doRequest("json")
1825 if res != nil && res.StatusCode == http.StatusNotModified {
1826 if res.Body != nil {
1827 res.Body.Close()
1828 }
1829 return nil, gensupport.WrapError(&googleapi.Error{
1830 Code: res.StatusCode,
1831 Header: res.Header,
1832 })
1833 }
1834 if err != nil {
1835 return nil, err
1836 }
1837 defer googleapi.CloseBody(res)
1838 if err := googleapi.CheckResponse(res); err != nil {
1839 return nil, gensupport.WrapError(err)
1840 }
1841 ret := &Operation{
1842 ServerResponse: googleapi.ServerResponse{
1843 Header: res.Header,
1844 HTTPStatusCode: res.StatusCode,
1845 },
1846 }
1847 target := &ret
1848 b, err := gensupport.DecodeResponseBytes(target, res)
1849 if err != nil {
1850 return nil, err
1851 }
1852 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.delete", "response", internallog.HTTPResponse(res, b))
1853 return ret, nil
1854 }
1855
1856 type ProjectsLocationsInstancesExportCall struct {
1857 s *Service
1858 name string
1859 exportinstancerequest *ExportInstanceRequest
1860 urlParams_ gensupport.URLParams
1861 ctx_ context.Context
1862 header_ http.Header
1863 }
1864
1865 // Export: Export instance.
1866 //
1867 // - name: Format:
1868 // `projects/{project}/locations/{location}/instances/{instance}`.
1869 func (r *ProjectsLocationsInstancesService) Export(name string, exportinstancerequest *ExportInstanceRequest) *ProjectsLocationsInstancesExportCall {
1870 c := &ProjectsLocationsInstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1871 c.name = name
1872 c.exportinstancerequest = exportinstancerequest
1873 return c
1874 }
1875
1876 // Fields allows partial responses to be retrieved. See
1877 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1878 // details.
1879 func (c *ProjectsLocationsInstancesExportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesExportCall {
1880 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1881 return c
1882 }
1883
1884 // Context sets the context to be used in this call's Do method.
1885 func (c *ProjectsLocationsInstancesExportCall) Context(ctx context.Context) *ProjectsLocationsInstancesExportCall {
1886 c.ctx_ = ctx
1887 return c
1888 }
1889
1890 // Header returns a http.Header that can be modified by the caller to add
1891 // headers to the request.
1892 func (c *ProjectsLocationsInstancesExportCall) Header() http.Header {
1893 if c.header_ == nil {
1894 c.header_ = make(http.Header)
1895 }
1896 return c.header_
1897 }
1898
1899 func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) {
1900 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1901 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.exportinstancerequest)
1902 if err != nil {
1903 return nil, err
1904 }
1905 c.urlParams_.Set("alt", alt)
1906 c.urlParams_.Set("prettyPrint", "false")
1907 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:export")
1908 urls += "?" + c.urlParams_.Encode()
1909 req, err := http.NewRequest("POST", urls, body)
1910 if err != nil {
1911 return nil, err
1912 }
1913 req.Header = reqHeaders
1914 googleapi.Expand(req.URL, map[string]string{
1915 "name": c.name,
1916 })
1917 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.export", "request", internallog.HTTPRequest(req, body.Bytes()))
1918 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1919 }
1920
1921 // Do executes the "looker.projects.locations.instances.export" call.
1922 // Any non-2xx status code is an error. Response headers are in either
1923 // *Operation.ServerResponse.Header or (if a response was returned at all) in
1924 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1925 // whether the returned error was because http.StatusNotModified was returned.
1926 func (c *ProjectsLocationsInstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1927 gensupport.SetOptions(c.urlParams_, opts...)
1928 res, err := c.doRequest("json")
1929 if res != nil && res.StatusCode == http.StatusNotModified {
1930 if res.Body != nil {
1931 res.Body.Close()
1932 }
1933 return nil, gensupport.WrapError(&googleapi.Error{
1934 Code: res.StatusCode,
1935 Header: res.Header,
1936 })
1937 }
1938 if err != nil {
1939 return nil, err
1940 }
1941 defer googleapi.CloseBody(res)
1942 if err := googleapi.CheckResponse(res); err != nil {
1943 return nil, gensupport.WrapError(err)
1944 }
1945 ret := &Operation{
1946 ServerResponse: googleapi.ServerResponse{
1947 Header: res.Header,
1948 HTTPStatusCode: res.StatusCode,
1949 },
1950 }
1951 target := &ret
1952 b, err := gensupport.DecodeResponseBytes(target, res)
1953 if err != nil {
1954 return nil, err
1955 }
1956 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.export", "response", internallog.HTTPResponse(res, b))
1957 return ret, nil
1958 }
1959
1960 type ProjectsLocationsInstancesGetCall struct {
1961 s *Service
1962 name string
1963 urlParams_ gensupport.URLParams
1964 ifNoneMatch_ string
1965 ctx_ context.Context
1966 header_ http.Header
1967 }
1968
1969 // Get: Gets details of a single Instance.
1970 //
1971 // - name: Format:
1972 // `projects/{project}/locations/{location}/instances/{instance}`.
1973 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
1974 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1975 c.name = name
1976 return c
1977 }
1978
1979 // Fields allows partial responses to be retrieved. See
1980 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1981 // details.
1982 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
1983 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1984 return c
1985 }
1986
1987 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1988 // object's ETag matches the given value. This is useful for getting updates
1989 // only after the object has changed since the last request.
1990 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
1991 c.ifNoneMatch_ = entityTag
1992 return c
1993 }
1994
1995 // Context sets the context to be used in this call's Do method.
1996 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
1997 c.ctx_ = ctx
1998 return c
1999 }
2000
2001 // Header returns a http.Header that can be modified by the caller to add
2002 // headers to the request.
2003 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
2004 if c.header_ == nil {
2005 c.header_ = make(http.Header)
2006 }
2007 return c.header_
2008 }
2009
2010 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
2011 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2012 if c.ifNoneMatch_ != "" {
2013 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2014 }
2015 c.urlParams_.Set("alt", alt)
2016 c.urlParams_.Set("prettyPrint", "false")
2017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2018 urls += "?" + c.urlParams_.Encode()
2019 req, err := http.NewRequest("GET", urls, nil)
2020 if err != nil {
2021 return nil, err
2022 }
2023 req.Header = reqHeaders
2024 googleapi.Expand(req.URL, map[string]string{
2025 "name": c.name,
2026 })
2027 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.get", "request", internallog.HTTPRequest(req, nil))
2028 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2029 }
2030
2031 // Do executes the "looker.projects.locations.instances.get" call.
2032 // Any non-2xx status code is an error. Response headers are in either
2033 // *Instance.ServerResponse.Header or (if a response was returned at all) in
2034 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2035 // whether the returned error was because http.StatusNotModified was returned.
2036 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
2037 gensupport.SetOptions(c.urlParams_, opts...)
2038 res, err := c.doRequest("json")
2039 if res != nil && res.StatusCode == http.StatusNotModified {
2040 if res.Body != nil {
2041 res.Body.Close()
2042 }
2043 return nil, gensupport.WrapError(&googleapi.Error{
2044 Code: res.StatusCode,
2045 Header: res.Header,
2046 })
2047 }
2048 if err != nil {
2049 return nil, err
2050 }
2051 defer googleapi.CloseBody(res)
2052 if err := googleapi.CheckResponse(res); err != nil {
2053 return nil, gensupport.WrapError(err)
2054 }
2055 ret := &Instance{
2056 ServerResponse: googleapi.ServerResponse{
2057 Header: res.Header,
2058 HTTPStatusCode: res.StatusCode,
2059 },
2060 }
2061 target := &ret
2062 b, err := gensupport.DecodeResponseBytes(target, res)
2063 if err != nil {
2064 return nil, err
2065 }
2066 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.get", "response", internallog.HTTPResponse(res, b))
2067 return ret, nil
2068 }
2069
2070 type ProjectsLocationsInstancesImportCall struct {
2071 s *Service
2072 name string
2073 importinstancerequest *ImportInstanceRequest
2074 urlParams_ gensupport.URLParams
2075 ctx_ context.Context
2076 header_ http.Header
2077 }
2078
2079 // Import: Import instance.
2080 //
2081 // - name: Format:
2082 // `projects/{project}/locations/{location}/instances/{instance}`.
2083 func (r *ProjectsLocationsInstancesService) Import(name string, importinstancerequest *ImportInstanceRequest) *ProjectsLocationsInstancesImportCall {
2084 c := &ProjectsLocationsInstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2085 c.name = name
2086 c.importinstancerequest = importinstancerequest
2087 return c
2088 }
2089
2090 // Fields allows partial responses to be retrieved. See
2091 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2092 // details.
2093 func (c *ProjectsLocationsInstancesImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesImportCall {
2094 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2095 return c
2096 }
2097
2098 // Context sets the context to be used in this call's Do method.
2099 func (c *ProjectsLocationsInstancesImportCall) Context(ctx context.Context) *ProjectsLocationsInstancesImportCall {
2100 c.ctx_ = ctx
2101 return c
2102 }
2103
2104 // Header returns a http.Header that can be modified by the caller to add
2105 // headers to the request.
2106 func (c *ProjectsLocationsInstancesImportCall) Header() http.Header {
2107 if c.header_ == nil {
2108 c.header_ = make(http.Header)
2109 }
2110 return c.header_
2111 }
2112
2113 func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) {
2114 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2115 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.importinstancerequest)
2116 if err != nil {
2117 return nil, err
2118 }
2119 c.urlParams_.Set("alt", alt)
2120 c.urlParams_.Set("prettyPrint", "false")
2121 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:import")
2122 urls += "?" + c.urlParams_.Encode()
2123 req, err := http.NewRequest("POST", urls, body)
2124 if err != nil {
2125 return nil, err
2126 }
2127 req.Header = reqHeaders
2128 googleapi.Expand(req.URL, map[string]string{
2129 "name": c.name,
2130 })
2131 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.import", "request", internallog.HTTPRequest(req, body.Bytes()))
2132 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2133 }
2134
2135 // Do executes the "looker.projects.locations.instances.import" call.
2136 // Any non-2xx status code is an error. Response headers are in either
2137 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2138 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2139 // whether the returned error was because http.StatusNotModified was returned.
2140 func (c *ProjectsLocationsInstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2141 gensupport.SetOptions(c.urlParams_, opts...)
2142 res, err := c.doRequest("json")
2143 if res != nil && res.StatusCode == http.StatusNotModified {
2144 if res.Body != nil {
2145 res.Body.Close()
2146 }
2147 return nil, gensupport.WrapError(&googleapi.Error{
2148 Code: res.StatusCode,
2149 Header: res.Header,
2150 })
2151 }
2152 if err != nil {
2153 return nil, err
2154 }
2155 defer googleapi.CloseBody(res)
2156 if err := googleapi.CheckResponse(res); err != nil {
2157 return nil, gensupport.WrapError(err)
2158 }
2159 ret := &Operation{
2160 ServerResponse: googleapi.ServerResponse{
2161 Header: res.Header,
2162 HTTPStatusCode: res.StatusCode,
2163 },
2164 }
2165 target := &ret
2166 b, err := gensupport.DecodeResponseBytes(target, res)
2167 if err != nil {
2168 return nil, err
2169 }
2170 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.import", "response", internallog.HTTPResponse(res, b))
2171 return ret, nil
2172 }
2173
2174 type ProjectsLocationsInstancesListCall struct {
2175 s *Service
2176 parent string
2177 urlParams_ gensupport.URLParams
2178 ifNoneMatch_ string
2179 ctx_ context.Context
2180 header_ http.Header
2181 }
2182
2183 // List: Lists Instances in a given project and location.
2184 //
2185 // - parent: Format: `projects/{project}/locations/{location}`.
2186 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
2187 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2188 c.parent = parent
2189 return c
2190 }
2191
2192 // PageSize sets the optional parameter "pageSize": The maximum number of
2193 // instances to return. If unspecified at most 256 will be returned. The
2194 // maximum possible value is 2048.
2195 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
2196 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2197 return c
2198 }
2199
2200 // PageToken sets the optional parameter "pageToken": A page token received
2201 // from a previous ListInstancesRequest.
2202 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
2203 c.urlParams_.Set("pageToken", pageToken)
2204 return c
2205 }
2206
2207 // Fields allows partial responses to be retrieved. See
2208 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2209 // details.
2210 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
2211 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2212 return c
2213 }
2214
2215 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2216 // object's ETag matches the given value. This is useful for getting updates
2217 // only after the object has changed since the last request.
2218 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
2219 c.ifNoneMatch_ = entityTag
2220 return c
2221 }
2222
2223 // Context sets the context to be used in this call's Do method.
2224 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
2225 c.ctx_ = ctx
2226 return c
2227 }
2228
2229 // Header returns a http.Header that can be modified by the caller to add
2230 // headers to the request.
2231 func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
2232 if c.header_ == nil {
2233 c.header_ = make(http.Header)
2234 }
2235 return c.header_
2236 }
2237
2238 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
2239 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2240 if c.ifNoneMatch_ != "" {
2241 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2242 }
2243 c.urlParams_.Set("alt", alt)
2244 c.urlParams_.Set("prettyPrint", "false")
2245 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2246 urls += "?" + c.urlParams_.Encode()
2247 req, err := http.NewRequest("GET", urls, nil)
2248 if err != nil {
2249 return nil, err
2250 }
2251 req.Header = reqHeaders
2252 googleapi.Expand(req.URL, map[string]string{
2253 "parent": c.parent,
2254 })
2255 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.list", "request", internallog.HTTPRequest(req, nil))
2256 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2257 }
2258
2259 // Do executes the "looker.projects.locations.instances.list" call.
2260 // Any non-2xx status code is an error. Response headers are in either
2261 // *ListInstancesResponse.ServerResponse.Header or (if a response was returned
2262 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2263 // check whether the returned error was because http.StatusNotModified was
2264 // returned.
2265 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
2266 gensupport.SetOptions(c.urlParams_, opts...)
2267 res, err := c.doRequest("json")
2268 if res != nil && res.StatusCode == http.StatusNotModified {
2269 if res.Body != nil {
2270 res.Body.Close()
2271 }
2272 return nil, gensupport.WrapError(&googleapi.Error{
2273 Code: res.StatusCode,
2274 Header: res.Header,
2275 })
2276 }
2277 if err != nil {
2278 return nil, err
2279 }
2280 defer googleapi.CloseBody(res)
2281 if err := googleapi.CheckResponse(res); err != nil {
2282 return nil, gensupport.WrapError(err)
2283 }
2284 ret := &ListInstancesResponse{
2285 ServerResponse: googleapi.ServerResponse{
2286 Header: res.Header,
2287 HTTPStatusCode: res.StatusCode,
2288 },
2289 }
2290 target := &ret
2291 b, err := gensupport.DecodeResponseBytes(target, res)
2292 if err != nil {
2293 return nil, err
2294 }
2295 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.list", "response", internallog.HTTPResponse(res, b))
2296 return ret, nil
2297 }
2298
2299 // Pages invokes f for each page of results.
2300 // A non-nil error returned from f will halt the iteration.
2301 // The provided context supersedes any context provided to the Context method.
2302 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
2303 c.ctx_ = ctx
2304 defer c.PageToken(c.urlParams_.Get("pageToken"))
2305 for {
2306 x, err := c.Do()
2307 if err != nil {
2308 return err
2309 }
2310 if err := f(x); err != nil {
2311 return err
2312 }
2313 if x.NextPageToken == "" {
2314 return nil
2315 }
2316 c.PageToken(x.NextPageToken)
2317 }
2318 }
2319
2320 type ProjectsLocationsInstancesPatchCall struct {
2321 s *Service
2322 name string
2323 instance *Instance
2324 urlParams_ gensupport.URLParams
2325 ctx_ context.Context
2326 header_ http.Header
2327 }
2328
2329 // Patch: Update Instance.
2330 //
2331 // - name: Output only. Format:
2332 // `projects/{project}/locations/{location}/instances/{instance}`.
2333 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
2334 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2335 c.name = name
2336 c.instance = instance
2337 return c
2338 }
2339
2340 // UpdateMask sets the optional parameter "updateMask": Required. Field mask
2341 // used to specify the fields to be overwritten in the Instance resource by the
2342 // update. The fields specified in the mask are relative to the resource, not
2343 // the full request. A field will be overwritten if it is in the mask.
2344 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
2345 c.urlParams_.Set("updateMask", updateMask)
2346 return c
2347 }
2348
2349 // Fields allows partial responses to be retrieved. See
2350 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2351 // details.
2352 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
2353 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2354 return c
2355 }
2356
2357 // Context sets the context to be used in this call's Do method.
2358 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
2359 c.ctx_ = ctx
2360 return c
2361 }
2362
2363 // Header returns a http.Header that can be modified by the caller to add
2364 // headers to the request.
2365 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
2366 if c.header_ == nil {
2367 c.header_ = make(http.Header)
2368 }
2369 return c.header_
2370 }
2371
2372 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
2373 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2374 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance)
2375 if err != nil {
2376 return nil, err
2377 }
2378 c.urlParams_.Set("alt", alt)
2379 c.urlParams_.Set("prettyPrint", "false")
2380 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2381 urls += "?" + c.urlParams_.Encode()
2382 req, err := http.NewRequest("PATCH", urls, body)
2383 if err != nil {
2384 return nil, err
2385 }
2386 req.Header = reqHeaders
2387 googleapi.Expand(req.URL, map[string]string{
2388 "name": c.name,
2389 })
2390 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
2391 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2392 }
2393
2394 // Do executes the "looker.projects.locations.instances.patch" call.
2395 // Any non-2xx status code is an error. Response headers are in either
2396 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2397 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2398 // whether the returned error was because http.StatusNotModified was returned.
2399 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2400 gensupport.SetOptions(c.urlParams_, opts...)
2401 res, err := c.doRequest("json")
2402 if res != nil && res.StatusCode == http.StatusNotModified {
2403 if res.Body != nil {
2404 res.Body.Close()
2405 }
2406 return nil, gensupport.WrapError(&googleapi.Error{
2407 Code: res.StatusCode,
2408 Header: res.Header,
2409 })
2410 }
2411 if err != nil {
2412 return nil, err
2413 }
2414 defer googleapi.CloseBody(res)
2415 if err := googleapi.CheckResponse(res); err != nil {
2416 return nil, gensupport.WrapError(err)
2417 }
2418 ret := &Operation{
2419 ServerResponse: googleapi.ServerResponse{
2420 Header: res.Header,
2421 HTTPStatusCode: res.StatusCode,
2422 },
2423 }
2424 target := &ret
2425 b, err := gensupport.DecodeResponseBytes(target, res)
2426 if err != nil {
2427 return nil, err
2428 }
2429 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.patch", "response", internallog.HTTPResponse(res, b))
2430 return ret, nil
2431 }
2432
2433 type ProjectsLocationsInstancesRestartCall struct {
2434 s *Service
2435 name string
2436 restartinstancerequest *RestartInstanceRequest
2437 urlParams_ gensupport.URLParams
2438 ctx_ context.Context
2439 header_ http.Header
2440 }
2441
2442 // Restart: Restart instance.
2443 //
2444 // - name: Format:
2445 // `projects/{project}/locations/{location}/instances/{instance}`.
2446 func (r *ProjectsLocationsInstancesService) Restart(name string, restartinstancerequest *RestartInstanceRequest) *ProjectsLocationsInstancesRestartCall {
2447 c := &ProjectsLocationsInstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2448 c.name = name
2449 c.restartinstancerequest = restartinstancerequest
2450 return c
2451 }
2452
2453 // Fields allows partial responses to be retrieved. See
2454 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2455 // details.
2456 func (c *ProjectsLocationsInstancesRestartCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRestartCall {
2457 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2458 return c
2459 }
2460
2461 // Context sets the context to be used in this call's Do method.
2462 func (c *ProjectsLocationsInstancesRestartCall) Context(ctx context.Context) *ProjectsLocationsInstancesRestartCall {
2463 c.ctx_ = ctx
2464 return c
2465 }
2466
2467 // Header returns a http.Header that can be modified by the caller to add
2468 // headers to the request.
2469 func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header {
2470 if c.header_ == nil {
2471 c.header_ = make(http.Header)
2472 }
2473 return c.header_
2474 }
2475
2476 func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) {
2477 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2478 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restartinstancerequest)
2479 if err != nil {
2480 return nil, err
2481 }
2482 c.urlParams_.Set("alt", alt)
2483 c.urlParams_.Set("prettyPrint", "false")
2484 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restart")
2485 urls += "?" + c.urlParams_.Encode()
2486 req, err := http.NewRequest("POST", urls, body)
2487 if err != nil {
2488 return nil, err
2489 }
2490 req.Header = reqHeaders
2491 googleapi.Expand(req.URL, map[string]string{
2492 "name": c.name,
2493 })
2494 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.restart", "request", internallog.HTTPRequest(req, body.Bytes()))
2495 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2496 }
2497
2498 // Do executes the "looker.projects.locations.instances.restart" call.
2499 // Any non-2xx status code is an error. Response headers are in either
2500 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2501 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2502 // whether the returned error was because http.StatusNotModified was returned.
2503 func (c *ProjectsLocationsInstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2504 gensupport.SetOptions(c.urlParams_, opts...)
2505 res, err := c.doRequest("json")
2506 if res != nil && res.StatusCode == http.StatusNotModified {
2507 if res.Body != nil {
2508 res.Body.Close()
2509 }
2510 return nil, gensupport.WrapError(&googleapi.Error{
2511 Code: res.StatusCode,
2512 Header: res.Header,
2513 })
2514 }
2515 if err != nil {
2516 return nil, err
2517 }
2518 defer googleapi.CloseBody(res)
2519 if err := googleapi.CheckResponse(res); err != nil {
2520 return nil, gensupport.WrapError(err)
2521 }
2522 ret := &Operation{
2523 ServerResponse: googleapi.ServerResponse{
2524 Header: res.Header,
2525 HTTPStatusCode: res.StatusCode,
2526 },
2527 }
2528 target := &ret
2529 b, err := gensupport.DecodeResponseBytes(target, res)
2530 if err != nil {
2531 return nil, err
2532 }
2533 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.restart", "response", internallog.HTTPResponse(res, b))
2534 return ret, nil
2535 }
2536
2537 type ProjectsLocationsInstancesRestoreCall struct {
2538 s *Service
2539 name string
2540 restoreinstancerequest *RestoreInstanceRequest
2541 urlParams_ gensupport.URLParams
2542 ctx_ context.Context
2543 header_ http.Header
2544 }
2545
2546 // Restore: Restore Looker instance.
2547 //
2548 // - name: Instance being restored Format:
2549 // projects/{project}/locations/{location}/instances/{instance}.
2550 func (r *ProjectsLocationsInstancesService) Restore(name string, restoreinstancerequest *RestoreInstanceRequest) *ProjectsLocationsInstancesRestoreCall {
2551 c := &ProjectsLocationsInstancesRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2552 c.name = name
2553 c.restoreinstancerequest = restoreinstancerequest
2554 return c
2555 }
2556
2557 // Fields allows partial responses to be retrieved. See
2558 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2559 // details.
2560 func (c *ProjectsLocationsInstancesRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRestoreCall {
2561 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2562 return c
2563 }
2564
2565 // Context sets the context to be used in this call's Do method.
2566 func (c *ProjectsLocationsInstancesRestoreCall) Context(ctx context.Context) *ProjectsLocationsInstancesRestoreCall {
2567 c.ctx_ = ctx
2568 return c
2569 }
2570
2571 // Header returns a http.Header that can be modified by the caller to add
2572 // headers to the request.
2573 func (c *ProjectsLocationsInstancesRestoreCall) Header() http.Header {
2574 if c.header_ == nil {
2575 c.header_ = make(http.Header)
2576 }
2577 return c.header_
2578 }
2579
2580 func (c *ProjectsLocationsInstancesRestoreCall) doRequest(alt string) (*http.Response, error) {
2581 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2582 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.restoreinstancerequest)
2583 if err != nil {
2584 return nil, err
2585 }
2586 c.urlParams_.Set("alt", alt)
2587 c.urlParams_.Set("prettyPrint", "false")
2588 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restore")
2589 urls += "?" + c.urlParams_.Encode()
2590 req, err := http.NewRequest("POST", urls, body)
2591 if err != nil {
2592 return nil, err
2593 }
2594 req.Header = reqHeaders
2595 googleapi.Expand(req.URL, map[string]string{
2596 "name": c.name,
2597 })
2598 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.restore", "request", internallog.HTTPRequest(req, body.Bytes()))
2599 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2600 }
2601
2602 // Do executes the "looker.projects.locations.instances.restore" call.
2603 // Any non-2xx status code is an error. Response headers are in either
2604 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2605 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2606 // whether the returned error was because http.StatusNotModified was returned.
2607 func (c *ProjectsLocationsInstancesRestoreCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2608 gensupport.SetOptions(c.urlParams_, opts...)
2609 res, err := c.doRequest("json")
2610 if res != nil && res.StatusCode == http.StatusNotModified {
2611 if res.Body != nil {
2612 res.Body.Close()
2613 }
2614 return nil, gensupport.WrapError(&googleapi.Error{
2615 Code: res.StatusCode,
2616 Header: res.Header,
2617 })
2618 }
2619 if err != nil {
2620 return nil, err
2621 }
2622 defer googleapi.CloseBody(res)
2623 if err := googleapi.CheckResponse(res); err != nil {
2624 return nil, gensupport.WrapError(err)
2625 }
2626 ret := &Operation{
2627 ServerResponse: googleapi.ServerResponse{
2628 Header: res.Header,
2629 HTTPStatusCode: res.StatusCode,
2630 },
2631 }
2632 target := &ret
2633 b, err := gensupport.DecodeResponseBytes(target, res)
2634 if err != nil {
2635 return nil, err
2636 }
2637 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.restore", "response", internallog.HTTPResponse(res, b))
2638 return ret, nil
2639 }
2640
2641 type ProjectsLocationsInstancesBackupsCreateCall struct {
2642 s *Service
2643 parent string
2644 instancebackup *InstanceBackup
2645 urlParams_ gensupport.URLParams
2646 ctx_ context.Context
2647 header_ http.Header
2648 }
2649
2650 // Create: Backup Looker instance.
2651 //
2652 // - parent: Format:
2653 // projects/{project}/locations/{location}/instances/{instance}.
2654 func (r *ProjectsLocationsInstancesBackupsService) Create(parent string, instancebackup *InstanceBackup) *ProjectsLocationsInstancesBackupsCreateCall {
2655 c := &ProjectsLocationsInstancesBackupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2656 c.parent = parent
2657 c.instancebackup = instancebackup
2658 return c
2659 }
2660
2661 // Fields allows partial responses to be retrieved. See
2662 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2663 // details.
2664 func (c *ProjectsLocationsInstancesBackupsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsCreateCall {
2665 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2666 return c
2667 }
2668
2669 // Context sets the context to be used in this call's Do method.
2670 func (c *ProjectsLocationsInstancesBackupsCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsCreateCall {
2671 c.ctx_ = ctx
2672 return c
2673 }
2674
2675 // Header returns a http.Header that can be modified by the caller to add
2676 // headers to the request.
2677 func (c *ProjectsLocationsInstancesBackupsCreateCall) Header() http.Header {
2678 if c.header_ == nil {
2679 c.header_ = make(http.Header)
2680 }
2681 return c.header_
2682 }
2683
2684 func (c *ProjectsLocationsInstancesBackupsCreateCall) doRequest(alt string) (*http.Response, error) {
2685 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2686 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instancebackup)
2687 if err != nil {
2688 return nil, err
2689 }
2690 c.urlParams_.Set("alt", alt)
2691 c.urlParams_.Set("prettyPrint", "false")
2692 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
2693 urls += "?" + c.urlParams_.Encode()
2694 req, err := http.NewRequest("POST", urls, body)
2695 if err != nil {
2696 return nil, err
2697 }
2698 req.Header = reqHeaders
2699 googleapi.Expand(req.URL, map[string]string{
2700 "parent": c.parent,
2701 })
2702 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2703 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2704 }
2705
2706 // Do executes the "looker.projects.locations.instances.backups.create" call.
2707 // Any non-2xx status code is an error. Response headers are in either
2708 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2709 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2710 // whether the returned error was because http.StatusNotModified was returned.
2711 func (c *ProjectsLocationsInstancesBackupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2712 gensupport.SetOptions(c.urlParams_, opts...)
2713 res, err := c.doRequest("json")
2714 if res != nil && res.StatusCode == http.StatusNotModified {
2715 if res.Body != nil {
2716 res.Body.Close()
2717 }
2718 return nil, gensupport.WrapError(&googleapi.Error{
2719 Code: res.StatusCode,
2720 Header: res.Header,
2721 })
2722 }
2723 if err != nil {
2724 return nil, err
2725 }
2726 defer googleapi.CloseBody(res)
2727 if err := googleapi.CheckResponse(res); err != nil {
2728 return nil, gensupport.WrapError(err)
2729 }
2730 ret := &Operation{
2731 ServerResponse: googleapi.ServerResponse{
2732 Header: res.Header,
2733 HTTPStatusCode: res.StatusCode,
2734 },
2735 }
2736 target := &ret
2737 b, err := gensupport.DecodeResponseBytes(target, res)
2738 if err != nil {
2739 return nil, err
2740 }
2741 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.create", "response", internallog.HTTPResponse(res, b))
2742 return ret, nil
2743 }
2744
2745 type ProjectsLocationsInstancesBackupsDeleteCall struct {
2746 s *Service
2747 name string
2748 urlParams_ gensupport.URLParams
2749 ctx_ context.Context
2750 header_ http.Header
2751 }
2752
2753 // Delete: Delete backup.
2754 //
2755 // - name: Format:
2756 // projects/{project}/locations/{location}/instances/{instance}/backups/{backu
2757 // p}.
2758 func (r *ProjectsLocationsInstancesBackupsService) Delete(name string) *ProjectsLocationsInstancesBackupsDeleteCall {
2759 c := &ProjectsLocationsInstancesBackupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2760 c.name = name
2761 return c
2762 }
2763
2764 // Fields allows partial responses to be retrieved. See
2765 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2766 // details.
2767 func (c *ProjectsLocationsInstancesBackupsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsDeleteCall {
2768 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2769 return c
2770 }
2771
2772 // Context sets the context to be used in this call's Do method.
2773 func (c *ProjectsLocationsInstancesBackupsDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsDeleteCall {
2774 c.ctx_ = ctx
2775 return c
2776 }
2777
2778 // Header returns a http.Header that can be modified by the caller to add
2779 // headers to the request.
2780 func (c *ProjectsLocationsInstancesBackupsDeleteCall) Header() http.Header {
2781 if c.header_ == nil {
2782 c.header_ = make(http.Header)
2783 }
2784 return c.header_
2785 }
2786
2787 func (c *ProjectsLocationsInstancesBackupsDeleteCall) doRequest(alt string) (*http.Response, error) {
2788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2789 c.urlParams_.Set("alt", alt)
2790 c.urlParams_.Set("prettyPrint", "false")
2791 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2792 urls += "?" + c.urlParams_.Encode()
2793 req, err := http.NewRequest("DELETE", urls, nil)
2794 if err != nil {
2795 return nil, err
2796 }
2797 req.Header = reqHeaders
2798 googleapi.Expand(req.URL, map[string]string{
2799 "name": c.name,
2800 })
2801 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.delete", "request", internallog.HTTPRequest(req, nil))
2802 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2803 }
2804
2805 // Do executes the "looker.projects.locations.instances.backups.delete" call.
2806 // Any non-2xx status code is an error. Response headers are in either
2807 // *Operation.ServerResponse.Header or (if a response was returned at all) in
2808 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2809 // whether the returned error was because http.StatusNotModified was returned.
2810 func (c *ProjectsLocationsInstancesBackupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2811 gensupport.SetOptions(c.urlParams_, opts...)
2812 res, err := c.doRequest("json")
2813 if res != nil && res.StatusCode == http.StatusNotModified {
2814 if res.Body != nil {
2815 res.Body.Close()
2816 }
2817 return nil, gensupport.WrapError(&googleapi.Error{
2818 Code: res.StatusCode,
2819 Header: res.Header,
2820 })
2821 }
2822 if err != nil {
2823 return nil, err
2824 }
2825 defer googleapi.CloseBody(res)
2826 if err := googleapi.CheckResponse(res); err != nil {
2827 return nil, gensupport.WrapError(err)
2828 }
2829 ret := &Operation{
2830 ServerResponse: googleapi.ServerResponse{
2831 Header: res.Header,
2832 HTTPStatusCode: res.StatusCode,
2833 },
2834 }
2835 target := &ret
2836 b, err := gensupport.DecodeResponseBytes(target, res)
2837 if err != nil {
2838 return nil, err
2839 }
2840 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.delete", "response", internallog.HTTPResponse(res, b))
2841 return ret, nil
2842 }
2843
2844 type ProjectsLocationsInstancesBackupsGetCall struct {
2845 s *Service
2846 name string
2847 urlParams_ gensupport.URLParams
2848 ifNoneMatch_ string
2849 ctx_ context.Context
2850 header_ http.Header
2851 }
2852
2853 // Get:
2854 //
2855 // - name: Format:
2856 // `projects/{project}/locations/{location}/instances/{instance}/backups/{back
2857 // up}`.
2858 func (r *ProjectsLocationsInstancesBackupsService) Get(name string) *ProjectsLocationsInstancesBackupsGetCall {
2859 c := &ProjectsLocationsInstancesBackupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2860 c.name = name
2861 return c
2862 }
2863
2864 // Fields allows partial responses to be retrieved. See
2865 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2866 // details.
2867 func (c *ProjectsLocationsInstancesBackupsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsGetCall {
2868 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2869 return c
2870 }
2871
2872 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2873 // object's ETag matches the given value. This is useful for getting updates
2874 // only after the object has changed since the last request.
2875 func (c *ProjectsLocationsInstancesBackupsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesBackupsGetCall {
2876 c.ifNoneMatch_ = entityTag
2877 return c
2878 }
2879
2880 // Context sets the context to be used in this call's Do method.
2881 func (c *ProjectsLocationsInstancesBackupsGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsGetCall {
2882 c.ctx_ = ctx
2883 return c
2884 }
2885
2886 // Header returns a http.Header that can be modified by the caller to add
2887 // headers to the request.
2888 func (c *ProjectsLocationsInstancesBackupsGetCall) Header() http.Header {
2889 if c.header_ == nil {
2890 c.header_ = make(http.Header)
2891 }
2892 return c.header_
2893 }
2894
2895 func (c *ProjectsLocationsInstancesBackupsGetCall) doRequest(alt string) (*http.Response, error) {
2896 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2897 if c.ifNoneMatch_ != "" {
2898 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2899 }
2900 c.urlParams_.Set("alt", alt)
2901 c.urlParams_.Set("prettyPrint", "false")
2902 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2903 urls += "?" + c.urlParams_.Encode()
2904 req, err := http.NewRequest("GET", urls, nil)
2905 if err != nil {
2906 return nil, err
2907 }
2908 req.Header = reqHeaders
2909 googleapi.Expand(req.URL, map[string]string{
2910 "name": c.name,
2911 })
2912 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.get", "request", internallog.HTTPRequest(req, nil))
2913 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2914 }
2915
2916 // Do executes the "looker.projects.locations.instances.backups.get" call.
2917 // Any non-2xx status code is an error. Response headers are in either
2918 // *InstanceBackup.ServerResponse.Header or (if a response was returned at all)
2919 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2920 // whether the returned error was because http.StatusNotModified was returned.
2921 func (c *ProjectsLocationsInstancesBackupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceBackup, error) {
2922 gensupport.SetOptions(c.urlParams_, opts...)
2923 res, err := c.doRequest("json")
2924 if res != nil && res.StatusCode == http.StatusNotModified {
2925 if res.Body != nil {
2926 res.Body.Close()
2927 }
2928 return nil, gensupport.WrapError(&googleapi.Error{
2929 Code: res.StatusCode,
2930 Header: res.Header,
2931 })
2932 }
2933 if err != nil {
2934 return nil, err
2935 }
2936 defer googleapi.CloseBody(res)
2937 if err := googleapi.CheckResponse(res); err != nil {
2938 return nil, gensupport.WrapError(err)
2939 }
2940 ret := &InstanceBackup{
2941 ServerResponse: googleapi.ServerResponse{
2942 Header: res.Header,
2943 HTTPStatusCode: res.StatusCode,
2944 },
2945 }
2946 target := &ret
2947 b, err := gensupport.DecodeResponseBytes(target, res)
2948 if err != nil {
2949 return nil, err
2950 }
2951 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.get", "response", internallog.HTTPResponse(res, b))
2952 return ret, nil
2953 }
2954
2955 type ProjectsLocationsInstancesBackupsListCall struct {
2956 s *Service
2957 parent string
2958 urlParams_ gensupport.URLParams
2959 ifNoneMatch_ string
2960 ctx_ context.Context
2961 header_ http.Header
2962 }
2963
2964 // List: List backups of Looker instance.
2965 //
2966 // - parent: Format:
2967 // projects/{project}/locations/{location}/instances/{instance}.
2968 func (r *ProjectsLocationsInstancesBackupsService) List(parent string) *ProjectsLocationsInstancesBackupsListCall {
2969 c := &ProjectsLocationsInstancesBackupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2970 c.parent = parent
2971 return c
2972 }
2973
2974 // OrderBy sets the optional parameter "orderBy": Sort results. Default order
2975 // is "create_time desc". Other supported fields are "state" and "expire_time".
2976 // https://google.aip.dev/132#ordering
2977 func (c *ProjectsLocationsInstancesBackupsListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesBackupsListCall {
2978 c.urlParams_.Set("orderBy", orderBy)
2979 return c
2980 }
2981
2982 // PageSize sets the optional parameter "pageSize": The maximum number of
2983 // instances to return.
2984 func (c *ProjectsLocationsInstancesBackupsListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesBackupsListCall {
2985 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2986 return c
2987 }
2988
2989 // PageToken sets the optional parameter "pageToken": A page token received
2990 // from a previous ListInstances request.
2991 func (c *ProjectsLocationsInstancesBackupsListCall) PageToken(pageToken string) *ProjectsLocationsInstancesBackupsListCall {
2992 c.urlParams_.Set("pageToken", pageToken)
2993 return c
2994 }
2995
2996 // Fields allows partial responses to be retrieved. See
2997 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2998 // details.
2999 func (c *ProjectsLocationsInstancesBackupsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsListCall {
3000 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3001 return c
3002 }
3003
3004 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3005 // object's ETag matches the given value. This is useful for getting updates
3006 // only after the object has changed since the last request.
3007 func (c *ProjectsLocationsInstancesBackupsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesBackupsListCall {
3008 c.ifNoneMatch_ = entityTag
3009 return c
3010 }
3011
3012 // Context sets the context to be used in this call's Do method.
3013 func (c *ProjectsLocationsInstancesBackupsListCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsListCall {
3014 c.ctx_ = ctx
3015 return c
3016 }
3017
3018 // Header returns a http.Header that can be modified by the caller to add
3019 // headers to the request.
3020 func (c *ProjectsLocationsInstancesBackupsListCall) Header() http.Header {
3021 if c.header_ == nil {
3022 c.header_ = make(http.Header)
3023 }
3024 return c.header_
3025 }
3026
3027 func (c *ProjectsLocationsInstancesBackupsListCall) doRequest(alt string) (*http.Response, error) {
3028 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3029 if c.ifNoneMatch_ != "" {
3030 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3031 }
3032 c.urlParams_.Set("alt", alt)
3033 c.urlParams_.Set("prettyPrint", "false")
3034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups")
3035 urls += "?" + c.urlParams_.Encode()
3036 req, err := http.NewRequest("GET", urls, nil)
3037 if err != nil {
3038 return nil, err
3039 }
3040 req.Header = reqHeaders
3041 googleapi.Expand(req.URL, map[string]string{
3042 "parent": c.parent,
3043 })
3044 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.list", "request", internallog.HTTPRequest(req, nil))
3045 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3046 }
3047
3048 // Do executes the "looker.projects.locations.instances.backups.list" call.
3049 // Any non-2xx status code is an error. Response headers are in either
3050 // *ListInstanceBackupsResponse.ServerResponse.Header or (if a response was
3051 // returned at all) in error.(*googleapi.Error).Header. Use
3052 // googleapi.IsNotModified to check whether the returned error was because
3053 // http.StatusNotModified was returned.
3054 func (c *ProjectsLocationsInstancesBackupsListCall) Do(opts ...googleapi.CallOption) (*ListInstanceBackupsResponse, error) {
3055 gensupport.SetOptions(c.urlParams_, opts...)
3056 res, err := c.doRequest("json")
3057 if res != nil && res.StatusCode == http.StatusNotModified {
3058 if res.Body != nil {
3059 res.Body.Close()
3060 }
3061 return nil, gensupport.WrapError(&googleapi.Error{
3062 Code: res.StatusCode,
3063 Header: res.Header,
3064 })
3065 }
3066 if err != nil {
3067 return nil, err
3068 }
3069 defer googleapi.CloseBody(res)
3070 if err := googleapi.CheckResponse(res); err != nil {
3071 return nil, gensupport.WrapError(err)
3072 }
3073 ret := &ListInstanceBackupsResponse{
3074 ServerResponse: googleapi.ServerResponse{
3075 Header: res.Header,
3076 HTTPStatusCode: res.StatusCode,
3077 },
3078 }
3079 target := &ret
3080 b, err := gensupport.DecodeResponseBytes(target, res)
3081 if err != nil {
3082 return nil, err
3083 }
3084 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.instances.backups.list", "response", internallog.HTTPResponse(res, b))
3085 return ret, nil
3086 }
3087
3088 // Pages invokes f for each page of results.
3089 // A non-nil error returned from f will halt the iteration.
3090 // The provided context supersedes any context provided to the Context method.
3091 func (c *ProjectsLocationsInstancesBackupsListCall) Pages(ctx context.Context, f func(*ListInstanceBackupsResponse) error) error {
3092 c.ctx_ = ctx
3093 defer c.PageToken(c.urlParams_.Get("pageToken"))
3094 for {
3095 x, err := c.Do()
3096 if err != nil {
3097 return err
3098 }
3099 if err := f(x); err != nil {
3100 return err
3101 }
3102 if x.NextPageToken == "" {
3103 return nil
3104 }
3105 c.PageToken(x.NextPageToken)
3106 }
3107 }
3108
3109 type ProjectsLocationsOperationsCancelCall struct {
3110 s *Service
3111 name string
3112 canceloperationrequest *CancelOperationRequest
3113 urlParams_ gensupport.URLParams
3114 ctx_ context.Context
3115 header_ http.Header
3116 }
3117
3118 // Cancel: Starts asynchronous cancellation on a long-running operation. The
3119 // server makes a best effort to cancel the operation, but success is not
3120 // guaranteed. If the server doesn't support this method, it returns
3121 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
3122 // other methods to check whether the cancellation succeeded or whether the
3123 // operation completed despite cancellation. On successful cancellation, the
3124 // operation is not deleted; instead, it becomes an operation with an
3125 // Operation.error value with a google.rpc.Status.code of `1`, corresponding to
3126 // `Code.CANCELLED`.
3127 //
3128 // - name: The name of the operation resource to be cancelled.
3129 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
3130 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3131 c.name = name
3132 c.canceloperationrequest = canceloperationrequest
3133 return c
3134 }
3135
3136 // Fields allows partial responses to be retrieved. See
3137 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3138 // details.
3139 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
3140 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3141 return c
3142 }
3143
3144 // Context sets the context to be used in this call's Do method.
3145 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
3146 c.ctx_ = ctx
3147 return c
3148 }
3149
3150 // Header returns a http.Header that can be modified by the caller to add
3151 // headers to the request.
3152 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
3153 if c.header_ == nil {
3154 c.header_ = make(http.Header)
3155 }
3156 return c.header_
3157 }
3158
3159 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3160 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3161 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest)
3162 if err != nil {
3163 return nil, err
3164 }
3165 c.urlParams_.Set("alt", alt)
3166 c.urlParams_.Set("prettyPrint", "false")
3167 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
3168 urls += "?" + c.urlParams_.Encode()
3169 req, err := http.NewRequest("POST", urls, body)
3170 if err != nil {
3171 return nil, err
3172 }
3173 req.Header = reqHeaders
3174 googleapi.Expand(req.URL, map[string]string{
3175 "name": c.name,
3176 })
3177 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
3178 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3179 }
3180
3181 // Do executes the "looker.projects.locations.operations.cancel" call.
3182 // Any non-2xx status code is an error. Response headers are in either
3183 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3184 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3185 // whether the returned error was because http.StatusNotModified was returned.
3186 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3187 gensupport.SetOptions(c.urlParams_, opts...)
3188 res, err := c.doRequest("json")
3189 if res != nil && res.StatusCode == http.StatusNotModified {
3190 if res.Body != nil {
3191 res.Body.Close()
3192 }
3193 return nil, gensupport.WrapError(&googleapi.Error{
3194 Code: res.StatusCode,
3195 Header: res.Header,
3196 })
3197 }
3198 if err != nil {
3199 return nil, err
3200 }
3201 defer googleapi.CloseBody(res)
3202 if err := googleapi.CheckResponse(res); err != nil {
3203 return nil, gensupport.WrapError(err)
3204 }
3205 ret := &Empty{
3206 ServerResponse: googleapi.ServerResponse{
3207 Header: res.Header,
3208 HTTPStatusCode: res.StatusCode,
3209 },
3210 }
3211 target := &ret
3212 b, err := gensupport.DecodeResponseBytes(target, res)
3213 if err != nil {
3214 return nil, err
3215 }
3216 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b))
3217 return ret, nil
3218 }
3219
3220 type ProjectsLocationsOperationsDeleteCall struct {
3221 s *Service
3222 name string
3223 urlParams_ gensupport.URLParams
3224 ctx_ context.Context
3225 header_ http.Header
3226 }
3227
3228 // Delete: Deletes a long-running operation. This method indicates that the
3229 // client is no longer interested in the operation result. It does not cancel
3230 // the operation. If the server doesn't support this method, it returns
3231 // `google.rpc.Code.UNIMPLEMENTED`.
3232 //
3233 // - name: The name of the operation resource to be deleted.
3234 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
3235 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3236 c.name = name
3237 return c
3238 }
3239
3240 // Fields allows partial responses to be retrieved. See
3241 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3242 // details.
3243 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
3244 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3245 return c
3246 }
3247
3248 // Context sets the context to be used in this call's Do method.
3249 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
3250 c.ctx_ = ctx
3251 return c
3252 }
3253
3254 // Header returns a http.Header that can be modified by the caller to add
3255 // headers to the request.
3256 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
3257 if c.header_ == nil {
3258 c.header_ = make(http.Header)
3259 }
3260 return c.header_
3261 }
3262
3263 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
3264 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3265 c.urlParams_.Set("alt", alt)
3266 c.urlParams_.Set("prettyPrint", "false")
3267 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3268 urls += "?" + c.urlParams_.Encode()
3269 req, err := http.NewRequest("DELETE", urls, nil)
3270 if err != nil {
3271 return nil, err
3272 }
3273 req.Header = reqHeaders
3274 googleapi.Expand(req.URL, map[string]string{
3275 "name": c.name,
3276 })
3277 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil))
3278 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3279 }
3280
3281 // Do executes the "looker.projects.locations.operations.delete" call.
3282 // Any non-2xx status code is an error. Response headers are in either
3283 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3284 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3285 // whether the returned error was because http.StatusNotModified was returned.
3286 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3287 gensupport.SetOptions(c.urlParams_, opts...)
3288 res, err := c.doRequest("json")
3289 if res != nil && res.StatusCode == http.StatusNotModified {
3290 if res.Body != nil {
3291 res.Body.Close()
3292 }
3293 return nil, gensupport.WrapError(&googleapi.Error{
3294 Code: res.StatusCode,
3295 Header: res.Header,
3296 })
3297 }
3298 if err != nil {
3299 return nil, err
3300 }
3301 defer googleapi.CloseBody(res)
3302 if err := googleapi.CheckResponse(res); err != nil {
3303 return nil, gensupport.WrapError(err)
3304 }
3305 ret := &Empty{
3306 ServerResponse: googleapi.ServerResponse{
3307 Header: res.Header,
3308 HTTPStatusCode: res.StatusCode,
3309 },
3310 }
3311 target := &ret
3312 b, err := gensupport.DecodeResponseBytes(target, res)
3313 if err != nil {
3314 return nil, err
3315 }
3316 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b))
3317 return ret, nil
3318 }
3319
3320 type ProjectsLocationsOperationsGetCall struct {
3321 s *Service
3322 name string
3323 urlParams_ gensupport.URLParams
3324 ifNoneMatch_ string
3325 ctx_ context.Context
3326 header_ http.Header
3327 }
3328
3329 // Get: Gets the latest state of a long-running operation. Clients can use this
3330 // method to poll the operation result at intervals as recommended by the API
3331 // service.
3332 //
3333 // - name: The name of the operation resource.
3334 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
3335 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3336 c.name = name
3337 return c
3338 }
3339
3340 // Fields allows partial responses to be retrieved. See
3341 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3342 // details.
3343 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
3344 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3345 return c
3346 }
3347
3348 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3349 // object's ETag matches the given value. This is useful for getting updates
3350 // only after the object has changed since the last request.
3351 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
3352 c.ifNoneMatch_ = entityTag
3353 return c
3354 }
3355
3356 // Context sets the context to be used in this call's Do method.
3357 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
3358 c.ctx_ = ctx
3359 return c
3360 }
3361
3362 // Header returns a http.Header that can be modified by the caller to add
3363 // headers to the request.
3364 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
3365 if c.header_ == nil {
3366 c.header_ = make(http.Header)
3367 }
3368 return c.header_
3369 }
3370
3371 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3372 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3373 if c.ifNoneMatch_ != "" {
3374 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3375 }
3376 c.urlParams_.Set("alt", alt)
3377 c.urlParams_.Set("prettyPrint", "false")
3378 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3379 urls += "?" + c.urlParams_.Encode()
3380 req, err := http.NewRequest("GET", urls, nil)
3381 if err != nil {
3382 return nil, err
3383 }
3384 req.Header = reqHeaders
3385 googleapi.Expand(req.URL, map[string]string{
3386 "name": c.name,
3387 })
3388 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil))
3389 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3390 }
3391
3392 // Do executes the "looker.projects.locations.operations.get" call.
3393 // Any non-2xx status code is an error. Response headers are in either
3394 // *Operation.ServerResponse.Header or (if a response was returned at all) in
3395 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3396 // whether the returned error was because http.StatusNotModified was returned.
3397 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3398 gensupport.SetOptions(c.urlParams_, opts...)
3399 res, err := c.doRequest("json")
3400 if res != nil && res.StatusCode == http.StatusNotModified {
3401 if res.Body != nil {
3402 res.Body.Close()
3403 }
3404 return nil, gensupport.WrapError(&googleapi.Error{
3405 Code: res.StatusCode,
3406 Header: res.Header,
3407 })
3408 }
3409 if err != nil {
3410 return nil, err
3411 }
3412 defer googleapi.CloseBody(res)
3413 if err := googleapi.CheckResponse(res); err != nil {
3414 return nil, gensupport.WrapError(err)
3415 }
3416 ret := &Operation{
3417 ServerResponse: googleapi.ServerResponse{
3418 Header: res.Header,
3419 HTTPStatusCode: res.StatusCode,
3420 },
3421 }
3422 target := &ret
3423 b, err := gensupport.DecodeResponseBytes(target, res)
3424 if err != nil {
3425 return nil, err
3426 }
3427 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b))
3428 return ret, nil
3429 }
3430
3431 type ProjectsLocationsOperationsListCall struct {
3432 s *Service
3433 name string
3434 urlParams_ gensupport.URLParams
3435 ifNoneMatch_ string
3436 ctx_ context.Context
3437 header_ http.Header
3438 }
3439
3440 // List: Lists operations that match the specified filter in the request. If
3441 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
3442 //
3443 // - name: The name of the operation's parent resource.
3444 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
3445 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3446 c.name = name
3447 return c
3448 }
3449
3450 // Filter sets the optional parameter "filter": The standard list filter.
3451 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
3452 c.urlParams_.Set("filter", filter)
3453 return c
3454 }
3455
3456 // PageSize sets the optional parameter "pageSize": The standard list page
3457 // size.
3458 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
3459 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3460 return c
3461 }
3462
3463 // PageToken sets the optional parameter "pageToken": The standard list page
3464 // token.
3465 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
3466 c.urlParams_.Set("pageToken", pageToken)
3467 return c
3468 }
3469
3470 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3471 // When set to `true`, operations that are reachable are returned as normal,
3472 // and those that are unreachable are returned in the
3473 // ListOperationsResponse.unreachable field. This can only be `true` when
3474 // reading across collections. For example, when `parent` is set to
3475 // "projects/example/locations/-". This field is not supported by default and
3476 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3477 // otherwise in service or product specific documentation.
3478 func (c *ProjectsLocationsOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsOperationsListCall {
3479 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3480 return c
3481 }
3482
3483 // Fields allows partial responses to be retrieved. See
3484 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3485 // details.
3486 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
3487 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3488 return c
3489 }
3490
3491 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3492 // object's ETag matches the given value. This is useful for getting updates
3493 // only after the object has changed since the last request.
3494 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
3495 c.ifNoneMatch_ = entityTag
3496 return c
3497 }
3498
3499 // Context sets the context to be used in this call's Do method.
3500 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
3501 c.ctx_ = ctx
3502 return c
3503 }
3504
3505 // Header returns a http.Header that can be modified by the caller to add
3506 // headers to the request.
3507 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
3508 if c.header_ == nil {
3509 c.header_ = make(http.Header)
3510 }
3511 return c.header_
3512 }
3513
3514 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
3515 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3516 if c.ifNoneMatch_ != "" {
3517 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3518 }
3519 c.urlParams_.Set("alt", alt)
3520 c.urlParams_.Set("prettyPrint", "false")
3521 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
3522 urls += "?" + c.urlParams_.Encode()
3523 req, err := http.NewRequest("GET", urls, nil)
3524 if err != nil {
3525 return nil, err
3526 }
3527 req.Header = reqHeaders
3528 googleapi.Expand(req.URL, map[string]string{
3529 "name": c.name,
3530 })
3531 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil))
3532 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3533 }
3534
3535 // Do executes the "looker.projects.locations.operations.list" call.
3536 // Any non-2xx status code is an error. Response headers are in either
3537 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
3538 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3539 // check whether the returned error was because http.StatusNotModified was
3540 // returned.
3541 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
3542 gensupport.SetOptions(c.urlParams_, opts...)
3543 res, err := c.doRequest("json")
3544 if res != nil && res.StatusCode == http.StatusNotModified {
3545 if res.Body != nil {
3546 res.Body.Close()
3547 }
3548 return nil, gensupport.WrapError(&googleapi.Error{
3549 Code: res.StatusCode,
3550 Header: res.Header,
3551 })
3552 }
3553 if err != nil {
3554 return nil, err
3555 }
3556 defer googleapi.CloseBody(res)
3557 if err := googleapi.CheckResponse(res); err != nil {
3558 return nil, gensupport.WrapError(err)
3559 }
3560 ret := &ListOperationsResponse{
3561 ServerResponse: googleapi.ServerResponse{
3562 Header: res.Header,
3563 HTTPStatusCode: res.StatusCode,
3564 },
3565 }
3566 target := &ret
3567 b, err := gensupport.DecodeResponseBytes(target, res)
3568 if err != nil {
3569 return nil, err
3570 }
3571 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "looker.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b))
3572 return ret, nil
3573 }
3574
3575 // Pages invokes f for each page of results.
3576 // A non-nil error returned from f will halt the iteration.
3577 // The provided context supersedes any context provided to the Context method.
3578 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
3579 c.ctx_ = ctx
3580 defer c.PageToken(c.urlParams_.Get("pageToken"))
3581 for {
3582 x, err := c.Do()
3583 if err != nil {
3584 return err
3585 }
3586 if err := f(x); err != nil {
3587 return err
3588 }
3589 if x.NextPageToken == "" {
3590 return nil
3591 }
3592 c.PageToken(x.NextPageToken)
3593 }
3594 }