Debian Codegraph @

prod_tt_sasportal/v1alpha1/prod_tt_sasportal-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 prod_tt_sasportal provides access to the SAS Portal API (Testing).
8 //
9 // For product documentation, see: https://developers.google.com/spectrum-access-system/
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/prod_tt_sasportal/v1alpha1"
27 // ...
28 // ctx := context.Background()
29 // prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // By default, all available scopes (see "Constants") are used to authenticate.
38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
39 //
40 // prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx, option.WithScopes(prod_tt_sasportal.SasportalScope))
41 //
42 // To use an API key for authentication (note: some APIs do not support API
43 // keys), use [google.golang.org/api/option.WithAPIKey]:
44 //
45 // prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx, option.WithAPIKey("AIza..."))
46 //
47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
48 // flow, use [google.golang.org/api/option.WithTokenSource]:
49 //
50 // config := &oauth2.Config{...}
51 // // ...
52 // token, err := config.Exchange(ctx, ...)
53 // prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
54 //
55 // See [google.golang.org/api/option.ClientOption] for details on options.
56 package prod_tt_sasportal // import "google.golang.org/api/prod_tt_sasportal/v1alpha1"
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "log/slog"
66 "net/http"
67 "net/url"
68 "strconv"
69 "strings"
70
71 "github.com/googleapis/gax-go/v2/internallog"
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80 // Always reference these packages, just in case the auto-generated code
81 // below doesn't.
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95 var _ = internallog.New
96
97 const apiId = "prod_tt_sasportal:v1alpha1"
98 const apiName = "prod_tt_sasportal"
99 const apiVersion = "v1alpha1"
100 const basePath = "https://prod-tt-sasportal.googleapis.com/"
101 const basePathTemplate = "https://prod-tt-sasportal.UNIVERSE_DOMAIN/"
102 const mtlsBasePath = "https://prod-tt-sasportal.mtls.googleapis.com/"
103
104 // OAuth2 scopes used by this API.
105 const (
106 // See, edit, configure, and delete your Google Cloud data and see the email
107 // address for your Google Account.
108 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
109
110 // Read, create, update, and delete your SAS Portal data.
111 SasportalScope = "https://www.googleapis.com/auth/sasportal"
112 )
113
114 // NewService creates a new Service.
115 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
116 scopesOption := internaloption.WithDefaultScopes(
117 "https://www.googleapis.com/auth/cloud-platform",
118 "https://www.googleapis.com/auth/sasportal",
119 )
120 // NOTE: prepend, so we don't override user-specified scopes.
121 opts = append([]option.ClientOption{scopesOption}, opts...)
122 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
123 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
124 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
125 opts = append(opts, internaloption.EnableNewAuthLibrary())
126 client, endpoint, err := htransport.NewClient(ctx, opts...)
127 if err != nil {
128 return nil, err
129 }
130 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
131 s.Customers = NewCustomersService(s)
132 s.Deployments = NewDeploymentsService(s)
133 s.Installer = NewInstallerService(s)
134 s.Nodes = NewNodesService(s)
135 s.Policies = NewPoliciesService(s)
136 if endpoint != "" {
137 s.BasePath = endpoint
138 }
139 return s, nil
140 }
141
142 // New creates a new Service. It uses the provided http.Client for requests.
143 //
144 // Deprecated: please use NewService instead.
145 // To provide a custom HTTP client, use option.WithHTTPClient.
146 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
147 func New(client *http.Client) (*Service, error) {
148 if client == nil {
149 return nil, errors.New("client is nil")
150 }
151 return NewService(context.TODO(), option.WithHTTPClient(client))
152 }
153
154 type Service struct {
155 client *http.Client
156 logger *slog.Logger
157 BasePath string // API endpoint base URL
158 UserAgent string // optional additional User-Agent fragment
159
160 Customers *CustomersService
161
162 Deployments *DeploymentsService
163
164 Installer *InstallerService
165
166 Nodes *NodesService
167
168 Policies *PoliciesService
169 }
170
171 func (s *Service) userAgent() string {
172 if s.UserAgent == "" {
173 return googleapi.UserAgent
174 }
175 return googleapi.UserAgent + " " + s.UserAgent
176 }
177
178 func NewCustomersService(s *Service) *CustomersService {
179 rs := &CustomersService{s: s}
180 rs.Deployments = NewCustomersDeploymentsService(s)
181 rs.Devices = NewCustomersDevicesService(s)
182 rs.Nodes = NewCustomersNodesService(s)
183 return rs
184 }
185
186 type CustomersService struct {
187 s *Service
188
189 Deployments *CustomersDeploymentsService
190
191 Devices *CustomersDevicesService
192
193 Nodes *CustomersNodesService
194 }
195
196 func NewCustomersDeploymentsService(s *Service) *CustomersDeploymentsService {
197 rs := &CustomersDeploymentsService{s: s}
198 rs.Devices = NewCustomersDeploymentsDevicesService(s)
199 return rs
200 }
201
202 type CustomersDeploymentsService struct {
203 s *Service
204
205 Devices *CustomersDeploymentsDevicesService
206 }
207
208 func NewCustomersDeploymentsDevicesService(s *Service) *CustomersDeploymentsDevicesService {
209 rs := &CustomersDeploymentsDevicesService{s: s}
210 return rs
211 }
212
213 type CustomersDeploymentsDevicesService struct {
214 s *Service
215 }
216
217 func NewCustomersDevicesService(s *Service) *CustomersDevicesService {
218 rs := &CustomersDevicesService{s: s}
219 return rs
220 }
221
222 type CustomersDevicesService struct {
223 s *Service
224 }
225
226 func NewCustomersNodesService(s *Service) *CustomersNodesService {
227 rs := &CustomersNodesService{s: s}
228 rs.Deployments = NewCustomersNodesDeploymentsService(s)
229 rs.Devices = NewCustomersNodesDevicesService(s)
230 rs.Nodes = NewCustomersNodesNodesService(s)
231 return rs
232 }
233
234 type CustomersNodesService struct {
235 s *Service
236
237 Deployments *CustomersNodesDeploymentsService
238
239 Devices *CustomersNodesDevicesService
240
241 Nodes *CustomersNodesNodesService
242 }
243
244 func NewCustomersNodesDeploymentsService(s *Service) *CustomersNodesDeploymentsService {
245 rs := &CustomersNodesDeploymentsService{s: s}
246 return rs
247 }
248
249 type CustomersNodesDeploymentsService struct {
250 s *Service
251 }
252
253 func NewCustomersNodesDevicesService(s *Service) *CustomersNodesDevicesService {
254 rs := &CustomersNodesDevicesService{s: s}
255 return rs
256 }
257
258 type CustomersNodesDevicesService struct {
259 s *Service
260 }
261
262 func NewCustomersNodesNodesService(s *Service) *CustomersNodesNodesService {
263 rs := &CustomersNodesNodesService{s: s}
264 return rs
265 }
266
267 type CustomersNodesNodesService struct {
268 s *Service
269 }
270
271 func NewDeploymentsService(s *Service) *DeploymentsService {
272 rs := &DeploymentsService{s: s}
273 rs.Devices = NewDeploymentsDevicesService(s)
274 return rs
275 }
276
277 type DeploymentsService struct {
278 s *Service
279
280 Devices *DeploymentsDevicesService
281 }
282
283 func NewDeploymentsDevicesService(s *Service) *DeploymentsDevicesService {
284 rs := &DeploymentsDevicesService{s: s}
285 return rs
286 }
287
288 type DeploymentsDevicesService struct {
289 s *Service
290 }
291
292 func NewInstallerService(s *Service) *InstallerService {
293 rs := &InstallerService{s: s}
294 return rs
295 }
296
297 type InstallerService struct {
298 s *Service
299 }
300
301 func NewNodesService(s *Service) *NodesService {
302 rs := &NodesService{s: s}
303 rs.Deployments = NewNodesDeploymentsService(s)
304 rs.Devices = NewNodesDevicesService(s)
305 rs.Nodes = NewNodesNodesService(s)
306 return rs
307 }
308
309 type NodesService struct {
310 s *Service
311
312 Deployments *NodesDeploymentsService
313
314 Devices *NodesDevicesService
315
316 Nodes *NodesNodesService
317 }
318
319 func NewNodesDeploymentsService(s *Service) *NodesDeploymentsService {
320 rs := &NodesDeploymentsService{s: s}
321 rs.Devices = NewNodesDeploymentsDevicesService(s)
322 return rs
323 }
324
325 type NodesDeploymentsService struct {
326 s *Service
327
328 Devices *NodesDeploymentsDevicesService
329 }
330
331 func NewNodesDeploymentsDevicesService(s *Service) *NodesDeploymentsDevicesService {
332 rs := &NodesDeploymentsDevicesService{s: s}
333 return rs
334 }
335
336 type NodesDeploymentsDevicesService struct {
337 s *Service
338 }
339
340 func NewNodesDevicesService(s *Service) *NodesDevicesService {
341 rs := &NodesDevicesService{s: s}
342 return rs
343 }
344
345 type NodesDevicesService struct {
346 s *Service
347 }
348
349 func NewNodesNodesService(s *Service) *NodesNodesService {
350 rs := &NodesNodesService{s: s}
351 rs.Deployments = NewNodesNodesDeploymentsService(s)
352 rs.Devices = NewNodesNodesDevicesService(s)
353 rs.Nodes = NewNodesNodesNodesService(s)
354 return rs
355 }
356
357 type NodesNodesService struct {
358 s *Service
359
360 Deployments *NodesNodesDeploymentsService
361
362 Devices *NodesNodesDevicesService
363
364 Nodes *NodesNodesNodesService
365 }
366
367 func NewNodesNodesDeploymentsService(s *Service) *NodesNodesDeploymentsService {
368 rs := &NodesNodesDeploymentsService{s: s}
369 return rs
370 }
371
372 type NodesNodesDeploymentsService struct {
373 s *Service
374 }
375
376 func NewNodesNodesDevicesService(s *Service) *NodesNodesDevicesService {
377 rs := &NodesNodesDevicesService{s: s}
378 return rs
379 }
380
381 type NodesNodesDevicesService struct {
382 s *Service
383 }
384
385 func NewNodesNodesNodesService(s *Service) *NodesNodesNodesService {
386 rs := &NodesNodesNodesService{s: s}
387 return rs
388 }
389
390 type NodesNodesNodesService struct {
391 s *Service
392 }
393
394 func NewPoliciesService(s *Service) *PoliciesService {
395 rs := &PoliciesService{s: s}
396 return rs
397 }
398
399 type PoliciesService struct {
400 s *Service
401 }
402
403 // SasPortalAssignment: Associates `members` with a `role`.
404 type SasPortalAssignment struct {
405 // Members: The identities the role is assigned to. It can have the following
406 // values: * `{user_email}`: An email address that represents a specific Google
407 // account. For example: `[email protected]`. * `{group_email}`: An email address
408 // that represents a Google group. For example, `[email protected]`.
409 Members []string `json:"members,omitempty"`
410 // Role: Required. Role that is assigned to `members`.
411 Role string `json:"role,omitempty"`
412 // ForceSendFields is a list of field names (e.g. "Members") to unconditionally
413 // include in API requests. By default, fields with empty or default values are
414 // omitted from API requests. See
415 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
416 // details.
417 ForceSendFields []string `json:"-"`
418 // NullFields is a list of field names (e.g. "Members") to include in API
419 // requests with the JSON null value. By default, fields with empty values are
420 // omitted from API requests. See
421 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
422 NullFields []string `json:"-"`
423 }
424
425 func (s SasPortalAssignment) MarshalJSON() ([]byte, error) {
426 type NoMethod SasPortalAssignment
427 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
428 }
429
430 // SasPortalChannelWithScore: The channel with score.
431 type SasPortalChannelWithScore struct {
432 // FrequencyRange: The frequency range of the channel.
433 FrequencyRange *SasPortalFrequencyRange `json:"frequencyRange,omitempty"`
434 // Score: The channel score, normalized to be in the range [0,100].
435 Score float64 `json:"score,omitempty"`
436 // ForceSendFields is a list of field names (e.g. "FrequencyRange") to
437 // unconditionally include in API requests. By default, fields with empty or
438 // default values are omitted from API requests. See
439 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
440 // details.
441 ForceSendFields []string `json:"-"`
442 // NullFields is a list of field names (e.g. "FrequencyRange") to include in
443 // API requests with the JSON null value. By default, fields with empty values
444 // are omitted from API requests. See
445 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
446 NullFields []string `json:"-"`
447 }
448
449 func (s SasPortalChannelWithScore) MarshalJSON() ([]byte, error) {
450 type NoMethod SasPortalChannelWithScore
451 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
452 }
453
454 func (s *SasPortalChannelWithScore) UnmarshalJSON(data []byte) error {
455 type NoMethod SasPortalChannelWithScore
456 var s1 struct {
457 Score gensupport.JSONFloat64 `json:"score"`
458 *NoMethod
459 }
460 s1.NoMethod = (*NoMethod)(s)
461 if err := json.Unmarshal(data, &s1); err != nil {
462 return err
463 }
464 s.Score = float64(s1.Score)
465 return nil
466 }
467
468 // SasPortalCreateSignedDeviceRequest: Request for CreateSignedDevice.
469 type SasPortalCreateSignedDeviceRequest struct {
470 // EncodedDevice: Required. JSON Web Token signed using a CPI private key.
471 // Payload must be the JSON encoding of the device. The user_id field must be
472 // set.
473 EncodedDevice string `json:"encodedDevice,omitempty"`
474 // InstallerId: Required. Unique installer id (CPI ID) from the Certified
475 // Professional Installers database.
476 InstallerId string `json:"installerId,omitempty"`
477 // ForceSendFields is a list of field names (e.g. "EncodedDevice") to
478 // unconditionally include in API requests. By default, fields with empty or
479 // default values are omitted from API requests. See
480 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
481 // details.
482 ForceSendFields []string `json:"-"`
483 // NullFields is a list of field names (e.g. "EncodedDevice") to include in API
484 // requests with the JSON null value. By default, fields with empty values are
485 // omitted from API requests. See
486 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
487 NullFields []string `json:"-"`
488 }
489
490 func (s SasPortalCreateSignedDeviceRequest) MarshalJSON() ([]byte, error) {
491 type NoMethod SasPortalCreateSignedDeviceRequest
492 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
493 }
494
495 // SasPortalCustomer: Entity representing a SAS customer.
496 type SasPortalCustomer struct {
497 // DisplayName: Required. Name of the organization that the customer entity
498 // represents.
499 DisplayName string `json:"displayName,omitempty"`
500 // Name: Output only. Resource name of the customer.
501 Name string `json:"name,omitempty"`
502 // SasUserIds: User IDs used by the devices belonging to this customer.
503 SasUserIds []string `json:"sasUserIds,omitempty"`
504
505 // ServerResponse contains the HTTP response code and headers from the server.
506 googleapi.ServerResponse `json:"-"`
507 // ForceSendFields is a list of field names (e.g. "DisplayName") to
508 // unconditionally include in API requests. By default, fields with empty or
509 // default values are omitted from API requests. See
510 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
511 // details.
512 ForceSendFields []string `json:"-"`
513 // NullFields is a list of field names (e.g. "DisplayName") to include in API
514 // requests with the JSON null value. By default, fields with empty values are
515 // omitted from API requests. See
516 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
517 NullFields []string `json:"-"`
518 }
519
520 func (s SasPortalCustomer) MarshalJSON() ([]byte, error) {
521 type NoMethod SasPortalCustomer
522 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
523 }
524
525 // SasPortalDeployment: The Deployment.
526 type SasPortalDeployment struct {
527 // DisplayName: The deployment's display name.
528 DisplayName string `json:"displayName,omitempty"`
529 // Frns: Output only. The FCC Registration Numbers (FRNs) copied from its
530 // direct parent.
531 Frns []string `json:"frns,omitempty"`
532 // Name: Output only. Resource name.
533 Name string `json:"name,omitempty"`
534 // SasUserIds: User ID used by the devices belonging to this deployment. Each
535 // deployment should be associated with one unique user ID.
536 SasUserIds []string `json:"sasUserIds,omitempty"`
537
538 // ServerResponse contains the HTTP response code and headers from the server.
539 googleapi.ServerResponse `json:"-"`
540 // ForceSendFields is a list of field names (e.g. "DisplayName") to
541 // unconditionally include in API requests. By default, fields with empty or
542 // default values are omitted from API requests. See
543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
544 // details.
545 ForceSendFields []string `json:"-"`
546 // NullFields is a list of field names (e.g. "DisplayName") to include in API
547 // requests with the JSON null value. By default, fields with empty values are
548 // omitted from API requests. See
549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
550 NullFields []string `json:"-"`
551 }
552
553 func (s SasPortalDeployment) MarshalJSON() ([]byte, error) {
554 type NoMethod SasPortalDeployment
555 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
556 }
557
558 // SasPortalDeploymentAssociation: Association between a gcp project and a SAS
559 // user id.
560 type SasPortalDeploymentAssociation struct {
561 // GcpProjectId: GCP project id of the associated project.
562 GcpProjectId string `json:"gcpProjectId,omitempty"`
563 // UserId: User id of the deployment.
564 UserId string `json:"userId,omitempty"`
565 // ForceSendFields is a list of field names (e.g. "GcpProjectId") to
566 // unconditionally include in API requests. By default, fields with empty or
567 // default values are omitted from API requests. See
568 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
569 // details.
570 ForceSendFields []string `json:"-"`
571 // NullFields is a list of field names (e.g. "GcpProjectId") to include in API
572 // requests with the JSON null value. By default, fields with empty values are
573 // omitted from API requests. See
574 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
575 NullFields []string `json:"-"`
576 }
577
578 func (s SasPortalDeploymentAssociation) MarshalJSON() ([]byte, error) {
579 type NoMethod SasPortalDeploymentAssociation
580 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
581 }
582
583 type SasPortalDevice struct {
584 // ActiveConfig: Output only. Current configuration of the device as registered
585 // to the SAS.
586 ActiveConfig *SasPortalDeviceConfig `json:"activeConfig,omitempty"`
587 // CurrentChannels: Output only. Current channels with scores.
588 CurrentChannels []*SasPortalChannelWithScore `json:"currentChannels,omitempty"`
589 // DeviceMetadata: Device parameters that can be overridden by both SAS Portal
590 // and SAS registration requests.
591 DeviceMetadata *SasPortalDeviceMetadata `json:"deviceMetadata,omitempty"`
592 // DisplayName: Device display name.
593 DisplayName string `json:"displayName,omitempty"`
594 // FccId: The FCC identifier of the device. Refer to
595 // https://www.fcc.gov/oet/ea/fccid for FccID format. Accept underscores and
596 // periods because some test-SAS customers use them.
597 FccId string `json:"fccId,omitempty"`
598 // GrantRangeAllowlists: Only ranges that are within the allowlists are
599 // available for new grants.
600 GrantRangeAllowlists []*SasPortalFrequencyRange `json:"grantRangeAllowlists,omitempty"`
601 // Grants: Output only. Grants held by the device.
602 Grants []*SasPortalDeviceGrant `json:"grants,omitempty"`
603 // Name: Output only. The resource path name.
604 Name string `json:"name,omitempty"`
605 // PreloadedConfig: Configuration of the device, as specified via SAS Portal
606 // API.
607 PreloadedConfig *SasPortalDeviceConfig `json:"preloadedConfig,omitempty"`
608 // SerialNumber: A serial number assigned to the device by the device
609 // manufacturer.
610 SerialNumber string `json:"serialNumber,omitempty"`
611 // State: Output only. Device state.
612 //
613 // Possible values:
614 // "DEVICE_STATE_UNSPECIFIED" - Unspecified state.
615 // "RESERVED" - Device created in the SAS Portal, however, not yet registered
616 // with SAS.
617 // "REGISTERED" - Device registered with SAS.
618 // "DEREGISTERED" - Device de-registered with SAS.
619 State string `json:"state,omitempty"`
620
621 // ServerResponse contains the HTTP response code and headers from the server.
622 googleapi.ServerResponse `json:"-"`
623 // ForceSendFields is a list of field names (e.g. "ActiveConfig") to
624 // unconditionally include in API requests. By default, fields with empty or
625 // default values are omitted from API requests. See
626 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
627 // details.
628 ForceSendFields []string `json:"-"`
629 // NullFields is a list of field names (e.g. "ActiveConfig") to include in API
630 // requests with the JSON null value. By default, fields with empty values are
631 // omitted from API requests. See
632 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
633 NullFields []string `json:"-"`
634 }
635
636 func (s SasPortalDevice) MarshalJSON() ([]byte, error) {
637 type NoMethod SasPortalDevice
638 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
639 }
640
641 // SasPortalDeviceAirInterface: Information about the device's air interface.
642 type SasPortalDeviceAirInterface struct {
643 // RadioTechnology: Conditional. This field specifies the radio access
644 // technology that is used for the CBSD.
645 //
646 // Possible values:
647 // "RADIO_TECHNOLOGY_UNSPECIFIED"
648 // "E_UTRA"
649 // "CAMBIUM_NETWORKS"
650 // "FOUR_G_BBW_SAA_1"
651 // "NR"
652 // "DOODLE_CBRS"
653 // "CW"
654 // "REDLINE"
655 // "TARANA_WIRELESS"
656 // "FAROS"
657 RadioTechnology string `json:"radioTechnology,omitempty"`
658 // SupportedSpec: Optional. This field is related to the `radioTechnology` and
659 // provides the air interface specification that the CBSD is compliant with at
660 // the time of registration.
661 SupportedSpec string `json:"supportedSpec,omitempty"`
662 // ForceSendFields is a list of field names (e.g. "RadioTechnology") to
663 // unconditionally include in API requests. By default, fields with empty or
664 // default values are omitted from API requests. See
665 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
666 // details.
667 ForceSendFields []string `json:"-"`
668 // NullFields is a list of field names (e.g. "RadioTechnology") to include in
669 // API requests with the JSON null value. By default, fields with empty values
670 // are omitted from API requests. See
671 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
672 NullFields []string `json:"-"`
673 }
674
675 func (s SasPortalDeviceAirInterface) MarshalJSON() ([]byte, error) {
676 type NoMethod SasPortalDeviceAirInterface
677 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
678 }
679
680 // SasPortalDeviceConfig: Information about the device configuration.
681 type SasPortalDeviceConfig struct {
682 // AirInterface: Information about this device's air interface.
683 AirInterface *SasPortalDeviceAirInterface `json:"airInterface,omitempty"`
684 // CallSign: The call sign of the device operator.
685 CallSign string `json:"callSign,omitempty"`
686 // Category: FCC category of the device.
687 //
688 // Possible values:
689 // "DEVICE_CATEGORY_UNSPECIFIED" - Unspecified device category.
690 // "DEVICE_CATEGORY_A" - Category A.
691 // "DEVICE_CATEGORY_B" - Category B.
692 Category string `json:"category,omitempty"`
693 // InstallationParams: Installation parameters for the device.
694 InstallationParams *SasPortalInstallationParams `json:"installationParams,omitempty"`
695 // IsSigned: Output only. Whether the configuration has been signed by a CPI.
696 IsSigned bool `json:"isSigned,omitempty"`
697 // MeasurementCapabilities: Measurement reporting capabilities of the device.
698 //
699 // Possible values:
700 // "MEASUREMENT_CAPABILITY_UNSPECIFIED"
701 // "MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITH_GRANT"
702 // "MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITHOUT_GRANT"
703 MeasurementCapabilities []string `json:"measurementCapabilities,omitempty"`
704 // Model: Information about this device model.
705 Model *SasPortalDeviceModel `json:"model,omitempty"`
706 // State: State of the configuration.
707 //
708 // Possible values:
709 // "DEVICE_CONFIG_STATE_UNSPECIFIED"
710 // "DRAFT"
711 // "FINAL"
712 State string `json:"state,omitempty"`
713 // UpdateTime: Output only. The last time the device configuration was edited.
714 UpdateTime string `json:"updateTime,omitempty"`
715 // UserId: The identifier of a device user.
716 UserId string `json:"userId,omitempty"`
717 // ForceSendFields is a list of field names (e.g. "AirInterface") to
718 // unconditionally include in API requests. By default, fields with empty or
719 // default values are omitted from API requests. See
720 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
721 // details.
722 ForceSendFields []string `json:"-"`
723 // NullFields is a list of field names (e.g. "AirInterface") to include in API
724 // requests with the JSON null value. By default, fields with empty values are
725 // omitted from API requests. See
726 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
727 NullFields []string `json:"-"`
728 }
729
730 func (s SasPortalDeviceConfig) MarshalJSON() ([]byte, error) {
731 type NoMethod SasPortalDeviceConfig
732 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
733 }
734
735 // SasPortalDeviceGrant: Device grant. It is an authorization provided by the
736 // Spectrum Access System to a device to transmit using specified operating
737 // parameters after a successful heartbeat by the device.
738 type SasPortalDeviceGrant struct {
739 // ChannelType: Type of channel used.
740 //
741 // Possible values:
742 // "CHANNEL_TYPE_UNSPECIFIED"
743 // "CHANNEL_TYPE_GAA"
744 // "CHANNEL_TYPE_PAL"
745 ChannelType string `json:"channelType,omitempty"`
746 // ExpireTime: The expiration time of the grant.
747 ExpireTime string `json:"expireTime,omitempty"`
748 // FrequencyRange: The transmission frequency range.
749 FrequencyRange *SasPortalFrequencyRange `json:"frequencyRange,omitempty"`
750 // GrantId: Grant Id.
751 GrantId string `json:"grantId,omitempty"`
752 // LastHeartbeatTransmitExpireTime: The transmit expiration time of the last
753 // heartbeat.
754 LastHeartbeatTransmitExpireTime string `json:"lastHeartbeatTransmitExpireTime,omitempty"`
755 // MaxEirp: Maximum Equivalent Isotropically Radiated Power (EIRP) permitted by
756 // the grant. The maximum EIRP is in units of dBm/MHz. The value of `maxEirp`
757 // represents the average (RMS) EIRP that would be measured by the procedure
758 // defined in FCC part 96.41(e)(3).
759 MaxEirp float64 `json:"maxEirp,omitempty"`
760 // MoveList: The DPA move lists on which this grant appears.
761 MoveList []*SasPortalDpaMoveList `json:"moveList,omitempty"`
762 // State: State of the grant.
763 //
764 // Possible values:
765 // "GRANT_STATE_UNSPECIFIED"
766 // "GRANT_STATE_GRANTED" - The grant has been granted but the device is not
767 // heartbeating on it.
768 // "GRANT_STATE_TERMINATED" - The grant has been terminated by the SAS.
769 // "GRANT_STATE_SUSPENDED" - The grant has been suspended by the SAS.
770 // "GRANT_STATE_AUTHORIZED" - The device is currently transmitting.
771 // "GRANT_STATE_EXPIRED" - The grant has expired.
772 State string `json:"state,omitempty"`
773 // SuspensionReason: If the grant is suspended, the reason(s) for suspension.
774 SuspensionReason []string `json:"suspensionReason,omitempty"`
775 // ForceSendFields is a list of field names (e.g. "ChannelType") to
776 // unconditionally include in API requests. By default, fields with empty or
777 // default values are omitted from API requests. See
778 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
779 // details.
780 ForceSendFields []string `json:"-"`
781 // NullFields is a list of field names (e.g. "ChannelType") to include in API
782 // requests with the JSON null value. By default, fields with empty values are
783 // omitted from API requests. See
784 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
785 NullFields []string `json:"-"`
786 }
787
788 func (s SasPortalDeviceGrant) MarshalJSON() ([]byte, error) {
789 type NoMethod SasPortalDeviceGrant
790 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
791 }
792
793 func (s *SasPortalDeviceGrant) UnmarshalJSON(data []byte) error {
794 type NoMethod SasPortalDeviceGrant
795 var s1 struct {
796 MaxEirp gensupport.JSONFloat64 `json:"maxEirp"`
797 *NoMethod
798 }
799 s1.NoMethod = (*NoMethod)(s)
800 if err := json.Unmarshal(data, &s1); err != nil {
801 return err
802 }
803 s.MaxEirp = float64(s1.MaxEirp)
804 return nil
805 }
806
807 // SasPortalDeviceMetadata: Device data overridable by both SAS Portal and
808 // registration requests.
809 type SasPortalDeviceMetadata struct {
810 // AntennaModel: If populated, the Antenna Model Pattern to use. Format is:
811 // `RecordCreatorId:PatternId`
812 AntennaModel string `json:"antennaModel,omitempty"`
813 // CommonChannelGroup: Common Channel Group (CCG). A group of CBSDs in the same
814 // ICG requesting a common primary channel assignment. For more details, see
815 // CBRSA-TS-2001 V3.0.0
816 // (https://ongoalliance.org/wp-content/uploads/2020/02/CBRSA-TS-2001-V3.0.0_Approved-for-publication.pdf).
817 CommonChannelGroup string `json:"commonChannelGroup,omitempty"`
818 // InterferenceCoordinationGroup: Interference Coordination Group (ICG). A
819 // group of CBSDs that manage their own interference with the group. For more
820 // details, see CBRSA-TS-2001 V3.0.0
821 // (https://ongoalliance.org/wp-content/uploads/2020/02/CBRSA-TS-2001-V3.0.0_Approved-for-publication.pdf).
822 InterferenceCoordinationGroup string `json:"interferenceCoordinationGroup,omitempty"`
823 // NrqzValidated: Output only. Set to `true` if a CPI has validated that they
824 // have coordinated with the National Quiet Zone office.
825 NrqzValidated bool `json:"nrqzValidated,omitempty"`
826 // NrqzValidation: Output only. National Radio Quiet Zone validation info.
827 NrqzValidation *SasPortalNrqzValidation `json:"nrqzValidation,omitempty"`
828 // ForceSendFields is a list of field names (e.g. "AntennaModel") to
829 // unconditionally include in API requests. By default, fields with empty or
830 // default values are omitted from API requests. See
831 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
832 // details.
833 ForceSendFields []string `json:"-"`
834 // NullFields is a list of field names (e.g. "AntennaModel") to include in API
835 // requests with the JSON null value. By default, fields with empty values are
836 // omitted from API requests. See
837 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
838 NullFields []string `json:"-"`
839 }
840
841 func (s SasPortalDeviceMetadata) MarshalJSON() ([]byte, error) {
842 type NoMethod SasPortalDeviceMetadata
843 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
844 }
845
846 // SasPortalDeviceModel: Information about the model of the device.
847 type SasPortalDeviceModel struct {
848 // FirmwareVersion: The firmware version of the device.
849 FirmwareVersion string `json:"firmwareVersion,omitempty"`
850 // HardwareVersion: The hardware version of the device.
851 HardwareVersion string `json:"hardwareVersion,omitempty"`
852 // Name: The name of the device model.
853 Name string `json:"name,omitempty"`
854 // SoftwareVersion: The software version of the device.
855 SoftwareVersion string `json:"softwareVersion,omitempty"`
856 // Vendor: The name of the device vendor.
857 Vendor string `json:"vendor,omitempty"`
858 // ForceSendFields is a list of field names (e.g. "FirmwareVersion") to
859 // unconditionally include in API requests. By default, fields with empty or
860 // default values are omitted from API requests. See
861 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
862 // details.
863 ForceSendFields []string `json:"-"`
864 // NullFields is a list of field names (e.g. "FirmwareVersion") to include in
865 // API requests with the JSON null value. By default, fields with empty values
866 // are omitted from API requests. See
867 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
868 NullFields []string `json:"-"`
869 }
870
871 func (s SasPortalDeviceModel) MarshalJSON() ([]byte, error) {
872 type NoMethod SasPortalDeviceModel
873 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
874 }
875
876 // SasPortalDpaMoveList: An entry in a DPA's move list.
877 type SasPortalDpaMoveList struct {
878 // DpaId: The ID of the DPA.
879 DpaId string `json:"dpaId,omitempty"`
880 // FrequencyRange: The frequency range that the move list affects.
881 FrequencyRange *SasPortalFrequencyRange `json:"frequencyRange,omitempty"`
882 // ForceSendFields is a list of field names (e.g. "DpaId") to unconditionally
883 // include in API requests. By default, fields with empty or default values are
884 // omitted from API requests. See
885 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
886 // details.
887 ForceSendFields []string `json:"-"`
888 // NullFields is a list of field names (e.g. "DpaId") to include in API
889 // requests with the JSON null value. By default, fields with empty values are
890 // omitted from API requests. See
891 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
892 NullFields []string `json:"-"`
893 }
894
895 func (s SasPortalDpaMoveList) MarshalJSON() ([]byte, error) {
896 type NoMethod SasPortalDpaMoveList
897 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
898 }
899
900 // SasPortalEmpty: A generic empty message that you can re-use to avoid
901 // defining duplicated empty messages in your APIs. A typical example is to use
902 // it as the request or the response type of an API method. For instance:
903 // service Foo { rpc Bar(google.protobuf.Empty) returns
904 // (google.protobuf.Empty); }
905 type SasPortalEmpty struct {
906 // ServerResponse contains the HTTP response code and headers from the server.
907 googleapi.ServerResponse `json:"-"`
908 }
909
910 // SasPortalFrequencyRange: Frequency range from `low_frequency` to
911 // `high_frequency`.
912 type SasPortalFrequencyRange struct {
913 // HighFrequencyMhz: The highest frequency of the frequency range in MHz.
914 HighFrequencyMhz float64 `json:"highFrequencyMhz,omitempty"`
915 // LowFrequencyMhz: The lowest frequency of the frequency range in MHz.
916 LowFrequencyMhz float64 `json:"lowFrequencyMhz,omitempty"`
917 // ForceSendFields is a list of field names (e.g. "HighFrequencyMhz") to
918 // unconditionally include in API requests. By default, fields with empty or
919 // default values are omitted from API requests. See
920 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
921 // details.
922 ForceSendFields []string `json:"-"`
923 // NullFields is a list of field names (e.g. "HighFrequencyMhz") to include in
924 // API requests with the JSON null value. By default, fields with empty values
925 // are omitted from API requests. See
926 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
927 NullFields []string `json:"-"`
928 }
929
930 func (s SasPortalFrequencyRange) MarshalJSON() ([]byte, error) {
931 type NoMethod SasPortalFrequencyRange
932 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
933 }
934
935 func (s *SasPortalFrequencyRange) UnmarshalJSON(data []byte) error {
936 type NoMethod SasPortalFrequencyRange
937 var s1 struct {
938 HighFrequencyMhz gensupport.JSONFloat64 `json:"highFrequencyMhz"`
939 LowFrequencyMhz gensupport.JSONFloat64 `json:"lowFrequencyMhz"`
940 *NoMethod
941 }
942 s1.NoMethod = (*NoMethod)(s)
943 if err := json.Unmarshal(data, &s1); err != nil {
944 return err
945 }
946 s.HighFrequencyMhz = float64(s1.HighFrequencyMhz)
947 s.LowFrequencyMhz = float64(s1.LowFrequencyMhz)
948 return nil
949 }
950
951 // SasPortalGcpProjectDeployment: Deployment associated with the GCP project.
952 // Includes whether SAS analytics has been enabled or not.
953 type SasPortalGcpProjectDeployment struct {
954 // Deployment: Deployment associated with the GCP project.
955 Deployment *SasPortalDeployment `json:"deployment,omitempty"`
956 // HasEnabledAnalytics: Whether SAS analytics has been enabled.
957 HasEnabledAnalytics bool `json:"hasEnabledAnalytics,omitempty"`
958 // ForceSendFields is a list of field names (e.g. "Deployment") to
959 // unconditionally include in API requests. By default, fields with empty or
960 // default values are omitted from API requests. See
961 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
962 // details.
963 ForceSendFields []string `json:"-"`
964 // NullFields is a list of field names (e.g. "Deployment") to include in API
965 // requests with the JSON null value. By default, fields with empty values are
966 // omitted from API requests. See
967 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
968 NullFields []string `json:"-"`
969 }
970
971 func (s SasPortalGcpProjectDeployment) MarshalJSON() ([]byte, error) {
972 type NoMethod SasPortalGcpProjectDeployment
973 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
974 }
975
976 // SasPortalGenerateSecretRequest: Request for GenerateSecret.
977 type SasPortalGenerateSecretRequest struct {
978 }
979
980 // SasPortalGenerateSecretResponse: Response for GenerateSecret.
981 type SasPortalGenerateSecretResponse struct {
982 // Secret: The secret generated by the string and used by ValidateInstaller.
983 Secret string `json:"secret,omitempty"`
984
985 // ServerResponse contains the HTTP response code and headers from the server.
986 googleapi.ServerResponse `json:"-"`
987 // ForceSendFields is a list of field names (e.g. "Secret") to unconditionally
988 // include in API requests. By default, fields with empty or default values are
989 // omitted from API requests. See
990 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
991 // details.
992 ForceSendFields []string `json:"-"`
993 // NullFields is a list of field names (e.g. "Secret") to include in API
994 // requests with the JSON null value. By default, fields with empty values are
995 // omitted from API requests. See
996 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
997 NullFields []string `json:"-"`
998 }
999
1000 func (s SasPortalGenerateSecretResponse) MarshalJSON() ([]byte, error) {
1001 type NoMethod SasPortalGenerateSecretResponse
1002 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1003 }
1004
1005 // SasPortalGetPolicyRequest: Request message for `GetPolicy` method.
1006 type SasPortalGetPolicyRequest struct {
1007 // Resource: Required. The resource for which the policy is being requested.
1008 Resource string `json:"resource,omitempty"`
1009 // ForceSendFields is a list of field names (e.g. "Resource") to
1010 // unconditionally include in API requests. By default, fields with empty or
1011 // default values are omitted from API requests. See
1012 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1013 // details.
1014 ForceSendFields []string `json:"-"`
1015 // NullFields is a list of field names (e.g. "Resource") to include in API
1016 // requests with the JSON null value. By default, fields with empty values are
1017 // omitted from API requests. See
1018 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1019 NullFields []string `json:"-"`
1020 }
1021
1022 func (s SasPortalGetPolicyRequest) MarshalJSON() ([]byte, error) {
1023 type NoMethod SasPortalGetPolicyRequest
1024 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1025 }
1026
1027 // SasPortalInstallationParams: Information about the device installation
1028 // parameters.
1029 type SasPortalInstallationParams struct {
1030 // AntennaAzimuth: Boresight direction of the horizontal plane of the antenna
1031 // in degrees with respect to true north. The value of this parameter is an
1032 // integer with a value between 0 and 359 inclusive. A value of 0 degrees means
1033 // true north; a value of 90 degrees means east. This parameter is optional for
1034 // Category A devices and conditional for Category B devices.
1035 AntennaAzimuth int64 `json:"antennaAzimuth,omitempty"`
1036 // AntennaBeamwidth: 3-dB antenna beamwidth of the antenna in the
1037 // horizontal-plane in degrees. This parameter is an unsigned integer having a
1038 // value between 0 and 360 (degrees) inclusive; it is optional for Category A
1039 // devices and conditional for Category B devices.
1040 AntennaBeamwidth int64 `json:"antennaBeamwidth,omitempty"`
1041 // AntennaDowntilt: Antenna downtilt in degrees and is an integer with a value
1042 // between -90 and +90 inclusive; a negative value means the antenna is tilted
1043 // up (above horizontal). This parameter is optional for Category A devices and
1044 // conditional for Category B devices.
1045 AntennaDowntilt int64 `json:"antennaDowntilt,omitempty"`
1046 // AntennaGain: Peak antenna gain in dBi. This parameter is a double with a
1047 // value between -127 and +128 (dBi) inclusive. Part of Release 2 to support
1048 // floating-point value
1049 AntennaGain float64 `json:"antennaGain,omitempty"`
1050 // AntennaModel: If an external antenna is used, the antenna model is
1051 // optionally provided in this field. The string has a maximum length of 128
1052 // octets.
1053 AntennaModel string `json:"antennaModel,omitempty"`
1054 // CpeCbsdIndication: If present, this parameter specifies whether the CBSD is
1055 // a CPE-CBSD or not.
1056 CpeCbsdIndication bool `json:"cpeCbsdIndication,omitempty"`
1057 // EirpCapability: This parameter is the maximum device EIRP in units of
1058 // dBm/10MHz and is an integer with a value between -127 and +47 (dBm/10 MHz)
1059 // inclusive. If not included, SAS interprets it as maximum allowable EIRP in
1060 // units of dBm/10MHz for device category.
1061 EirpCapability int64 `json:"eirpCapability,omitempty"`
1062 // Height: Device antenna height in meters. When the `heightType` parameter
1063 // value is "AGL", the antenna height should be given relative to ground level.
1064 // When the `heightType` parameter value is "AMSL", it is given with respect to
1065 // WGS84 datum.
1066 Height float64 `json:"height,omitempty"`
1067 // HeightType: Specifies how the height is measured.
1068 //
1069 // Possible values:
1070 // "HEIGHT_TYPE_UNSPECIFIED" - Unspecified height type.
1071 // "HEIGHT_TYPE_AGL" - AGL height is measured relative to the ground level.
1072 // "HEIGHT_TYPE_AMSL" - AMSL height is measured relative to the mean sea
1073 // level.
1074 HeightType string `json:"heightType,omitempty"`
1075 // HorizontalAccuracy: A positive number in meters to indicate accuracy of the
1076 // device antenna horizontal location. This optional parameter should only be
1077 // present if its value is less than the FCC requirement of 50 meters.
1078 HorizontalAccuracy float64 `json:"horizontalAccuracy,omitempty"`
1079 // IndoorDeployment: Whether the device antenna is indoor or not. `true`:
1080 // indoor. `false`: outdoor.
1081 IndoorDeployment bool `json:"indoorDeployment,omitempty"`
1082 // Latitude: Latitude of the device antenna location in degrees relative to the
1083 // WGS 84 datum. The allowed range is from -90.000000 to +90.000000. Positive
1084 // values represent latitudes north of the equator; negative values south of
1085 // the equator.
1086 Latitude float64 `json:"latitude,omitempty"`
1087 // Longitude: Longitude of the device antenna location in degrees relative to
1088 // the WGS 84 datum. The allowed range is from -180.000000 to +180.000000.
1089 // Positive values represent longitudes east of the prime meridian; negative
1090 // values west of the prime meridian.
1091 Longitude float64 `json:"longitude,omitempty"`
1092 // VerticalAccuracy: A positive number in meters to indicate accuracy of the
1093 // device antenna vertical location. This optional parameter should only be
1094 // present if its value is less than the FCC requirement of 3 meters.
1095 VerticalAccuracy float64 `json:"verticalAccuracy,omitempty"`
1096 // ForceSendFields is a list of field names (e.g. "AntennaAzimuth") to
1097 // unconditionally include in API requests. By default, fields with empty or
1098 // default values are omitted from API requests. See
1099 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1100 // details.
1101 ForceSendFields []string `json:"-"`
1102 // NullFields is a list of field names (e.g. "AntennaAzimuth") to include in
1103 // API requests with the JSON null value. By default, fields with empty values
1104 // are omitted from API requests. See
1105 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1106 NullFields []string `json:"-"`
1107 }
1108
1109 func (s SasPortalInstallationParams) MarshalJSON() ([]byte, error) {
1110 type NoMethod SasPortalInstallationParams
1111 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1112 }
1113
1114 func (s *SasPortalInstallationParams) UnmarshalJSON(data []byte) error {
1115 type NoMethod SasPortalInstallationParams
1116 var s1 struct {
1117 AntennaGain gensupport.JSONFloat64 `json:"antennaGain"`
1118 Height gensupport.JSONFloat64 `json:"height"`
1119 HorizontalAccuracy gensupport.JSONFloat64 `json:"horizontalAccuracy"`
1120 Latitude gensupport.JSONFloat64 `json:"latitude"`
1121 Longitude gensupport.JSONFloat64 `json:"longitude"`
1122 VerticalAccuracy gensupport.JSONFloat64 `json:"verticalAccuracy"`
1123 *NoMethod
1124 }
1125 s1.NoMethod = (*NoMethod)(s)
1126 if err := json.Unmarshal(data, &s1); err != nil {
1127 return err
1128 }
1129 s.AntennaGain = float64(s1.AntennaGain)
1130 s.Height = float64(s1.Height)
1131 s.HorizontalAccuracy = float64(s1.HorizontalAccuracy)
1132 s.Latitude = float64(s1.Latitude)
1133 s.Longitude = float64(s1.Longitude)
1134 s.VerticalAccuracy = float64(s1.VerticalAccuracy)
1135 return nil
1136 }
1137
1138 // SasPortalListCustomersResponse: Response for `ListCustomers`.
1139 type SasPortalListCustomersResponse struct {
1140 // Customers: The list of customers that match the request.
1141 Customers []*SasPortalCustomer `json:"customers,omitempty"`
1142 // NextPageToken: A pagination token returned from a previous call to
1143 // ListCustomers that indicates from where listing should continue. If the
1144 // field is missing or empty, it means there are no more customers.
1145 NextPageToken string `json:"nextPageToken,omitempty"`
1146
1147 // ServerResponse contains the HTTP response code and headers from the server.
1148 googleapi.ServerResponse `json:"-"`
1149 // ForceSendFields is a list of field names (e.g. "Customers") to
1150 // unconditionally include in API requests. By default, fields with empty or
1151 // default values are omitted from API requests. See
1152 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1153 // details.
1154 ForceSendFields []string `json:"-"`
1155 // NullFields is a list of field names (e.g. "Customers") to include in API
1156 // requests with the JSON null value. By default, fields with empty values are
1157 // omitted from API requests. See
1158 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1159 NullFields []string `json:"-"`
1160 }
1161
1162 func (s SasPortalListCustomersResponse) MarshalJSON() ([]byte, error) {
1163 type NoMethod SasPortalListCustomersResponse
1164 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1165 }
1166
1167 // SasPortalListDeploymentsResponse: Response for ListDeployments.
1168 type SasPortalListDeploymentsResponse struct {
1169 // Deployments: The deployments that match the request.
1170 Deployments []*SasPortalDeployment `json:"deployments,omitempty"`
1171 // NextPageToken: A pagination token returned from a previous call to
1172 // ListDeployments that indicates from where listing should continue. If the
1173 // field is missing or empty, it means there are no more deployments.
1174 NextPageToken string `json:"nextPageToken,omitempty"`
1175
1176 // ServerResponse contains the HTTP response code and headers from the server.
1177 googleapi.ServerResponse `json:"-"`
1178 // ForceSendFields is a list of field names (e.g. "Deployments") to
1179 // unconditionally include in API requests. By default, fields with empty or
1180 // default values are omitted from API requests. See
1181 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1182 // details.
1183 ForceSendFields []string `json:"-"`
1184 // NullFields is a list of field names (e.g. "Deployments") to include in API
1185 // requests with the JSON null value. By default, fields with empty values are
1186 // omitted from API requests. See
1187 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1188 NullFields []string `json:"-"`
1189 }
1190
1191 func (s SasPortalListDeploymentsResponse) MarshalJSON() ([]byte, error) {
1192 type NoMethod SasPortalListDeploymentsResponse
1193 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1194 }
1195
1196 // SasPortalListDevicesResponse: Response for ListDevices.
1197 type SasPortalListDevicesResponse struct {
1198 // Devices: The devices that match the request.
1199 Devices []*SasPortalDevice `json:"devices,omitempty"`
1200 // NextPageToken: A pagination token returned from a previous call to
1201 // ListDevices that indicates from where listing should continue. If the field
1202 // is missing or empty, it means there is no more devices.
1203 NextPageToken string `json:"nextPageToken,omitempty"`
1204
1205 // ServerResponse contains the HTTP response code and headers from the server.
1206 googleapi.ServerResponse `json:"-"`
1207 // ForceSendFields is a list of field names (e.g. "Devices") to unconditionally
1208 // include in API requests. By default, fields with empty or default values are
1209 // omitted from API requests. See
1210 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1211 // details.
1212 ForceSendFields []string `json:"-"`
1213 // NullFields is a list of field names (e.g. "Devices") to include in API
1214 // requests with the JSON null value. By default, fields with empty values are
1215 // omitted from API requests. See
1216 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1217 NullFields []string `json:"-"`
1218 }
1219
1220 func (s SasPortalListDevicesResponse) MarshalJSON() ([]byte, error) {
1221 type NoMethod SasPortalListDevicesResponse
1222 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1223 }
1224
1225 // SasPortalListGcpProjectDeploymentsResponse: Response for
1226 // [ListGcpProjectDeployments].
1227 type SasPortalListGcpProjectDeploymentsResponse struct {
1228 // Deployments: Optional. Deployments associated with the GCP project
1229 Deployments []*SasPortalGcpProjectDeployment `json:"deployments,omitempty"`
1230
1231 // ServerResponse contains the HTTP response code and headers from the server.
1232 googleapi.ServerResponse `json:"-"`
1233 // ForceSendFields is a list of field names (e.g. "Deployments") to
1234 // unconditionally include in API requests. By default, fields with empty or
1235 // default values are omitted from API requests. See
1236 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1237 // details.
1238 ForceSendFields []string `json:"-"`
1239 // NullFields is a list of field names (e.g. "Deployments") to include in API
1240 // requests with the JSON null value. By default, fields with empty values are
1241 // omitted from API requests. See
1242 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1243 NullFields []string `json:"-"`
1244 }
1245
1246 func (s SasPortalListGcpProjectDeploymentsResponse) MarshalJSON() ([]byte, error) {
1247 type NoMethod SasPortalListGcpProjectDeploymentsResponse
1248 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1249 }
1250
1251 // SasPortalListLegacyOrganizationsResponse: Response for
1252 // [ListLegacyOrganizations].
1253 // [spectrum.sas.portal.v1alpha1.Provisioning.ListLegacyOrganizations].
1254 type SasPortalListLegacyOrganizationsResponse struct {
1255 // Organizations: Optional. Legacy SAS organizations.
1256 Organizations []*SasPortalOrganization `json:"organizations,omitempty"`
1257
1258 // ServerResponse contains the HTTP response code and headers from the server.
1259 googleapi.ServerResponse `json:"-"`
1260 // ForceSendFields is a list of field names (e.g. "Organizations") to
1261 // unconditionally include in API requests. By default, fields with empty or
1262 // default values are omitted from API requests. See
1263 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1264 // details.
1265 ForceSendFields []string `json:"-"`
1266 // NullFields is a list of field names (e.g. "Organizations") to include in API
1267 // requests with the JSON null value. By default, fields with empty values are
1268 // omitted from API requests. See
1269 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1270 NullFields []string `json:"-"`
1271 }
1272
1273 func (s SasPortalListLegacyOrganizationsResponse) MarshalJSON() ([]byte, error) {
1274 type NoMethod SasPortalListLegacyOrganizationsResponse
1275 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1276 }
1277
1278 // SasPortalListNodesResponse: Response for ListNodes.
1279 type SasPortalListNodesResponse struct {
1280 // NextPageToken: A pagination token returned from a previous call to ListNodes
1281 // that indicates from where listing should continue. If the field is missing
1282 // or empty, it means there is no more nodes.
1283 NextPageToken string `json:"nextPageToken,omitempty"`
1284 // Nodes: The nodes that match the request.
1285 Nodes []*SasPortalNode `json:"nodes,omitempty"`
1286
1287 // ServerResponse contains the HTTP response code and headers from the server.
1288 googleapi.ServerResponse `json:"-"`
1289 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1290 // unconditionally include in API requests. By default, fields with empty or
1291 // default values are omitted from API requests. See
1292 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1293 // details.
1294 ForceSendFields []string `json:"-"`
1295 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1296 // requests with the JSON null value. By default, fields with empty values are
1297 // omitted from API requests. See
1298 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1299 NullFields []string `json:"-"`
1300 }
1301
1302 func (s SasPortalListNodesResponse) MarshalJSON() ([]byte, error) {
1303 type NoMethod SasPortalListNodesResponse
1304 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1305 }
1306
1307 // SasPortalMigrateOrganizationMetadata: Long-running operation metadata
1308 // message returned by the MigrateOrganization.
1309 type SasPortalMigrateOrganizationMetadata struct {
1310 // OperationState: Output only. Current operation state
1311 //
1312 // Possible values:
1313 // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
1314 // "OPERATION_STATE_PENDING" - Pending (Not started).
1315 // "OPERATION_STATE_RUNNING" - In-progress.
1316 // "OPERATION_STATE_SUCCEEDED" - Done successfully.
1317 // "OPERATION_STATE_FAILED" - Done with errors.
1318 OperationState string `json:"operationState,omitempty"`
1319 // ForceSendFields is a list of field names (e.g. "OperationState") to
1320 // unconditionally include in API requests. By default, fields with empty or
1321 // default values are omitted from API requests. See
1322 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1323 // details.
1324 ForceSendFields []string `json:"-"`
1325 // NullFields is a list of field names (e.g. "OperationState") to include in
1326 // API requests with the JSON null value. By default, fields with empty values
1327 // are omitted from API requests. See
1328 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1329 NullFields []string `json:"-"`
1330 }
1331
1332 func (s SasPortalMigrateOrganizationMetadata) MarshalJSON() ([]byte, error) {
1333 type NoMethod SasPortalMigrateOrganizationMetadata
1334 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1335 }
1336
1337 // SasPortalMigrateOrganizationRequest: Request for [MigrateOrganization].
1338 // [spectrum.sas.portal.v1alpha1.Provisioning.MigrateOrganization]. GCP
1339 // Project, Organization Info, and caller's GAIA ID should be retrieved from
1340 // the RPC handler, and used to check authorization on SAS Portal organization
1341 // and to create GCP Projects.
1342 type SasPortalMigrateOrganizationRequest struct {
1343 // OrganizationId: Required. Id of the SAS organization to be migrated.
1344 OrganizationId int64 `json:"organizationId,omitempty,string"`
1345 // ForceSendFields is a list of field names (e.g. "OrganizationId") to
1346 // unconditionally include in API requests. By default, fields with empty or
1347 // default values are omitted from API requests. See
1348 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1349 // details.
1350 ForceSendFields []string `json:"-"`
1351 // NullFields is a list of field names (e.g. "OrganizationId") to include in
1352 // API requests with the JSON null value. By default, fields with empty values
1353 // are omitted from API requests. See
1354 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1355 NullFields []string `json:"-"`
1356 }
1357
1358 func (s SasPortalMigrateOrganizationRequest) MarshalJSON() ([]byte, error) {
1359 type NoMethod SasPortalMigrateOrganizationRequest
1360 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1361 }
1362
1363 // SasPortalMigrateOrganizationResponse: Response for [MigrateOrganization].
1364 // [spectrum.sas.portal.v1alpha1.Provisioning.MigrateOrganization].
1365 type SasPortalMigrateOrganizationResponse struct {
1366 // DeploymentAssociation: Optional. A list of deployment association that were
1367 // created for the migration, or current associations if they already exist.
1368 DeploymentAssociation []*SasPortalDeploymentAssociation `json:"deploymentAssociation,omitempty"`
1369 // ForceSendFields is a list of field names (e.g. "DeploymentAssociation") to
1370 // unconditionally include in API requests. By default, fields with empty or
1371 // default values are omitted from API requests. See
1372 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1373 // details.
1374 ForceSendFields []string `json:"-"`
1375 // NullFields is a list of field names (e.g. "DeploymentAssociation") to
1376 // include in API requests with the JSON null value. By default, fields with
1377 // empty values are omitted from API requests. See
1378 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1379 NullFields []string `json:"-"`
1380 }
1381
1382 func (s SasPortalMigrateOrganizationResponse) MarshalJSON() ([]byte, error) {
1383 type NoMethod SasPortalMigrateOrganizationResponse
1384 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1385 }
1386
1387 // SasPortalMoveDeploymentRequest: Request for MoveDeployment.
1388 type SasPortalMoveDeploymentRequest struct {
1389 // Destination: Required. The name of the new parent resource node or customer
1390 // to reparent the deployment under.
1391 Destination string `json:"destination,omitempty"`
1392 // ForceSendFields is a list of field names (e.g. "Destination") to
1393 // unconditionally include in API requests. By default, fields with empty or
1394 // default values are omitted from API requests. See
1395 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1396 // details.
1397 ForceSendFields []string `json:"-"`
1398 // NullFields is a list of field names (e.g. "Destination") to include in API
1399 // requests with the JSON null value. By default, fields with empty values are
1400 // omitted from API requests. See
1401 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1402 NullFields []string `json:"-"`
1403 }
1404
1405 func (s SasPortalMoveDeploymentRequest) MarshalJSON() ([]byte, error) {
1406 type NoMethod SasPortalMoveDeploymentRequest
1407 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1408 }
1409
1410 // SasPortalMoveDeviceRequest: Request for MoveDevice.
1411 type SasPortalMoveDeviceRequest struct {
1412 // Destination: Required. The name of the new parent resource node or customer
1413 // to reparent the device under.
1414 Destination string `json:"destination,omitempty"`
1415 // ForceSendFields is a list of field names (e.g. "Destination") to
1416 // unconditionally include in API requests. By default, fields with empty or
1417 // default values are omitted from API requests. See
1418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1419 // details.
1420 ForceSendFields []string `json:"-"`
1421 // NullFields is a list of field names (e.g. "Destination") to include in API
1422 // requests with the JSON null value. By default, fields with empty values are
1423 // omitted from API requests. See
1424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1425 NullFields []string `json:"-"`
1426 }
1427
1428 func (s SasPortalMoveDeviceRequest) MarshalJSON() ([]byte, error) {
1429 type NoMethod SasPortalMoveDeviceRequest
1430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1431 }
1432
1433 // SasPortalMoveNodeRequest: Request for MoveNode.
1434 type SasPortalMoveNodeRequest struct {
1435 // Destination: Required. The name of the new parent resource node or customer
1436 // to reparent the node under.
1437 Destination string `json:"destination,omitempty"`
1438 // ForceSendFields is a list of field names (e.g. "Destination") to
1439 // unconditionally include in API requests. By default, fields with empty or
1440 // default values are omitted from API requests. See
1441 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1442 // details.
1443 ForceSendFields []string `json:"-"`
1444 // NullFields is a list of field names (e.g. "Destination") to include in API
1445 // requests with the JSON null value. By default, fields with empty values are
1446 // omitted from API requests. See
1447 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1448 NullFields []string `json:"-"`
1449 }
1450
1451 func (s SasPortalMoveNodeRequest) MarshalJSON() ([]byte, error) {
1452 type NoMethod SasPortalMoveNodeRequest
1453 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1454 }
1455
1456 // SasPortalNode: The Node.
1457 type SasPortalNode struct {
1458 // DisplayName: The node's display name.
1459 DisplayName string `json:"displayName,omitempty"`
1460 // Name: Output only. Resource name.
1461 Name string `json:"name,omitempty"`
1462 // SasUserIds: User ids used by the devices belonging to this node.
1463 SasUserIds []string `json:"sasUserIds,omitempty"`
1464
1465 // ServerResponse contains the HTTP response code and headers from the server.
1466 googleapi.ServerResponse `json:"-"`
1467 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1468 // unconditionally include in API requests. By default, fields with empty or
1469 // default values are omitted from API requests. See
1470 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1471 // details.
1472 ForceSendFields []string `json:"-"`
1473 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1474 // requests with the JSON null value. By default, fields with empty values are
1475 // omitted from API requests. See
1476 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1477 NullFields []string `json:"-"`
1478 }
1479
1480 func (s SasPortalNode) MarshalJSON() ([]byte, error) {
1481 type NoMethod SasPortalNode
1482 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1483 }
1484
1485 // SasPortalNrqzValidation: Information about National Radio Quiet Zone
1486 // validation.
1487 type SasPortalNrqzValidation struct {
1488 // CaseId: Validation case ID.
1489 CaseId string `json:"caseId,omitempty"`
1490 // CpiId: CPI who signed the validation.
1491 CpiId string `json:"cpiId,omitempty"`
1492 // Latitude: Device latitude that's associated with the validation.
1493 Latitude float64 `json:"latitude,omitempty"`
1494 // Longitude: Device longitude that's associated with the validation.
1495 Longitude float64 `json:"longitude,omitempty"`
1496 // State: State of the NRQZ validation info.
1497 //
1498 // Possible values:
1499 // "STATE_UNSPECIFIED" - Unspecified state.
1500 // "DRAFT" - Draft state.
1501 // "FINAL" - Final state.
1502 State string `json:"state,omitempty"`
1503 // ForceSendFields is a list of field names (e.g. "CaseId") to unconditionally
1504 // include in API requests. By default, fields with empty or default values are
1505 // omitted from API requests. See
1506 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1507 // details.
1508 ForceSendFields []string `json:"-"`
1509 // NullFields is a list of field names (e.g. "CaseId") to include in API
1510 // requests with the JSON null value. By default, fields with empty values are
1511 // omitted from API requests. See
1512 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1513 NullFields []string `json:"-"`
1514 }
1515
1516 func (s SasPortalNrqzValidation) MarshalJSON() ([]byte, error) {
1517 type NoMethod SasPortalNrqzValidation
1518 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1519 }
1520
1521 func (s *SasPortalNrqzValidation) UnmarshalJSON(data []byte) error {
1522 type NoMethod SasPortalNrqzValidation
1523 var s1 struct {
1524 Latitude gensupport.JSONFloat64 `json:"latitude"`
1525 Longitude gensupport.JSONFloat64 `json:"longitude"`
1526 *NoMethod
1527 }
1528 s1.NoMethod = (*NoMethod)(s)
1529 if err := json.Unmarshal(data, &s1); err != nil {
1530 return err
1531 }
1532 s.Latitude = float64(s1.Latitude)
1533 s.Longitude = float64(s1.Longitude)
1534 return nil
1535 }
1536
1537 // SasPortalOperation: This resource represents a long-running operation that
1538 // is the result of a network API call.
1539 type SasPortalOperation struct {
1540 // Done: If the value is `false`, it means the operation is still in progress.
1541 // If `true`, the operation is completed, and either `error` or `response` is
1542 // available.
1543 Done bool `json:"done,omitempty"`
1544 // Error: The error result of the operation in case of failure or cancellation.
1545 Error *SasPortalStatus `json:"error,omitempty"`
1546 // Metadata: Service-specific metadata associated with the operation. It
1547 // typically contains progress information and common metadata such as create
1548 // time. Some services might not provide such metadata. Any method that returns
1549 // a long-running operation should document the metadata type, if any.
1550 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1551 // Name: The server-assigned name, which is only unique within the same service
1552 // that originally returns it. If you use the default HTTP mapping, the `name`
1553 // should be a resource name ending with `operations/{unique_id}`.
1554 Name string `json:"name,omitempty"`
1555 // Response: The normal, successful response of the operation. If the original
1556 // method returns no data on success, such as `Delete`, the response is
1557 // `google.protobuf.Empty`. If the original method is standard
1558 // `Get`/`Create`/`Update`, the response should be the resource. For other
1559 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
1560 // original method name. For example, if the original method name is
1561 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
1562 Response googleapi.RawMessage `json:"response,omitempty"`
1563
1564 // ServerResponse contains the HTTP response code and headers from the server.
1565 googleapi.ServerResponse `json:"-"`
1566 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
1567 // include in API requests. By default, fields with empty or default values are
1568 // omitted from API requests. See
1569 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1570 // details.
1571 ForceSendFields []string `json:"-"`
1572 // NullFields is a list of field names (e.g. "Done") to include in API requests
1573 // with the JSON null value. By default, fields with empty values are omitted
1574 // from API requests. See
1575 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1576 NullFields []string `json:"-"`
1577 }
1578
1579 func (s SasPortalOperation) MarshalJSON() ([]byte, error) {
1580 type NoMethod SasPortalOperation
1581 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1582 }
1583
1584 // SasPortalOrganization: Organization details.
1585 type SasPortalOrganization struct {
1586 // DisplayName: Name of organization
1587 DisplayName string `json:"displayName,omitempty"`
1588 // Id: Id of organization
1589 Id int64 `json:"id,omitempty,string"`
1590 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1591 // unconditionally include in API requests. By default, fields with empty or
1592 // default values are omitted from API requests. See
1593 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1594 // details.
1595 ForceSendFields []string `json:"-"`
1596 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1597 // requests with the JSON null value. By default, fields with empty values are
1598 // omitted from API requests. See
1599 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1600 NullFields []string `json:"-"`
1601 }
1602
1603 func (s SasPortalOrganization) MarshalJSON() ([]byte, error) {
1604 type NoMethod SasPortalOrganization
1605 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1606 }
1607
1608 // SasPortalPolicy: Defines an access control policy to the resources.
1609 type SasPortalPolicy struct {
1610 // Assignments: List of assignments
1611 Assignments []*SasPortalAssignment `json:"assignments,omitempty"`
1612 // Etag: The etag is used for optimistic concurrency control as a way to help
1613 // prevent simultaneous updates of a policy from overwriting each other. It is
1614 // strongly suggested that systems make use of the etag in the
1615 // read-modify-write cycle to perform policy updates in order to avoid race
1616 // conditions: An etag is returned in the response to GetPolicy, and systems
1617 // are expected to put that etag in the request to SetPolicy to ensure that
1618 // their change will be applied to the same version of the policy. If no etag
1619 // is provided in the call to GetPolicy, then the existing policy is
1620 // overwritten blindly.
1621 Etag string `json:"etag,omitempty"`
1622
1623 // ServerResponse contains the HTTP response code and headers from the server.
1624 googleapi.ServerResponse `json:"-"`
1625 // ForceSendFields is a list of field names (e.g. "Assignments") to
1626 // unconditionally include in API requests. By default, fields with empty or
1627 // default values are omitted from API requests. See
1628 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1629 // details.
1630 ForceSendFields []string `json:"-"`
1631 // NullFields is a list of field names (e.g. "Assignments") to include in API
1632 // requests with the JSON null value. By default, fields with empty values are
1633 // omitted from API requests. See
1634 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1635 NullFields []string `json:"-"`
1636 }
1637
1638 func (s SasPortalPolicy) MarshalJSON() ([]byte, error) {
1639 type NoMethod SasPortalPolicy
1640 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1641 }
1642
1643 // SasPortalProvisionDeploymentRequest: Request for [ProvisionDeployment].
1644 // [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment]. GCP
1645 // Project, Organization Info, and caller’s GAIA ID should be retrieved from
1646 // the RPC handler, and used as inputs to create a new SAS organization (if not
1647 // exists) and a new SAS deployment.
1648 type SasPortalProvisionDeploymentRequest struct {
1649 // NewDeploymentDisplayName: Optional. If this field is set, and a new SAS
1650 // Portal Deployment needs to be created, its display name will be set to the
1651 // value of this field.
1652 NewDeploymentDisplayName string `json:"newDeploymentDisplayName,omitempty"`
1653 // NewOrganizationDisplayName: Optional. If this field is set, and a new SAS
1654 // Portal Organization needs to be created, its display name will be set to the
1655 // value of this field.
1656 NewOrganizationDisplayName string `json:"newOrganizationDisplayName,omitempty"`
1657 // OrganizationId: Optional. If this field is set then a new deployment will be
1658 // created under the organization specified by this id.
1659 OrganizationId int64 `json:"organizationId,omitempty,string"`
1660 // ForceSendFields is a list of field names (e.g. "NewDeploymentDisplayName")
1661 // to unconditionally include in API requests. By default, fields with empty or
1662 // default values are omitted from API requests. See
1663 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1664 // details.
1665 ForceSendFields []string `json:"-"`
1666 // NullFields is a list of field names (e.g. "NewDeploymentDisplayName") to
1667 // include in API requests with the JSON null value. By default, fields with
1668 // empty values are omitted from API requests. See
1669 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1670 NullFields []string `json:"-"`
1671 }
1672
1673 func (s SasPortalProvisionDeploymentRequest) MarshalJSON() ([]byte, error) {
1674 type NoMethod SasPortalProvisionDeploymentRequest
1675 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1676 }
1677
1678 // SasPortalProvisionDeploymentResponse: Response for [ProvisionDeployment].
1679 // [spectrum.sas.portal.v1alpha1.Provisioning.ProvisionDeployment].
1680 type SasPortalProvisionDeploymentResponse struct {
1681 // ErrorMessage: Optional. Optional error message if the provisioning request
1682 // is not successful.
1683 ErrorMessage string `json:"errorMessage,omitempty"`
1684
1685 // ServerResponse contains the HTTP response code and headers from the server.
1686 googleapi.ServerResponse `json:"-"`
1687 // ForceSendFields is a list of field names (e.g. "ErrorMessage") to
1688 // unconditionally include in API requests. By default, fields with empty or
1689 // default values are omitted from API requests. See
1690 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1691 // details.
1692 ForceSendFields []string `json:"-"`
1693 // NullFields is a list of field names (e.g. "ErrorMessage") to include in API
1694 // requests with the JSON null value. By default, fields with empty values are
1695 // omitted from API requests. See
1696 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1697 NullFields []string `json:"-"`
1698 }
1699
1700 func (s SasPortalProvisionDeploymentResponse) MarshalJSON() ([]byte, error) {
1701 type NoMethod SasPortalProvisionDeploymentResponse
1702 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1703 }
1704
1705 // SasPortalSetPolicyRequest: Request message for `SetPolicy` method.
1706 type SasPortalSetPolicyRequest struct {
1707 // DisableNotification: Optional. Set the field as `true` to disable the
1708 // onboarding notification.
1709 DisableNotification bool `json:"disableNotification,omitempty"`
1710 // Policy: Required. The policy to be applied to the `resource`.
1711 Policy *SasPortalPolicy `json:"policy,omitempty"`
1712 // Resource: Required. The resource for which the policy is being specified.
1713 // This policy replaces any existing policy.
1714 Resource string `json:"resource,omitempty"`
1715 // ForceSendFields is a list of field names (e.g. "DisableNotification") to
1716 // unconditionally include in API requests. By default, fields with empty or
1717 // default values are omitted from API requests. See
1718 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1719 // details.
1720 ForceSendFields []string `json:"-"`
1721 // NullFields is a list of field names (e.g. "DisableNotification") to include
1722 // in API requests with the JSON null value. By default, fields with empty
1723 // values are omitted from API requests. See
1724 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1725 NullFields []string `json:"-"`
1726 }
1727
1728 func (s SasPortalSetPolicyRequest) MarshalJSON() ([]byte, error) {
1729 type NoMethod SasPortalSetPolicyRequest
1730 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1731 }
1732
1733 // SasPortalSetupSasAnalyticsMetadata: Metadata returned by the long running
1734 // operation for the SetupSasAnalytics rpc.
1735 type SasPortalSetupSasAnalyticsMetadata struct {
1736 }
1737
1738 // SasPortalSetupSasAnalyticsRequest: Request for the SetupSasAnalytics rpc.
1739 type SasPortalSetupSasAnalyticsRequest struct {
1740 // UserId: Optional. User id to setup analytics for, if not provided the user
1741 // id associated with the project is used. optional
1742 UserId string `json:"userId,omitempty"`
1743 // ForceSendFields is a list of field names (e.g. "UserId") to unconditionally
1744 // include in API requests. By default, fields with empty or default values are
1745 // omitted from API requests. See
1746 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1747 // details.
1748 ForceSendFields []string `json:"-"`
1749 // NullFields is a list of field names (e.g. "UserId") to include in API
1750 // requests with the JSON null value. By default, fields with empty values are
1751 // omitted from API requests. See
1752 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1753 NullFields []string `json:"-"`
1754 }
1755
1756 func (s SasPortalSetupSasAnalyticsRequest) MarshalJSON() ([]byte, error) {
1757 type NoMethod SasPortalSetupSasAnalyticsRequest
1758 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1759 }
1760
1761 // SasPortalSetupSasAnalyticsResponse: Response returned by the long running
1762 // operation for the SetupSasAnalytics rpc.
1763 type SasPortalSetupSasAnalyticsResponse struct {
1764 }
1765
1766 // SasPortalSignDeviceRequest: Request for SignDevice.
1767 type SasPortalSignDeviceRequest struct {
1768 // Device: Required. The device to sign. The device fields name, fcc_id and
1769 // serial_number must be set. The user_id field must be set.
1770 Device *SasPortalDevice `json:"device,omitempty"`
1771 // ForceSendFields is a list of field names (e.g. "Device") to unconditionally
1772 // include in API requests. By default, fields with empty or default values are
1773 // omitted from API requests. See
1774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1775 // details.
1776 ForceSendFields []string `json:"-"`
1777 // NullFields is a list of field names (e.g. "Device") to include in API
1778 // requests with the JSON null value. By default, fields with empty values are
1779 // omitted from API requests. See
1780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1781 NullFields []string `json:"-"`
1782 }
1783
1784 func (s SasPortalSignDeviceRequest) MarshalJSON() ([]byte, error) {
1785 type NoMethod SasPortalSignDeviceRequest
1786 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1787 }
1788
1789 // SasPortalStatus: The `Status` type defines a logical error model that is
1790 // suitable for different programming environments, including REST APIs and RPC
1791 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
1792 // contains three pieces of data: error code, error message, and error details.
1793 // You can find out more about this error model and how to work with it in the
1794 // API Design Guide (https://cloud.google.com/apis/design/errors).
1795 type SasPortalStatus struct {
1796 // Code: The status code, which should be an enum value of google.rpc.Code.
1797 Code int64 `json:"code,omitempty"`
1798 // Details: A list of messages that carry the error details. There is a common
1799 // set of message types for APIs to use.
1800 Details []googleapi.RawMessage `json:"details,omitempty"`
1801 // Message: A developer-facing error message, which should be in English. Any
1802 // user-facing error message should be localized and sent in the
1803 // google.rpc.Status.details field, or localized by the client.
1804 Message string `json:"message,omitempty"`
1805 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1806 // include in API requests. By default, fields with empty or default values are
1807 // omitted from API requests. See
1808 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1809 // details.
1810 ForceSendFields []string `json:"-"`
1811 // NullFields is a list of field names (e.g. "Code") to include in API requests
1812 // with the JSON null value. By default, fields with empty values are omitted
1813 // from API requests. See
1814 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1815 NullFields []string `json:"-"`
1816 }
1817
1818 func (s SasPortalStatus) MarshalJSON() ([]byte, error) {
1819 type NoMethod SasPortalStatus
1820 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1821 }
1822
1823 // SasPortalTestPermissionsRequest: Request message for `TestPermissions`
1824 // method.
1825 type SasPortalTestPermissionsRequest struct {
1826 // Permissions: The set of permissions to check for the `resource`.
1827 Permissions []string `json:"permissions,omitempty"`
1828 // Resource: Required. The resource for which the permissions are being
1829 // requested.
1830 Resource string `json:"resource,omitempty"`
1831 // ForceSendFields is a list of field names (e.g. "Permissions") to
1832 // unconditionally include in API requests. By default, fields with empty or
1833 // default values are omitted from API requests. See
1834 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1835 // details.
1836 ForceSendFields []string `json:"-"`
1837 // NullFields is a list of field names (e.g. "Permissions") to include in API
1838 // requests with the JSON null value. By default, fields with empty values are
1839 // omitted from API requests. See
1840 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1841 NullFields []string `json:"-"`
1842 }
1843
1844 func (s SasPortalTestPermissionsRequest) MarshalJSON() ([]byte, error) {
1845 type NoMethod SasPortalTestPermissionsRequest
1846 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1847 }
1848
1849 // SasPortalTestPermissionsResponse: Response message for `TestPermissions`
1850 // method.
1851 type SasPortalTestPermissionsResponse struct {
1852 // Permissions: A set of permissions that the caller is allowed.
1853 Permissions []string `json:"permissions,omitempty"`
1854
1855 // ServerResponse contains the HTTP response code and headers from the server.
1856 googleapi.ServerResponse `json:"-"`
1857 // ForceSendFields is a list of field names (e.g. "Permissions") to
1858 // unconditionally include in API requests. By default, fields with empty or
1859 // default values are omitted from API requests. See
1860 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1861 // details.
1862 ForceSendFields []string `json:"-"`
1863 // NullFields is a list of field names (e.g. "Permissions") to include in API
1864 // requests with the JSON null value. By default, fields with empty values are
1865 // omitted from API requests. See
1866 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1867 NullFields []string `json:"-"`
1868 }
1869
1870 func (s SasPortalTestPermissionsResponse) MarshalJSON() ([]byte, error) {
1871 type NoMethod SasPortalTestPermissionsResponse
1872 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1873 }
1874
1875 // SasPortalUpdateSignedDeviceRequest: Request for UpdateSignedDevice.
1876 type SasPortalUpdateSignedDeviceRequest struct {
1877 // EncodedDevice: Required. The JSON Web Token signed using a CPI private key.
1878 // Payload must be the JSON encoding of the device. The user_id field must be
1879 // set.
1880 EncodedDevice string `json:"encodedDevice,omitempty"`
1881 // InstallerId: Required. Unique installer ID (CPI ID) from the Certified
1882 // Professional Installers database.
1883 InstallerId string `json:"installerId,omitempty"`
1884 // ForceSendFields is a list of field names (e.g. "EncodedDevice") to
1885 // unconditionally include in API requests. By default, fields with empty or
1886 // default values are omitted from API requests. See
1887 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1888 // details.
1889 ForceSendFields []string `json:"-"`
1890 // NullFields is a list of field names (e.g. "EncodedDevice") to include in API
1891 // requests with the JSON null value. By default, fields with empty values are
1892 // omitted from API requests. See
1893 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1894 NullFields []string `json:"-"`
1895 }
1896
1897 func (s SasPortalUpdateSignedDeviceRequest) MarshalJSON() ([]byte, error) {
1898 type NoMethod SasPortalUpdateSignedDeviceRequest
1899 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1900 }
1901
1902 // SasPortalValidateInstallerRequest: Request for ValidateInstaller.
1903 type SasPortalValidateInstallerRequest struct {
1904 // EncodedSecret: Required. JSON Web Token signed using a CPI private key.
1905 // Payload must include a "secret" claim whose value is the secret.
1906 EncodedSecret string `json:"encodedSecret,omitempty"`
1907 // InstallerId: Required. Unique installer id (CPI ID) from the Certified
1908 // Professional Installers database.
1909 InstallerId string `json:"installerId,omitempty"`
1910 // Secret: Required. Secret returned by the GenerateSecret.
1911 Secret string `json:"secret,omitempty"`
1912 // ForceSendFields is a list of field names (e.g. "EncodedSecret") to
1913 // unconditionally include in API requests. By default, fields with empty or
1914 // default values are omitted from API requests. See
1915 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1916 // details.
1917 ForceSendFields []string `json:"-"`
1918 // NullFields is a list of field names (e.g. "EncodedSecret") to include in API
1919 // requests with the JSON null value. By default, fields with empty values are
1920 // omitted from API requests. See
1921 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1922 NullFields []string `json:"-"`
1923 }
1924
1925 func (s SasPortalValidateInstallerRequest) MarshalJSON() ([]byte, error) {
1926 type NoMethod SasPortalValidateInstallerRequest
1927 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1928 }
1929
1930 // SasPortalValidateInstallerResponse: Response for ValidateInstaller.
1931 type SasPortalValidateInstallerResponse struct {
1932 // ServerResponse contains the HTTP response code and headers from the server.
1933 googleapi.ServerResponse `json:"-"`
1934 }
1935
1936 type CustomersGetCall struct {
1937 s *Service
1938 name string
1939 urlParams_ gensupport.URLParams
1940 ifNoneMatch_ string
1941 ctx_ context.Context
1942 header_ http.Header
1943 }
1944
1945 // Get: Returns a requested customer.
1946 //
1947 // - name: The name of the customer.
1948 func (r *CustomersService) Get(name string) *CustomersGetCall {
1949 c := &CustomersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1950 c.name = name
1951 return c
1952 }
1953
1954 // Fields allows partial responses to be retrieved. See
1955 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1956 // details.
1957 func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall {
1958 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1959 return c
1960 }
1961
1962 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1963 // object's ETag matches the given value. This is useful for getting updates
1964 // only after the object has changed since the last request.
1965 func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall {
1966 c.ifNoneMatch_ = entityTag
1967 return c
1968 }
1969
1970 // Context sets the context to be used in this call's Do method.
1971 func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall {
1972 c.ctx_ = ctx
1973 return c
1974 }
1975
1976 // Header returns a http.Header that can be modified by the caller to add
1977 // headers to the request.
1978 func (c *CustomersGetCall) Header() http.Header {
1979 if c.header_ == nil {
1980 c.header_ = make(http.Header)
1981 }
1982 return c.header_
1983 }
1984
1985 func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) {
1986 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1987 if c.ifNoneMatch_ != "" {
1988 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1989 }
1990 c.urlParams_.Set("alt", alt)
1991 c.urlParams_.Set("prettyPrint", "false")
1992 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
1993 urls += "?" + c.urlParams_.Encode()
1994 req, err := http.NewRequest("GET", urls, nil)
1995 if err != nil {
1996 return nil, err
1997 }
1998 req.Header = reqHeaders
1999 googleapi.Expand(req.URL, map[string]string{
2000 "name": c.name,
2001 })
2002 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.get", "request", internallog.HTTPRequest(req, nil))
2003 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2004 }
2005
2006 // Do executes the "prod_tt_sasportal.customers.get" call.
2007 // Any non-2xx status code is an error. Response headers are in either
2008 // *SasPortalCustomer.ServerResponse.Header or (if a response was returned at
2009 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2010 // check whether the returned error was because http.StatusNotModified was
2011 // returned.
2012 func (c *CustomersGetCall) Do(opts ...googleapi.CallOption) (*SasPortalCustomer, error) {
2013 gensupport.SetOptions(c.urlParams_, opts...)
2014 res, err := c.doRequest("json")
2015 if res != nil && res.StatusCode == http.StatusNotModified {
2016 if res.Body != nil {
2017 res.Body.Close()
2018 }
2019 return nil, gensupport.WrapError(&googleapi.Error{
2020 Code: res.StatusCode,
2021 Header: res.Header,
2022 })
2023 }
2024 if err != nil {
2025 return nil, err
2026 }
2027 defer googleapi.CloseBody(res)
2028 if err := googleapi.CheckResponse(res); err != nil {
2029 return nil, gensupport.WrapError(err)
2030 }
2031 ret := &SasPortalCustomer{
2032 ServerResponse: googleapi.ServerResponse{
2033 Header: res.Header,
2034 HTTPStatusCode: res.StatusCode,
2035 },
2036 }
2037 target := &ret
2038 b, err := gensupport.DecodeResponseBytes(target, res)
2039 if err != nil {
2040 return nil, err
2041 }
2042 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.get", "response", internallog.HTTPResponse(res, b))
2043 return ret, nil
2044 }
2045
2046 type CustomersListCall struct {
2047 s *Service
2048 urlParams_ gensupport.URLParams
2049 ifNoneMatch_ string
2050 ctx_ context.Context
2051 header_ http.Header
2052 }
2053
2054 // List: Returns a list of requested customers.
2055 func (r *CustomersService) List() *CustomersListCall {
2056 c := &CustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2057 return c
2058 }
2059
2060 // PageSize sets the optional parameter "pageSize": The maximum number of
2061 // customers to return in the response.
2062 func (c *CustomersListCall) PageSize(pageSize int64) *CustomersListCall {
2063 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2064 return c
2065 }
2066
2067 // PageToken sets the optional parameter "pageToken": A pagination token
2068 // returned from a previous call to ListCustomers that indicates where this
2069 // listing should continue from.
2070 func (c *CustomersListCall) PageToken(pageToken string) *CustomersListCall {
2071 c.urlParams_.Set("pageToken", pageToken)
2072 return c
2073 }
2074
2075 // Fields allows partial responses to be retrieved. See
2076 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2077 // details.
2078 func (c *CustomersListCall) Fields(s ...googleapi.Field) *CustomersListCall {
2079 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2080 return c
2081 }
2082
2083 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2084 // object's ETag matches the given value. This is useful for getting updates
2085 // only after the object has changed since the last request.
2086 func (c *CustomersListCall) IfNoneMatch(entityTag string) *CustomersListCall {
2087 c.ifNoneMatch_ = entityTag
2088 return c
2089 }
2090
2091 // Context sets the context to be used in this call's Do method.
2092 func (c *CustomersListCall) Context(ctx context.Context) *CustomersListCall {
2093 c.ctx_ = ctx
2094 return c
2095 }
2096
2097 // Header returns a http.Header that can be modified by the caller to add
2098 // headers to the request.
2099 func (c *CustomersListCall) Header() http.Header {
2100 if c.header_ == nil {
2101 c.header_ = make(http.Header)
2102 }
2103 return c.header_
2104 }
2105
2106 func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) {
2107 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2108 if c.ifNoneMatch_ != "" {
2109 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2110 }
2111 c.urlParams_.Set("alt", alt)
2112 c.urlParams_.Set("prettyPrint", "false")
2113 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers")
2114 urls += "?" + c.urlParams_.Encode()
2115 req, err := http.NewRequest("GET", urls, nil)
2116 if err != nil {
2117 return nil, err
2118 }
2119 req.Header = reqHeaders
2120 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.list", "request", internallog.HTTPRequest(req, nil))
2121 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2122 }
2123
2124 // Do executes the "prod_tt_sasportal.customers.list" call.
2125 // Any non-2xx status code is an error. Response headers are in either
2126 // *SasPortalListCustomersResponse.ServerResponse.Header or (if a response was
2127 // returned at all) in error.(*googleapi.Error).Header. Use
2128 // googleapi.IsNotModified to check whether the returned error was because
2129 // http.StatusNotModified was returned.
2130 func (c *CustomersListCall) Do(opts ...googleapi.CallOption) (*SasPortalListCustomersResponse, error) {
2131 gensupport.SetOptions(c.urlParams_, opts...)
2132 res, err := c.doRequest("json")
2133 if res != nil && res.StatusCode == http.StatusNotModified {
2134 if res.Body != nil {
2135 res.Body.Close()
2136 }
2137 return nil, gensupport.WrapError(&googleapi.Error{
2138 Code: res.StatusCode,
2139 Header: res.Header,
2140 })
2141 }
2142 if err != nil {
2143 return nil, err
2144 }
2145 defer googleapi.CloseBody(res)
2146 if err := googleapi.CheckResponse(res); err != nil {
2147 return nil, gensupport.WrapError(err)
2148 }
2149 ret := &SasPortalListCustomersResponse{
2150 ServerResponse: googleapi.ServerResponse{
2151 Header: res.Header,
2152 HTTPStatusCode: res.StatusCode,
2153 },
2154 }
2155 target := &ret
2156 b, err := gensupport.DecodeResponseBytes(target, res)
2157 if err != nil {
2158 return nil, err
2159 }
2160 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.list", "response", internallog.HTTPResponse(res, b))
2161 return ret, nil
2162 }
2163
2164 // Pages invokes f for each page of results.
2165 // A non-nil error returned from f will halt the iteration.
2166 // The provided context supersedes any context provided to the Context method.
2167 func (c *CustomersListCall) Pages(ctx context.Context, f func(*SasPortalListCustomersResponse) error) error {
2168 c.ctx_ = ctx
2169 defer c.PageToken(c.urlParams_.Get("pageToken"))
2170 for {
2171 x, err := c.Do()
2172 if err != nil {
2173 return err
2174 }
2175 if err := f(x); err != nil {
2176 return err
2177 }
2178 if x.NextPageToken == "" {
2179 return nil
2180 }
2181 c.PageToken(x.NextPageToken)
2182 }
2183 }
2184
2185 type CustomersListGcpProjectDeploymentsCall struct {
2186 s *Service
2187 urlParams_ gensupport.URLParams
2188 ifNoneMatch_ string
2189 ctx_ context.Context
2190 header_ http.Header
2191 }
2192
2193 // ListGcpProjectDeployments: Returns a list of SAS deployments associated with
2194 // current GCP project. Includes whether SAS analytics has been enabled or not.
2195 func (r *CustomersService) ListGcpProjectDeployments() *CustomersListGcpProjectDeploymentsCall {
2196 c := &CustomersListGcpProjectDeploymentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2197 return c
2198 }
2199
2200 // Fields allows partial responses to be retrieved. See
2201 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2202 // details.
2203 func (c *CustomersListGcpProjectDeploymentsCall) Fields(s ...googleapi.Field) *CustomersListGcpProjectDeploymentsCall {
2204 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2205 return c
2206 }
2207
2208 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2209 // object's ETag matches the given value. This is useful for getting updates
2210 // only after the object has changed since the last request.
2211 func (c *CustomersListGcpProjectDeploymentsCall) IfNoneMatch(entityTag string) *CustomersListGcpProjectDeploymentsCall {
2212 c.ifNoneMatch_ = entityTag
2213 return c
2214 }
2215
2216 // Context sets the context to be used in this call's Do method.
2217 func (c *CustomersListGcpProjectDeploymentsCall) Context(ctx context.Context) *CustomersListGcpProjectDeploymentsCall {
2218 c.ctx_ = ctx
2219 return c
2220 }
2221
2222 // Header returns a http.Header that can be modified by the caller to add
2223 // headers to the request.
2224 func (c *CustomersListGcpProjectDeploymentsCall) Header() http.Header {
2225 if c.header_ == nil {
2226 c.header_ = make(http.Header)
2227 }
2228 return c.header_
2229 }
2230
2231 func (c *CustomersListGcpProjectDeploymentsCall) doRequest(alt string) (*http.Response, error) {
2232 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2233 if c.ifNoneMatch_ != "" {
2234 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2235 }
2236 c.urlParams_.Set("alt", alt)
2237 c.urlParams_.Set("prettyPrint", "false")
2238 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listGcpProjectDeployments")
2239 urls += "?" + c.urlParams_.Encode()
2240 req, err := http.NewRequest("GET", urls, nil)
2241 if err != nil {
2242 return nil, err
2243 }
2244 req.Header = reqHeaders
2245 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.listGcpProjectDeployments", "request", internallog.HTTPRequest(req, nil))
2246 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2247 }
2248
2249 // Do executes the "prod_tt_sasportal.customers.listGcpProjectDeployments" call.
2250 // Any non-2xx status code is an error. Response headers are in either
2251 // *SasPortalListGcpProjectDeploymentsResponse.ServerResponse.Header or (if a
2252 // response was returned at all) in error.(*googleapi.Error).Header. Use
2253 // googleapi.IsNotModified to check whether the returned error was because
2254 // http.StatusNotModified was returned.
2255 func (c *CustomersListGcpProjectDeploymentsCall) Do(opts ...googleapi.CallOption) (*SasPortalListGcpProjectDeploymentsResponse, error) {
2256 gensupport.SetOptions(c.urlParams_, opts...)
2257 res, err := c.doRequest("json")
2258 if res != nil && res.StatusCode == http.StatusNotModified {
2259 if res.Body != nil {
2260 res.Body.Close()
2261 }
2262 return nil, gensupport.WrapError(&googleapi.Error{
2263 Code: res.StatusCode,
2264 Header: res.Header,
2265 })
2266 }
2267 if err != nil {
2268 return nil, err
2269 }
2270 defer googleapi.CloseBody(res)
2271 if err := googleapi.CheckResponse(res); err != nil {
2272 return nil, gensupport.WrapError(err)
2273 }
2274 ret := &SasPortalListGcpProjectDeploymentsResponse{
2275 ServerResponse: googleapi.ServerResponse{
2276 Header: res.Header,
2277 HTTPStatusCode: res.StatusCode,
2278 },
2279 }
2280 target := &ret
2281 b, err := gensupport.DecodeResponseBytes(target, res)
2282 if err != nil {
2283 return nil, err
2284 }
2285 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.listGcpProjectDeployments", "response", internallog.HTTPResponse(res, b))
2286 return ret, nil
2287 }
2288
2289 type CustomersListLegacyOrganizationsCall struct {
2290 s *Service
2291 urlParams_ gensupport.URLParams
2292 ifNoneMatch_ string
2293 ctx_ context.Context
2294 header_ http.Header
2295 }
2296
2297 // ListLegacyOrganizations: Returns a list of legacy organizations.
2298 func (r *CustomersService) ListLegacyOrganizations() *CustomersListLegacyOrganizationsCall {
2299 c := &CustomersListLegacyOrganizationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2300 return c
2301 }
2302
2303 // Fields allows partial responses to be retrieved. See
2304 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2305 // details.
2306 func (c *CustomersListLegacyOrganizationsCall) Fields(s ...googleapi.Field) *CustomersListLegacyOrganizationsCall {
2307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2308 return c
2309 }
2310
2311 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2312 // object's ETag matches the given value. This is useful for getting updates
2313 // only after the object has changed since the last request.
2314 func (c *CustomersListLegacyOrganizationsCall) IfNoneMatch(entityTag string) *CustomersListLegacyOrganizationsCall {
2315 c.ifNoneMatch_ = entityTag
2316 return c
2317 }
2318
2319 // Context sets the context to be used in this call's Do method.
2320 func (c *CustomersListLegacyOrganizationsCall) Context(ctx context.Context) *CustomersListLegacyOrganizationsCall {
2321 c.ctx_ = ctx
2322 return c
2323 }
2324
2325 // Header returns a http.Header that can be modified by the caller to add
2326 // headers to the request.
2327 func (c *CustomersListLegacyOrganizationsCall) Header() http.Header {
2328 if c.header_ == nil {
2329 c.header_ = make(http.Header)
2330 }
2331 return c.header_
2332 }
2333
2334 func (c *CustomersListLegacyOrganizationsCall) doRequest(alt string) (*http.Response, error) {
2335 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2336 if c.ifNoneMatch_ != "" {
2337 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2338 }
2339 c.urlParams_.Set("alt", alt)
2340 c.urlParams_.Set("prettyPrint", "false")
2341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:listLegacyOrganizations")
2342 urls += "?" + c.urlParams_.Encode()
2343 req, err := http.NewRequest("GET", urls, nil)
2344 if err != nil {
2345 return nil, err
2346 }
2347 req.Header = reqHeaders
2348 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.listLegacyOrganizations", "request", internallog.HTTPRequest(req, nil))
2349 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2350 }
2351
2352 // Do executes the "prod_tt_sasportal.customers.listLegacyOrganizations" call.
2353 // Any non-2xx status code is an error. Response headers are in either
2354 // *SasPortalListLegacyOrganizationsResponse.ServerResponse.Header or (if a
2355 // response was returned at all) in error.(*googleapi.Error).Header. Use
2356 // googleapi.IsNotModified to check whether the returned error was because
2357 // http.StatusNotModified was returned.
2358 func (c *CustomersListLegacyOrganizationsCall) Do(opts ...googleapi.CallOption) (*SasPortalListLegacyOrganizationsResponse, error) {
2359 gensupport.SetOptions(c.urlParams_, opts...)
2360 res, err := c.doRequest("json")
2361 if res != nil && res.StatusCode == http.StatusNotModified {
2362 if res.Body != nil {
2363 res.Body.Close()
2364 }
2365 return nil, gensupport.WrapError(&googleapi.Error{
2366 Code: res.StatusCode,
2367 Header: res.Header,
2368 })
2369 }
2370 if err != nil {
2371 return nil, err
2372 }
2373 defer googleapi.CloseBody(res)
2374 if err := googleapi.CheckResponse(res); err != nil {
2375 return nil, gensupport.WrapError(err)
2376 }
2377 ret := &SasPortalListLegacyOrganizationsResponse{
2378 ServerResponse: googleapi.ServerResponse{
2379 Header: res.Header,
2380 HTTPStatusCode: res.StatusCode,
2381 },
2382 }
2383 target := &ret
2384 b, err := gensupport.DecodeResponseBytes(target, res)
2385 if err != nil {
2386 return nil, err
2387 }
2388 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.listLegacyOrganizations", "response", internallog.HTTPResponse(res, b))
2389 return ret, nil
2390 }
2391
2392 type CustomersMigrateOrganizationCall struct {
2393 s *Service
2394 sasportalmigrateorganizationrequest *SasPortalMigrateOrganizationRequest
2395 urlParams_ gensupport.URLParams
2396 ctx_ context.Context
2397 header_ http.Header
2398 }
2399
2400 // MigrateOrganization: Migrates a SAS organization to the cloud. This will
2401 // create GCP projects for each deployment and associate them. The SAS
2402 // Organization is linked to the gcp project that called the command.
2403 // go/sas-legacy-customer-migration
2404 func (r *CustomersService) MigrateOrganization(sasportalmigrateorganizationrequest *SasPortalMigrateOrganizationRequest) *CustomersMigrateOrganizationCall {
2405 c := &CustomersMigrateOrganizationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2406 c.sasportalmigrateorganizationrequest = sasportalmigrateorganizationrequest
2407 return c
2408 }
2409
2410 // Fields allows partial responses to be retrieved. See
2411 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2412 // details.
2413 func (c *CustomersMigrateOrganizationCall) Fields(s ...googleapi.Field) *CustomersMigrateOrganizationCall {
2414 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2415 return c
2416 }
2417
2418 // Context sets the context to be used in this call's Do method.
2419 func (c *CustomersMigrateOrganizationCall) Context(ctx context.Context) *CustomersMigrateOrganizationCall {
2420 c.ctx_ = ctx
2421 return c
2422 }
2423
2424 // Header returns a http.Header that can be modified by the caller to add
2425 // headers to the request.
2426 func (c *CustomersMigrateOrganizationCall) Header() http.Header {
2427 if c.header_ == nil {
2428 c.header_ = make(http.Header)
2429 }
2430 return c.header_
2431 }
2432
2433 func (c *CustomersMigrateOrganizationCall) doRequest(alt string) (*http.Response, error) {
2434 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2435 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmigrateorganizationrequest)
2436 if err != nil {
2437 return nil, err
2438 }
2439 c.urlParams_.Set("alt", alt)
2440 c.urlParams_.Set("prettyPrint", "false")
2441 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:migrateOrganization")
2442 urls += "?" + c.urlParams_.Encode()
2443 req, err := http.NewRequest("POST", urls, body)
2444 if err != nil {
2445 return nil, err
2446 }
2447 req.Header = reqHeaders
2448 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.migrateOrganization", "request", internallog.HTTPRequest(req, body.Bytes()))
2449 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2450 }
2451
2452 // Do executes the "prod_tt_sasportal.customers.migrateOrganization" call.
2453 // Any non-2xx status code is an error. Response headers are in either
2454 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
2455 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2456 // check whether the returned error was because http.StatusNotModified was
2457 // returned.
2458 func (c *CustomersMigrateOrganizationCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
2459 gensupport.SetOptions(c.urlParams_, opts...)
2460 res, err := c.doRequest("json")
2461 if res != nil && res.StatusCode == http.StatusNotModified {
2462 if res.Body != nil {
2463 res.Body.Close()
2464 }
2465 return nil, gensupport.WrapError(&googleapi.Error{
2466 Code: res.StatusCode,
2467 Header: res.Header,
2468 })
2469 }
2470 if err != nil {
2471 return nil, err
2472 }
2473 defer googleapi.CloseBody(res)
2474 if err := googleapi.CheckResponse(res); err != nil {
2475 return nil, gensupport.WrapError(err)
2476 }
2477 ret := &SasPortalOperation{
2478 ServerResponse: googleapi.ServerResponse{
2479 Header: res.Header,
2480 HTTPStatusCode: res.StatusCode,
2481 },
2482 }
2483 target := &ret
2484 b, err := gensupport.DecodeResponseBytes(target, res)
2485 if err != nil {
2486 return nil, err
2487 }
2488 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.migrateOrganization", "response", internallog.HTTPResponse(res, b))
2489 return ret, nil
2490 }
2491
2492 type CustomersPatchCall struct {
2493 s *Service
2494 name string
2495 sasportalcustomer *SasPortalCustomer
2496 urlParams_ gensupport.URLParams
2497 ctx_ context.Context
2498 header_ http.Header
2499 }
2500
2501 // Patch: Updates an existing customer.
2502 //
2503 // - name: Output only. Resource name of the customer.
2504 func (r *CustomersService) Patch(name string, sasportalcustomer *SasPortalCustomer) *CustomersPatchCall {
2505 c := &CustomersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2506 c.name = name
2507 c.sasportalcustomer = sasportalcustomer
2508 return c
2509 }
2510
2511 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
2512 func (c *CustomersPatchCall) UpdateMask(updateMask string) *CustomersPatchCall {
2513 c.urlParams_.Set("updateMask", updateMask)
2514 return c
2515 }
2516
2517 // Fields allows partial responses to be retrieved. See
2518 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2519 // details.
2520 func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall {
2521 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2522 return c
2523 }
2524
2525 // Context sets the context to be used in this call's Do method.
2526 func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall {
2527 c.ctx_ = ctx
2528 return c
2529 }
2530
2531 // Header returns a http.Header that can be modified by the caller to add
2532 // headers to the request.
2533 func (c *CustomersPatchCall) Header() http.Header {
2534 if c.header_ == nil {
2535 c.header_ = make(http.Header)
2536 }
2537 return c.header_
2538 }
2539
2540 func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) {
2541 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2542 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcustomer)
2543 if err != nil {
2544 return nil, err
2545 }
2546 c.urlParams_.Set("alt", alt)
2547 c.urlParams_.Set("prettyPrint", "false")
2548 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
2549 urls += "?" + c.urlParams_.Encode()
2550 req, err := http.NewRequest("PATCH", urls, body)
2551 if err != nil {
2552 return nil, err
2553 }
2554 req.Header = reqHeaders
2555 googleapi.Expand(req.URL, map[string]string{
2556 "name": c.name,
2557 })
2558 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
2559 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2560 }
2561
2562 // Do executes the "prod_tt_sasportal.customers.patch" call.
2563 // Any non-2xx status code is an error. Response headers are in either
2564 // *SasPortalCustomer.ServerResponse.Header or (if a response was returned at
2565 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2566 // check whether the returned error was because http.StatusNotModified was
2567 // returned.
2568 func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalCustomer, error) {
2569 gensupport.SetOptions(c.urlParams_, opts...)
2570 res, err := c.doRequest("json")
2571 if res != nil && res.StatusCode == http.StatusNotModified {
2572 if res.Body != nil {
2573 res.Body.Close()
2574 }
2575 return nil, gensupport.WrapError(&googleapi.Error{
2576 Code: res.StatusCode,
2577 Header: res.Header,
2578 })
2579 }
2580 if err != nil {
2581 return nil, err
2582 }
2583 defer googleapi.CloseBody(res)
2584 if err := googleapi.CheckResponse(res); err != nil {
2585 return nil, gensupport.WrapError(err)
2586 }
2587 ret := &SasPortalCustomer{
2588 ServerResponse: googleapi.ServerResponse{
2589 Header: res.Header,
2590 HTTPStatusCode: res.StatusCode,
2591 },
2592 }
2593 target := &ret
2594 b, err := gensupport.DecodeResponseBytes(target, res)
2595 if err != nil {
2596 return nil, err
2597 }
2598 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.patch", "response", internallog.HTTPResponse(res, b))
2599 return ret, nil
2600 }
2601
2602 type CustomersProvisionDeploymentCall struct {
2603 s *Service
2604 sasportalprovisiondeploymentrequest *SasPortalProvisionDeploymentRequest
2605 urlParams_ gensupport.URLParams
2606 ctx_ context.Context
2607 header_ http.Header
2608 }
2609
2610 // ProvisionDeployment: Creates a new SAS deployment through the GCP workflow.
2611 // Creates a SAS organization if an organization match is not found.
2612 func (r *CustomersService) ProvisionDeployment(sasportalprovisiondeploymentrequest *SasPortalProvisionDeploymentRequest) *CustomersProvisionDeploymentCall {
2613 c := &CustomersProvisionDeploymentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2614 c.sasportalprovisiondeploymentrequest = sasportalprovisiondeploymentrequest
2615 return c
2616 }
2617
2618 // Fields allows partial responses to be retrieved. See
2619 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2620 // details.
2621 func (c *CustomersProvisionDeploymentCall) Fields(s ...googleapi.Field) *CustomersProvisionDeploymentCall {
2622 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2623 return c
2624 }
2625
2626 // Context sets the context to be used in this call's Do method.
2627 func (c *CustomersProvisionDeploymentCall) Context(ctx context.Context) *CustomersProvisionDeploymentCall {
2628 c.ctx_ = ctx
2629 return c
2630 }
2631
2632 // Header returns a http.Header that can be modified by the caller to add
2633 // headers to the request.
2634 func (c *CustomersProvisionDeploymentCall) Header() http.Header {
2635 if c.header_ == nil {
2636 c.header_ = make(http.Header)
2637 }
2638 return c.header_
2639 }
2640
2641 func (c *CustomersProvisionDeploymentCall) doRequest(alt string) (*http.Response, error) {
2642 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2643 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalprovisiondeploymentrequest)
2644 if err != nil {
2645 return nil, err
2646 }
2647 c.urlParams_.Set("alt", alt)
2648 c.urlParams_.Set("prettyPrint", "false")
2649 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:provisionDeployment")
2650 urls += "?" + c.urlParams_.Encode()
2651 req, err := http.NewRequest("POST", urls, body)
2652 if err != nil {
2653 return nil, err
2654 }
2655 req.Header = reqHeaders
2656 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.provisionDeployment", "request", internallog.HTTPRequest(req, body.Bytes()))
2657 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2658 }
2659
2660 // Do executes the "prod_tt_sasportal.customers.provisionDeployment" call.
2661 // Any non-2xx status code is an error. Response headers are in either
2662 // *SasPortalProvisionDeploymentResponse.ServerResponse.Header or (if a
2663 // response was returned at all) in error.(*googleapi.Error).Header. Use
2664 // googleapi.IsNotModified to check whether the returned error was because
2665 // http.StatusNotModified was returned.
2666 func (c *CustomersProvisionDeploymentCall) Do(opts ...googleapi.CallOption) (*SasPortalProvisionDeploymentResponse, error) {
2667 gensupport.SetOptions(c.urlParams_, opts...)
2668 res, err := c.doRequest("json")
2669 if res != nil && res.StatusCode == http.StatusNotModified {
2670 if res.Body != nil {
2671 res.Body.Close()
2672 }
2673 return nil, gensupport.WrapError(&googleapi.Error{
2674 Code: res.StatusCode,
2675 Header: res.Header,
2676 })
2677 }
2678 if err != nil {
2679 return nil, err
2680 }
2681 defer googleapi.CloseBody(res)
2682 if err := googleapi.CheckResponse(res); err != nil {
2683 return nil, gensupport.WrapError(err)
2684 }
2685 ret := &SasPortalProvisionDeploymentResponse{
2686 ServerResponse: googleapi.ServerResponse{
2687 Header: res.Header,
2688 HTTPStatusCode: res.StatusCode,
2689 },
2690 }
2691 target := &ret
2692 b, err := gensupport.DecodeResponseBytes(target, res)
2693 if err != nil {
2694 return nil, err
2695 }
2696 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.provisionDeployment", "response", internallog.HTTPResponse(res, b))
2697 return ret, nil
2698 }
2699
2700 type CustomersSetupSasAnalyticsCall struct {
2701 s *Service
2702 sasportalsetupsasanalyticsrequest *SasPortalSetupSasAnalyticsRequest
2703 urlParams_ gensupport.URLParams
2704 ctx_ context.Context
2705 header_ http.Header
2706 }
2707
2708 // SetupSasAnalytics: Setups the a GCP Project to receive SAS Analytics
2709 // messages via GCP Pub/Sub with a subscription to BigQuery. All the Pub/Sub
2710 // topics and BigQuery tables are created automatically as part of this
2711 // service.
2712 func (r *CustomersService) SetupSasAnalytics(sasportalsetupsasanalyticsrequest *SasPortalSetupSasAnalyticsRequest) *CustomersSetupSasAnalyticsCall {
2713 c := &CustomersSetupSasAnalyticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2714 c.sasportalsetupsasanalyticsrequest = sasportalsetupsasanalyticsrequest
2715 return c
2716 }
2717
2718 // Fields allows partial responses to be retrieved. See
2719 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2720 // details.
2721 func (c *CustomersSetupSasAnalyticsCall) Fields(s ...googleapi.Field) *CustomersSetupSasAnalyticsCall {
2722 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2723 return c
2724 }
2725
2726 // Context sets the context to be used in this call's Do method.
2727 func (c *CustomersSetupSasAnalyticsCall) Context(ctx context.Context) *CustomersSetupSasAnalyticsCall {
2728 c.ctx_ = ctx
2729 return c
2730 }
2731
2732 // Header returns a http.Header that can be modified by the caller to add
2733 // headers to the request.
2734 func (c *CustomersSetupSasAnalyticsCall) Header() http.Header {
2735 if c.header_ == nil {
2736 c.header_ = make(http.Header)
2737 }
2738 return c.header_
2739 }
2740
2741 func (c *CustomersSetupSasAnalyticsCall) doRequest(alt string) (*http.Response, error) {
2742 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2743 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetupsasanalyticsrequest)
2744 if err != nil {
2745 return nil, err
2746 }
2747 c.urlParams_.Set("alt", alt)
2748 c.urlParams_.Set("prettyPrint", "false")
2749 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers:setupSasAnalytics")
2750 urls += "?" + c.urlParams_.Encode()
2751 req, err := http.NewRequest("POST", urls, body)
2752 if err != nil {
2753 return nil, err
2754 }
2755 req.Header = reqHeaders
2756 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.setupSasAnalytics", "request", internallog.HTTPRequest(req, body.Bytes()))
2757 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2758 }
2759
2760 // Do executes the "prod_tt_sasportal.customers.setupSasAnalytics" call.
2761 // Any non-2xx status code is an error. Response headers are in either
2762 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
2763 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2764 // check whether the returned error was because http.StatusNotModified was
2765 // returned.
2766 func (c *CustomersSetupSasAnalyticsCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
2767 gensupport.SetOptions(c.urlParams_, opts...)
2768 res, err := c.doRequest("json")
2769 if res != nil && res.StatusCode == http.StatusNotModified {
2770 if res.Body != nil {
2771 res.Body.Close()
2772 }
2773 return nil, gensupport.WrapError(&googleapi.Error{
2774 Code: res.StatusCode,
2775 Header: res.Header,
2776 })
2777 }
2778 if err != nil {
2779 return nil, err
2780 }
2781 defer googleapi.CloseBody(res)
2782 if err := googleapi.CheckResponse(res); err != nil {
2783 return nil, gensupport.WrapError(err)
2784 }
2785 ret := &SasPortalOperation{
2786 ServerResponse: googleapi.ServerResponse{
2787 Header: res.Header,
2788 HTTPStatusCode: res.StatusCode,
2789 },
2790 }
2791 target := &ret
2792 b, err := gensupport.DecodeResponseBytes(target, res)
2793 if err != nil {
2794 return nil, err
2795 }
2796 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.setupSasAnalytics", "response", internallog.HTTPResponse(res, b))
2797 return ret, nil
2798 }
2799
2800 type CustomersDeploymentsCreateCall struct {
2801 s *Service
2802 parent string
2803 sasportaldeployment *SasPortalDeployment
2804 urlParams_ gensupport.URLParams
2805 ctx_ context.Context
2806 header_ http.Header
2807 }
2808
2809 // Create: Creates a new deployment.
2810 //
2811 // - parent: The parent resource name where the deployment is to be created.
2812 func (r *CustomersDeploymentsService) Create(parent string, sasportaldeployment *SasPortalDeployment) *CustomersDeploymentsCreateCall {
2813 c := &CustomersDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2814 c.parent = parent
2815 c.sasportaldeployment = sasportaldeployment
2816 return c
2817 }
2818
2819 // Fields allows partial responses to be retrieved. See
2820 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2821 // details.
2822 func (c *CustomersDeploymentsCreateCall) Fields(s ...googleapi.Field) *CustomersDeploymentsCreateCall {
2823 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2824 return c
2825 }
2826
2827 // Context sets the context to be used in this call's Do method.
2828 func (c *CustomersDeploymentsCreateCall) Context(ctx context.Context) *CustomersDeploymentsCreateCall {
2829 c.ctx_ = ctx
2830 return c
2831 }
2832
2833 // Header returns a http.Header that can be modified by the caller to add
2834 // headers to the request.
2835 func (c *CustomersDeploymentsCreateCall) Header() http.Header {
2836 if c.header_ == nil {
2837 c.header_ = make(http.Header)
2838 }
2839 return c.header_
2840 }
2841
2842 func (c *CustomersDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
2843 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2844 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment)
2845 if err != nil {
2846 return nil, err
2847 }
2848 c.urlParams_.Set("alt", alt)
2849 c.urlParams_.Set("prettyPrint", "false")
2850 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
2851 urls += "?" + c.urlParams_.Encode()
2852 req, err := http.NewRequest("POST", urls, body)
2853 if err != nil {
2854 return nil, err
2855 }
2856 req.Header = reqHeaders
2857 googleapi.Expand(req.URL, map[string]string{
2858 "parent": c.parent,
2859 })
2860 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2861 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2862 }
2863
2864 // Do executes the "prod_tt_sasportal.customers.deployments.create" call.
2865 // Any non-2xx status code is an error. Response headers are in either
2866 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
2867 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2868 // check whether the returned error was because http.StatusNotModified was
2869 // returned.
2870 func (c *CustomersDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
2871 gensupport.SetOptions(c.urlParams_, opts...)
2872 res, err := c.doRequest("json")
2873 if res != nil && res.StatusCode == http.StatusNotModified {
2874 if res.Body != nil {
2875 res.Body.Close()
2876 }
2877 return nil, gensupport.WrapError(&googleapi.Error{
2878 Code: res.StatusCode,
2879 Header: res.Header,
2880 })
2881 }
2882 if err != nil {
2883 return nil, err
2884 }
2885 defer googleapi.CloseBody(res)
2886 if err := googleapi.CheckResponse(res); err != nil {
2887 return nil, gensupport.WrapError(err)
2888 }
2889 ret := &SasPortalDeployment{
2890 ServerResponse: googleapi.ServerResponse{
2891 Header: res.Header,
2892 HTTPStatusCode: res.StatusCode,
2893 },
2894 }
2895 target := &ret
2896 b, err := gensupport.DecodeResponseBytes(target, res)
2897 if err != nil {
2898 return nil, err
2899 }
2900 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.create", "response", internallog.HTTPResponse(res, b))
2901 return ret, nil
2902 }
2903
2904 type CustomersDeploymentsDeleteCall struct {
2905 s *Service
2906 name string
2907 urlParams_ gensupport.URLParams
2908 ctx_ context.Context
2909 header_ http.Header
2910 }
2911
2912 // Delete: Deletes a deployment.
2913 //
2914 // - name: The name of the deployment.
2915 func (r *CustomersDeploymentsService) Delete(name string) *CustomersDeploymentsDeleteCall {
2916 c := &CustomersDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2917 c.name = name
2918 return c
2919 }
2920
2921 // Fields allows partial responses to be retrieved. See
2922 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2923 // details.
2924 func (c *CustomersDeploymentsDeleteCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDeleteCall {
2925 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2926 return c
2927 }
2928
2929 // Context sets the context to be used in this call's Do method.
2930 func (c *CustomersDeploymentsDeleteCall) Context(ctx context.Context) *CustomersDeploymentsDeleteCall {
2931 c.ctx_ = ctx
2932 return c
2933 }
2934
2935 // Header returns a http.Header that can be modified by the caller to add
2936 // headers to the request.
2937 func (c *CustomersDeploymentsDeleteCall) Header() http.Header {
2938 if c.header_ == nil {
2939 c.header_ = make(http.Header)
2940 }
2941 return c.header_
2942 }
2943
2944 func (c *CustomersDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
2945 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2946 c.urlParams_.Set("alt", alt)
2947 c.urlParams_.Set("prettyPrint", "false")
2948 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
2949 urls += "?" + c.urlParams_.Encode()
2950 req, err := http.NewRequest("DELETE", urls, nil)
2951 if err != nil {
2952 return nil, err
2953 }
2954 req.Header = reqHeaders
2955 googleapi.Expand(req.URL, map[string]string{
2956 "name": c.name,
2957 })
2958 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.delete", "request", internallog.HTTPRequest(req, nil))
2959 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2960 }
2961
2962 // Do executes the "prod_tt_sasportal.customers.deployments.delete" call.
2963 // Any non-2xx status code is an error. Response headers are in either
2964 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
2965 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2966 // whether the returned error was because http.StatusNotModified was returned.
2967 func (c *CustomersDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
2968 gensupport.SetOptions(c.urlParams_, opts...)
2969 res, err := c.doRequest("json")
2970 if res != nil && res.StatusCode == http.StatusNotModified {
2971 if res.Body != nil {
2972 res.Body.Close()
2973 }
2974 return nil, gensupport.WrapError(&googleapi.Error{
2975 Code: res.StatusCode,
2976 Header: res.Header,
2977 })
2978 }
2979 if err != nil {
2980 return nil, err
2981 }
2982 defer googleapi.CloseBody(res)
2983 if err := googleapi.CheckResponse(res); err != nil {
2984 return nil, gensupport.WrapError(err)
2985 }
2986 ret := &SasPortalEmpty{
2987 ServerResponse: googleapi.ServerResponse{
2988 Header: res.Header,
2989 HTTPStatusCode: res.StatusCode,
2990 },
2991 }
2992 target := &ret
2993 b, err := gensupport.DecodeResponseBytes(target, res)
2994 if err != nil {
2995 return nil, err
2996 }
2997 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.delete", "response", internallog.HTTPResponse(res, b))
2998 return ret, nil
2999 }
3000
3001 type CustomersDeploymentsGetCall struct {
3002 s *Service
3003 name string
3004 urlParams_ gensupport.URLParams
3005 ifNoneMatch_ string
3006 ctx_ context.Context
3007 header_ http.Header
3008 }
3009
3010 // Get: Returns a requested deployment.
3011 //
3012 // - name: The name of the deployment.
3013 func (r *CustomersDeploymentsService) Get(name string) *CustomersDeploymentsGetCall {
3014 c := &CustomersDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3015 c.name = name
3016 return c
3017 }
3018
3019 // Fields allows partial responses to be retrieved. See
3020 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3021 // details.
3022 func (c *CustomersDeploymentsGetCall) Fields(s ...googleapi.Field) *CustomersDeploymentsGetCall {
3023 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3024 return c
3025 }
3026
3027 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3028 // object's ETag matches the given value. This is useful for getting updates
3029 // only after the object has changed since the last request.
3030 func (c *CustomersDeploymentsGetCall) IfNoneMatch(entityTag string) *CustomersDeploymentsGetCall {
3031 c.ifNoneMatch_ = entityTag
3032 return c
3033 }
3034
3035 // Context sets the context to be used in this call's Do method.
3036 func (c *CustomersDeploymentsGetCall) Context(ctx context.Context) *CustomersDeploymentsGetCall {
3037 c.ctx_ = ctx
3038 return c
3039 }
3040
3041 // Header returns a http.Header that can be modified by the caller to add
3042 // headers to the request.
3043 func (c *CustomersDeploymentsGetCall) Header() http.Header {
3044 if c.header_ == nil {
3045 c.header_ = make(http.Header)
3046 }
3047 return c.header_
3048 }
3049
3050 func (c *CustomersDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
3051 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3052 if c.ifNoneMatch_ != "" {
3053 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3054 }
3055 c.urlParams_.Set("alt", alt)
3056 c.urlParams_.Set("prettyPrint", "false")
3057 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
3058 urls += "?" + c.urlParams_.Encode()
3059 req, err := http.NewRequest("GET", urls, nil)
3060 if err != nil {
3061 return nil, err
3062 }
3063 req.Header = reqHeaders
3064 googleapi.Expand(req.URL, map[string]string{
3065 "name": c.name,
3066 })
3067 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.get", "request", internallog.HTTPRequest(req, nil))
3068 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3069 }
3070
3071 // Do executes the "prod_tt_sasportal.customers.deployments.get" call.
3072 // Any non-2xx status code is an error. Response headers are in either
3073 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
3074 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3075 // check whether the returned error was because http.StatusNotModified was
3076 // returned.
3077 func (c *CustomersDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
3078 gensupport.SetOptions(c.urlParams_, opts...)
3079 res, err := c.doRequest("json")
3080 if res != nil && res.StatusCode == http.StatusNotModified {
3081 if res.Body != nil {
3082 res.Body.Close()
3083 }
3084 return nil, gensupport.WrapError(&googleapi.Error{
3085 Code: res.StatusCode,
3086 Header: res.Header,
3087 })
3088 }
3089 if err != nil {
3090 return nil, err
3091 }
3092 defer googleapi.CloseBody(res)
3093 if err := googleapi.CheckResponse(res); err != nil {
3094 return nil, gensupport.WrapError(err)
3095 }
3096 ret := &SasPortalDeployment{
3097 ServerResponse: googleapi.ServerResponse{
3098 Header: res.Header,
3099 HTTPStatusCode: res.StatusCode,
3100 },
3101 }
3102 target := &ret
3103 b, err := gensupport.DecodeResponseBytes(target, res)
3104 if err != nil {
3105 return nil, err
3106 }
3107 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.get", "response", internallog.HTTPResponse(res, b))
3108 return ret, nil
3109 }
3110
3111 type CustomersDeploymentsListCall struct {
3112 s *Service
3113 parent string
3114 urlParams_ gensupport.URLParams
3115 ifNoneMatch_ string
3116 ctx_ context.Context
3117 header_ http.Header
3118 }
3119
3120 // List: Lists deployments.
3121 //
3122 // - parent: The parent resource name, for example, "nodes/1",
3123 // customer/1/nodes/2.
3124 func (r *CustomersDeploymentsService) List(parent string) *CustomersDeploymentsListCall {
3125 c := &CustomersDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3126 c.parent = parent
3127 return c
3128 }
3129
3130 // Filter sets the optional parameter "filter": The filter expression. The
3131 // filter should have the following format: "DIRECT_CHILDREN" or format:
3132 // "direct_children". The filter is case insensitive. If empty, then no
3133 // deployments are filtered.
3134 func (c *CustomersDeploymentsListCall) Filter(filter string) *CustomersDeploymentsListCall {
3135 c.urlParams_.Set("filter", filter)
3136 return c
3137 }
3138
3139 // PageSize sets the optional parameter "pageSize": The maximum number of
3140 // deployments to return in the response.
3141 func (c *CustomersDeploymentsListCall) PageSize(pageSize int64) *CustomersDeploymentsListCall {
3142 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3143 return c
3144 }
3145
3146 // PageToken sets the optional parameter "pageToken": A pagination token
3147 // returned from a previous call to ListDeployments that indicates where this
3148 // listing should continue from.
3149 func (c *CustomersDeploymentsListCall) PageToken(pageToken string) *CustomersDeploymentsListCall {
3150 c.urlParams_.Set("pageToken", pageToken)
3151 return c
3152 }
3153
3154 // Fields allows partial responses to be retrieved. See
3155 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3156 // details.
3157 func (c *CustomersDeploymentsListCall) Fields(s ...googleapi.Field) *CustomersDeploymentsListCall {
3158 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3159 return c
3160 }
3161
3162 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3163 // object's ETag matches the given value. This is useful for getting updates
3164 // only after the object has changed since the last request.
3165 func (c *CustomersDeploymentsListCall) IfNoneMatch(entityTag string) *CustomersDeploymentsListCall {
3166 c.ifNoneMatch_ = entityTag
3167 return c
3168 }
3169
3170 // Context sets the context to be used in this call's Do method.
3171 func (c *CustomersDeploymentsListCall) Context(ctx context.Context) *CustomersDeploymentsListCall {
3172 c.ctx_ = ctx
3173 return c
3174 }
3175
3176 // Header returns a http.Header that can be modified by the caller to add
3177 // headers to the request.
3178 func (c *CustomersDeploymentsListCall) Header() http.Header {
3179 if c.header_ == nil {
3180 c.header_ = make(http.Header)
3181 }
3182 return c.header_
3183 }
3184
3185 func (c *CustomersDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
3186 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3187 if c.ifNoneMatch_ != "" {
3188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3189 }
3190 c.urlParams_.Set("alt", alt)
3191 c.urlParams_.Set("prettyPrint", "false")
3192 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
3193 urls += "?" + c.urlParams_.Encode()
3194 req, err := http.NewRequest("GET", urls, nil)
3195 if err != nil {
3196 return nil, err
3197 }
3198 req.Header = reqHeaders
3199 googleapi.Expand(req.URL, map[string]string{
3200 "parent": c.parent,
3201 })
3202 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.list", "request", internallog.HTTPRequest(req, nil))
3203 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3204 }
3205
3206 // Do executes the "prod_tt_sasportal.customers.deployments.list" call.
3207 // Any non-2xx status code is an error. Response headers are in either
3208 // *SasPortalListDeploymentsResponse.ServerResponse.Header or (if a response
3209 // was returned at all) in error.(*googleapi.Error).Header. Use
3210 // googleapi.IsNotModified to check whether the returned error was because
3211 // http.StatusNotModified was returned.
3212 func (c *CustomersDeploymentsListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDeploymentsResponse, error) {
3213 gensupport.SetOptions(c.urlParams_, opts...)
3214 res, err := c.doRequest("json")
3215 if res != nil && res.StatusCode == http.StatusNotModified {
3216 if res.Body != nil {
3217 res.Body.Close()
3218 }
3219 return nil, gensupport.WrapError(&googleapi.Error{
3220 Code: res.StatusCode,
3221 Header: res.Header,
3222 })
3223 }
3224 if err != nil {
3225 return nil, err
3226 }
3227 defer googleapi.CloseBody(res)
3228 if err := googleapi.CheckResponse(res); err != nil {
3229 return nil, gensupport.WrapError(err)
3230 }
3231 ret := &SasPortalListDeploymentsResponse{
3232 ServerResponse: googleapi.ServerResponse{
3233 Header: res.Header,
3234 HTTPStatusCode: res.StatusCode,
3235 },
3236 }
3237 target := &ret
3238 b, err := gensupport.DecodeResponseBytes(target, res)
3239 if err != nil {
3240 return nil, err
3241 }
3242 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.list", "response", internallog.HTTPResponse(res, b))
3243 return ret, nil
3244 }
3245
3246 // Pages invokes f for each page of results.
3247 // A non-nil error returned from f will halt the iteration.
3248 // The provided context supersedes any context provided to the Context method.
3249 func (c *CustomersDeploymentsListCall) Pages(ctx context.Context, f func(*SasPortalListDeploymentsResponse) error) error {
3250 c.ctx_ = ctx
3251 defer c.PageToken(c.urlParams_.Get("pageToken"))
3252 for {
3253 x, err := c.Do()
3254 if err != nil {
3255 return err
3256 }
3257 if err := f(x); err != nil {
3258 return err
3259 }
3260 if x.NextPageToken == "" {
3261 return nil
3262 }
3263 c.PageToken(x.NextPageToken)
3264 }
3265 }
3266
3267 type CustomersDeploymentsMoveCall struct {
3268 s *Service
3269 name string
3270 sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest
3271 urlParams_ gensupport.URLParams
3272 ctx_ context.Context
3273 header_ http.Header
3274 }
3275
3276 // Move: Moves a deployment under another node or customer.
3277 //
3278 // - name: The name of the deployment to move.
3279 func (r *CustomersDeploymentsService) Move(name string, sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest) *CustomersDeploymentsMoveCall {
3280 c := &CustomersDeploymentsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3281 c.name = name
3282 c.sasportalmovedeploymentrequest = sasportalmovedeploymentrequest
3283 return c
3284 }
3285
3286 // Fields allows partial responses to be retrieved. See
3287 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3288 // details.
3289 func (c *CustomersDeploymentsMoveCall) Fields(s ...googleapi.Field) *CustomersDeploymentsMoveCall {
3290 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3291 return c
3292 }
3293
3294 // Context sets the context to be used in this call's Do method.
3295 func (c *CustomersDeploymentsMoveCall) Context(ctx context.Context) *CustomersDeploymentsMoveCall {
3296 c.ctx_ = ctx
3297 return c
3298 }
3299
3300 // Header returns a http.Header that can be modified by the caller to add
3301 // headers to the request.
3302 func (c *CustomersDeploymentsMoveCall) Header() http.Header {
3303 if c.header_ == nil {
3304 c.header_ = make(http.Header)
3305 }
3306 return c.header_
3307 }
3308
3309 func (c *CustomersDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) {
3310 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3311 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest)
3312 if err != nil {
3313 return nil, err
3314 }
3315 c.urlParams_.Set("alt", alt)
3316 c.urlParams_.Set("prettyPrint", "false")
3317 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
3318 urls += "?" + c.urlParams_.Encode()
3319 req, err := http.NewRequest("POST", urls, body)
3320 if err != nil {
3321 return nil, err
3322 }
3323 req.Header = reqHeaders
3324 googleapi.Expand(req.URL, map[string]string{
3325 "name": c.name,
3326 })
3327 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.move", "request", internallog.HTTPRequest(req, body.Bytes()))
3328 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3329 }
3330
3331 // Do executes the "prod_tt_sasportal.customers.deployments.move" call.
3332 // Any non-2xx status code is an error. Response headers are in either
3333 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
3334 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3335 // check whether the returned error was because http.StatusNotModified was
3336 // returned.
3337 func (c *CustomersDeploymentsMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
3338 gensupport.SetOptions(c.urlParams_, opts...)
3339 res, err := c.doRequest("json")
3340 if res != nil && res.StatusCode == http.StatusNotModified {
3341 if res.Body != nil {
3342 res.Body.Close()
3343 }
3344 return nil, gensupport.WrapError(&googleapi.Error{
3345 Code: res.StatusCode,
3346 Header: res.Header,
3347 })
3348 }
3349 if err != nil {
3350 return nil, err
3351 }
3352 defer googleapi.CloseBody(res)
3353 if err := googleapi.CheckResponse(res); err != nil {
3354 return nil, gensupport.WrapError(err)
3355 }
3356 ret := &SasPortalOperation{
3357 ServerResponse: googleapi.ServerResponse{
3358 Header: res.Header,
3359 HTTPStatusCode: res.StatusCode,
3360 },
3361 }
3362 target := &ret
3363 b, err := gensupport.DecodeResponseBytes(target, res)
3364 if err != nil {
3365 return nil, err
3366 }
3367 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.move", "response", internallog.HTTPResponse(res, b))
3368 return ret, nil
3369 }
3370
3371 type CustomersDeploymentsPatchCall struct {
3372 s *Service
3373 name string
3374 sasportaldeployment *SasPortalDeployment
3375 urlParams_ gensupport.URLParams
3376 ctx_ context.Context
3377 header_ http.Header
3378 }
3379
3380 // Patch: Updates an existing deployment.
3381 //
3382 // - name: Output only. Resource name.
3383 func (r *CustomersDeploymentsService) Patch(name string, sasportaldeployment *SasPortalDeployment) *CustomersDeploymentsPatchCall {
3384 c := &CustomersDeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3385 c.name = name
3386 c.sasportaldeployment = sasportaldeployment
3387 return c
3388 }
3389
3390 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
3391 func (c *CustomersDeploymentsPatchCall) UpdateMask(updateMask string) *CustomersDeploymentsPatchCall {
3392 c.urlParams_.Set("updateMask", updateMask)
3393 return c
3394 }
3395
3396 // Fields allows partial responses to be retrieved. See
3397 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3398 // details.
3399 func (c *CustomersDeploymentsPatchCall) Fields(s ...googleapi.Field) *CustomersDeploymentsPatchCall {
3400 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3401 return c
3402 }
3403
3404 // Context sets the context to be used in this call's Do method.
3405 func (c *CustomersDeploymentsPatchCall) Context(ctx context.Context) *CustomersDeploymentsPatchCall {
3406 c.ctx_ = ctx
3407 return c
3408 }
3409
3410 // Header returns a http.Header that can be modified by the caller to add
3411 // headers to the request.
3412 func (c *CustomersDeploymentsPatchCall) Header() http.Header {
3413 if c.header_ == nil {
3414 c.header_ = make(http.Header)
3415 }
3416 return c.header_
3417 }
3418
3419 func (c *CustomersDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
3420 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3421 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment)
3422 if err != nil {
3423 return nil, err
3424 }
3425 c.urlParams_.Set("alt", alt)
3426 c.urlParams_.Set("prettyPrint", "false")
3427 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
3428 urls += "?" + c.urlParams_.Encode()
3429 req, err := http.NewRequest("PATCH", urls, body)
3430 if err != nil {
3431 return nil, err
3432 }
3433 req.Header = reqHeaders
3434 googleapi.Expand(req.URL, map[string]string{
3435 "name": c.name,
3436 })
3437 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3438 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3439 }
3440
3441 // Do executes the "prod_tt_sasportal.customers.deployments.patch" call.
3442 // Any non-2xx status code is an error. Response headers are in either
3443 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
3444 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3445 // check whether the returned error was because http.StatusNotModified was
3446 // returned.
3447 func (c *CustomersDeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
3448 gensupport.SetOptions(c.urlParams_, opts...)
3449 res, err := c.doRequest("json")
3450 if res != nil && res.StatusCode == http.StatusNotModified {
3451 if res.Body != nil {
3452 res.Body.Close()
3453 }
3454 return nil, gensupport.WrapError(&googleapi.Error{
3455 Code: res.StatusCode,
3456 Header: res.Header,
3457 })
3458 }
3459 if err != nil {
3460 return nil, err
3461 }
3462 defer googleapi.CloseBody(res)
3463 if err := googleapi.CheckResponse(res); err != nil {
3464 return nil, gensupport.WrapError(err)
3465 }
3466 ret := &SasPortalDeployment{
3467 ServerResponse: googleapi.ServerResponse{
3468 Header: res.Header,
3469 HTTPStatusCode: res.StatusCode,
3470 },
3471 }
3472 target := &ret
3473 b, err := gensupport.DecodeResponseBytes(target, res)
3474 if err != nil {
3475 return nil, err
3476 }
3477 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.patch", "response", internallog.HTTPResponse(res, b))
3478 return ret, nil
3479 }
3480
3481 type CustomersDeploymentsDevicesCreateCall struct {
3482 s *Service
3483 parent string
3484 sasportaldevice *SasPortalDevice
3485 urlParams_ gensupport.URLParams
3486 ctx_ context.Context
3487 header_ http.Header
3488 }
3489
3490 // Create: Creates a device under a node or customer.
3491 //
3492 // - parent: The name of the parent resource.
3493 func (r *CustomersDeploymentsDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *CustomersDeploymentsDevicesCreateCall {
3494 c := &CustomersDeploymentsDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3495 c.parent = parent
3496 c.sasportaldevice = sasportaldevice
3497 return c
3498 }
3499
3500 // Fields allows partial responses to be retrieved. See
3501 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3502 // details.
3503 func (c *CustomersDeploymentsDevicesCreateCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesCreateCall {
3504 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3505 return c
3506 }
3507
3508 // Context sets the context to be used in this call's Do method.
3509 func (c *CustomersDeploymentsDevicesCreateCall) Context(ctx context.Context) *CustomersDeploymentsDevicesCreateCall {
3510 c.ctx_ = ctx
3511 return c
3512 }
3513
3514 // Header returns a http.Header that can be modified by the caller to add
3515 // headers to the request.
3516 func (c *CustomersDeploymentsDevicesCreateCall) Header() http.Header {
3517 if c.header_ == nil {
3518 c.header_ = make(http.Header)
3519 }
3520 return c.header_
3521 }
3522
3523 func (c *CustomersDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
3524 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3525 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
3526 if err != nil {
3527 return nil, err
3528 }
3529 c.urlParams_.Set("alt", alt)
3530 c.urlParams_.Set("prettyPrint", "false")
3531 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
3532 urls += "?" + c.urlParams_.Encode()
3533 req, err := http.NewRequest("POST", urls, body)
3534 if err != nil {
3535 return nil, err
3536 }
3537 req.Header = reqHeaders
3538 googleapi.Expand(req.URL, map[string]string{
3539 "parent": c.parent,
3540 })
3541 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3542 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3543 }
3544
3545 // Do executes the "prod_tt_sasportal.customers.deployments.devices.create" call.
3546 // Any non-2xx status code is an error. Response headers are in either
3547 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
3548 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3549 // check whether the returned error was because http.StatusNotModified was
3550 // returned.
3551 func (c *CustomersDeploymentsDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
3552 gensupport.SetOptions(c.urlParams_, opts...)
3553 res, err := c.doRequest("json")
3554 if res != nil && res.StatusCode == http.StatusNotModified {
3555 if res.Body != nil {
3556 res.Body.Close()
3557 }
3558 return nil, gensupport.WrapError(&googleapi.Error{
3559 Code: res.StatusCode,
3560 Header: res.Header,
3561 })
3562 }
3563 if err != nil {
3564 return nil, err
3565 }
3566 defer googleapi.CloseBody(res)
3567 if err := googleapi.CheckResponse(res); err != nil {
3568 return nil, gensupport.WrapError(err)
3569 }
3570 ret := &SasPortalDevice{
3571 ServerResponse: googleapi.ServerResponse{
3572 Header: res.Header,
3573 HTTPStatusCode: res.StatusCode,
3574 },
3575 }
3576 target := &ret
3577 b, err := gensupport.DecodeResponseBytes(target, res)
3578 if err != nil {
3579 return nil, err
3580 }
3581 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.create", "response", internallog.HTTPResponse(res, b))
3582 return ret, nil
3583 }
3584
3585 type CustomersDeploymentsDevicesCreateSignedCall struct {
3586 s *Service
3587 parent string
3588 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
3589 urlParams_ gensupport.URLParams
3590 ctx_ context.Context
3591 header_ http.Header
3592 }
3593
3594 // CreateSigned: Creates a signed device under a node or customer.
3595 //
3596 // - parent: The name of the parent resource.
3597 func (r *CustomersDeploymentsDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *CustomersDeploymentsDevicesCreateSignedCall {
3598 c := &CustomersDeploymentsDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3599 c.parent = parent
3600 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
3601 return c
3602 }
3603
3604 // Fields allows partial responses to be retrieved. See
3605 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3606 // details.
3607 func (c *CustomersDeploymentsDevicesCreateSignedCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesCreateSignedCall {
3608 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3609 return c
3610 }
3611
3612 // Context sets the context to be used in this call's Do method.
3613 func (c *CustomersDeploymentsDevicesCreateSignedCall) Context(ctx context.Context) *CustomersDeploymentsDevicesCreateSignedCall {
3614 c.ctx_ = ctx
3615 return c
3616 }
3617
3618 // Header returns a http.Header that can be modified by the caller to add
3619 // headers to the request.
3620 func (c *CustomersDeploymentsDevicesCreateSignedCall) Header() http.Header {
3621 if c.header_ == nil {
3622 c.header_ = make(http.Header)
3623 }
3624 return c.header_
3625 }
3626
3627 func (c *CustomersDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
3628 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3629 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
3630 if err != nil {
3631 return nil, err
3632 }
3633 c.urlParams_.Set("alt", alt)
3634 c.urlParams_.Set("prettyPrint", "false")
3635 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
3636 urls += "?" + c.urlParams_.Encode()
3637 req, err := http.NewRequest("POST", urls, body)
3638 if err != nil {
3639 return nil, err
3640 }
3641 req.Header = reqHeaders
3642 googleapi.Expand(req.URL, map[string]string{
3643 "parent": c.parent,
3644 })
3645 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
3646 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3647 }
3648
3649 // Do executes the "prod_tt_sasportal.customers.deployments.devices.createSigned" call.
3650 // Any non-2xx status code is an error. Response headers are in either
3651 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
3652 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3653 // check whether the returned error was because http.StatusNotModified was
3654 // returned.
3655 func (c *CustomersDeploymentsDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
3656 gensupport.SetOptions(c.urlParams_, opts...)
3657 res, err := c.doRequest("json")
3658 if res != nil && res.StatusCode == http.StatusNotModified {
3659 if res.Body != nil {
3660 res.Body.Close()
3661 }
3662 return nil, gensupport.WrapError(&googleapi.Error{
3663 Code: res.StatusCode,
3664 Header: res.Header,
3665 })
3666 }
3667 if err != nil {
3668 return nil, err
3669 }
3670 defer googleapi.CloseBody(res)
3671 if err := googleapi.CheckResponse(res); err != nil {
3672 return nil, gensupport.WrapError(err)
3673 }
3674 ret := &SasPortalDevice{
3675 ServerResponse: googleapi.ServerResponse{
3676 Header: res.Header,
3677 HTTPStatusCode: res.StatusCode,
3678 },
3679 }
3680 target := &ret
3681 b, err := gensupport.DecodeResponseBytes(target, res)
3682 if err != nil {
3683 return nil, err
3684 }
3685 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.createSigned", "response", internallog.HTTPResponse(res, b))
3686 return ret, nil
3687 }
3688
3689 type CustomersDeploymentsDevicesListCall struct {
3690 s *Service
3691 parent string
3692 urlParams_ gensupport.URLParams
3693 ifNoneMatch_ string
3694 ctx_ context.Context
3695 header_ http.Header
3696 }
3697
3698 // List: Lists devices under a node or customer.
3699 //
3700 // - parent: The name of the parent resource.
3701 func (r *CustomersDeploymentsDevicesService) List(parent string) *CustomersDeploymentsDevicesListCall {
3702 c := &CustomersDeploymentsDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3703 c.parent = parent
3704 return c
3705 }
3706
3707 // Filter sets the optional parameter "filter": The filter expression. The
3708 // filter should have one of the following formats: "sn=123454" or
3709 // "display_name=MyDevice". sn corresponds to serial number of the device. The
3710 // filter is case insensitive.
3711 func (c *CustomersDeploymentsDevicesListCall) Filter(filter string) *CustomersDeploymentsDevicesListCall {
3712 c.urlParams_.Set("filter", filter)
3713 return c
3714 }
3715
3716 // PageSize sets the optional parameter "pageSize": The maximum number of
3717 // devices to return in the response. If empty or zero, all devices will be
3718 // listed. Must be in the range [0, 1000].
3719 func (c *CustomersDeploymentsDevicesListCall) PageSize(pageSize int64) *CustomersDeploymentsDevicesListCall {
3720 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3721 return c
3722 }
3723
3724 // PageToken sets the optional parameter "pageToken": A pagination token
3725 // returned from a previous call to ListDevices that indicates where this
3726 // listing should continue from.
3727 func (c *CustomersDeploymentsDevicesListCall) PageToken(pageToken string) *CustomersDeploymentsDevicesListCall {
3728 c.urlParams_.Set("pageToken", pageToken)
3729 return c
3730 }
3731
3732 // Fields allows partial responses to be retrieved. See
3733 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3734 // details.
3735 func (c *CustomersDeploymentsDevicesListCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesListCall {
3736 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3737 return c
3738 }
3739
3740 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3741 // object's ETag matches the given value. This is useful for getting updates
3742 // only after the object has changed since the last request.
3743 func (c *CustomersDeploymentsDevicesListCall) IfNoneMatch(entityTag string) *CustomersDeploymentsDevicesListCall {
3744 c.ifNoneMatch_ = entityTag
3745 return c
3746 }
3747
3748 // Context sets the context to be used in this call's Do method.
3749 func (c *CustomersDeploymentsDevicesListCall) Context(ctx context.Context) *CustomersDeploymentsDevicesListCall {
3750 c.ctx_ = ctx
3751 return c
3752 }
3753
3754 // Header returns a http.Header that can be modified by the caller to add
3755 // headers to the request.
3756 func (c *CustomersDeploymentsDevicesListCall) Header() http.Header {
3757 if c.header_ == nil {
3758 c.header_ = make(http.Header)
3759 }
3760 return c.header_
3761 }
3762
3763 func (c *CustomersDeploymentsDevicesListCall) doRequest(alt string) (*http.Response, error) {
3764 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3765 if c.ifNoneMatch_ != "" {
3766 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3767 }
3768 c.urlParams_.Set("alt", alt)
3769 c.urlParams_.Set("prettyPrint", "false")
3770 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
3771 urls += "?" + c.urlParams_.Encode()
3772 req, err := http.NewRequest("GET", urls, nil)
3773 if err != nil {
3774 return nil, err
3775 }
3776 req.Header = reqHeaders
3777 googleapi.Expand(req.URL, map[string]string{
3778 "parent": c.parent,
3779 })
3780 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.list", "request", internallog.HTTPRequest(req, nil))
3781 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3782 }
3783
3784 // Do executes the "prod_tt_sasportal.customers.deployments.devices.list" call.
3785 // Any non-2xx status code is an error. Response headers are in either
3786 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
3787 // returned at all) in error.(*googleapi.Error).Header. Use
3788 // googleapi.IsNotModified to check whether the returned error was because
3789 // http.StatusNotModified was returned.
3790 func (c *CustomersDeploymentsDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
3791 gensupport.SetOptions(c.urlParams_, opts...)
3792 res, err := c.doRequest("json")
3793 if res != nil && res.StatusCode == http.StatusNotModified {
3794 if res.Body != nil {
3795 res.Body.Close()
3796 }
3797 return nil, gensupport.WrapError(&googleapi.Error{
3798 Code: res.StatusCode,
3799 Header: res.Header,
3800 })
3801 }
3802 if err != nil {
3803 return nil, err
3804 }
3805 defer googleapi.CloseBody(res)
3806 if err := googleapi.CheckResponse(res); err != nil {
3807 return nil, gensupport.WrapError(err)
3808 }
3809 ret := &SasPortalListDevicesResponse{
3810 ServerResponse: googleapi.ServerResponse{
3811 Header: res.Header,
3812 HTTPStatusCode: res.StatusCode,
3813 },
3814 }
3815 target := &ret
3816 b, err := gensupport.DecodeResponseBytes(target, res)
3817 if err != nil {
3818 return nil, err
3819 }
3820 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.deployments.devices.list", "response", internallog.HTTPResponse(res, b))
3821 return ret, nil
3822 }
3823
3824 // Pages invokes f for each page of results.
3825 // A non-nil error returned from f will halt the iteration.
3826 // The provided context supersedes any context provided to the Context method.
3827 func (c *CustomersDeploymentsDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
3828 c.ctx_ = ctx
3829 defer c.PageToken(c.urlParams_.Get("pageToken"))
3830 for {
3831 x, err := c.Do()
3832 if err != nil {
3833 return err
3834 }
3835 if err := f(x); err != nil {
3836 return err
3837 }
3838 if x.NextPageToken == "" {
3839 return nil
3840 }
3841 c.PageToken(x.NextPageToken)
3842 }
3843 }
3844
3845 type CustomersDevicesCreateCall struct {
3846 s *Service
3847 parent string
3848 sasportaldevice *SasPortalDevice
3849 urlParams_ gensupport.URLParams
3850 ctx_ context.Context
3851 header_ http.Header
3852 }
3853
3854 // Create: Creates a device under a node or customer.
3855 //
3856 // - parent: The name of the parent resource.
3857 func (r *CustomersDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *CustomersDevicesCreateCall {
3858 c := &CustomersDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3859 c.parent = parent
3860 c.sasportaldevice = sasportaldevice
3861 return c
3862 }
3863
3864 // Fields allows partial responses to be retrieved. See
3865 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3866 // details.
3867 func (c *CustomersDevicesCreateCall) Fields(s ...googleapi.Field) *CustomersDevicesCreateCall {
3868 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3869 return c
3870 }
3871
3872 // Context sets the context to be used in this call's Do method.
3873 func (c *CustomersDevicesCreateCall) Context(ctx context.Context) *CustomersDevicesCreateCall {
3874 c.ctx_ = ctx
3875 return c
3876 }
3877
3878 // Header returns a http.Header that can be modified by the caller to add
3879 // headers to the request.
3880 func (c *CustomersDevicesCreateCall) Header() http.Header {
3881 if c.header_ == nil {
3882 c.header_ = make(http.Header)
3883 }
3884 return c.header_
3885 }
3886
3887 func (c *CustomersDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
3888 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3889 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
3890 if err != nil {
3891 return nil, err
3892 }
3893 c.urlParams_.Set("alt", alt)
3894 c.urlParams_.Set("prettyPrint", "false")
3895 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
3896 urls += "?" + c.urlParams_.Encode()
3897 req, err := http.NewRequest("POST", urls, body)
3898 if err != nil {
3899 return nil, err
3900 }
3901 req.Header = reqHeaders
3902 googleapi.Expand(req.URL, map[string]string{
3903 "parent": c.parent,
3904 })
3905 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3906 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3907 }
3908
3909 // Do executes the "prod_tt_sasportal.customers.devices.create" call.
3910 // Any non-2xx status code is an error. Response headers are in either
3911 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
3912 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3913 // check whether the returned error was because http.StatusNotModified was
3914 // returned.
3915 func (c *CustomersDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
3916 gensupport.SetOptions(c.urlParams_, opts...)
3917 res, err := c.doRequest("json")
3918 if res != nil && res.StatusCode == http.StatusNotModified {
3919 if res.Body != nil {
3920 res.Body.Close()
3921 }
3922 return nil, gensupport.WrapError(&googleapi.Error{
3923 Code: res.StatusCode,
3924 Header: res.Header,
3925 })
3926 }
3927 if err != nil {
3928 return nil, err
3929 }
3930 defer googleapi.CloseBody(res)
3931 if err := googleapi.CheckResponse(res); err != nil {
3932 return nil, gensupport.WrapError(err)
3933 }
3934 ret := &SasPortalDevice{
3935 ServerResponse: googleapi.ServerResponse{
3936 Header: res.Header,
3937 HTTPStatusCode: res.StatusCode,
3938 },
3939 }
3940 target := &ret
3941 b, err := gensupport.DecodeResponseBytes(target, res)
3942 if err != nil {
3943 return nil, err
3944 }
3945 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.create", "response", internallog.HTTPResponse(res, b))
3946 return ret, nil
3947 }
3948
3949 type CustomersDevicesCreateSignedCall struct {
3950 s *Service
3951 parent string
3952 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
3953 urlParams_ gensupport.URLParams
3954 ctx_ context.Context
3955 header_ http.Header
3956 }
3957
3958 // CreateSigned: Creates a signed device under a node or customer.
3959 //
3960 // - parent: The name of the parent resource.
3961 func (r *CustomersDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *CustomersDevicesCreateSignedCall {
3962 c := &CustomersDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3963 c.parent = parent
3964 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
3965 return c
3966 }
3967
3968 // Fields allows partial responses to be retrieved. See
3969 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3970 // details.
3971 func (c *CustomersDevicesCreateSignedCall) Fields(s ...googleapi.Field) *CustomersDevicesCreateSignedCall {
3972 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3973 return c
3974 }
3975
3976 // Context sets the context to be used in this call's Do method.
3977 func (c *CustomersDevicesCreateSignedCall) Context(ctx context.Context) *CustomersDevicesCreateSignedCall {
3978 c.ctx_ = ctx
3979 return c
3980 }
3981
3982 // Header returns a http.Header that can be modified by the caller to add
3983 // headers to the request.
3984 func (c *CustomersDevicesCreateSignedCall) Header() http.Header {
3985 if c.header_ == nil {
3986 c.header_ = make(http.Header)
3987 }
3988 return c.header_
3989 }
3990
3991 func (c *CustomersDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
3992 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3993 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
3994 if err != nil {
3995 return nil, err
3996 }
3997 c.urlParams_.Set("alt", alt)
3998 c.urlParams_.Set("prettyPrint", "false")
3999 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
4000 urls += "?" + c.urlParams_.Encode()
4001 req, err := http.NewRequest("POST", urls, body)
4002 if err != nil {
4003 return nil, err
4004 }
4005 req.Header = reqHeaders
4006 googleapi.Expand(req.URL, map[string]string{
4007 "parent": c.parent,
4008 })
4009 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
4010 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4011 }
4012
4013 // Do executes the "prod_tt_sasportal.customers.devices.createSigned" call.
4014 // Any non-2xx status code is an error. Response headers are in either
4015 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
4016 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4017 // check whether the returned error was because http.StatusNotModified was
4018 // returned.
4019 func (c *CustomersDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
4020 gensupport.SetOptions(c.urlParams_, opts...)
4021 res, err := c.doRequest("json")
4022 if res != nil && res.StatusCode == http.StatusNotModified {
4023 if res.Body != nil {
4024 res.Body.Close()
4025 }
4026 return nil, gensupport.WrapError(&googleapi.Error{
4027 Code: res.StatusCode,
4028 Header: res.Header,
4029 })
4030 }
4031 if err != nil {
4032 return nil, err
4033 }
4034 defer googleapi.CloseBody(res)
4035 if err := googleapi.CheckResponse(res); err != nil {
4036 return nil, gensupport.WrapError(err)
4037 }
4038 ret := &SasPortalDevice{
4039 ServerResponse: googleapi.ServerResponse{
4040 Header: res.Header,
4041 HTTPStatusCode: res.StatusCode,
4042 },
4043 }
4044 target := &ret
4045 b, err := gensupport.DecodeResponseBytes(target, res)
4046 if err != nil {
4047 return nil, err
4048 }
4049 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.createSigned", "response", internallog.HTTPResponse(res, b))
4050 return ret, nil
4051 }
4052
4053 type CustomersDevicesDeleteCall struct {
4054 s *Service
4055 name string
4056 urlParams_ gensupport.URLParams
4057 ctx_ context.Context
4058 header_ http.Header
4059 }
4060
4061 // Delete: Deletes a device.
4062 //
4063 // - name: The name of the device.
4064 func (r *CustomersDevicesService) Delete(name string) *CustomersDevicesDeleteCall {
4065 c := &CustomersDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4066 c.name = name
4067 return c
4068 }
4069
4070 // Fields allows partial responses to be retrieved. See
4071 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4072 // details.
4073 func (c *CustomersDevicesDeleteCall) Fields(s ...googleapi.Field) *CustomersDevicesDeleteCall {
4074 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4075 return c
4076 }
4077
4078 // Context sets the context to be used in this call's Do method.
4079 func (c *CustomersDevicesDeleteCall) Context(ctx context.Context) *CustomersDevicesDeleteCall {
4080 c.ctx_ = ctx
4081 return c
4082 }
4083
4084 // Header returns a http.Header that can be modified by the caller to add
4085 // headers to the request.
4086 func (c *CustomersDevicesDeleteCall) Header() http.Header {
4087 if c.header_ == nil {
4088 c.header_ = make(http.Header)
4089 }
4090 return c.header_
4091 }
4092
4093 func (c *CustomersDevicesDeleteCall) doRequest(alt string) (*http.Response, error) {
4094 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4095 c.urlParams_.Set("alt", alt)
4096 c.urlParams_.Set("prettyPrint", "false")
4097 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
4098 urls += "?" + c.urlParams_.Encode()
4099 req, err := http.NewRequest("DELETE", urls, nil)
4100 if err != nil {
4101 return nil, err
4102 }
4103 req.Header = reqHeaders
4104 googleapi.Expand(req.URL, map[string]string{
4105 "name": c.name,
4106 })
4107 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.delete", "request", internallog.HTTPRequest(req, nil))
4108 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4109 }
4110
4111 // Do executes the "prod_tt_sasportal.customers.devices.delete" call.
4112 // Any non-2xx status code is an error. Response headers are in either
4113 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
4114 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4115 // whether the returned error was because http.StatusNotModified was returned.
4116 func (c *CustomersDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
4117 gensupport.SetOptions(c.urlParams_, opts...)
4118 res, err := c.doRequest("json")
4119 if res != nil && res.StatusCode == http.StatusNotModified {
4120 if res.Body != nil {
4121 res.Body.Close()
4122 }
4123 return nil, gensupport.WrapError(&googleapi.Error{
4124 Code: res.StatusCode,
4125 Header: res.Header,
4126 })
4127 }
4128 if err != nil {
4129 return nil, err
4130 }
4131 defer googleapi.CloseBody(res)
4132 if err := googleapi.CheckResponse(res); err != nil {
4133 return nil, gensupport.WrapError(err)
4134 }
4135 ret := &SasPortalEmpty{
4136 ServerResponse: googleapi.ServerResponse{
4137 Header: res.Header,
4138 HTTPStatusCode: res.StatusCode,
4139 },
4140 }
4141 target := &ret
4142 b, err := gensupport.DecodeResponseBytes(target, res)
4143 if err != nil {
4144 return nil, err
4145 }
4146 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.delete", "response", internallog.HTTPResponse(res, b))
4147 return ret, nil
4148 }
4149
4150 type CustomersDevicesGetCall struct {
4151 s *Service
4152 name string
4153 urlParams_ gensupport.URLParams
4154 ifNoneMatch_ string
4155 ctx_ context.Context
4156 header_ http.Header
4157 }
4158
4159 // Get: Gets details about a device.
4160 //
4161 // - name: The name of the device.
4162 func (r *CustomersDevicesService) Get(name string) *CustomersDevicesGetCall {
4163 c := &CustomersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4164 c.name = name
4165 return c
4166 }
4167
4168 // Fields allows partial responses to be retrieved. See
4169 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4170 // details.
4171 func (c *CustomersDevicesGetCall) Fields(s ...googleapi.Field) *CustomersDevicesGetCall {
4172 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4173 return c
4174 }
4175
4176 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4177 // object's ETag matches the given value. This is useful for getting updates
4178 // only after the object has changed since the last request.
4179 func (c *CustomersDevicesGetCall) IfNoneMatch(entityTag string) *CustomersDevicesGetCall {
4180 c.ifNoneMatch_ = entityTag
4181 return c
4182 }
4183
4184 // Context sets the context to be used in this call's Do method.
4185 func (c *CustomersDevicesGetCall) Context(ctx context.Context) *CustomersDevicesGetCall {
4186 c.ctx_ = ctx
4187 return c
4188 }
4189
4190 // Header returns a http.Header that can be modified by the caller to add
4191 // headers to the request.
4192 func (c *CustomersDevicesGetCall) Header() http.Header {
4193 if c.header_ == nil {
4194 c.header_ = make(http.Header)
4195 }
4196 return c.header_
4197 }
4198
4199 func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
4200 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4201 if c.ifNoneMatch_ != "" {
4202 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4203 }
4204 c.urlParams_.Set("alt", alt)
4205 c.urlParams_.Set("prettyPrint", "false")
4206 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
4207 urls += "?" + c.urlParams_.Encode()
4208 req, err := http.NewRequest("GET", urls, nil)
4209 if err != nil {
4210 return nil, err
4211 }
4212 req.Header = reqHeaders
4213 googleapi.Expand(req.URL, map[string]string{
4214 "name": c.name,
4215 })
4216 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.get", "request", internallog.HTTPRequest(req, nil))
4217 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4218 }
4219
4220 // Do executes the "prod_tt_sasportal.customers.devices.get" call.
4221 // Any non-2xx status code is an error. Response headers are in either
4222 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
4223 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4224 // check whether the returned error was because http.StatusNotModified was
4225 // returned.
4226 func (c *CustomersDevicesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
4227 gensupport.SetOptions(c.urlParams_, opts...)
4228 res, err := c.doRequest("json")
4229 if res != nil && res.StatusCode == http.StatusNotModified {
4230 if res.Body != nil {
4231 res.Body.Close()
4232 }
4233 return nil, gensupport.WrapError(&googleapi.Error{
4234 Code: res.StatusCode,
4235 Header: res.Header,
4236 })
4237 }
4238 if err != nil {
4239 return nil, err
4240 }
4241 defer googleapi.CloseBody(res)
4242 if err := googleapi.CheckResponse(res); err != nil {
4243 return nil, gensupport.WrapError(err)
4244 }
4245 ret := &SasPortalDevice{
4246 ServerResponse: googleapi.ServerResponse{
4247 Header: res.Header,
4248 HTTPStatusCode: res.StatusCode,
4249 },
4250 }
4251 target := &ret
4252 b, err := gensupport.DecodeResponseBytes(target, res)
4253 if err != nil {
4254 return nil, err
4255 }
4256 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.get", "response", internallog.HTTPResponse(res, b))
4257 return ret, nil
4258 }
4259
4260 type CustomersDevicesListCall struct {
4261 s *Service
4262 parent string
4263 urlParams_ gensupport.URLParams
4264 ifNoneMatch_ string
4265 ctx_ context.Context
4266 header_ http.Header
4267 }
4268
4269 // List: Lists devices under a node or customer.
4270 //
4271 // - parent: The name of the parent resource.
4272 func (r *CustomersDevicesService) List(parent string) *CustomersDevicesListCall {
4273 c := &CustomersDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4274 c.parent = parent
4275 return c
4276 }
4277
4278 // Filter sets the optional parameter "filter": The filter expression. The
4279 // filter should have one of the following formats: "sn=123454" or
4280 // "display_name=MyDevice". sn corresponds to serial number of the device. The
4281 // filter is case insensitive.
4282 func (c *CustomersDevicesListCall) Filter(filter string) *CustomersDevicesListCall {
4283 c.urlParams_.Set("filter", filter)
4284 return c
4285 }
4286
4287 // PageSize sets the optional parameter "pageSize": The maximum number of
4288 // devices to return in the response. If empty or zero, all devices will be
4289 // listed. Must be in the range [0, 1000].
4290 func (c *CustomersDevicesListCall) PageSize(pageSize int64) *CustomersDevicesListCall {
4291 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4292 return c
4293 }
4294
4295 // PageToken sets the optional parameter "pageToken": A pagination token
4296 // returned from a previous call to ListDevices that indicates where this
4297 // listing should continue from.
4298 func (c *CustomersDevicesListCall) PageToken(pageToken string) *CustomersDevicesListCall {
4299 c.urlParams_.Set("pageToken", pageToken)
4300 return c
4301 }
4302
4303 // Fields allows partial responses to be retrieved. See
4304 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4305 // details.
4306 func (c *CustomersDevicesListCall) Fields(s ...googleapi.Field) *CustomersDevicesListCall {
4307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4308 return c
4309 }
4310
4311 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4312 // object's ETag matches the given value. This is useful for getting updates
4313 // only after the object has changed since the last request.
4314 func (c *CustomersDevicesListCall) IfNoneMatch(entityTag string) *CustomersDevicesListCall {
4315 c.ifNoneMatch_ = entityTag
4316 return c
4317 }
4318
4319 // Context sets the context to be used in this call's Do method.
4320 func (c *CustomersDevicesListCall) Context(ctx context.Context) *CustomersDevicesListCall {
4321 c.ctx_ = ctx
4322 return c
4323 }
4324
4325 // Header returns a http.Header that can be modified by the caller to add
4326 // headers to the request.
4327 func (c *CustomersDevicesListCall) Header() http.Header {
4328 if c.header_ == nil {
4329 c.header_ = make(http.Header)
4330 }
4331 return c.header_
4332 }
4333
4334 func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) {
4335 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4336 if c.ifNoneMatch_ != "" {
4337 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4338 }
4339 c.urlParams_.Set("alt", alt)
4340 c.urlParams_.Set("prettyPrint", "false")
4341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
4342 urls += "?" + c.urlParams_.Encode()
4343 req, err := http.NewRequest("GET", urls, nil)
4344 if err != nil {
4345 return nil, err
4346 }
4347 req.Header = reqHeaders
4348 googleapi.Expand(req.URL, map[string]string{
4349 "parent": c.parent,
4350 })
4351 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.list", "request", internallog.HTTPRequest(req, nil))
4352 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4353 }
4354
4355 // Do executes the "prod_tt_sasportal.customers.devices.list" call.
4356 // Any non-2xx status code is an error. Response headers are in either
4357 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
4358 // returned at all) in error.(*googleapi.Error).Header. Use
4359 // googleapi.IsNotModified to check whether the returned error was because
4360 // http.StatusNotModified was returned.
4361 func (c *CustomersDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
4362 gensupport.SetOptions(c.urlParams_, opts...)
4363 res, err := c.doRequest("json")
4364 if res != nil && res.StatusCode == http.StatusNotModified {
4365 if res.Body != nil {
4366 res.Body.Close()
4367 }
4368 return nil, gensupport.WrapError(&googleapi.Error{
4369 Code: res.StatusCode,
4370 Header: res.Header,
4371 })
4372 }
4373 if err != nil {
4374 return nil, err
4375 }
4376 defer googleapi.CloseBody(res)
4377 if err := googleapi.CheckResponse(res); err != nil {
4378 return nil, gensupport.WrapError(err)
4379 }
4380 ret := &SasPortalListDevicesResponse{
4381 ServerResponse: googleapi.ServerResponse{
4382 Header: res.Header,
4383 HTTPStatusCode: res.StatusCode,
4384 },
4385 }
4386 target := &ret
4387 b, err := gensupport.DecodeResponseBytes(target, res)
4388 if err != nil {
4389 return nil, err
4390 }
4391 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.list", "response", internallog.HTTPResponse(res, b))
4392 return ret, nil
4393 }
4394
4395 // Pages invokes f for each page of results.
4396 // A non-nil error returned from f will halt the iteration.
4397 // The provided context supersedes any context provided to the Context method.
4398 func (c *CustomersDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
4399 c.ctx_ = ctx
4400 defer c.PageToken(c.urlParams_.Get("pageToken"))
4401 for {
4402 x, err := c.Do()
4403 if err != nil {
4404 return err
4405 }
4406 if err := f(x); err != nil {
4407 return err
4408 }
4409 if x.NextPageToken == "" {
4410 return nil
4411 }
4412 c.PageToken(x.NextPageToken)
4413 }
4414 }
4415
4416 type CustomersDevicesMoveCall struct {
4417 s *Service
4418 name string
4419 sasportalmovedevicerequest *SasPortalMoveDeviceRequest
4420 urlParams_ gensupport.URLParams
4421 ctx_ context.Context
4422 header_ http.Header
4423 }
4424
4425 // Move: Moves a device under another node or customer.
4426 //
4427 // - name: The name of the device to move.
4428 func (r *CustomersDevicesService) Move(name string, sasportalmovedevicerequest *SasPortalMoveDeviceRequest) *CustomersDevicesMoveCall {
4429 c := &CustomersDevicesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4430 c.name = name
4431 c.sasportalmovedevicerequest = sasportalmovedevicerequest
4432 return c
4433 }
4434
4435 // Fields allows partial responses to be retrieved. See
4436 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4437 // details.
4438 func (c *CustomersDevicesMoveCall) Fields(s ...googleapi.Field) *CustomersDevicesMoveCall {
4439 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4440 return c
4441 }
4442
4443 // Context sets the context to be used in this call's Do method.
4444 func (c *CustomersDevicesMoveCall) Context(ctx context.Context) *CustomersDevicesMoveCall {
4445 c.ctx_ = ctx
4446 return c
4447 }
4448
4449 // Header returns a http.Header that can be modified by the caller to add
4450 // headers to the request.
4451 func (c *CustomersDevicesMoveCall) Header() http.Header {
4452 if c.header_ == nil {
4453 c.header_ = make(http.Header)
4454 }
4455 return c.header_
4456 }
4457
4458 func (c *CustomersDevicesMoveCall) doRequest(alt string) (*http.Response, error) {
4459 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4460 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest)
4461 if err != nil {
4462 return nil, err
4463 }
4464 c.urlParams_.Set("alt", alt)
4465 c.urlParams_.Set("prettyPrint", "false")
4466 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
4467 urls += "?" + c.urlParams_.Encode()
4468 req, err := http.NewRequest("POST", urls, body)
4469 if err != nil {
4470 return nil, err
4471 }
4472 req.Header = reqHeaders
4473 googleapi.Expand(req.URL, map[string]string{
4474 "name": c.name,
4475 })
4476 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.move", "request", internallog.HTTPRequest(req, body.Bytes()))
4477 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4478 }
4479
4480 // Do executes the "prod_tt_sasportal.customers.devices.move" call.
4481 // Any non-2xx status code is an error. Response headers are in either
4482 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
4483 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4484 // check whether the returned error was because http.StatusNotModified was
4485 // returned.
4486 func (c *CustomersDevicesMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
4487 gensupport.SetOptions(c.urlParams_, opts...)
4488 res, err := c.doRequest("json")
4489 if res != nil && res.StatusCode == http.StatusNotModified {
4490 if res.Body != nil {
4491 res.Body.Close()
4492 }
4493 return nil, gensupport.WrapError(&googleapi.Error{
4494 Code: res.StatusCode,
4495 Header: res.Header,
4496 })
4497 }
4498 if err != nil {
4499 return nil, err
4500 }
4501 defer googleapi.CloseBody(res)
4502 if err := googleapi.CheckResponse(res); err != nil {
4503 return nil, gensupport.WrapError(err)
4504 }
4505 ret := &SasPortalOperation{
4506 ServerResponse: googleapi.ServerResponse{
4507 Header: res.Header,
4508 HTTPStatusCode: res.StatusCode,
4509 },
4510 }
4511 target := &ret
4512 b, err := gensupport.DecodeResponseBytes(target, res)
4513 if err != nil {
4514 return nil, err
4515 }
4516 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.move", "response", internallog.HTTPResponse(res, b))
4517 return ret, nil
4518 }
4519
4520 type CustomersDevicesPatchCall struct {
4521 s *Service
4522 name string
4523 sasportaldevice *SasPortalDevice
4524 urlParams_ gensupport.URLParams
4525 ctx_ context.Context
4526 header_ http.Header
4527 }
4528
4529 // Patch: Updates a device.
4530 //
4531 // - name: Output only. The resource path name.
4532 func (r *CustomersDevicesService) Patch(name string, sasportaldevice *SasPortalDevice) *CustomersDevicesPatchCall {
4533 c := &CustomersDevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4534 c.name = name
4535 c.sasportaldevice = sasportaldevice
4536 return c
4537 }
4538
4539 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
4540 func (c *CustomersDevicesPatchCall) UpdateMask(updateMask string) *CustomersDevicesPatchCall {
4541 c.urlParams_.Set("updateMask", updateMask)
4542 return c
4543 }
4544
4545 // Fields allows partial responses to be retrieved. See
4546 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4547 // details.
4548 func (c *CustomersDevicesPatchCall) Fields(s ...googleapi.Field) *CustomersDevicesPatchCall {
4549 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4550 return c
4551 }
4552
4553 // Context sets the context to be used in this call's Do method.
4554 func (c *CustomersDevicesPatchCall) Context(ctx context.Context) *CustomersDevicesPatchCall {
4555 c.ctx_ = ctx
4556 return c
4557 }
4558
4559 // Header returns a http.Header that can be modified by the caller to add
4560 // headers to the request.
4561 func (c *CustomersDevicesPatchCall) Header() http.Header {
4562 if c.header_ == nil {
4563 c.header_ = make(http.Header)
4564 }
4565 return c.header_
4566 }
4567
4568 func (c *CustomersDevicesPatchCall) doRequest(alt string) (*http.Response, error) {
4569 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4570 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
4571 if err != nil {
4572 return nil, err
4573 }
4574 c.urlParams_.Set("alt", alt)
4575 c.urlParams_.Set("prettyPrint", "false")
4576 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
4577 urls += "?" + c.urlParams_.Encode()
4578 req, err := http.NewRequest("PATCH", urls, body)
4579 if err != nil {
4580 return nil, err
4581 }
4582 req.Header = reqHeaders
4583 googleapi.Expand(req.URL, map[string]string{
4584 "name": c.name,
4585 })
4586 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
4587 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4588 }
4589
4590 // Do executes the "prod_tt_sasportal.customers.devices.patch" call.
4591 // Any non-2xx status code is an error. Response headers are in either
4592 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
4593 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4594 // check whether the returned error was because http.StatusNotModified was
4595 // returned.
4596 func (c *CustomersDevicesPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
4597 gensupport.SetOptions(c.urlParams_, opts...)
4598 res, err := c.doRequest("json")
4599 if res != nil && res.StatusCode == http.StatusNotModified {
4600 if res.Body != nil {
4601 res.Body.Close()
4602 }
4603 return nil, gensupport.WrapError(&googleapi.Error{
4604 Code: res.StatusCode,
4605 Header: res.Header,
4606 })
4607 }
4608 if err != nil {
4609 return nil, err
4610 }
4611 defer googleapi.CloseBody(res)
4612 if err := googleapi.CheckResponse(res); err != nil {
4613 return nil, gensupport.WrapError(err)
4614 }
4615 ret := &SasPortalDevice{
4616 ServerResponse: googleapi.ServerResponse{
4617 Header: res.Header,
4618 HTTPStatusCode: res.StatusCode,
4619 },
4620 }
4621 target := &ret
4622 b, err := gensupport.DecodeResponseBytes(target, res)
4623 if err != nil {
4624 return nil, err
4625 }
4626 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.patch", "response", internallog.HTTPResponse(res, b))
4627 return ret, nil
4628 }
4629
4630 type CustomersDevicesSignDeviceCall struct {
4631 s *Service
4632 name string
4633 sasportalsigndevicerequest *SasPortalSignDeviceRequest
4634 urlParams_ gensupport.URLParams
4635 ctx_ context.Context
4636 header_ http.Header
4637 }
4638
4639 // SignDevice: Signs a device.
4640 //
4641 // - name: Output only. The resource path name.
4642 func (r *CustomersDevicesService) SignDevice(name string, sasportalsigndevicerequest *SasPortalSignDeviceRequest) *CustomersDevicesSignDeviceCall {
4643 c := &CustomersDevicesSignDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4644 c.name = name
4645 c.sasportalsigndevicerequest = sasportalsigndevicerequest
4646 return c
4647 }
4648
4649 // Fields allows partial responses to be retrieved. See
4650 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4651 // details.
4652 func (c *CustomersDevicesSignDeviceCall) Fields(s ...googleapi.Field) *CustomersDevicesSignDeviceCall {
4653 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4654 return c
4655 }
4656
4657 // Context sets the context to be used in this call's Do method.
4658 func (c *CustomersDevicesSignDeviceCall) Context(ctx context.Context) *CustomersDevicesSignDeviceCall {
4659 c.ctx_ = ctx
4660 return c
4661 }
4662
4663 // Header returns a http.Header that can be modified by the caller to add
4664 // headers to the request.
4665 func (c *CustomersDevicesSignDeviceCall) Header() http.Header {
4666 if c.header_ == nil {
4667 c.header_ = make(http.Header)
4668 }
4669 return c.header_
4670 }
4671
4672 func (c *CustomersDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) {
4673 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4674 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest)
4675 if err != nil {
4676 return nil, err
4677 }
4678 c.urlParams_.Set("alt", alt)
4679 c.urlParams_.Set("prettyPrint", "false")
4680 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:signDevice")
4681 urls += "?" + c.urlParams_.Encode()
4682 req, err := http.NewRequest("POST", urls, body)
4683 if err != nil {
4684 return nil, err
4685 }
4686 req.Header = reqHeaders
4687 googleapi.Expand(req.URL, map[string]string{
4688 "name": c.name,
4689 })
4690 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.signDevice", "request", internallog.HTTPRequest(req, body.Bytes()))
4691 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4692 }
4693
4694 // Do executes the "prod_tt_sasportal.customers.devices.signDevice" call.
4695 // Any non-2xx status code is an error. Response headers are in either
4696 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
4697 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4698 // whether the returned error was because http.StatusNotModified was returned.
4699 func (c *CustomersDevicesSignDeviceCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
4700 gensupport.SetOptions(c.urlParams_, opts...)
4701 res, err := c.doRequest("json")
4702 if res != nil && res.StatusCode == http.StatusNotModified {
4703 if res.Body != nil {
4704 res.Body.Close()
4705 }
4706 return nil, gensupport.WrapError(&googleapi.Error{
4707 Code: res.StatusCode,
4708 Header: res.Header,
4709 })
4710 }
4711 if err != nil {
4712 return nil, err
4713 }
4714 defer googleapi.CloseBody(res)
4715 if err := googleapi.CheckResponse(res); err != nil {
4716 return nil, gensupport.WrapError(err)
4717 }
4718 ret := &SasPortalEmpty{
4719 ServerResponse: googleapi.ServerResponse{
4720 Header: res.Header,
4721 HTTPStatusCode: res.StatusCode,
4722 },
4723 }
4724 target := &ret
4725 b, err := gensupport.DecodeResponseBytes(target, res)
4726 if err != nil {
4727 return nil, err
4728 }
4729 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.signDevice", "response", internallog.HTTPResponse(res, b))
4730 return ret, nil
4731 }
4732
4733 type CustomersDevicesUpdateSignedCall struct {
4734 s *Service
4735 name string
4736 sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest
4737 urlParams_ gensupport.URLParams
4738 ctx_ context.Context
4739 header_ http.Header
4740 }
4741
4742 // UpdateSigned: Updates a signed device.
4743 //
4744 // - name: The name of the device to update.
4745 func (r *CustomersDevicesService) UpdateSigned(name string, sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest) *CustomersDevicesUpdateSignedCall {
4746 c := &CustomersDevicesUpdateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4747 c.name = name
4748 c.sasportalupdatesigneddevicerequest = sasportalupdatesigneddevicerequest
4749 return c
4750 }
4751
4752 // Fields allows partial responses to be retrieved. See
4753 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4754 // details.
4755 func (c *CustomersDevicesUpdateSignedCall) Fields(s ...googleapi.Field) *CustomersDevicesUpdateSignedCall {
4756 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4757 return c
4758 }
4759
4760 // Context sets the context to be used in this call's Do method.
4761 func (c *CustomersDevicesUpdateSignedCall) Context(ctx context.Context) *CustomersDevicesUpdateSignedCall {
4762 c.ctx_ = ctx
4763 return c
4764 }
4765
4766 // Header returns a http.Header that can be modified by the caller to add
4767 // headers to the request.
4768 func (c *CustomersDevicesUpdateSignedCall) Header() http.Header {
4769 if c.header_ == nil {
4770 c.header_ = make(http.Header)
4771 }
4772 return c.header_
4773 }
4774
4775 func (c *CustomersDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) {
4776 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4777 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest)
4778 if err != nil {
4779 return nil, err
4780 }
4781 c.urlParams_.Set("alt", alt)
4782 c.urlParams_.Set("prettyPrint", "false")
4783 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:updateSigned")
4784 urls += "?" + c.urlParams_.Encode()
4785 req, err := http.NewRequest("PATCH", urls, body)
4786 if err != nil {
4787 return nil, err
4788 }
4789 req.Header = reqHeaders
4790 googleapi.Expand(req.URL, map[string]string{
4791 "name": c.name,
4792 })
4793 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.updateSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
4794 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4795 }
4796
4797 // Do executes the "prod_tt_sasportal.customers.devices.updateSigned" call.
4798 // Any non-2xx status code is an error. Response headers are in either
4799 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
4800 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4801 // check whether the returned error was because http.StatusNotModified was
4802 // returned.
4803 func (c *CustomersDevicesUpdateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
4804 gensupport.SetOptions(c.urlParams_, opts...)
4805 res, err := c.doRequest("json")
4806 if res != nil && res.StatusCode == http.StatusNotModified {
4807 if res.Body != nil {
4808 res.Body.Close()
4809 }
4810 return nil, gensupport.WrapError(&googleapi.Error{
4811 Code: res.StatusCode,
4812 Header: res.Header,
4813 })
4814 }
4815 if err != nil {
4816 return nil, err
4817 }
4818 defer googleapi.CloseBody(res)
4819 if err := googleapi.CheckResponse(res); err != nil {
4820 return nil, gensupport.WrapError(err)
4821 }
4822 ret := &SasPortalDevice{
4823 ServerResponse: googleapi.ServerResponse{
4824 Header: res.Header,
4825 HTTPStatusCode: res.StatusCode,
4826 },
4827 }
4828 target := &ret
4829 b, err := gensupport.DecodeResponseBytes(target, res)
4830 if err != nil {
4831 return nil, err
4832 }
4833 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.devices.updateSigned", "response", internallog.HTTPResponse(res, b))
4834 return ret, nil
4835 }
4836
4837 type CustomersNodesCreateCall struct {
4838 s *Service
4839 parent string
4840 sasportalnode *SasPortalNode
4841 urlParams_ gensupport.URLParams
4842 ctx_ context.Context
4843 header_ http.Header
4844 }
4845
4846 // Create: Creates a new node.
4847 //
4848 // - parent: The parent resource name where the node is to be created.
4849 func (r *CustomersNodesService) Create(parent string, sasportalnode *SasPortalNode) *CustomersNodesCreateCall {
4850 c := &CustomersNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4851 c.parent = parent
4852 c.sasportalnode = sasportalnode
4853 return c
4854 }
4855
4856 // Fields allows partial responses to be retrieved. See
4857 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4858 // details.
4859 func (c *CustomersNodesCreateCall) Fields(s ...googleapi.Field) *CustomersNodesCreateCall {
4860 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4861 return c
4862 }
4863
4864 // Context sets the context to be used in this call's Do method.
4865 func (c *CustomersNodesCreateCall) Context(ctx context.Context) *CustomersNodesCreateCall {
4866 c.ctx_ = ctx
4867 return c
4868 }
4869
4870 // Header returns a http.Header that can be modified by the caller to add
4871 // headers to the request.
4872 func (c *CustomersNodesCreateCall) Header() http.Header {
4873 if c.header_ == nil {
4874 c.header_ = make(http.Header)
4875 }
4876 return c.header_
4877 }
4878
4879 func (c *CustomersNodesCreateCall) doRequest(alt string) (*http.Response, error) {
4880 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4881 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
4882 if err != nil {
4883 return nil, err
4884 }
4885 c.urlParams_.Set("alt", alt)
4886 c.urlParams_.Set("prettyPrint", "false")
4887 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
4888 urls += "?" + c.urlParams_.Encode()
4889 req, err := http.NewRequest("POST", urls, body)
4890 if err != nil {
4891 return nil, err
4892 }
4893 req.Header = reqHeaders
4894 googleapi.Expand(req.URL, map[string]string{
4895 "parent": c.parent,
4896 })
4897 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4898 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4899 }
4900
4901 // Do executes the "prod_tt_sasportal.customers.nodes.create" call.
4902 // Any non-2xx status code is an error. Response headers are in either
4903 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
4904 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4905 // whether the returned error was because http.StatusNotModified was returned.
4906 func (c *CustomersNodesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
4907 gensupport.SetOptions(c.urlParams_, opts...)
4908 res, err := c.doRequest("json")
4909 if res != nil && res.StatusCode == http.StatusNotModified {
4910 if res.Body != nil {
4911 res.Body.Close()
4912 }
4913 return nil, gensupport.WrapError(&googleapi.Error{
4914 Code: res.StatusCode,
4915 Header: res.Header,
4916 })
4917 }
4918 if err != nil {
4919 return nil, err
4920 }
4921 defer googleapi.CloseBody(res)
4922 if err := googleapi.CheckResponse(res); err != nil {
4923 return nil, gensupport.WrapError(err)
4924 }
4925 ret := &SasPortalNode{
4926 ServerResponse: googleapi.ServerResponse{
4927 Header: res.Header,
4928 HTTPStatusCode: res.StatusCode,
4929 },
4930 }
4931 target := &ret
4932 b, err := gensupport.DecodeResponseBytes(target, res)
4933 if err != nil {
4934 return nil, err
4935 }
4936 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.create", "response", internallog.HTTPResponse(res, b))
4937 return ret, nil
4938 }
4939
4940 type CustomersNodesDeleteCall struct {
4941 s *Service
4942 name string
4943 urlParams_ gensupport.URLParams
4944 ctx_ context.Context
4945 header_ http.Header
4946 }
4947
4948 // Delete: Deletes a node.
4949 //
4950 // - name: The name of the node.
4951 func (r *CustomersNodesService) Delete(name string) *CustomersNodesDeleteCall {
4952 c := &CustomersNodesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4953 c.name = name
4954 return c
4955 }
4956
4957 // Fields allows partial responses to be retrieved. See
4958 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4959 // details.
4960 func (c *CustomersNodesDeleteCall) Fields(s ...googleapi.Field) *CustomersNodesDeleteCall {
4961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4962 return c
4963 }
4964
4965 // Context sets the context to be used in this call's Do method.
4966 func (c *CustomersNodesDeleteCall) Context(ctx context.Context) *CustomersNodesDeleteCall {
4967 c.ctx_ = ctx
4968 return c
4969 }
4970
4971 // Header returns a http.Header that can be modified by the caller to add
4972 // headers to the request.
4973 func (c *CustomersNodesDeleteCall) Header() http.Header {
4974 if c.header_ == nil {
4975 c.header_ = make(http.Header)
4976 }
4977 return c.header_
4978 }
4979
4980 func (c *CustomersNodesDeleteCall) doRequest(alt string) (*http.Response, error) {
4981 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4982 c.urlParams_.Set("alt", alt)
4983 c.urlParams_.Set("prettyPrint", "false")
4984 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
4985 urls += "?" + c.urlParams_.Encode()
4986 req, err := http.NewRequest("DELETE", urls, nil)
4987 if err != nil {
4988 return nil, err
4989 }
4990 req.Header = reqHeaders
4991 googleapi.Expand(req.URL, map[string]string{
4992 "name": c.name,
4993 })
4994 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.delete", "request", internallog.HTTPRequest(req, nil))
4995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4996 }
4997
4998 // Do executes the "prod_tt_sasportal.customers.nodes.delete" call.
4999 // Any non-2xx status code is an error. Response headers are in either
5000 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
5001 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5002 // whether the returned error was because http.StatusNotModified was returned.
5003 func (c *CustomersNodesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
5004 gensupport.SetOptions(c.urlParams_, opts...)
5005 res, err := c.doRequest("json")
5006 if res != nil && res.StatusCode == http.StatusNotModified {
5007 if res.Body != nil {
5008 res.Body.Close()
5009 }
5010 return nil, gensupport.WrapError(&googleapi.Error{
5011 Code: res.StatusCode,
5012 Header: res.Header,
5013 })
5014 }
5015 if err != nil {
5016 return nil, err
5017 }
5018 defer googleapi.CloseBody(res)
5019 if err := googleapi.CheckResponse(res); err != nil {
5020 return nil, gensupport.WrapError(err)
5021 }
5022 ret := &SasPortalEmpty{
5023 ServerResponse: googleapi.ServerResponse{
5024 Header: res.Header,
5025 HTTPStatusCode: res.StatusCode,
5026 },
5027 }
5028 target := &ret
5029 b, err := gensupport.DecodeResponseBytes(target, res)
5030 if err != nil {
5031 return nil, err
5032 }
5033 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.delete", "response", internallog.HTTPResponse(res, b))
5034 return ret, nil
5035 }
5036
5037 type CustomersNodesGetCall struct {
5038 s *Service
5039 name string
5040 urlParams_ gensupport.URLParams
5041 ifNoneMatch_ string
5042 ctx_ context.Context
5043 header_ http.Header
5044 }
5045
5046 // Get: Returns a requested node.
5047 //
5048 // - name: The name of the node.
5049 func (r *CustomersNodesService) Get(name string) *CustomersNodesGetCall {
5050 c := &CustomersNodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5051 c.name = name
5052 return c
5053 }
5054
5055 // Fields allows partial responses to be retrieved. See
5056 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5057 // details.
5058 func (c *CustomersNodesGetCall) Fields(s ...googleapi.Field) *CustomersNodesGetCall {
5059 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5060 return c
5061 }
5062
5063 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5064 // object's ETag matches the given value. This is useful for getting updates
5065 // only after the object has changed since the last request.
5066 func (c *CustomersNodesGetCall) IfNoneMatch(entityTag string) *CustomersNodesGetCall {
5067 c.ifNoneMatch_ = entityTag
5068 return c
5069 }
5070
5071 // Context sets the context to be used in this call's Do method.
5072 func (c *CustomersNodesGetCall) Context(ctx context.Context) *CustomersNodesGetCall {
5073 c.ctx_ = ctx
5074 return c
5075 }
5076
5077 // Header returns a http.Header that can be modified by the caller to add
5078 // headers to the request.
5079 func (c *CustomersNodesGetCall) Header() http.Header {
5080 if c.header_ == nil {
5081 c.header_ = make(http.Header)
5082 }
5083 return c.header_
5084 }
5085
5086 func (c *CustomersNodesGetCall) doRequest(alt string) (*http.Response, error) {
5087 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5088 if c.ifNoneMatch_ != "" {
5089 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5090 }
5091 c.urlParams_.Set("alt", alt)
5092 c.urlParams_.Set("prettyPrint", "false")
5093 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
5094 urls += "?" + c.urlParams_.Encode()
5095 req, err := http.NewRequest("GET", urls, nil)
5096 if err != nil {
5097 return nil, err
5098 }
5099 req.Header = reqHeaders
5100 googleapi.Expand(req.URL, map[string]string{
5101 "name": c.name,
5102 })
5103 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.get", "request", internallog.HTTPRequest(req, nil))
5104 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5105 }
5106
5107 // Do executes the "prod_tt_sasportal.customers.nodes.get" call.
5108 // Any non-2xx status code is an error. Response headers are in either
5109 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
5110 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5111 // whether the returned error was because http.StatusNotModified was returned.
5112 func (c *CustomersNodesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
5113 gensupport.SetOptions(c.urlParams_, opts...)
5114 res, err := c.doRequest("json")
5115 if res != nil && res.StatusCode == http.StatusNotModified {
5116 if res.Body != nil {
5117 res.Body.Close()
5118 }
5119 return nil, gensupport.WrapError(&googleapi.Error{
5120 Code: res.StatusCode,
5121 Header: res.Header,
5122 })
5123 }
5124 if err != nil {
5125 return nil, err
5126 }
5127 defer googleapi.CloseBody(res)
5128 if err := googleapi.CheckResponse(res); err != nil {
5129 return nil, gensupport.WrapError(err)
5130 }
5131 ret := &SasPortalNode{
5132 ServerResponse: googleapi.ServerResponse{
5133 Header: res.Header,
5134 HTTPStatusCode: res.StatusCode,
5135 },
5136 }
5137 target := &ret
5138 b, err := gensupport.DecodeResponseBytes(target, res)
5139 if err != nil {
5140 return nil, err
5141 }
5142 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.get", "response", internallog.HTTPResponse(res, b))
5143 return ret, nil
5144 }
5145
5146 type CustomersNodesListCall struct {
5147 s *Service
5148 parent string
5149 urlParams_ gensupport.URLParams
5150 ifNoneMatch_ string
5151 ctx_ context.Context
5152 header_ http.Header
5153 }
5154
5155 // List: Lists nodes.
5156 //
5157 // - parent: The parent resource name, for example, "nodes/1".
5158 func (r *CustomersNodesService) List(parent string) *CustomersNodesListCall {
5159 c := &CustomersNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5160 c.parent = parent
5161 return c
5162 }
5163
5164 // Filter sets the optional parameter "filter": The filter expression. The
5165 // filter should have the following format: "DIRECT_CHILDREN" or format:
5166 // "direct_children". The filter is case insensitive. If empty, then no nodes
5167 // are filtered.
5168 func (c *CustomersNodesListCall) Filter(filter string) *CustomersNodesListCall {
5169 c.urlParams_.Set("filter", filter)
5170 return c
5171 }
5172
5173 // PageSize sets the optional parameter "pageSize": The maximum number of nodes
5174 // to return in the response.
5175 func (c *CustomersNodesListCall) PageSize(pageSize int64) *CustomersNodesListCall {
5176 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5177 return c
5178 }
5179
5180 // PageToken sets the optional parameter "pageToken": A pagination token
5181 // returned from a previous call to ListNodes that indicates where this listing
5182 // should continue from.
5183 func (c *CustomersNodesListCall) PageToken(pageToken string) *CustomersNodesListCall {
5184 c.urlParams_.Set("pageToken", pageToken)
5185 return c
5186 }
5187
5188 // Fields allows partial responses to be retrieved. See
5189 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5190 // details.
5191 func (c *CustomersNodesListCall) Fields(s ...googleapi.Field) *CustomersNodesListCall {
5192 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5193 return c
5194 }
5195
5196 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5197 // object's ETag matches the given value. This is useful for getting updates
5198 // only after the object has changed since the last request.
5199 func (c *CustomersNodesListCall) IfNoneMatch(entityTag string) *CustomersNodesListCall {
5200 c.ifNoneMatch_ = entityTag
5201 return c
5202 }
5203
5204 // Context sets the context to be used in this call's Do method.
5205 func (c *CustomersNodesListCall) Context(ctx context.Context) *CustomersNodesListCall {
5206 c.ctx_ = ctx
5207 return c
5208 }
5209
5210 // Header returns a http.Header that can be modified by the caller to add
5211 // headers to the request.
5212 func (c *CustomersNodesListCall) Header() http.Header {
5213 if c.header_ == nil {
5214 c.header_ = make(http.Header)
5215 }
5216 return c.header_
5217 }
5218
5219 func (c *CustomersNodesListCall) doRequest(alt string) (*http.Response, error) {
5220 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5221 if c.ifNoneMatch_ != "" {
5222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5223 }
5224 c.urlParams_.Set("alt", alt)
5225 c.urlParams_.Set("prettyPrint", "false")
5226 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
5227 urls += "?" + c.urlParams_.Encode()
5228 req, err := http.NewRequest("GET", urls, nil)
5229 if err != nil {
5230 return nil, err
5231 }
5232 req.Header = reqHeaders
5233 googleapi.Expand(req.URL, map[string]string{
5234 "parent": c.parent,
5235 })
5236 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.list", "request", internallog.HTTPRequest(req, nil))
5237 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5238 }
5239
5240 // Do executes the "prod_tt_sasportal.customers.nodes.list" call.
5241 // Any non-2xx status code is an error. Response headers are in either
5242 // *SasPortalListNodesResponse.ServerResponse.Header or (if a response was
5243 // returned at all) in error.(*googleapi.Error).Header. Use
5244 // googleapi.IsNotModified to check whether the returned error was because
5245 // http.StatusNotModified was returned.
5246 func (c *CustomersNodesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListNodesResponse, error) {
5247 gensupport.SetOptions(c.urlParams_, opts...)
5248 res, err := c.doRequest("json")
5249 if res != nil && res.StatusCode == http.StatusNotModified {
5250 if res.Body != nil {
5251 res.Body.Close()
5252 }
5253 return nil, gensupport.WrapError(&googleapi.Error{
5254 Code: res.StatusCode,
5255 Header: res.Header,
5256 })
5257 }
5258 if err != nil {
5259 return nil, err
5260 }
5261 defer googleapi.CloseBody(res)
5262 if err := googleapi.CheckResponse(res); err != nil {
5263 return nil, gensupport.WrapError(err)
5264 }
5265 ret := &SasPortalListNodesResponse{
5266 ServerResponse: googleapi.ServerResponse{
5267 Header: res.Header,
5268 HTTPStatusCode: res.StatusCode,
5269 },
5270 }
5271 target := &ret
5272 b, err := gensupport.DecodeResponseBytes(target, res)
5273 if err != nil {
5274 return nil, err
5275 }
5276 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.list", "response", internallog.HTTPResponse(res, b))
5277 return ret, nil
5278 }
5279
5280 // Pages invokes f for each page of results.
5281 // A non-nil error returned from f will halt the iteration.
5282 // The provided context supersedes any context provided to the Context method.
5283 func (c *CustomersNodesListCall) Pages(ctx context.Context, f func(*SasPortalListNodesResponse) error) error {
5284 c.ctx_ = ctx
5285 defer c.PageToken(c.urlParams_.Get("pageToken"))
5286 for {
5287 x, err := c.Do()
5288 if err != nil {
5289 return err
5290 }
5291 if err := f(x); err != nil {
5292 return err
5293 }
5294 if x.NextPageToken == "" {
5295 return nil
5296 }
5297 c.PageToken(x.NextPageToken)
5298 }
5299 }
5300
5301 type CustomersNodesMoveCall struct {
5302 s *Service
5303 name string
5304 sasportalmovenoderequest *SasPortalMoveNodeRequest
5305 urlParams_ gensupport.URLParams
5306 ctx_ context.Context
5307 header_ http.Header
5308 }
5309
5310 // Move: Moves a node under another node or customer.
5311 //
5312 // - name: The name of the node to move.
5313 func (r *CustomersNodesService) Move(name string, sasportalmovenoderequest *SasPortalMoveNodeRequest) *CustomersNodesMoveCall {
5314 c := &CustomersNodesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5315 c.name = name
5316 c.sasportalmovenoderequest = sasportalmovenoderequest
5317 return c
5318 }
5319
5320 // Fields allows partial responses to be retrieved. See
5321 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5322 // details.
5323 func (c *CustomersNodesMoveCall) Fields(s ...googleapi.Field) *CustomersNodesMoveCall {
5324 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5325 return c
5326 }
5327
5328 // Context sets the context to be used in this call's Do method.
5329 func (c *CustomersNodesMoveCall) Context(ctx context.Context) *CustomersNodesMoveCall {
5330 c.ctx_ = ctx
5331 return c
5332 }
5333
5334 // Header returns a http.Header that can be modified by the caller to add
5335 // headers to the request.
5336 func (c *CustomersNodesMoveCall) Header() http.Header {
5337 if c.header_ == nil {
5338 c.header_ = make(http.Header)
5339 }
5340 return c.header_
5341 }
5342
5343 func (c *CustomersNodesMoveCall) doRequest(alt string) (*http.Response, error) {
5344 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5345 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest)
5346 if err != nil {
5347 return nil, err
5348 }
5349 c.urlParams_.Set("alt", alt)
5350 c.urlParams_.Set("prettyPrint", "false")
5351 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
5352 urls += "?" + c.urlParams_.Encode()
5353 req, err := http.NewRequest("POST", urls, body)
5354 if err != nil {
5355 return nil, err
5356 }
5357 req.Header = reqHeaders
5358 googleapi.Expand(req.URL, map[string]string{
5359 "name": c.name,
5360 })
5361 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.move", "request", internallog.HTTPRequest(req, body.Bytes()))
5362 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5363 }
5364
5365 // Do executes the "prod_tt_sasportal.customers.nodes.move" call.
5366 // Any non-2xx status code is an error. Response headers are in either
5367 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
5368 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5369 // check whether the returned error was because http.StatusNotModified was
5370 // returned.
5371 func (c *CustomersNodesMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
5372 gensupport.SetOptions(c.urlParams_, opts...)
5373 res, err := c.doRequest("json")
5374 if res != nil && res.StatusCode == http.StatusNotModified {
5375 if res.Body != nil {
5376 res.Body.Close()
5377 }
5378 return nil, gensupport.WrapError(&googleapi.Error{
5379 Code: res.StatusCode,
5380 Header: res.Header,
5381 })
5382 }
5383 if err != nil {
5384 return nil, err
5385 }
5386 defer googleapi.CloseBody(res)
5387 if err := googleapi.CheckResponse(res); err != nil {
5388 return nil, gensupport.WrapError(err)
5389 }
5390 ret := &SasPortalOperation{
5391 ServerResponse: googleapi.ServerResponse{
5392 Header: res.Header,
5393 HTTPStatusCode: res.StatusCode,
5394 },
5395 }
5396 target := &ret
5397 b, err := gensupport.DecodeResponseBytes(target, res)
5398 if err != nil {
5399 return nil, err
5400 }
5401 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.move", "response", internallog.HTTPResponse(res, b))
5402 return ret, nil
5403 }
5404
5405 type CustomersNodesPatchCall struct {
5406 s *Service
5407 name string
5408 sasportalnode *SasPortalNode
5409 urlParams_ gensupport.URLParams
5410 ctx_ context.Context
5411 header_ http.Header
5412 }
5413
5414 // Patch: Updates an existing node.
5415 //
5416 // - name: Output only. Resource name.
5417 func (r *CustomersNodesService) Patch(name string, sasportalnode *SasPortalNode) *CustomersNodesPatchCall {
5418 c := &CustomersNodesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5419 c.name = name
5420 c.sasportalnode = sasportalnode
5421 return c
5422 }
5423
5424 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
5425 func (c *CustomersNodesPatchCall) UpdateMask(updateMask string) *CustomersNodesPatchCall {
5426 c.urlParams_.Set("updateMask", updateMask)
5427 return c
5428 }
5429
5430 // Fields allows partial responses to be retrieved. See
5431 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5432 // details.
5433 func (c *CustomersNodesPatchCall) Fields(s ...googleapi.Field) *CustomersNodesPatchCall {
5434 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5435 return c
5436 }
5437
5438 // Context sets the context to be used in this call's Do method.
5439 func (c *CustomersNodesPatchCall) Context(ctx context.Context) *CustomersNodesPatchCall {
5440 c.ctx_ = ctx
5441 return c
5442 }
5443
5444 // Header returns a http.Header that can be modified by the caller to add
5445 // headers to the request.
5446 func (c *CustomersNodesPatchCall) Header() http.Header {
5447 if c.header_ == nil {
5448 c.header_ = make(http.Header)
5449 }
5450 return c.header_
5451 }
5452
5453 func (c *CustomersNodesPatchCall) doRequest(alt string) (*http.Response, error) {
5454 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5455 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
5456 if err != nil {
5457 return nil, err
5458 }
5459 c.urlParams_.Set("alt", alt)
5460 c.urlParams_.Set("prettyPrint", "false")
5461 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
5462 urls += "?" + c.urlParams_.Encode()
5463 req, err := http.NewRequest("PATCH", urls, body)
5464 if err != nil {
5465 return nil, err
5466 }
5467 req.Header = reqHeaders
5468 googleapi.Expand(req.URL, map[string]string{
5469 "name": c.name,
5470 })
5471 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5472 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5473 }
5474
5475 // Do executes the "prod_tt_sasportal.customers.nodes.patch" call.
5476 // Any non-2xx status code is an error. Response headers are in either
5477 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
5478 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5479 // whether the returned error was because http.StatusNotModified was returned.
5480 func (c *CustomersNodesPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
5481 gensupport.SetOptions(c.urlParams_, opts...)
5482 res, err := c.doRequest("json")
5483 if res != nil && res.StatusCode == http.StatusNotModified {
5484 if res.Body != nil {
5485 res.Body.Close()
5486 }
5487 return nil, gensupport.WrapError(&googleapi.Error{
5488 Code: res.StatusCode,
5489 Header: res.Header,
5490 })
5491 }
5492 if err != nil {
5493 return nil, err
5494 }
5495 defer googleapi.CloseBody(res)
5496 if err := googleapi.CheckResponse(res); err != nil {
5497 return nil, gensupport.WrapError(err)
5498 }
5499 ret := &SasPortalNode{
5500 ServerResponse: googleapi.ServerResponse{
5501 Header: res.Header,
5502 HTTPStatusCode: res.StatusCode,
5503 },
5504 }
5505 target := &ret
5506 b, err := gensupport.DecodeResponseBytes(target, res)
5507 if err != nil {
5508 return nil, err
5509 }
5510 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.patch", "response", internallog.HTTPResponse(res, b))
5511 return ret, nil
5512 }
5513
5514 type CustomersNodesDeploymentsCreateCall struct {
5515 s *Service
5516 parent string
5517 sasportaldeployment *SasPortalDeployment
5518 urlParams_ gensupport.URLParams
5519 ctx_ context.Context
5520 header_ http.Header
5521 }
5522
5523 // Create: Creates a new deployment.
5524 //
5525 // - parent: The parent resource name where the deployment is to be created.
5526 func (r *CustomersNodesDeploymentsService) Create(parent string, sasportaldeployment *SasPortalDeployment) *CustomersNodesDeploymentsCreateCall {
5527 c := &CustomersNodesDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5528 c.parent = parent
5529 c.sasportaldeployment = sasportaldeployment
5530 return c
5531 }
5532
5533 // Fields allows partial responses to be retrieved. See
5534 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5535 // details.
5536 func (c *CustomersNodesDeploymentsCreateCall) Fields(s ...googleapi.Field) *CustomersNodesDeploymentsCreateCall {
5537 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5538 return c
5539 }
5540
5541 // Context sets the context to be used in this call's Do method.
5542 func (c *CustomersNodesDeploymentsCreateCall) Context(ctx context.Context) *CustomersNodesDeploymentsCreateCall {
5543 c.ctx_ = ctx
5544 return c
5545 }
5546
5547 // Header returns a http.Header that can be modified by the caller to add
5548 // headers to the request.
5549 func (c *CustomersNodesDeploymentsCreateCall) Header() http.Header {
5550 if c.header_ == nil {
5551 c.header_ = make(http.Header)
5552 }
5553 return c.header_
5554 }
5555
5556 func (c *CustomersNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
5557 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5558 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment)
5559 if err != nil {
5560 return nil, err
5561 }
5562 c.urlParams_.Set("alt", alt)
5563 c.urlParams_.Set("prettyPrint", "false")
5564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
5565 urls += "?" + c.urlParams_.Encode()
5566 req, err := http.NewRequest("POST", urls, body)
5567 if err != nil {
5568 return nil, err
5569 }
5570 req.Header = reqHeaders
5571 googleapi.Expand(req.URL, map[string]string{
5572 "parent": c.parent,
5573 })
5574 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.deployments.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5575 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5576 }
5577
5578 // Do executes the "prod_tt_sasportal.customers.nodes.deployments.create" call.
5579 // Any non-2xx status code is an error. Response headers are in either
5580 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
5581 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5582 // check whether the returned error was because http.StatusNotModified was
5583 // returned.
5584 func (c *CustomersNodesDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
5585 gensupport.SetOptions(c.urlParams_, opts...)
5586 res, err := c.doRequest("json")
5587 if res != nil && res.StatusCode == http.StatusNotModified {
5588 if res.Body != nil {
5589 res.Body.Close()
5590 }
5591 return nil, gensupport.WrapError(&googleapi.Error{
5592 Code: res.StatusCode,
5593 Header: res.Header,
5594 })
5595 }
5596 if err != nil {
5597 return nil, err
5598 }
5599 defer googleapi.CloseBody(res)
5600 if err := googleapi.CheckResponse(res); err != nil {
5601 return nil, gensupport.WrapError(err)
5602 }
5603 ret := &SasPortalDeployment{
5604 ServerResponse: googleapi.ServerResponse{
5605 Header: res.Header,
5606 HTTPStatusCode: res.StatusCode,
5607 },
5608 }
5609 target := &ret
5610 b, err := gensupport.DecodeResponseBytes(target, res)
5611 if err != nil {
5612 return nil, err
5613 }
5614 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.deployments.create", "response", internallog.HTTPResponse(res, b))
5615 return ret, nil
5616 }
5617
5618 type CustomersNodesDeploymentsListCall struct {
5619 s *Service
5620 parent string
5621 urlParams_ gensupport.URLParams
5622 ifNoneMatch_ string
5623 ctx_ context.Context
5624 header_ http.Header
5625 }
5626
5627 // List: Lists deployments.
5628 //
5629 // - parent: The parent resource name, for example, "nodes/1",
5630 // customer/1/nodes/2.
5631 func (r *CustomersNodesDeploymentsService) List(parent string) *CustomersNodesDeploymentsListCall {
5632 c := &CustomersNodesDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5633 c.parent = parent
5634 return c
5635 }
5636
5637 // Filter sets the optional parameter "filter": The filter expression. The
5638 // filter should have the following format: "DIRECT_CHILDREN" or format:
5639 // "direct_children". The filter is case insensitive. If empty, then no
5640 // deployments are filtered.
5641 func (c *CustomersNodesDeploymentsListCall) Filter(filter string) *CustomersNodesDeploymentsListCall {
5642 c.urlParams_.Set("filter", filter)
5643 return c
5644 }
5645
5646 // PageSize sets the optional parameter "pageSize": The maximum number of
5647 // deployments to return in the response.
5648 func (c *CustomersNodesDeploymentsListCall) PageSize(pageSize int64) *CustomersNodesDeploymentsListCall {
5649 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5650 return c
5651 }
5652
5653 // PageToken sets the optional parameter "pageToken": A pagination token
5654 // returned from a previous call to ListDeployments that indicates where this
5655 // listing should continue from.
5656 func (c *CustomersNodesDeploymentsListCall) PageToken(pageToken string) *CustomersNodesDeploymentsListCall {
5657 c.urlParams_.Set("pageToken", pageToken)
5658 return c
5659 }
5660
5661 // Fields allows partial responses to be retrieved. See
5662 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5663 // details.
5664 func (c *CustomersNodesDeploymentsListCall) Fields(s ...googleapi.Field) *CustomersNodesDeploymentsListCall {
5665 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5666 return c
5667 }
5668
5669 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5670 // object's ETag matches the given value. This is useful for getting updates
5671 // only after the object has changed since the last request.
5672 func (c *CustomersNodesDeploymentsListCall) IfNoneMatch(entityTag string) *CustomersNodesDeploymentsListCall {
5673 c.ifNoneMatch_ = entityTag
5674 return c
5675 }
5676
5677 // Context sets the context to be used in this call's Do method.
5678 func (c *CustomersNodesDeploymentsListCall) Context(ctx context.Context) *CustomersNodesDeploymentsListCall {
5679 c.ctx_ = ctx
5680 return c
5681 }
5682
5683 // Header returns a http.Header that can be modified by the caller to add
5684 // headers to the request.
5685 func (c *CustomersNodesDeploymentsListCall) Header() http.Header {
5686 if c.header_ == nil {
5687 c.header_ = make(http.Header)
5688 }
5689 return c.header_
5690 }
5691
5692 func (c *CustomersNodesDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
5693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5694 if c.ifNoneMatch_ != "" {
5695 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5696 }
5697 c.urlParams_.Set("alt", alt)
5698 c.urlParams_.Set("prettyPrint", "false")
5699 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
5700 urls += "?" + c.urlParams_.Encode()
5701 req, err := http.NewRequest("GET", urls, nil)
5702 if err != nil {
5703 return nil, err
5704 }
5705 req.Header = reqHeaders
5706 googleapi.Expand(req.URL, map[string]string{
5707 "parent": c.parent,
5708 })
5709 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.deployments.list", "request", internallog.HTTPRequest(req, nil))
5710 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5711 }
5712
5713 // Do executes the "prod_tt_sasportal.customers.nodes.deployments.list" call.
5714 // Any non-2xx status code is an error. Response headers are in either
5715 // *SasPortalListDeploymentsResponse.ServerResponse.Header or (if a response
5716 // was returned at all) in error.(*googleapi.Error).Header. Use
5717 // googleapi.IsNotModified to check whether the returned error was because
5718 // http.StatusNotModified was returned.
5719 func (c *CustomersNodesDeploymentsListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDeploymentsResponse, error) {
5720 gensupport.SetOptions(c.urlParams_, opts...)
5721 res, err := c.doRequest("json")
5722 if res != nil && res.StatusCode == http.StatusNotModified {
5723 if res.Body != nil {
5724 res.Body.Close()
5725 }
5726 return nil, gensupport.WrapError(&googleapi.Error{
5727 Code: res.StatusCode,
5728 Header: res.Header,
5729 })
5730 }
5731 if err != nil {
5732 return nil, err
5733 }
5734 defer googleapi.CloseBody(res)
5735 if err := googleapi.CheckResponse(res); err != nil {
5736 return nil, gensupport.WrapError(err)
5737 }
5738 ret := &SasPortalListDeploymentsResponse{
5739 ServerResponse: googleapi.ServerResponse{
5740 Header: res.Header,
5741 HTTPStatusCode: res.StatusCode,
5742 },
5743 }
5744 target := &ret
5745 b, err := gensupport.DecodeResponseBytes(target, res)
5746 if err != nil {
5747 return nil, err
5748 }
5749 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.deployments.list", "response", internallog.HTTPResponse(res, b))
5750 return ret, nil
5751 }
5752
5753 // Pages invokes f for each page of results.
5754 // A non-nil error returned from f will halt the iteration.
5755 // The provided context supersedes any context provided to the Context method.
5756 func (c *CustomersNodesDeploymentsListCall) Pages(ctx context.Context, f func(*SasPortalListDeploymentsResponse) error) error {
5757 c.ctx_ = ctx
5758 defer c.PageToken(c.urlParams_.Get("pageToken"))
5759 for {
5760 x, err := c.Do()
5761 if err != nil {
5762 return err
5763 }
5764 if err := f(x); err != nil {
5765 return err
5766 }
5767 if x.NextPageToken == "" {
5768 return nil
5769 }
5770 c.PageToken(x.NextPageToken)
5771 }
5772 }
5773
5774 type CustomersNodesDevicesCreateCall struct {
5775 s *Service
5776 parent string
5777 sasportaldevice *SasPortalDevice
5778 urlParams_ gensupport.URLParams
5779 ctx_ context.Context
5780 header_ http.Header
5781 }
5782
5783 // Create: Creates a device under a node or customer.
5784 //
5785 // - parent: The name of the parent resource.
5786 func (r *CustomersNodesDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *CustomersNodesDevicesCreateCall {
5787 c := &CustomersNodesDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5788 c.parent = parent
5789 c.sasportaldevice = sasportaldevice
5790 return c
5791 }
5792
5793 // Fields allows partial responses to be retrieved. See
5794 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5795 // details.
5796 func (c *CustomersNodesDevicesCreateCall) Fields(s ...googleapi.Field) *CustomersNodesDevicesCreateCall {
5797 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5798 return c
5799 }
5800
5801 // Context sets the context to be used in this call's Do method.
5802 func (c *CustomersNodesDevicesCreateCall) Context(ctx context.Context) *CustomersNodesDevicesCreateCall {
5803 c.ctx_ = ctx
5804 return c
5805 }
5806
5807 // Header returns a http.Header that can be modified by the caller to add
5808 // headers to the request.
5809 func (c *CustomersNodesDevicesCreateCall) Header() http.Header {
5810 if c.header_ == nil {
5811 c.header_ = make(http.Header)
5812 }
5813 return c.header_
5814 }
5815
5816 func (c *CustomersNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
5817 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5818 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
5819 if err != nil {
5820 return nil, err
5821 }
5822 c.urlParams_.Set("alt", alt)
5823 c.urlParams_.Set("prettyPrint", "false")
5824 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
5825 urls += "?" + c.urlParams_.Encode()
5826 req, err := http.NewRequest("POST", urls, body)
5827 if err != nil {
5828 return nil, err
5829 }
5830 req.Header = reqHeaders
5831 googleapi.Expand(req.URL, map[string]string{
5832 "parent": c.parent,
5833 })
5834 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5835 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5836 }
5837
5838 // Do executes the "prod_tt_sasportal.customers.nodes.devices.create" call.
5839 // Any non-2xx status code is an error. Response headers are in either
5840 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
5841 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5842 // check whether the returned error was because http.StatusNotModified was
5843 // returned.
5844 func (c *CustomersNodesDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
5845 gensupport.SetOptions(c.urlParams_, opts...)
5846 res, err := c.doRequest("json")
5847 if res != nil && res.StatusCode == http.StatusNotModified {
5848 if res.Body != nil {
5849 res.Body.Close()
5850 }
5851 return nil, gensupport.WrapError(&googleapi.Error{
5852 Code: res.StatusCode,
5853 Header: res.Header,
5854 })
5855 }
5856 if err != nil {
5857 return nil, err
5858 }
5859 defer googleapi.CloseBody(res)
5860 if err := googleapi.CheckResponse(res); err != nil {
5861 return nil, gensupport.WrapError(err)
5862 }
5863 ret := &SasPortalDevice{
5864 ServerResponse: googleapi.ServerResponse{
5865 Header: res.Header,
5866 HTTPStatusCode: res.StatusCode,
5867 },
5868 }
5869 target := &ret
5870 b, err := gensupport.DecodeResponseBytes(target, res)
5871 if err != nil {
5872 return nil, err
5873 }
5874 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.create", "response", internallog.HTTPResponse(res, b))
5875 return ret, nil
5876 }
5877
5878 type CustomersNodesDevicesCreateSignedCall struct {
5879 s *Service
5880 parent string
5881 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
5882 urlParams_ gensupport.URLParams
5883 ctx_ context.Context
5884 header_ http.Header
5885 }
5886
5887 // CreateSigned: Creates a signed device under a node or customer.
5888 //
5889 // - parent: The name of the parent resource.
5890 func (r *CustomersNodesDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *CustomersNodesDevicesCreateSignedCall {
5891 c := &CustomersNodesDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5892 c.parent = parent
5893 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
5894 return c
5895 }
5896
5897 // Fields allows partial responses to be retrieved. See
5898 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5899 // details.
5900 func (c *CustomersNodesDevicesCreateSignedCall) Fields(s ...googleapi.Field) *CustomersNodesDevicesCreateSignedCall {
5901 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5902 return c
5903 }
5904
5905 // Context sets the context to be used in this call's Do method.
5906 func (c *CustomersNodesDevicesCreateSignedCall) Context(ctx context.Context) *CustomersNodesDevicesCreateSignedCall {
5907 c.ctx_ = ctx
5908 return c
5909 }
5910
5911 // Header returns a http.Header that can be modified by the caller to add
5912 // headers to the request.
5913 func (c *CustomersNodesDevicesCreateSignedCall) Header() http.Header {
5914 if c.header_ == nil {
5915 c.header_ = make(http.Header)
5916 }
5917 return c.header_
5918 }
5919
5920 func (c *CustomersNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
5921 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5922 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
5923 if err != nil {
5924 return nil, err
5925 }
5926 c.urlParams_.Set("alt", alt)
5927 c.urlParams_.Set("prettyPrint", "false")
5928 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
5929 urls += "?" + c.urlParams_.Encode()
5930 req, err := http.NewRequest("POST", urls, body)
5931 if err != nil {
5932 return nil, err
5933 }
5934 req.Header = reqHeaders
5935 googleapi.Expand(req.URL, map[string]string{
5936 "parent": c.parent,
5937 })
5938 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
5939 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5940 }
5941
5942 // Do executes the "prod_tt_sasportal.customers.nodes.devices.createSigned" call.
5943 // Any non-2xx status code is an error. Response headers are in either
5944 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
5945 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5946 // check whether the returned error was because http.StatusNotModified was
5947 // returned.
5948 func (c *CustomersNodesDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
5949 gensupport.SetOptions(c.urlParams_, opts...)
5950 res, err := c.doRequest("json")
5951 if res != nil && res.StatusCode == http.StatusNotModified {
5952 if res.Body != nil {
5953 res.Body.Close()
5954 }
5955 return nil, gensupport.WrapError(&googleapi.Error{
5956 Code: res.StatusCode,
5957 Header: res.Header,
5958 })
5959 }
5960 if err != nil {
5961 return nil, err
5962 }
5963 defer googleapi.CloseBody(res)
5964 if err := googleapi.CheckResponse(res); err != nil {
5965 return nil, gensupport.WrapError(err)
5966 }
5967 ret := &SasPortalDevice{
5968 ServerResponse: googleapi.ServerResponse{
5969 Header: res.Header,
5970 HTTPStatusCode: res.StatusCode,
5971 },
5972 }
5973 target := &ret
5974 b, err := gensupport.DecodeResponseBytes(target, res)
5975 if err != nil {
5976 return nil, err
5977 }
5978 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.createSigned", "response", internallog.HTTPResponse(res, b))
5979 return ret, nil
5980 }
5981
5982 type CustomersNodesDevicesListCall struct {
5983 s *Service
5984 parent string
5985 urlParams_ gensupport.URLParams
5986 ifNoneMatch_ string
5987 ctx_ context.Context
5988 header_ http.Header
5989 }
5990
5991 // List: Lists devices under a node or customer.
5992 //
5993 // - parent: The name of the parent resource.
5994 func (r *CustomersNodesDevicesService) List(parent string) *CustomersNodesDevicesListCall {
5995 c := &CustomersNodesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5996 c.parent = parent
5997 return c
5998 }
5999
6000 // Filter sets the optional parameter "filter": The filter expression. The
6001 // filter should have one of the following formats: "sn=123454" or
6002 // "display_name=MyDevice". sn corresponds to serial number of the device. The
6003 // filter is case insensitive.
6004 func (c *CustomersNodesDevicesListCall) Filter(filter string) *CustomersNodesDevicesListCall {
6005 c.urlParams_.Set("filter", filter)
6006 return c
6007 }
6008
6009 // PageSize sets the optional parameter "pageSize": The maximum number of
6010 // devices to return in the response. If empty or zero, all devices will be
6011 // listed. Must be in the range [0, 1000].
6012 func (c *CustomersNodesDevicesListCall) PageSize(pageSize int64) *CustomersNodesDevicesListCall {
6013 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6014 return c
6015 }
6016
6017 // PageToken sets the optional parameter "pageToken": A pagination token
6018 // returned from a previous call to ListDevices that indicates where this
6019 // listing should continue from.
6020 func (c *CustomersNodesDevicesListCall) PageToken(pageToken string) *CustomersNodesDevicesListCall {
6021 c.urlParams_.Set("pageToken", pageToken)
6022 return c
6023 }
6024
6025 // Fields allows partial responses to be retrieved. See
6026 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6027 // details.
6028 func (c *CustomersNodesDevicesListCall) Fields(s ...googleapi.Field) *CustomersNodesDevicesListCall {
6029 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6030 return c
6031 }
6032
6033 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6034 // object's ETag matches the given value. This is useful for getting updates
6035 // only after the object has changed since the last request.
6036 func (c *CustomersNodesDevicesListCall) IfNoneMatch(entityTag string) *CustomersNodesDevicesListCall {
6037 c.ifNoneMatch_ = entityTag
6038 return c
6039 }
6040
6041 // Context sets the context to be used in this call's Do method.
6042 func (c *CustomersNodesDevicesListCall) Context(ctx context.Context) *CustomersNodesDevicesListCall {
6043 c.ctx_ = ctx
6044 return c
6045 }
6046
6047 // Header returns a http.Header that can be modified by the caller to add
6048 // headers to the request.
6049 func (c *CustomersNodesDevicesListCall) Header() http.Header {
6050 if c.header_ == nil {
6051 c.header_ = make(http.Header)
6052 }
6053 return c.header_
6054 }
6055
6056 func (c *CustomersNodesDevicesListCall) doRequest(alt string) (*http.Response, error) {
6057 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6058 if c.ifNoneMatch_ != "" {
6059 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6060 }
6061 c.urlParams_.Set("alt", alt)
6062 c.urlParams_.Set("prettyPrint", "false")
6063 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
6064 urls += "?" + c.urlParams_.Encode()
6065 req, err := http.NewRequest("GET", urls, nil)
6066 if err != nil {
6067 return nil, err
6068 }
6069 req.Header = reqHeaders
6070 googleapi.Expand(req.URL, map[string]string{
6071 "parent": c.parent,
6072 })
6073 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.list", "request", internallog.HTTPRequest(req, nil))
6074 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6075 }
6076
6077 // Do executes the "prod_tt_sasportal.customers.nodes.devices.list" call.
6078 // Any non-2xx status code is an error. Response headers are in either
6079 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
6080 // returned at all) in error.(*googleapi.Error).Header. Use
6081 // googleapi.IsNotModified to check whether the returned error was because
6082 // http.StatusNotModified was returned.
6083 func (c *CustomersNodesDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
6084 gensupport.SetOptions(c.urlParams_, opts...)
6085 res, err := c.doRequest("json")
6086 if res != nil && res.StatusCode == http.StatusNotModified {
6087 if res.Body != nil {
6088 res.Body.Close()
6089 }
6090 return nil, gensupport.WrapError(&googleapi.Error{
6091 Code: res.StatusCode,
6092 Header: res.Header,
6093 })
6094 }
6095 if err != nil {
6096 return nil, err
6097 }
6098 defer googleapi.CloseBody(res)
6099 if err := googleapi.CheckResponse(res); err != nil {
6100 return nil, gensupport.WrapError(err)
6101 }
6102 ret := &SasPortalListDevicesResponse{
6103 ServerResponse: googleapi.ServerResponse{
6104 Header: res.Header,
6105 HTTPStatusCode: res.StatusCode,
6106 },
6107 }
6108 target := &ret
6109 b, err := gensupport.DecodeResponseBytes(target, res)
6110 if err != nil {
6111 return nil, err
6112 }
6113 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.devices.list", "response", internallog.HTTPResponse(res, b))
6114 return ret, nil
6115 }
6116
6117 // Pages invokes f for each page of results.
6118 // A non-nil error returned from f will halt the iteration.
6119 // The provided context supersedes any context provided to the Context method.
6120 func (c *CustomersNodesDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
6121 c.ctx_ = ctx
6122 defer c.PageToken(c.urlParams_.Get("pageToken"))
6123 for {
6124 x, err := c.Do()
6125 if err != nil {
6126 return err
6127 }
6128 if err := f(x); err != nil {
6129 return err
6130 }
6131 if x.NextPageToken == "" {
6132 return nil
6133 }
6134 c.PageToken(x.NextPageToken)
6135 }
6136 }
6137
6138 type CustomersNodesNodesCreateCall struct {
6139 s *Service
6140 parent string
6141 sasportalnode *SasPortalNode
6142 urlParams_ gensupport.URLParams
6143 ctx_ context.Context
6144 header_ http.Header
6145 }
6146
6147 // Create: Creates a new node.
6148 //
6149 // - parent: The parent resource name where the node is to be created.
6150 func (r *CustomersNodesNodesService) Create(parent string, sasportalnode *SasPortalNode) *CustomersNodesNodesCreateCall {
6151 c := &CustomersNodesNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6152 c.parent = parent
6153 c.sasportalnode = sasportalnode
6154 return c
6155 }
6156
6157 // Fields allows partial responses to be retrieved. See
6158 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6159 // details.
6160 func (c *CustomersNodesNodesCreateCall) Fields(s ...googleapi.Field) *CustomersNodesNodesCreateCall {
6161 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6162 return c
6163 }
6164
6165 // Context sets the context to be used in this call's Do method.
6166 func (c *CustomersNodesNodesCreateCall) Context(ctx context.Context) *CustomersNodesNodesCreateCall {
6167 c.ctx_ = ctx
6168 return c
6169 }
6170
6171 // Header returns a http.Header that can be modified by the caller to add
6172 // headers to the request.
6173 func (c *CustomersNodesNodesCreateCall) Header() http.Header {
6174 if c.header_ == nil {
6175 c.header_ = make(http.Header)
6176 }
6177 return c.header_
6178 }
6179
6180 func (c *CustomersNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) {
6181 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6182 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
6183 if err != nil {
6184 return nil, err
6185 }
6186 c.urlParams_.Set("alt", alt)
6187 c.urlParams_.Set("prettyPrint", "false")
6188 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
6189 urls += "?" + c.urlParams_.Encode()
6190 req, err := http.NewRequest("POST", urls, body)
6191 if err != nil {
6192 return nil, err
6193 }
6194 req.Header = reqHeaders
6195 googleapi.Expand(req.URL, map[string]string{
6196 "parent": c.parent,
6197 })
6198 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.nodes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6199 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6200 }
6201
6202 // Do executes the "prod_tt_sasportal.customers.nodes.nodes.create" call.
6203 // Any non-2xx status code is an error. Response headers are in either
6204 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
6205 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6206 // whether the returned error was because http.StatusNotModified was returned.
6207 func (c *CustomersNodesNodesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
6208 gensupport.SetOptions(c.urlParams_, opts...)
6209 res, err := c.doRequest("json")
6210 if res != nil && res.StatusCode == http.StatusNotModified {
6211 if res.Body != nil {
6212 res.Body.Close()
6213 }
6214 return nil, gensupport.WrapError(&googleapi.Error{
6215 Code: res.StatusCode,
6216 Header: res.Header,
6217 })
6218 }
6219 if err != nil {
6220 return nil, err
6221 }
6222 defer googleapi.CloseBody(res)
6223 if err := googleapi.CheckResponse(res); err != nil {
6224 return nil, gensupport.WrapError(err)
6225 }
6226 ret := &SasPortalNode{
6227 ServerResponse: googleapi.ServerResponse{
6228 Header: res.Header,
6229 HTTPStatusCode: res.StatusCode,
6230 },
6231 }
6232 target := &ret
6233 b, err := gensupport.DecodeResponseBytes(target, res)
6234 if err != nil {
6235 return nil, err
6236 }
6237 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.nodes.create", "response", internallog.HTTPResponse(res, b))
6238 return ret, nil
6239 }
6240
6241 type CustomersNodesNodesListCall struct {
6242 s *Service
6243 parent string
6244 urlParams_ gensupport.URLParams
6245 ifNoneMatch_ string
6246 ctx_ context.Context
6247 header_ http.Header
6248 }
6249
6250 // List: Lists nodes.
6251 //
6252 // - parent: The parent resource name, for example, "nodes/1".
6253 func (r *CustomersNodesNodesService) List(parent string) *CustomersNodesNodesListCall {
6254 c := &CustomersNodesNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6255 c.parent = parent
6256 return c
6257 }
6258
6259 // Filter sets the optional parameter "filter": The filter expression. The
6260 // filter should have the following format: "DIRECT_CHILDREN" or format:
6261 // "direct_children". The filter is case insensitive. If empty, then no nodes
6262 // are filtered.
6263 func (c *CustomersNodesNodesListCall) Filter(filter string) *CustomersNodesNodesListCall {
6264 c.urlParams_.Set("filter", filter)
6265 return c
6266 }
6267
6268 // PageSize sets the optional parameter "pageSize": The maximum number of nodes
6269 // to return in the response.
6270 func (c *CustomersNodesNodesListCall) PageSize(pageSize int64) *CustomersNodesNodesListCall {
6271 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6272 return c
6273 }
6274
6275 // PageToken sets the optional parameter "pageToken": A pagination token
6276 // returned from a previous call to ListNodes that indicates where this listing
6277 // should continue from.
6278 func (c *CustomersNodesNodesListCall) PageToken(pageToken string) *CustomersNodesNodesListCall {
6279 c.urlParams_.Set("pageToken", pageToken)
6280 return c
6281 }
6282
6283 // Fields allows partial responses to be retrieved. See
6284 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6285 // details.
6286 func (c *CustomersNodesNodesListCall) Fields(s ...googleapi.Field) *CustomersNodesNodesListCall {
6287 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6288 return c
6289 }
6290
6291 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6292 // object's ETag matches the given value. This is useful for getting updates
6293 // only after the object has changed since the last request.
6294 func (c *CustomersNodesNodesListCall) IfNoneMatch(entityTag string) *CustomersNodesNodesListCall {
6295 c.ifNoneMatch_ = entityTag
6296 return c
6297 }
6298
6299 // Context sets the context to be used in this call's Do method.
6300 func (c *CustomersNodesNodesListCall) Context(ctx context.Context) *CustomersNodesNodesListCall {
6301 c.ctx_ = ctx
6302 return c
6303 }
6304
6305 // Header returns a http.Header that can be modified by the caller to add
6306 // headers to the request.
6307 func (c *CustomersNodesNodesListCall) Header() http.Header {
6308 if c.header_ == nil {
6309 c.header_ = make(http.Header)
6310 }
6311 return c.header_
6312 }
6313
6314 func (c *CustomersNodesNodesListCall) doRequest(alt string) (*http.Response, error) {
6315 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6316 if c.ifNoneMatch_ != "" {
6317 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6318 }
6319 c.urlParams_.Set("alt", alt)
6320 c.urlParams_.Set("prettyPrint", "false")
6321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
6322 urls += "?" + c.urlParams_.Encode()
6323 req, err := http.NewRequest("GET", urls, nil)
6324 if err != nil {
6325 return nil, err
6326 }
6327 req.Header = reqHeaders
6328 googleapi.Expand(req.URL, map[string]string{
6329 "parent": c.parent,
6330 })
6331 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.nodes.list", "request", internallog.HTTPRequest(req, nil))
6332 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6333 }
6334
6335 // Do executes the "prod_tt_sasportal.customers.nodes.nodes.list" call.
6336 // Any non-2xx status code is an error. Response headers are in either
6337 // *SasPortalListNodesResponse.ServerResponse.Header or (if a response was
6338 // returned at all) in error.(*googleapi.Error).Header. Use
6339 // googleapi.IsNotModified to check whether the returned error was because
6340 // http.StatusNotModified was returned.
6341 func (c *CustomersNodesNodesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListNodesResponse, error) {
6342 gensupport.SetOptions(c.urlParams_, opts...)
6343 res, err := c.doRequest("json")
6344 if res != nil && res.StatusCode == http.StatusNotModified {
6345 if res.Body != nil {
6346 res.Body.Close()
6347 }
6348 return nil, gensupport.WrapError(&googleapi.Error{
6349 Code: res.StatusCode,
6350 Header: res.Header,
6351 })
6352 }
6353 if err != nil {
6354 return nil, err
6355 }
6356 defer googleapi.CloseBody(res)
6357 if err := googleapi.CheckResponse(res); err != nil {
6358 return nil, gensupport.WrapError(err)
6359 }
6360 ret := &SasPortalListNodesResponse{
6361 ServerResponse: googleapi.ServerResponse{
6362 Header: res.Header,
6363 HTTPStatusCode: res.StatusCode,
6364 },
6365 }
6366 target := &ret
6367 b, err := gensupport.DecodeResponseBytes(target, res)
6368 if err != nil {
6369 return nil, err
6370 }
6371 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.customers.nodes.nodes.list", "response", internallog.HTTPResponse(res, b))
6372 return ret, nil
6373 }
6374
6375 // Pages invokes f for each page of results.
6376 // A non-nil error returned from f will halt the iteration.
6377 // The provided context supersedes any context provided to the Context method.
6378 func (c *CustomersNodesNodesListCall) Pages(ctx context.Context, f func(*SasPortalListNodesResponse) error) error {
6379 c.ctx_ = ctx
6380 defer c.PageToken(c.urlParams_.Get("pageToken"))
6381 for {
6382 x, err := c.Do()
6383 if err != nil {
6384 return err
6385 }
6386 if err := f(x); err != nil {
6387 return err
6388 }
6389 if x.NextPageToken == "" {
6390 return nil
6391 }
6392 c.PageToken(x.NextPageToken)
6393 }
6394 }
6395
6396 type DeploymentsGetCall struct {
6397 s *Service
6398 name string
6399 urlParams_ gensupport.URLParams
6400 ifNoneMatch_ string
6401 ctx_ context.Context
6402 header_ http.Header
6403 }
6404
6405 // Get: Returns a requested deployment.
6406 //
6407 // - name: The name of the deployment.
6408 func (r *DeploymentsService) Get(name string) *DeploymentsGetCall {
6409 c := &DeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6410 c.name = name
6411 return c
6412 }
6413
6414 // Fields allows partial responses to be retrieved. See
6415 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6416 // details.
6417 func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall {
6418 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6419 return c
6420 }
6421
6422 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6423 // object's ETag matches the given value. This is useful for getting updates
6424 // only after the object has changed since the last request.
6425 func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall {
6426 c.ifNoneMatch_ = entityTag
6427 return c
6428 }
6429
6430 // Context sets the context to be used in this call's Do method.
6431 func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall {
6432 c.ctx_ = ctx
6433 return c
6434 }
6435
6436 // Header returns a http.Header that can be modified by the caller to add
6437 // headers to the request.
6438 func (c *DeploymentsGetCall) Header() http.Header {
6439 if c.header_ == nil {
6440 c.header_ = make(http.Header)
6441 }
6442 return c.header_
6443 }
6444
6445 func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
6446 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6447 if c.ifNoneMatch_ != "" {
6448 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6449 }
6450 c.urlParams_.Set("alt", alt)
6451 c.urlParams_.Set("prettyPrint", "false")
6452 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
6453 urls += "?" + c.urlParams_.Encode()
6454 req, err := http.NewRequest("GET", urls, nil)
6455 if err != nil {
6456 return nil, err
6457 }
6458 req.Header = reqHeaders
6459 googleapi.Expand(req.URL, map[string]string{
6460 "name": c.name,
6461 })
6462 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.get", "request", internallog.HTTPRequest(req, nil))
6463 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6464 }
6465
6466 // Do executes the "prod_tt_sasportal.deployments.get" call.
6467 // Any non-2xx status code is an error. Response headers are in either
6468 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
6469 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6470 // check whether the returned error was because http.StatusNotModified was
6471 // returned.
6472 func (c *DeploymentsGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
6473 gensupport.SetOptions(c.urlParams_, opts...)
6474 res, err := c.doRequest("json")
6475 if res != nil && res.StatusCode == http.StatusNotModified {
6476 if res.Body != nil {
6477 res.Body.Close()
6478 }
6479 return nil, gensupport.WrapError(&googleapi.Error{
6480 Code: res.StatusCode,
6481 Header: res.Header,
6482 })
6483 }
6484 if err != nil {
6485 return nil, err
6486 }
6487 defer googleapi.CloseBody(res)
6488 if err := googleapi.CheckResponse(res); err != nil {
6489 return nil, gensupport.WrapError(err)
6490 }
6491 ret := &SasPortalDeployment{
6492 ServerResponse: googleapi.ServerResponse{
6493 Header: res.Header,
6494 HTTPStatusCode: res.StatusCode,
6495 },
6496 }
6497 target := &ret
6498 b, err := gensupport.DecodeResponseBytes(target, res)
6499 if err != nil {
6500 return nil, err
6501 }
6502 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.get", "response", internallog.HTTPResponse(res, b))
6503 return ret, nil
6504 }
6505
6506 type DeploymentsDevicesDeleteCall struct {
6507 s *Service
6508 name string
6509 urlParams_ gensupport.URLParams
6510 ctx_ context.Context
6511 header_ http.Header
6512 }
6513
6514 // Delete: Deletes a device.
6515 //
6516 // - name: The name of the device.
6517 func (r *DeploymentsDevicesService) Delete(name string) *DeploymentsDevicesDeleteCall {
6518 c := &DeploymentsDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6519 c.name = name
6520 return c
6521 }
6522
6523 // Fields allows partial responses to be retrieved. See
6524 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6525 // details.
6526 func (c *DeploymentsDevicesDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDevicesDeleteCall {
6527 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6528 return c
6529 }
6530
6531 // Context sets the context to be used in this call's Do method.
6532 func (c *DeploymentsDevicesDeleteCall) Context(ctx context.Context) *DeploymentsDevicesDeleteCall {
6533 c.ctx_ = ctx
6534 return c
6535 }
6536
6537 // Header returns a http.Header that can be modified by the caller to add
6538 // headers to the request.
6539 func (c *DeploymentsDevicesDeleteCall) Header() http.Header {
6540 if c.header_ == nil {
6541 c.header_ = make(http.Header)
6542 }
6543 return c.header_
6544 }
6545
6546 func (c *DeploymentsDevicesDeleteCall) doRequest(alt string) (*http.Response, error) {
6547 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6548 c.urlParams_.Set("alt", alt)
6549 c.urlParams_.Set("prettyPrint", "false")
6550 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
6551 urls += "?" + c.urlParams_.Encode()
6552 req, err := http.NewRequest("DELETE", urls, nil)
6553 if err != nil {
6554 return nil, err
6555 }
6556 req.Header = reqHeaders
6557 googleapi.Expand(req.URL, map[string]string{
6558 "name": c.name,
6559 })
6560 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.delete", "request", internallog.HTTPRequest(req, nil))
6561 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6562 }
6563
6564 // Do executes the "prod_tt_sasportal.deployments.devices.delete" call.
6565 // Any non-2xx status code is an error. Response headers are in either
6566 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
6567 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6568 // whether the returned error was because http.StatusNotModified was returned.
6569 func (c *DeploymentsDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
6570 gensupport.SetOptions(c.urlParams_, opts...)
6571 res, err := c.doRequest("json")
6572 if res != nil && res.StatusCode == http.StatusNotModified {
6573 if res.Body != nil {
6574 res.Body.Close()
6575 }
6576 return nil, gensupport.WrapError(&googleapi.Error{
6577 Code: res.StatusCode,
6578 Header: res.Header,
6579 })
6580 }
6581 if err != nil {
6582 return nil, err
6583 }
6584 defer googleapi.CloseBody(res)
6585 if err := googleapi.CheckResponse(res); err != nil {
6586 return nil, gensupport.WrapError(err)
6587 }
6588 ret := &SasPortalEmpty{
6589 ServerResponse: googleapi.ServerResponse{
6590 Header: res.Header,
6591 HTTPStatusCode: res.StatusCode,
6592 },
6593 }
6594 target := &ret
6595 b, err := gensupport.DecodeResponseBytes(target, res)
6596 if err != nil {
6597 return nil, err
6598 }
6599 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.delete", "response", internallog.HTTPResponse(res, b))
6600 return ret, nil
6601 }
6602
6603 type DeploymentsDevicesGetCall struct {
6604 s *Service
6605 name string
6606 urlParams_ gensupport.URLParams
6607 ifNoneMatch_ string
6608 ctx_ context.Context
6609 header_ http.Header
6610 }
6611
6612 // Get: Gets details about a device.
6613 //
6614 // - name: The name of the device.
6615 func (r *DeploymentsDevicesService) Get(name string) *DeploymentsDevicesGetCall {
6616 c := &DeploymentsDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6617 c.name = name
6618 return c
6619 }
6620
6621 // Fields allows partial responses to be retrieved. See
6622 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6623 // details.
6624 func (c *DeploymentsDevicesGetCall) Fields(s ...googleapi.Field) *DeploymentsDevicesGetCall {
6625 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6626 return c
6627 }
6628
6629 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6630 // object's ETag matches the given value. This is useful for getting updates
6631 // only after the object has changed since the last request.
6632 func (c *DeploymentsDevicesGetCall) IfNoneMatch(entityTag string) *DeploymentsDevicesGetCall {
6633 c.ifNoneMatch_ = entityTag
6634 return c
6635 }
6636
6637 // Context sets the context to be used in this call's Do method.
6638 func (c *DeploymentsDevicesGetCall) Context(ctx context.Context) *DeploymentsDevicesGetCall {
6639 c.ctx_ = ctx
6640 return c
6641 }
6642
6643 // Header returns a http.Header that can be modified by the caller to add
6644 // headers to the request.
6645 func (c *DeploymentsDevicesGetCall) Header() http.Header {
6646 if c.header_ == nil {
6647 c.header_ = make(http.Header)
6648 }
6649 return c.header_
6650 }
6651
6652 func (c *DeploymentsDevicesGetCall) doRequest(alt string) (*http.Response, error) {
6653 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6654 if c.ifNoneMatch_ != "" {
6655 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6656 }
6657 c.urlParams_.Set("alt", alt)
6658 c.urlParams_.Set("prettyPrint", "false")
6659 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
6660 urls += "?" + c.urlParams_.Encode()
6661 req, err := http.NewRequest("GET", urls, nil)
6662 if err != nil {
6663 return nil, err
6664 }
6665 req.Header = reqHeaders
6666 googleapi.Expand(req.URL, map[string]string{
6667 "name": c.name,
6668 })
6669 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.get", "request", internallog.HTTPRequest(req, nil))
6670 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6671 }
6672
6673 // Do executes the "prod_tt_sasportal.deployments.devices.get" call.
6674 // Any non-2xx status code is an error. Response headers are in either
6675 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
6676 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6677 // check whether the returned error was because http.StatusNotModified was
6678 // returned.
6679 func (c *DeploymentsDevicesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
6680 gensupport.SetOptions(c.urlParams_, opts...)
6681 res, err := c.doRequest("json")
6682 if res != nil && res.StatusCode == http.StatusNotModified {
6683 if res.Body != nil {
6684 res.Body.Close()
6685 }
6686 return nil, gensupport.WrapError(&googleapi.Error{
6687 Code: res.StatusCode,
6688 Header: res.Header,
6689 })
6690 }
6691 if err != nil {
6692 return nil, err
6693 }
6694 defer googleapi.CloseBody(res)
6695 if err := googleapi.CheckResponse(res); err != nil {
6696 return nil, gensupport.WrapError(err)
6697 }
6698 ret := &SasPortalDevice{
6699 ServerResponse: googleapi.ServerResponse{
6700 Header: res.Header,
6701 HTTPStatusCode: res.StatusCode,
6702 },
6703 }
6704 target := &ret
6705 b, err := gensupport.DecodeResponseBytes(target, res)
6706 if err != nil {
6707 return nil, err
6708 }
6709 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.get", "response", internallog.HTTPResponse(res, b))
6710 return ret, nil
6711 }
6712
6713 type DeploymentsDevicesMoveCall struct {
6714 s *Service
6715 name string
6716 sasportalmovedevicerequest *SasPortalMoveDeviceRequest
6717 urlParams_ gensupport.URLParams
6718 ctx_ context.Context
6719 header_ http.Header
6720 }
6721
6722 // Move: Moves a device under another node or customer.
6723 //
6724 // - name: The name of the device to move.
6725 func (r *DeploymentsDevicesService) Move(name string, sasportalmovedevicerequest *SasPortalMoveDeviceRequest) *DeploymentsDevicesMoveCall {
6726 c := &DeploymentsDevicesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6727 c.name = name
6728 c.sasportalmovedevicerequest = sasportalmovedevicerequest
6729 return c
6730 }
6731
6732 // Fields allows partial responses to be retrieved. See
6733 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6734 // details.
6735 func (c *DeploymentsDevicesMoveCall) Fields(s ...googleapi.Field) *DeploymentsDevicesMoveCall {
6736 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6737 return c
6738 }
6739
6740 // Context sets the context to be used in this call's Do method.
6741 func (c *DeploymentsDevicesMoveCall) Context(ctx context.Context) *DeploymentsDevicesMoveCall {
6742 c.ctx_ = ctx
6743 return c
6744 }
6745
6746 // Header returns a http.Header that can be modified by the caller to add
6747 // headers to the request.
6748 func (c *DeploymentsDevicesMoveCall) Header() http.Header {
6749 if c.header_ == nil {
6750 c.header_ = make(http.Header)
6751 }
6752 return c.header_
6753 }
6754
6755 func (c *DeploymentsDevicesMoveCall) doRequest(alt string) (*http.Response, error) {
6756 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6757 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest)
6758 if err != nil {
6759 return nil, err
6760 }
6761 c.urlParams_.Set("alt", alt)
6762 c.urlParams_.Set("prettyPrint", "false")
6763 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
6764 urls += "?" + c.urlParams_.Encode()
6765 req, err := http.NewRequest("POST", urls, body)
6766 if err != nil {
6767 return nil, err
6768 }
6769 req.Header = reqHeaders
6770 googleapi.Expand(req.URL, map[string]string{
6771 "name": c.name,
6772 })
6773 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.move", "request", internallog.HTTPRequest(req, body.Bytes()))
6774 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6775 }
6776
6777 // Do executes the "prod_tt_sasportal.deployments.devices.move" call.
6778 // Any non-2xx status code is an error. Response headers are in either
6779 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
6780 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6781 // check whether the returned error was because http.StatusNotModified was
6782 // returned.
6783 func (c *DeploymentsDevicesMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
6784 gensupport.SetOptions(c.urlParams_, opts...)
6785 res, err := c.doRequest("json")
6786 if res != nil && res.StatusCode == http.StatusNotModified {
6787 if res.Body != nil {
6788 res.Body.Close()
6789 }
6790 return nil, gensupport.WrapError(&googleapi.Error{
6791 Code: res.StatusCode,
6792 Header: res.Header,
6793 })
6794 }
6795 if err != nil {
6796 return nil, err
6797 }
6798 defer googleapi.CloseBody(res)
6799 if err := googleapi.CheckResponse(res); err != nil {
6800 return nil, gensupport.WrapError(err)
6801 }
6802 ret := &SasPortalOperation{
6803 ServerResponse: googleapi.ServerResponse{
6804 Header: res.Header,
6805 HTTPStatusCode: res.StatusCode,
6806 },
6807 }
6808 target := &ret
6809 b, err := gensupport.DecodeResponseBytes(target, res)
6810 if err != nil {
6811 return nil, err
6812 }
6813 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.move", "response", internallog.HTTPResponse(res, b))
6814 return ret, nil
6815 }
6816
6817 type DeploymentsDevicesPatchCall struct {
6818 s *Service
6819 name string
6820 sasportaldevice *SasPortalDevice
6821 urlParams_ gensupport.URLParams
6822 ctx_ context.Context
6823 header_ http.Header
6824 }
6825
6826 // Patch: Updates a device.
6827 //
6828 // - name: Output only. The resource path name.
6829 func (r *DeploymentsDevicesService) Patch(name string, sasportaldevice *SasPortalDevice) *DeploymentsDevicesPatchCall {
6830 c := &DeploymentsDevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6831 c.name = name
6832 c.sasportaldevice = sasportaldevice
6833 return c
6834 }
6835
6836 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
6837 func (c *DeploymentsDevicesPatchCall) UpdateMask(updateMask string) *DeploymentsDevicesPatchCall {
6838 c.urlParams_.Set("updateMask", updateMask)
6839 return c
6840 }
6841
6842 // Fields allows partial responses to be retrieved. See
6843 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6844 // details.
6845 func (c *DeploymentsDevicesPatchCall) Fields(s ...googleapi.Field) *DeploymentsDevicesPatchCall {
6846 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6847 return c
6848 }
6849
6850 // Context sets the context to be used in this call's Do method.
6851 func (c *DeploymentsDevicesPatchCall) Context(ctx context.Context) *DeploymentsDevicesPatchCall {
6852 c.ctx_ = ctx
6853 return c
6854 }
6855
6856 // Header returns a http.Header that can be modified by the caller to add
6857 // headers to the request.
6858 func (c *DeploymentsDevicesPatchCall) Header() http.Header {
6859 if c.header_ == nil {
6860 c.header_ = make(http.Header)
6861 }
6862 return c.header_
6863 }
6864
6865 func (c *DeploymentsDevicesPatchCall) doRequest(alt string) (*http.Response, error) {
6866 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6867 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
6868 if err != nil {
6869 return nil, err
6870 }
6871 c.urlParams_.Set("alt", alt)
6872 c.urlParams_.Set("prettyPrint", "false")
6873 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
6874 urls += "?" + c.urlParams_.Encode()
6875 req, err := http.NewRequest("PATCH", urls, body)
6876 if err != nil {
6877 return nil, err
6878 }
6879 req.Header = reqHeaders
6880 googleapi.Expand(req.URL, map[string]string{
6881 "name": c.name,
6882 })
6883 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6884 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6885 }
6886
6887 // Do executes the "prod_tt_sasportal.deployments.devices.patch" call.
6888 // Any non-2xx status code is an error. Response headers are in either
6889 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
6890 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6891 // check whether the returned error was because http.StatusNotModified was
6892 // returned.
6893 func (c *DeploymentsDevicesPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
6894 gensupport.SetOptions(c.urlParams_, opts...)
6895 res, err := c.doRequest("json")
6896 if res != nil && res.StatusCode == http.StatusNotModified {
6897 if res.Body != nil {
6898 res.Body.Close()
6899 }
6900 return nil, gensupport.WrapError(&googleapi.Error{
6901 Code: res.StatusCode,
6902 Header: res.Header,
6903 })
6904 }
6905 if err != nil {
6906 return nil, err
6907 }
6908 defer googleapi.CloseBody(res)
6909 if err := googleapi.CheckResponse(res); err != nil {
6910 return nil, gensupport.WrapError(err)
6911 }
6912 ret := &SasPortalDevice{
6913 ServerResponse: googleapi.ServerResponse{
6914 Header: res.Header,
6915 HTTPStatusCode: res.StatusCode,
6916 },
6917 }
6918 target := &ret
6919 b, err := gensupport.DecodeResponseBytes(target, res)
6920 if err != nil {
6921 return nil, err
6922 }
6923 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.patch", "response", internallog.HTTPResponse(res, b))
6924 return ret, nil
6925 }
6926
6927 type DeploymentsDevicesSignDeviceCall struct {
6928 s *Service
6929 name string
6930 sasportalsigndevicerequest *SasPortalSignDeviceRequest
6931 urlParams_ gensupport.URLParams
6932 ctx_ context.Context
6933 header_ http.Header
6934 }
6935
6936 // SignDevice: Signs a device.
6937 //
6938 // - name: Output only. The resource path name.
6939 func (r *DeploymentsDevicesService) SignDevice(name string, sasportalsigndevicerequest *SasPortalSignDeviceRequest) *DeploymentsDevicesSignDeviceCall {
6940 c := &DeploymentsDevicesSignDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6941 c.name = name
6942 c.sasportalsigndevicerequest = sasportalsigndevicerequest
6943 return c
6944 }
6945
6946 // Fields allows partial responses to be retrieved. See
6947 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6948 // details.
6949 func (c *DeploymentsDevicesSignDeviceCall) Fields(s ...googleapi.Field) *DeploymentsDevicesSignDeviceCall {
6950 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6951 return c
6952 }
6953
6954 // Context sets the context to be used in this call's Do method.
6955 func (c *DeploymentsDevicesSignDeviceCall) Context(ctx context.Context) *DeploymentsDevicesSignDeviceCall {
6956 c.ctx_ = ctx
6957 return c
6958 }
6959
6960 // Header returns a http.Header that can be modified by the caller to add
6961 // headers to the request.
6962 func (c *DeploymentsDevicesSignDeviceCall) Header() http.Header {
6963 if c.header_ == nil {
6964 c.header_ = make(http.Header)
6965 }
6966 return c.header_
6967 }
6968
6969 func (c *DeploymentsDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) {
6970 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6971 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest)
6972 if err != nil {
6973 return nil, err
6974 }
6975 c.urlParams_.Set("alt", alt)
6976 c.urlParams_.Set("prettyPrint", "false")
6977 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:signDevice")
6978 urls += "?" + c.urlParams_.Encode()
6979 req, err := http.NewRequest("POST", urls, body)
6980 if err != nil {
6981 return nil, err
6982 }
6983 req.Header = reqHeaders
6984 googleapi.Expand(req.URL, map[string]string{
6985 "name": c.name,
6986 })
6987 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.signDevice", "request", internallog.HTTPRequest(req, body.Bytes()))
6988 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6989 }
6990
6991 // Do executes the "prod_tt_sasportal.deployments.devices.signDevice" call.
6992 // Any non-2xx status code is an error. Response headers are in either
6993 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
6994 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6995 // whether the returned error was because http.StatusNotModified was returned.
6996 func (c *DeploymentsDevicesSignDeviceCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
6997 gensupport.SetOptions(c.urlParams_, opts...)
6998 res, err := c.doRequest("json")
6999 if res != nil && res.StatusCode == http.StatusNotModified {
7000 if res.Body != nil {
7001 res.Body.Close()
7002 }
7003 return nil, gensupport.WrapError(&googleapi.Error{
7004 Code: res.StatusCode,
7005 Header: res.Header,
7006 })
7007 }
7008 if err != nil {
7009 return nil, err
7010 }
7011 defer googleapi.CloseBody(res)
7012 if err := googleapi.CheckResponse(res); err != nil {
7013 return nil, gensupport.WrapError(err)
7014 }
7015 ret := &SasPortalEmpty{
7016 ServerResponse: googleapi.ServerResponse{
7017 Header: res.Header,
7018 HTTPStatusCode: res.StatusCode,
7019 },
7020 }
7021 target := &ret
7022 b, err := gensupport.DecodeResponseBytes(target, res)
7023 if err != nil {
7024 return nil, err
7025 }
7026 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.signDevice", "response", internallog.HTTPResponse(res, b))
7027 return ret, nil
7028 }
7029
7030 type DeploymentsDevicesUpdateSignedCall struct {
7031 s *Service
7032 name string
7033 sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest
7034 urlParams_ gensupport.URLParams
7035 ctx_ context.Context
7036 header_ http.Header
7037 }
7038
7039 // UpdateSigned: Updates a signed device.
7040 //
7041 // - name: The name of the device to update.
7042 func (r *DeploymentsDevicesService) UpdateSigned(name string, sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest) *DeploymentsDevicesUpdateSignedCall {
7043 c := &DeploymentsDevicesUpdateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7044 c.name = name
7045 c.sasportalupdatesigneddevicerequest = sasportalupdatesigneddevicerequest
7046 return c
7047 }
7048
7049 // Fields allows partial responses to be retrieved. See
7050 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7051 // details.
7052 func (c *DeploymentsDevicesUpdateSignedCall) Fields(s ...googleapi.Field) *DeploymentsDevicesUpdateSignedCall {
7053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7054 return c
7055 }
7056
7057 // Context sets the context to be used in this call's Do method.
7058 func (c *DeploymentsDevicesUpdateSignedCall) Context(ctx context.Context) *DeploymentsDevicesUpdateSignedCall {
7059 c.ctx_ = ctx
7060 return c
7061 }
7062
7063 // Header returns a http.Header that can be modified by the caller to add
7064 // headers to the request.
7065 func (c *DeploymentsDevicesUpdateSignedCall) Header() http.Header {
7066 if c.header_ == nil {
7067 c.header_ = make(http.Header)
7068 }
7069 return c.header_
7070 }
7071
7072 func (c *DeploymentsDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) {
7073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7074 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest)
7075 if err != nil {
7076 return nil, err
7077 }
7078 c.urlParams_.Set("alt", alt)
7079 c.urlParams_.Set("prettyPrint", "false")
7080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:updateSigned")
7081 urls += "?" + c.urlParams_.Encode()
7082 req, err := http.NewRequest("PATCH", urls, body)
7083 if err != nil {
7084 return nil, err
7085 }
7086 req.Header = reqHeaders
7087 googleapi.Expand(req.URL, map[string]string{
7088 "name": c.name,
7089 })
7090 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.updateSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
7091 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7092 }
7093
7094 // Do executes the "prod_tt_sasportal.deployments.devices.updateSigned" call.
7095 // Any non-2xx status code is an error. Response headers are in either
7096 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
7097 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7098 // check whether the returned error was because http.StatusNotModified was
7099 // returned.
7100 func (c *DeploymentsDevicesUpdateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
7101 gensupport.SetOptions(c.urlParams_, opts...)
7102 res, err := c.doRequest("json")
7103 if res != nil && res.StatusCode == http.StatusNotModified {
7104 if res.Body != nil {
7105 res.Body.Close()
7106 }
7107 return nil, gensupport.WrapError(&googleapi.Error{
7108 Code: res.StatusCode,
7109 Header: res.Header,
7110 })
7111 }
7112 if err != nil {
7113 return nil, err
7114 }
7115 defer googleapi.CloseBody(res)
7116 if err := googleapi.CheckResponse(res); err != nil {
7117 return nil, gensupport.WrapError(err)
7118 }
7119 ret := &SasPortalDevice{
7120 ServerResponse: googleapi.ServerResponse{
7121 Header: res.Header,
7122 HTTPStatusCode: res.StatusCode,
7123 },
7124 }
7125 target := &ret
7126 b, err := gensupport.DecodeResponseBytes(target, res)
7127 if err != nil {
7128 return nil, err
7129 }
7130 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.deployments.devices.updateSigned", "response", internallog.HTTPResponse(res, b))
7131 return ret, nil
7132 }
7133
7134 type InstallerGenerateSecretCall struct {
7135 s *Service
7136 sasportalgeneratesecretrequest *SasPortalGenerateSecretRequest
7137 urlParams_ gensupport.URLParams
7138 ctx_ context.Context
7139 header_ http.Header
7140 }
7141
7142 // GenerateSecret: Generates a secret to be used with the ValidateInstaller.
7143 func (r *InstallerService) GenerateSecret(sasportalgeneratesecretrequest *SasPortalGenerateSecretRequest) *InstallerGenerateSecretCall {
7144 c := &InstallerGenerateSecretCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7145 c.sasportalgeneratesecretrequest = sasportalgeneratesecretrequest
7146 return c
7147 }
7148
7149 // Fields allows partial responses to be retrieved. See
7150 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7151 // details.
7152 func (c *InstallerGenerateSecretCall) Fields(s ...googleapi.Field) *InstallerGenerateSecretCall {
7153 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7154 return c
7155 }
7156
7157 // Context sets the context to be used in this call's Do method.
7158 func (c *InstallerGenerateSecretCall) Context(ctx context.Context) *InstallerGenerateSecretCall {
7159 c.ctx_ = ctx
7160 return c
7161 }
7162
7163 // Header returns a http.Header that can be modified by the caller to add
7164 // headers to the request.
7165 func (c *InstallerGenerateSecretCall) Header() http.Header {
7166 if c.header_ == nil {
7167 c.header_ = make(http.Header)
7168 }
7169 return c.header_
7170 }
7171
7172 func (c *InstallerGenerateSecretCall) doRequest(alt string) (*http.Response, error) {
7173 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7174 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgeneratesecretrequest)
7175 if err != nil {
7176 return nil, err
7177 }
7178 c.urlParams_.Set("alt", alt)
7179 c.urlParams_.Set("prettyPrint", "false")
7180 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/installer:generateSecret")
7181 urls += "?" + c.urlParams_.Encode()
7182 req, err := http.NewRequest("POST", urls, body)
7183 if err != nil {
7184 return nil, err
7185 }
7186 req.Header = reqHeaders
7187 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.installer.generateSecret", "request", internallog.HTTPRequest(req, body.Bytes()))
7188 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7189 }
7190
7191 // Do executes the "prod_tt_sasportal.installer.generateSecret" call.
7192 // Any non-2xx status code is an error. Response headers are in either
7193 // *SasPortalGenerateSecretResponse.ServerResponse.Header or (if a response was
7194 // returned at all) in error.(*googleapi.Error).Header. Use
7195 // googleapi.IsNotModified to check whether the returned error was because
7196 // http.StatusNotModified was returned.
7197 func (c *InstallerGenerateSecretCall) Do(opts ...googleapi.CallOption) (*SasPortalGenerateSecretResponse, error) {
7198 gensupport.SetOptions(c.urlParams_, opts...)
7199 res, err := c.doRequest("json")
7200 if res != nil && res.StatusCode == http.StatusNotModified {
7201 if res.Body != nil {
7202 res.Body.Close()
7203 }
7204 return nil, gensupport.WrapError(&googleapi.Error{
7205 Code: res.StatusCode,
7206 Header: res.Header,
7207 })
7208 }
7209 if err != nil {
7210 return nil, err
7211 }
7212 defer googleapi.CloseBody(res)
7213 if err := googleapi.CheckResponse(res); err != nil {
7214 return nil, gensupport.WrapError(err)
7215 }
7216 ret := &SasPortalGenerateSecretResponse{
7217 ServerResponse: googleapi.ServerResponse{
7218 Header: res.Header,
7219 HTTPStatusCode: res.StatusCode,
7220 },
7221 }
7222 target := &ret
7223 b, err := gensupport.DecodeResponseBytes(target, res)
7224 if err != nil {
7225 return nil, err
7226 }
7227 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.installer.generateSecret", "response", internallog.HTTPResponse(res, b))
7228 return ret, nil
7229 }
7230
7231 type InstallerValidateCall struct {
7232 s *Service
7233 sasportalvalidateinstallerrequest *SasPortalValidateInstallerRequest
7234 urlParams_ gensupport.URLParams
7235 ctx_ context.Context
7236 header_ http.Header
7237 }
7238
7239 // Validate: Validates the identity of a Certified Professional Installer
7240 // (CPI).
7241 func (r *InstallerService) Validate(sasportalvalidateinstallerrequest *SasPortalValidateInstallerRequest) *InstallerValidateCall {
7242 c := &InstallerValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7243 c.sasportalvalidateinstallerrequest = sasportalvalidateinstallerrequest
7244 return c
7245 }
7246
7247 // Fields allows partial responses to be retrieved. See
7248 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7249 // details.
7250 func (c *InstallerValidateCall) Fields(s ...googleapi.Field) *InstallerValidateCall {
7251 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7252 return c
7253 }
7254
7255 // Context sets the context to be used in this call's Do method.
7256 func (c *InstallerValidateCall) Context(ctx context.Context) *InstallerValidateCall {
7257 c.ctx_ = ctx
7258 return c
7259 }
7260
7261 // Header returns a http.Header that can be modified by the caller to add
7262 // headers to the request.
7263 func (c *InstallerValidateCall) Header() http.Header {
7264 if c.header_ == nil {
7265 c.header_ = make(http.Header)
7266 }
7267 return c.header_
7268 }
7269
7270 func (c *InstallerValidateCall) doRequest(alt string) (*http.Response, error) {
7271 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7272 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalvalidateinstallerrequest)
7273 if err != nil {
7274 return nil, err
7275 }
7276 c.urlParams_.Set("alt", alt)
7277 c.urlParams_.Set("prettyPrint", "false")
7278 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/installer:validate")
7279 urls += "?" + c.urlParams_.Encode()
7280 req, err := http.NewRequest("POST", urls, body)
7281 if err != nil {
7282 return nil, err
7283 }
7284 req.Header = reqHeaders
7285 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.installer.validate", "request", internallog.HTTPRequest(req, body.Bytes()))
7286 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7287 }
7288
7289 // Do executes the "prod_tt_sasportal.installer.validate" call.
7290 // Any non-2xx status code is an error. Response headers are in either
7291 // *SasPortalValidateInstallerResponse.ServerResponse.Header or (if a response
7292 // was returned at all) in error.(*googleapi.Error).Header. Use
7293 // googleapi.IsNotModified to check whether the returned error was because
7294 // http.StatusNotModified was returned.
7295 func (c *InstallerValidateCall) Do(opts ...googleapi.CallOption) (*SasPortalValidateInstallerResponse, error) {
7296 gensupport.SetOptions(c.urlParams_, opts...)
7297 res, err := c.doRequest("json")
7298 if res != nil && res.StatusCode == http.StatusNotModified {
7299 if res.Body != nil {
7300 res.Body.Close()
7301 }
7302 return nil, gensupport.WrapError(&googleapi.Error{
7303 Code: res.StatusCode,
7304 Header: res.Header,
7305 })
7306 }
7307 if err != nil {
7308 return nil, err
7309 }
7310 defer googleapi.CloseBody(res)
7311 if err := googleapi.CheckResponse(res); err != nil {
7312 return nil, gensupport.WrapError(err)
7313 }
7314 ret := &SasPortalValidateInstallerResponse{
7315 ServerResponse: googleapi.ServerResponse{
7316 Header: res.Header,
7317 HTTPStatusCode: res.StatusCode,
7318 },
7319 }
7320 target := &ret
7321 b, err := gensupport.DecodeResponseBytes(target, res)
7322 if err != nil {
7323 return nil, err
7324 }
7325 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.installer.validate", "response", internallog.HTTPResponse(res, b))
7326 return ret, nil
7327 }
7328
7329 type NodesGetCall struct {
7330 s *Service
7331 name string
7332 urlParams_ gensupport.URLParams
7333 ifNoneMatch_ string
7334 ctx_ context.Context
7335 header_ http.Header
7336 }
7337
7338 // Get: Returns a requested node.
7339 //
7340 // - name: The name of the node.
7341 func (r *NodesService) Get(name string) *NodesGetCall {
7342 c := &NodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7343 c.name = name
7344 return c
7345 }
7346
7347 // Fields allows partial responses to be retrieved. See
7348 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7349 // details.
7350 func (c *NodesGetCall) Fields(s ...googleapi.Field) *NodesGetCall {
7351 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7352 return c
7353 }
7354
7355 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7356 // object's ETag matches the given value. This is useful for getting updates
7357 // only after the object has changed since the last request.
7358 func (c *NodesGetCall) IfNoneMatch(entityTag string) *NodesGetCall {
7359 c.ifNoneMatch_ = entityTag
7360 return c
7361 }
7362
7363 // Context sets the context to be used in this call's Do method.
7364 func (c *NodesGetCall) Context(ctx context.Context) *NodesGetCall {
7365 c.ctx_ = ctx
7366 return c
7367 }
7368
7369 // Header returns a http.Header that can be modified by the caller to add
7370 // headers to the request.
7371 func (c *NodesGetCall) Header() http.Header {
7372 if c.header_ == nil {
7373 c.header_ = make(http.Header)
7374 }
7375 return c.header_
7376 }
7377
7378 func (c *NodesGetCall) doRequest(alt string) (*http.Response, error) {
7379 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7380 if c.ifNoneMatch_ != "" {
7381 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7382 }
7383 c.urlParams_.Set("alt", alt)
7384 c.urlParams_.Set("prettyPrint", "false")
7385 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
7386 urls += "?" + c.urlParams_.Encode()
7387 req, err := http.NewRequest("GET", urls, nil)
7388 if err != nil {
7389 return nil, err
7390 }
7391 req.Header = reqHeaders
7392 googleapi.Expand(req.URL, map[string]string{
7393 "name": c.name,
7394 })
7395 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.get", "request", internallog.HTTPRequest(req, nil))
7396 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7397 }
7398
7399 // Do executes the "prod_tt_sasportal.nodes.get" call.
7400 // Any non-2xx status code is an error. Response headers are in either
7401 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
7402 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7403 // whether the returned error was because http.StatusNotModified was returned.
7404 func (c *NodesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
7405 gensupport.SetOptions(c.urlParams_, opts...)
7406 res, err := c.doRequest("json")
7407 if res != nil && res.StatusCode == http.StatusNotModified {
7408 if res.Body != nil {
7409 res.Body.Close()
7410 }
7411 return nil, gensupport.WrapError(&googleapi.Error{
7412 Code: res.StatusCode,
7413 Header: res.Header,
7414 })
7415 }
7416 if err != nil {
7417 return nil, err
7418 }
7419 defer googleapi.CloseBody(res)
7420 if err := googleapi.CheckResponse(res); err != nil {
7421 return nil, gensupport.WrapError(err)
7422 }
7423 ret := &SasPortalNode{
7424 ServerResponse: googleapi.ServerResponse{
7425 Header: res.Header,
7426 HTTPStatusCode: res.StatusCode,
7427 },
7428 }
7429 target := &ret
7430 b, err := gensupport.DecodeResponseBytes(target, res)
7431 if err != nil {
7432 return nil, err
7433 }
7434 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.get", "response", internallog.HTTPResponse(res, b))
7435 return ret, nil
7436 }
7437
7438 type NodesDeploymentsDeleteCall struct {
7439 s *Service
7440 name string
7441 urlParams_ gensupport.URLParams
7442 ctx_ context.Context
7443 header_ http.Header
7444 }
7445
7446 // Delete: Deletes a deployment.
7447 //
7448 // - name: The name of the deployment.
7449 func (r *NodesDeploymentsService) Delete(name string) *NodesDeploymentsDeleteCall {
7450 c := &NodesDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7451 c.name = name
7452 return c
7453 }
7454
7455 // Fields allows partial responses to be retrieved. See
7456 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7457 // details.
7458 func (c *NodesDeploymentsDeleteCall) Fields(s ...googleapi.Field) *NodesDeploymentsDeleteCall {
7459 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7460 return c
7461 }
7462
7463 // Context sets the context to be used in this call's Do method.
7464 func (c *NodesDeploymentsDeleteCall) Context(ctx context.Context) *NodesDeploymentsDeleteCall {
7465 c.ctx_ = ctx
7466 return c
7467 }
7468
7469 // Header returns a http.Header that can be modified by the caller to add
7470 // headers to the request.
7471 func (c *NodesDeploymentsDeleteCall) Header() http.Header {
7472 if c.header_ == nil {
7473 c.header_ = make(http.Header)
7474 }
7475 return c.header_
7476 }
7477
7478 func (c *NodesDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
7479 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7480 c.urlParams_.Set("alt", alt)
7481 c.urlParams_.Set("prettyPrint", "false")
7482 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
7483 urls += "?" + c.urlParams_.Encode()
7484 req, err := http.NewRequest("DELETE", urls, nil)
7485 if err != nil {
7486 return nil, err
7487 }
7488 req.Header = reqHeaders
7489 googleapi.Expand(req.URL, map[string]string{
7490 "name": c.name,
7491 })
7492 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.delete", "request", internallog.HTTPRequest(req, nil))
7493 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7494 }
7495
7496 // Do executes the "prod_tt_sasportal.nodes.deployments.delete" call.
7497 // Any non-2xx status code is an error. Response headers are in either
7498 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
7499 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7500 // whether the returned error was because http.StatusNotModified was returned.
7501 func (c *NodesDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
7502 gensupport.SetOptions(c.urlParams_, opts...)
7503 res, err := c.doRequest("json")
7504 if res != nil && res.StatusCode == http.StatusNotModified {
7505 if res.Body != nil {
7506 res.Body.Close()
7507 }
7508 return nil, gensupport.WrapError(&googleapi.Error{
7509 Code: res.StatusCode,
7510 Header: res.Header,
7511 })
7512 }
7513 if err != nil {
7514 return nil, err
7515 }
7516 defer googleapi.CloseBody(res)
7517 if err := googleapi.CheckResponse(res); err != nil {
7518 return nil, gensupport.WrapError(err)
7519 }
7520 ret := &SasPortalEmpty{
7521 ServerResponse: googleapi.ServerResponse{
7522 Header: res.Header,
7523 HTTPStatusCode: res.StatusCode,
7524 },
7525 }
7526 target := &ret
7527 b, err := gensupport.DecodeResponseBytes(target, res)
7528 if err != nil {
7529 return nil, err
7530 }
7531 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.delete", "response", internallog.HTTPResponse(res, b))
7532 return ret, nil
7533 }
7534
7535 type NodesDeploymentsGetCall struct {
7536 s *Service
7537 name string
7538 urlParams_ gensupport.URLParams
7539 ifNoneMatch_ string
7540 ctx_ context.Context
7541 header_ http.Header
7542 }
7543
7544 // Get: Returns a requested deployment.
7545 //
7546 // - name: The name of the deployment.
7547 func (r *NodesDeploymentsService) Get(name string) *NodesDeploymentsGetCall {
7548 c := &NodesDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7549 c.name = name
7550 return c
7551 }
7552
7553 // Fields allows partial responses to be retrieved. See
7554 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7555 // details.
7556 func (c *NodesDeploymentsGetCall) Fields(s ...googleapi.Field) *NodesDeploymentsGetCall {
7557 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7558 return c
7559 }
7560
7561 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7562 // object's ETag matches the given value. This is useful for getting updates
7563 // only after the object has changed since the last request.
7564 func (c *NodesDeploymentsGetCall) IfNoneMatch(entityTag string) *NodesDeploymentsGetCall {
7565 c.ifNoneMatch_ = entityTag
7566 return c
7567 }
7568
7569 // Context sets the context to be used in this call's Do method.
7570 func (c *NodesDeploymentsGetCall) Context(ctx context.Context) *NodesDeploymentsGetCall {
7571 c.ctx_ = ctx
7572 return c
7573 }
7574
7575 // Header returns a http.Header that can be modified by the caller to add
7576 // headers to the request.
7577 func (c *NodesDeploymentsGetCall) Header() http.Header {
7578 if c.header_ == nil {
7579 c.header_ = make(http.Header)
7580 }
7581 return c.header_
7582 }
7583
7584 func (c *NodesDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
7585 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7586 if c.ifNoneMatch_ != "" {
7587 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7588 }
7589 c.urlParams_.Set("alt", alt)
7590 c.urlParams_.Set("prettyPrint", "false")
7591 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
7592 urls += "?" + c.urlParams_.Encode()
7593 req, err := http.NewRequest("GET", urls, nil)
7594 if err != nil {
7595 return nil, err
7596 }
7597 req.Header = reqHeaders
7598 googleapi.Expand(req.URL, map[string]string{
7599 "name": c.name,
7600 })
7601 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.get", "request", internallog.HTTPRequest(req, nil))
7602 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7603 }
7604
7605 // Do executes the "prod_tt_sasportal.nodes.deployments.get" call.
7606 // Any non-2xx status code is an error. Response headers are in either
7607 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
7608 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7609 // check whether the returned error was because http.StatusNotModified was
7610 // returned.
7611 func (c *NodesDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
7612 gensupport.SetOptions(c.urlParams_, opts...)
7613 res, err := c.doRequest("json")
7614 if res != nil && res.StatusCode == http.StatusNotModified {
7615 if res.Body != nil {
7616 res.Body.Close()
7617 }
7618 return nil, gensupport.WrapError(&googleapi.Error{
7619 Code: res.StatusCode,
7620 Header: res.Header,
7621 })
7622 }
7623 if err != nil {
7624 return nil, err
7625 }
7626 defer googleapi.CloseBody(res)
7627 if err := googleapi.CheckResponse(res); err != nil {
7628 return nil, gensupport.WrapError(err)
7629 }
7630 ret := &SasPortalDeployment{
7631 ServerResponse: googleapi.ServerResponse{
7632 Header: res.Header,
7633 HTTPStatusCode: res.StatusCode,
7634 },
7635 }
7636 target := &ret
7637 b, err := gensupport.DecodeResponseBytes(target, res)
7638 if err != nil {
7639 return nil, err
7640 }
7641 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.get", "response", internallog.HTTPResponse(res, b))
7642 return ret, nil
7643 }
7644
7645 type NodesDeploymentsListCall struct {
7646 s *Service
7647 parent string
7648 urlParams_ gensupport.URLParams
7649 ifNoneMatch_ string
7650 ctx_ context.Context
7651 header_ http.Header
7652 }
7653
7654 // List: Lists deployments.
7655 //
7656 // - parent: The parent resource name, for example, "nodes/1",
7657 // customer/1/nodes/2.
7658 func (r *NodesDeploymentsService) List(parent string) *NodesDeploymentsListCall {
7659 c := &NodesDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7660 c.parent = parent
7661 return c
7662 }
7663
7664 // Filter sets the optional parameter "filter": The filter expression. The
7665 // filter should have the following format: "DIRECT_CHILDREN" or format:
7666 // "direct_children". The filter is case insensitive. If empty, then no
7667 // deployments are filtered.
7668 func (c *NodesDeploymentsListCall) Filter(filter string) *NodesDeploymentsListCall {
7669 c.urlParams_.Set("filter", filter)
7670 return c
7671 }
7672
7673 // PageSize sets the optional parameter "pageSize": The maximum number of
7674 // deployments to return in the response.
7675 func (c *NodesDeploymentsListCall) PageSize(pageSize int64) *NodesDeploymentsListCall {
7676 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7677 return c
7678 }
7679
7680 // PageToken sets the optional parameter "pageToken": A pagination token
7681 // returned from a previous call to ListDeployments that indicates where this
7682 // listing should continue from.
7683 func (c *NodesDeploymentsListCall) PageToken(pageToken string) *NodesDeploymentsListCall {
7684 c.urlParams_.Set("pageToken", pageToken)
7685 return c
7686 }
7687
7688 // Fields allows partial responses to be retrieved. See
7689 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7690 // details.
7691 func (c *NodesDeploymentsListCall) Fields(s ...googleapi.Field) *NodesDeploymentsListCall {
7692 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7693 return c
7694 }
7695
7696 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7697 // object's ETag matches the given value. This is useful for getting updates
7698 // only after the object has changed since the last request.
7699 func (c *NodesDeploymentsListCall) IfNoneMatch(entityTag string) *NodesDeploymentsListCall {
7700 c.ifNoneMatch_ = entityTag
7701 return c
7702 }
7703
7704 // Context sets the context to be used in this call's Do method.
7705 func (c *NodesDeploymentsListCall) Context(ctx context.Context) *NodesDeploymentsListCall {
7706 c.ctx_ = ctx
7707 return c
7708 }
7709
7710 // Header returns a http.Header that can be modified by the caller to add
7711 // headers to the request.
7712 func (c *NodesDeploymentsListCall) Header() http.Header {
7713 if c.header_ == nil {
7714 c.header_ = make(http.Header)
7715 }
7716 return c.header_
7717 }
7718
7719 func (c *NodesDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
7720 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7721 if c.ifNoneMatch_ != "" {
7722 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7723 }
7724 c.urlParams_.Set("alt", alt)
7725 c.urlParams_.Set("prettyPrint", "false")
7726 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
7727 urls += "?" + c.urlParams_.Encode()
7728 req, err := http.NewRequest("GET", urls, nil)
7729 if err != nil {
7730 return nil, err
7731 }
7732 req.Header = reqHeaders
7733 googleapi.Expand(req.URL, map[string]string{
7734 "parent": c.parent,
7735 })
7736 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.list", "request", internallog.HTTPRequest(req, nil))
7737 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7738 }
7739
7740 // Do executes the "prod_tt_sasportal.nodes.deployments.list" call.
7741 // Any non-2xx status code is an error. Response headers are in either
7742 // *SasPortalListDeploymentsResponse.ServerResponse.Header or (if a response
7743 // was returned at all) in error.(*googleapi.Error).Header. Use
7744 // googleapi.IsNotModified to check whether the returned error was because
7745 // http.StatusNotModified was returned.
7746 func (c *NodesDeploymentsListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDeploymentsResponse, error) {
7747 gensupport.SetOptions(c.urlParams_, opts...)
7748 res, err := c.doRequest("json")
7749 if res != nil && res.StatusCode == http.StatusNotModified {
7750 if res.Body != nil {
7751 res.Body.Close()
7752 }
7753 return nil, gensupport.WrapError(&googleapi.Error{
7754 Code: res.StatusCode,
7755 Header: res.Header,
7756 })
7757 }
7758 if err != nil {
7759 return nil, err
7760 }
7761 defer googleapi.CloseBody(res)
7762 if err := googleapi.CheckResponse(res); err != nil {
7763 return nil, gensupport.WrapError(err)
7764 }
7765 ret := &SasPortalListDeploymentsResponse{
7766 ServerResponse: googleapi.ServerResponse{
7767 Header: res.Header,
7768 HTTPStatusCode: res.StatusCode,
7769 },
7770 }
7771 target := &ret
7772 b, err := gensupport.DecodeResponseBytes(target, res)
7773 if err != nil {
7774 return nil, err
7775 }
7776 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.list", "response", internallog.HTTPResponse(res, b))
7777 return ret, nil
7778 }
7779
7780 // Pages invokes f for each page of results.
7781 // A non-nil error returned from f will halt the iteration.
7782 // The provided context supersedes any context provided to the Context method.
7783 func (c *NodesDeploymentsListCall) Pages(ctx context.Context, f func(*SasPortalListDeploymentsResponse) error) error {
7784 c.ctx_ = ctx
7785 defer c.PageToken(c.urlParams_.Get("pageToken"))
7786 for {
7787 x, err := c.Do()
7788 if err != nil {
7789 return err
7790 }
7791 if err := f(x); err != nil {
7792 return err
7793 }
7794 if x.NextPageToken == "" {
7795 return nil
7796 }
7797 c.PageToken(x.NextPageToken)
7798 }
7799 }
7800
7801 type NodesDeploymentsMoveCall struct {
7802 s *Service
7803 name string
7804 sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest
7805 urlParams_ gensupport.URLParams
7806 ctx_ context.Context
7807 header_ http.Header
7808 }
7809
7810 // Move: Moves a deployment under another node or customer.
7811 //
7812 // - name: The name of the deployment to move.
7813 func (r *NodesDeploymentsService) Move(name string, sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest) *NodesDeploymentsMoveCall {
7814 c := &NodesDeploymentsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7815 c.name = name
7816 c.sasportalmovedeploymentrequest = sasportalmovedeploymentrequest
7817 return c
7818 }
7819
7820 // Fields allows partial responses to be retrieved. See
7821 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7822 // details.
7823 func (c *NodesDeploymentsMoveCall) Fields(s ...googleapi.Field) *NodesDeploymentsMoveCall {
7824 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7825 return c
7826 }
7827
7828 // Context sets the context to be used in this call's Do method.
7829 func (c *NodesDeploymentsMoveCall) Context(ctx context.Context) *NodesDeploymentsMoveCall {
7830 c.ctx_ = ctx
7831 return c
7832 }
7833
7834 // Header returns a http.Header that can be modified by the caller to add
7835 // headers to the request.
7836 func (c *NodesDeploymentsMoveCall) Header() http.Header {
7837 if c.header_ == nil {
7838 c.header_ = make(http.Header)
7839 }
7840 return c.header_
7841 }
7842
7843 func (c *NodesDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) {
7844 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7845 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedeploymentrequest)
7846 if err != nil {
7847 return nil, err
7848 }
7849 c.urlParams_.Set("alt", alt)
7850 c.urlParams_.Set("prettyPrint", "false")
7851 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
7852 urls += "?" + c.urlParams_.Encode()
7853 req, err := http.NewRequest("POST", urls, body)
7854 if err != nil {
7855 return nil, err
7856 }
7857 req.Header = reqHeaders
7858 googleapi.Expand(req.URL, map[string]string{
7859 "name": c.name,
7860 })
7861 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.move", "request", internallog.HTTPRequest(req, body.Bytes()))
7862 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7863 }
7864
7865 // Do executes the "prod_tt_sasportal.nodes.deployments.move" call.
7866 // Any non-2xx status code is an error. Response headers are in either
7867 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
7868 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7869 // check whether the returned error was because http.StatusNotModified was
7870 // returned.
7871 func (c *NodesDeploymentsMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
7872 gensupport.SetOptions(c.urlParams_, opts...)
7873 res, err := c.doRequest("json")
7874 if res != nil && res.StatusCode == http.StatusNotModified {
7875 if res.Body != nil {
7876 res.Body.Close()
7877 }
7878 return nil, gensupport.WrapError(&googleapi.Error{
7879 Code: res.StatusCode,
7880 Header: res.Header,
7881 })
7882 }
7883 if err != nil {
7884 return nil, err
7885 }
7886 defer googleapi.CloseBody(res)
7887 if err := googleapi.CheckResponse(res); err != nil {
7888 return nil, gensupport.WrapError(err)
7889 }
7890 ret := &SasPortalOperation{
7891 ServerResponse: googleapi.ServerResponse{
7892 Header: res.Header,
7893 HTTPStatusCode: res.StatusCode,
7894 },
7895 }
7896 target := &ret
7897 b, err := gensupport.DecodeResponseBytes(target, res)
7898 if err != nil {
7899 return nil, err
7900 }
7901 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.move", "response", internallog.HTTPResponse(res, b))
7902 return ret, nil
7903 }
7904
7905 type NodesDeploymentsPatchCall struct {
7906 s *Service
7907 name string
7908 sasportaldeployment *SasPortalDeployment
7909 urlParams_ gensupport.URLParams
7910 ctx_ context.Context
7911 header_ http.Header
7912 }
7913
7914 // Patch: Updates an existing deployment.
7915 //
7916 // - name: Output only. Resource name.
7917 func (r *NodesDeploymentsService) Patch(name string, sasportaldeployment *SasPortalDeployment) *NodesDeploymentsPatchCall {
7918 c := &NodesDeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7919 c.name = name
7920 c.sasportaldeployment = sasportaldeployment
7921 return c
7922 }
7923
7924 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
7925 func (c *NodesDeploymentsPatchCall) UpdateMask(updateMask string) *NodesDeploymentsPatchCall {
7926 c.urlParams_.Set("updateMask", updateMask)
7927 return c
7928 }
7929
7930 // Fields allows partial responses to be retrieved. See
7931 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7932 // details.
7933 func (c *NodesDeploymentsPatchCall) Fields(s ...googleapi.Field) *NodesDeploymentsPatchCall {
7934 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7935 return c
7936 }
7937
7938 // Context sets the context to be used in this call's Do method.
7939 func (c *NodesDeploymentsPatchCall) Context(ctx context.Context) *NodesDeploymentsPatchCall {
7940 c.ctx_ = ctx
7941 return c
7942 }
7943
7944 // Header returns a http.Header that can be modified by the caller to add
7945 // headers to the request.
7946 func (c *NodesDeploymentsPatchCall) Header() http.Header {
7947 if c.header_ == nil {
7948 c.header_ = make(http.Header)
7949 }
7950 return c.header_
7951 }
7952
7953 func (c *NodesDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
7954 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7955 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment)
7956 if err != nil {
7957 return nil, err
7958 }
7959 c.urlParams_.Set("alt", alt)
7960 c.urlParams_.Set("prettyPrint", "false")
7961 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
7962 urls += "?" + c.urlParams_.Encode()
7963 req, err := http.NewRequest("PATCH", urls, body)
7964 if err != nil {
7965 return nil, err
7966 }
7967 req.Header = reqHeaders
7968 googleapi.Expand(req.URL, map[string]string{
7969 "name": c.name,
7970 })
7971 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7972 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7973 }
7974
7975 // Do executes the "prod_tt_sasportal.nodes.deployments.patch" call.
7976 // Any non-2xx status code is an error. Response headers are in either
7977 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
7978 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7979 // check whether the returned error was because http.StatusNotModified was
7980 // returned.
7981 func (c *NodesDeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
7982 gensupport.SetOptions(c.urlParams_, opts...)
7983 res, err := c.doRequest("json")
7984 if res != nil && res.StatusCode == http.StatusNotModified {
7985 if res.Body != nil {
7986 res.Body.Close()
7987 }
7988 return nil, gensupport.WrapError(&googleapi.Error{
7989 Code: res.StatusCode,
7990 Header: res.Header,
7991 })
7992 }
7993 if err != nil {
7994 return nil, err
7995 }
7996 defer googleapi.CloseBody(res)
7997 if err := googleapi.CheckResponse(res); err != nil {
7998 return nil, gensupport.WrapError(err)
7999 }
8000 ret := &SasPortalDeployment{
8001 ServerResponse: googleapi.ServerResponse{
8002 Header: res.Header,
8003 HTTPStatusCode: res.StatusCode,
8004 },
8005 }
8006 target := &ret
8007 b, err := gensupport.DecodeResponseBytes(target, res)
8008 if err != nil {
8009 return nil, err
8010 }
8011 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.patch", "response", internallog.HTTPResponse(res, b))
8012 return ret, nil
8013 }
8014
8015 type NodesDeploymentsDevicesCreateCall struct {
8016 s *Service
8017 parent string
8018 sasportaldevice *SasPortalDevice
8019 urlParams_ gensupport.URLParams
8020 ctx_ context.Context
8021 header_ http.Header
8022 }
8023
8024 // Create: Creates a device under a node or customer.
8025 //
8026 // - parent: The name of the parent resource.
8027 func (r *NodesDeploymentsDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *NodesDeploymentsDevicesCreateCall {
8028 c := &NodesDeploymentsDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8029 c.parent = parent
8030 c.sasportaldevice = sasportaldevice
8031 return c
8032 }
8033
8034 // Fields allows partial responses to be retrieved. See
8035 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8036 // details.
8037 func (c *NodesDeploymentsDevicesCreateCall) Fields(s ...googleapi.Field) *NodesDeploymentsDevicesCreateCall {
8038 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8039 return c
8040 }
8041
8042 // Context sets the context to be used in this call's Do method.
8043 func (c *NodesDeploymentsDevicesCreateCall) Context(ctx context.Context) *NodesDeploymentsDevicesCreateCall {
8044 c.ctx_ = ctx
8045 return c
8046 }
8047
8048 // Header returns a http.Header that can be modified by the caller to add
8049 // headers to the request.
8050 func (c *NodesDeploymentsDevicesCreateCall) Header() http.Header {
8051 if c.header_ == nil {
8052 c.header_ = make(http.Header)
8053 }
8054 return c.header_
8055 }
8056
8057 func (c *NodesDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
8058 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8059 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
8060 if err != nil {
8061 return nil, err
8062 }
8063 c.urlParams_.Set("alt", alt)
8064 c.urlParams_.Set("prettyPrint", "false")
8065 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
8066 urls += "?" + c.urlParams_.Encode()
8067 req, err := http.NewRequest("POST", urls, body)
8068 if err != nil {
8069 return nil, err
8070 }
8071 req.Header = reqHeaders
8072 googleapi.Expand(req.URL, map[string]string{
8073 "parent": c.parent,
8074 })
8075 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8076 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8077 }
8078
8079 // Do executes the "prod_tt_sasportal.nodes.deployments.devices.create" call.
8080 // Any non-2xx status code is an error. Response headers are in either
8081 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
8082 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8083 // check whether the returned error was because http.StatusNotModified was
8084 // returned.
8085 func (c *NodesDeploymentsDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
8086 gensupport.SetOptions(c.urlParams_, opts...)
8087 res, err := c.doRequest("json")
8088 if res != nil && res.StatusCode == http.StatusNotModified {
8089 if res.Body != nil {
8090 res.Body.Close()
8091 }
8092 return nil, gensupport.WrapError(&googleapi.Error{
8093 Code: res.StatusCode,
8094 Header: res.Header,
8095 })
8096 }
8097 if err != nil {
8098 return nil, err
8099 }
8100 defer googleapi.CloseBody(res)
8101 if err := googleapi.CheckResponse(res); err != nil {
8102 return nil, gensupport.WrapError(err)
8103 }
8104 ret := &SasPortalDevice{
8105 ServerResponse: googleapi.ServerResponse{
8106 Header: res.Header,
8107 HTTPStatusCode: res.StatusCode,
8108 },
8109 }
8110 target := &ret
8111 b, err := gensupport.DecodeResponseBytes(target, res)
8112 if err != nil {
8113 return nil, err
8114 }
8115 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.create", "response", internallog.HTTPResponse(res, b))
8116 return ret, nil
8117 }
8118
8119 type NodesDeploymentsDevicesCreateSignedCall struct {
8120 s *Service
8121 parent string
8122 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
8123 urlParams_ gensupport.URLParams
8124 ctx_ context.Context
8125 header_ http.Header
8126 }
8127
8128 // CreateSigned: Creates a signed device under a node or customer.
8129 //
8130 // - parent: The name of the parent resource.
8131 func (r *NodesDeploymentsDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *NodesDeploymentsDevicesCreateSignedCall {
8132 c := &NodesDeploymentsDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8133 c.parent = parent
8134 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
8135 return c
8136 }
8137
8138 // Fields allows partial responses to be retrieved. See
8139 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8140 // details.
8141 func (c *NodesDeploymentsDevicesCreateSignedCall) Fields(s ...googleapi.Field) *NodesDeploymentsDevicesCreateSignedCall {
8142 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8143 return c
8144 }
8145
8146 // Context sets the context to be used in this call's Do method.
8147 func (c *NodesDeploymentsDevicesCreateSignedCall) Context(ctx context.Context) *NodesDeploymentsDevicesCreateSignedCall {
8148 c.ctx_ = ctx
8149 return c
8150 }
8151
8152 // Header returns a http.Header that can be modified by the caller to add
8153 // headers to the request.
8154 func (c *NodesDeploymentsDevicesCreateSignedCall) Header() http.Header {
8155 if c.header_ == nil {
8156 c.header_ = make(http.Header)
8157 }
8158 return c.header_
8159 }
8160
8161 func (c *NodesDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
8162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8163 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
8164 if err != nil {
8165 return nil, err
8166 }
8167 c.urlParams_.Set("alt", alt)
8168 c.urlParams_.Set("prettyPrint", "false")
8169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
8170 urls += "?" + c.urlParams_.Encode()
8171 req, err := http.NewRequest("POST", urls, body)
8172 if err != nil {
8173 return nil, err
8174 }
8175 req.Header = reqHeaders
8176 googleapi.Expand(req.URL, map[string]string{
8177 "parent": c.parent,
8178 })
8179 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
8180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8181 }
8182
8183 // Do executes the "prod_tt_sasportal.nodes.deployments.devices.createSigned" call.
8184 // Any non-2xx status code is an error. Response headers are in either
8185 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
8186 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8187 // check whether the returned error was because http.StatusNotModified was
8188 // returned.
8189 func (c *NodesDeploymentsDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
8190 gensupport.SetOptions(c.urlParams_, opts...)
8191 res, err := c.doRequest("json")
8192 if res != nil && res.StatusCode == http.StatusNotModified {
8193 if res.Body != nil {
8194 res.Body.Close()
8195 }
8196 return nil, gensupport.WrapError(&googleapi.Error{
8197 Code: res.StatusCode,
8198 Header: res.Header,
8199 })
8200 }
8201 if err != nil {
8202 return nil, err
8203 }
8204 defer googleapi.CloseBody(res)
8205 if err := googleapi.CheckResponse(res); err != nil {
8206 return nil, gensupport.WrapError(err)
8207 }
8208 ret := &SasPortalDevice{
8209 ServerResponse: googleapi.ServerResponse{
8210 Header: res.Header,
8211 HTTPStatusCode: res.StatusCode,
8212 },
8213 }
8214 target := &ret
8215 b, err := gensupport.DecodeResponseBytes(target, res)
8216 if err != nil {
8217 return nil, err
8218 }
8219 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.createSigned", "response", internallog.HTTPResponse(res, b))
8220 return ret, nil
8221 }
8222
8223 type NodesDeploymentsDevicesListCall struct {
8224 s *Service
8225 parent string
8226 urlParams_ gensupport.URLParams
8227 ifNoneMatch_ string
8228 ctx_ context.Context
8229 header_ http.Header
8230 }
8231
8232 // List: Lists devices under a node or customer.
8233 //
8234 // - parent: The name of the parent resource.
8235 func (r *NodesDeploymentsDevicesService) List(parent string) *NodesDeploymentsDevicesListCall {
8236 c := &NodesDeploymentsDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8237 c.parent = parent
8238 return c
8239 }
8240
8241 // Filter sets the optional parameter "filter": The filter expression. The
8242 // filter should have one of the following formats: "sn=123454" or
8243 // "display_name=MyDevice". sn corresponds to serial number of the device. The
8244 // filter is case insensitive.
8245 func (c *NodesDeploymentsDevicesListCall) Filter(filter string) *NodesDeploymentsDevicesListCall {
8246 c.urlParams_.Set("filter", filter)
8247 return c
8248 }
8249
8250 // PageSize sets the optional parameter "pageSize": The maximum number of
8251 // devices to return in the response. If empty or zero, all devices will be
8252 // listed. Must be in the range [0, 1000].
8253 func (c *NodesDeploymentsDevicesListCall) PageSize(pageSize int64) *NodesDeploymentsDevicesListCall {
8254 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8255 return c
8256 }
8257
8258 // PageToken sets the optional parameter "pageToken": A pagination token
8259 // returned from a previous call to ListDevices that indicates where this
8260 // listing should continue from.
8261 func (c *NodesDeploymentsDevicesListCall) PageToken(pageToken string) *NodesDeploymentsDevicesListCall {
8262 c.urlParams_.Set("pageToken", pageToken)
8263 return c
8264 }
8265
8266 // Fields allows partial responses to be retrieved. See
8267 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8268 // details.
8269 func (c *NodesDeploymentsDevicesListCall) Fields(s ...googleapi.Field) *NodesDeploymentsDevicesListCall {
8270 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8271 return c
8272 }
8273
8274 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8275 // object's ETag matches the given value. This is useful for getting updates
8276 // only after the object has changed since the last request.
8277 func (c *NodesDeploymentsDevicesListCall) IfNoneMatch(entityTag string) *NodesDeploymentsDevicesListCall {
8278 c.ifNoneMatch_ = entityTag
8279 return c
8280 }
8281
8282 // Context sets the context to be used in this call's Do method.
8283 func (c *NodesDeploymentsDevicesListCall) Context(ctx context.Context) *NodesDeploymentsDevicesListCall {
8284 c.ctx_ = ctx
8285 return c
8286 }
8287
8288 // Header returns a http.Header that can be modified by the caller to add
8289 // headers to the request.
8290 func (c *NodesDeploymentsDevicesListCall) Header() http.Header {
8291 if c.header_ == nil {
8292 c.header_ = make(http.Header)
8293 }
8294 return c.header_
8295 }
8296
8297 func (c *NodesDeploymentsDevicesListCall) doRequest(alt string) (*http.Response, error) {
8298 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8299 if c.ifNoneMatch_ != "" {
8300 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8301 }
8302 c.urlParams_.Set("alt", alt)
8303 c.urlParams_.Set("prettyPrint", "false")
8304 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
8305 urls += "?" + c.urlParams_.Encode()
8306 req, err := http.NewRequest("GET", urls, nil)
8307 if err != nil {
8308 return nil, err
8309 }
8310 req.Header = reqHeaders
8311 googleapi.Expand(req.URL, map[string]string{
8312 "parent": c.parent,
8313 })
8314 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.list", "request", internallog.HTTPRequest(req, nil))
8315 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8316 }
8317
8318 // Do executes the "prod_tt_sasportal.nodes.deployments.devices.list" call.
8319 // Any non-2xx status code is an error. Response headers are in either
8320 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
8321 // returned at all) in error.(*googleapi.Error).Header. Use
8322 // googleapi.IsNotModified to check whether the returned error was because
8323 // http.StatusNotModified was returned.
8324 func (c *NodesDeploymentsDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
8325 gensupport.SetOptions(c.urlParams_, opts...)
8326 res, err := c.doRequest("json")
8327 if res != nil && res.StatusCode == http.StatusNotModified {
8328 if res.Body != nil {
8329 res.Body.Close()
8330 }
8331 return nil, gensupport.WrapError(&googleapi.Error{
8332 Code: res.StatusCode,
8333 Header: res.Header,
8334 })
8335 }
8336 if err != nil {
8337 return nil, err
8338 }
8339 defer googleapi.CloseBody(res)
8340 if err := googleapi.CheckResponse(res); err != nil {
8341 return nil, gensupport.WrapError(err)
8342 }
8343 ret := &SasPortalListDevicesResponse{
8344 ServerResponse: googleapi.ServerResponse{
8345 Header: res.Header,
8346 HTTPStatusCode: res.StatusCode,
8347 },
8348 }
8349 target := &ret
8350 b, err := gensupport.DecodeResponseBytes(target, res)
8351 if err != nil {
8352 return nil, err
8353 }
8354 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.deployments.devices.list", "response", internallog.HTTPResponse(res, b))
8355 return ret, nil
8356 }
8357
8358 // Pages invokes f for each page of results.
8359 // A non-nil error returned from f will halt the iteration.
8360 // The provided context supersedes any context provided to the Context method.
8361 func (c *NodesDeploymentsDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
8362 c.ctx_ = ctx
8363 defer c.PageToken(c.urlParams_.Get("pageToken"))
8364 for {
8365 x, err := c.Do()
8366 if err != nil {
8367 return err
8368 }
8369 if err := f(x); err != nil {
8370 return err
8371 }
8372 if x.NextPageToken == "" {
8373 return nil
8374 }
8375 c.PageToken(x.NextPageToken)
8376 }
8377 }
8378
8379 type NodesDevicesCreateCall struct {
8380 s *Service
8381 parent string
8382 sasportaldevice *SasPortalDevice
8383 urlParams_ gensupport.URLParams
8384 ctx_ context.Context
8385 header_ http.Header
8386 }
8387
8388 // Create: Creates a device under a node or customer.
8389 //
8390 // - parent: The name of the parent resource.
8391 func (r *NodesDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *NodesDevicesCreateCall {
8392 c := &NodesDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8393 c.parent = parent
8394 c.sasportaldevice = sasportaldevice
8395 return c
8396 }
8397
8398 // Fields allows partial responses to be retrieved. See
8399 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8400 // details.
8401 func (c *NodesDevicesCreateCall) Fields(s ...googleapi.Field) *NodesDevicesCreateCall {
8402 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8403 return c
8404 }
8405
8406 // Context sets the context to be used in this call's Do method.
8407 func (c *NodesDevicesCreateCall) Context(ctx context.Context) *NodesDevicesCreateCall {
8408 c.ctx_ = ctx
8409 return c
8410 }
8411
8412 // Header returns a http.Header that can be modified by the caller to add
8413 // headers to the request.
8414 func (c *NodesDevicesCreateCall) Header() http.Header {
8415 if c.header_ == nil {
8416 c.header_ = make(http.Header)
8417 }
8418 return c.header_
8419 }
8420
8421 func (c *NodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
8422 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8423 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
8424 if err != nil {
8425 return nil, err
8426 }
8427 c.urlParams_.Set("alt", alt)
8428 c.urlParams_.Set("prettyPrint", "false")
8429 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
8430 urls += "?" + c.urlParams_.Encode()
8431 req, err := http.NewRequest("POST", urls, body)
8432 if err != nil {
8433 return nil, err
8434 }
8435 req.Header = reqHeaders
8436 googleapi.Expand(req.URL, map[string]string{
8437 "parent": c.parent,
8438 })
8439 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8440 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8441 }
8442
8443 // Do executes the "prod_tt_sasportal.nodes.devices.create" call.
8444 // Any non-2xx status code is an error. Response headers are in either
8445 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
8446 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8447 // check whether the returned error was because http.StatusNotModified was
8448 // returned.
8449 func (c *NodesDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
8450 gensupport.SetOptions(c.urlParams_, opts...)
8451 res, err := c.doRequest("json")
8452 if res != nil && res.StatusCode == http.StatusNotModified {
8453 if res.Body != nil {
8454 res.Body.Close()
8455 }
8456 return nil, gensupport.WrapError(&googleapi.Error{
8457 Code: res.StatusCode,
8458 Header: res.Header,
8459 })
8460 }
8461 if err != nil {
8462 return nil, err
8463 }
8464 defer googleapi.CloseBody(res)
8465 if err := googleapi.CheckResponse(res); err != nil {
8466 return nil, gensupport.WrapError(err)
8467 }
8468 ret := &SasPortalDevice{
8469 ServerResponse: googleapi.ServerResponse{
8470 Header: res.Header,
8471 HTTPStatusCode: res.StatusCode,
8472 },
8473 }
8474 target := &ret
8475 b, err := gensupport.DecodeResponseBytes(target, res)
8476 if err != nil {
8477 return nil, err
8478 }
8479 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.create", "response", internallog.HTTPResponse(res, b))
8480 return ret, nil
8481 }
8482
8483 type NodesDevicesCreateSignedCall struct {
8484 s *Service
8485 parent string
8486 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
8487 urlParams_ gensupport.URLParams
8488 ctx_ context.Context
8489 header_ http.Header
8490 }
8491
8492 // CreateSigned: Creates a signed device under a node or customer.
8493 //
8494 // - parent: The name of the parent resource.
8495 func (r *NodesDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *NodesDevicesCreateSignedCall {
8496 c := &NodesDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8497 c.parent = parent
8498 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
8499 return c
8500 }
8501
8502 // Fields allows partial responses to be retrieved. See
8503 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8504 // details.
8505 func (c *NodesDevicesCreateSignedCall) Fields(s ...googleapi.Field) *NodesDevicesCreateSignedCall {
8506 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8507 return c
8508 }
8509
8510 // Context sets the context to be used in this call's Do method.
8511 func (c *NodesDevicesCreateSignedCall) Context(ctx context.Context) *NodesDevicesCreateSignedCall {
8512 c.ctx_ = ctx
8513 return c
8514 }
8515
8516 // Header returns a http.Header that can be modified by the caller to add
8517 // headers to the request.
8518 func (c *NodesDevicesCreateSignedCall) Header() http.Header {
8519 if c.header_ == nil {
8520 c.header_ = make(http.Header)
8521 }
8522 return c.header_
8523 }
8524
8525 func (c *NodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
8526 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8527 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
8528 if err != nil {
8529 return nil, err
8530 }
8531 c.urlParams_.Set("alt", alt)
8532 c.urlParams_.Set("prettyPrint", "false")
8533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
8534 urls += "?" + c.urlParams_.Encode()
8535 req, err := http.NewRequest("POST", urls, body)
8536 if err != nil {
8537 return nil, err
8538 }
8539 req.Header = reqHeaders
8540 googleapi.Expand(req.URL, map[string]string{
8541 "parent": c.parent,
8542 })
8543 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
8544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8545 }
8546
8547 // Do executes the "prod_tt_sasportal.nodes.devices.createSigned" call.
8548 // Any non-2xx status code is an error. Response headers are in either
8549 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
8550 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8551 // check whether the returned error was because http.StatusNotModified was
8552 // returned.
8553 func (c *NodesDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
8554 gensupport.SetOptions(c.urlParams_, opts...)
8555 res, err := c.doRequest("json")
8556 if res != nil && res.StatusCode == http.StatusNotModified {
8557 if res.Body != nil {
8558 res.Body.Close()
8559 }
8560 return nil, gensupport.WrapError(&googleapi.Error{
8561 Code: res.StatusCode,
8562 Header: res.Header,
8563 })
8564 }
8565 if err != nil {
8566 return nil, err
8567 }
8568 defer googleapi.CloseBody(res)
8569 if err := googleapi.CheckResponse(res); err != nil {
8570 return nil, gensupport.WrapError(err)
8571 }
8572 ret := &SasPortalDevice{
8573 ServerResponse: googleapi.ServerResponse{
8574 Header: res.Header,
8575 HTTPStatusCode: res.StatusCode,
8576 },
8577 }
8578 target := &ret
8579 b, err := gensupport.DecodeResponseBytes(target, res)
8580 if err != nil {
8581 return nil, err
8582 }
8583 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.createSigned", "response", internallog.HTTPResponse(res, b))
8584 return ret, nil
8585 }
8586
8587 type NodesDevicesDeleteCall struct {
8588 s *Service
8589 name string
8590 urlParams_ gensupport.URLParams
8591 ctx_ context.Context
8592 header_ http.Header
8593 }
8594
8595 // Delete: Deletes a device.
8596 //
8597 // - name: The name of the device.
8598 func (r *NodesDevicesService) Delete(name string) *NodesDevicesDeleteCall {
8599 c := &NodesDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8600 c.name = name
8601 return c
8602 }
8603
8604 // Fields allows partial responses to be retrieved. See
8605 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8606 // details.
8607 func (c *NodesDevicesDeleteCall) Fields(s ...googleapi.Field) *NodesDevicesDeleteCall {
8608 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8609 return c
8610 }
8611
8612 // Context sets the context to be used in this call's Do method.
8613 func (c *NodesDevicesDeleteCall) Context(ctx context.Context) *NodesDevicesDeleteCall {
8614 c.ctx_ = ctx
8615 return c
8616 }
8617
8618 // Header returns a http.Header that can be modified by the caller to add
8619 // headers to the request.
8620 func (c *NodesDevicesDeleteCall) Header() http.Header {
8621 if c.header_ == nil {
8622 c.header_ = make(http.Header)
8623 }
8624 return c.header_
8625 }
8626
8627 func (c *NodesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) {
8628 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8629 c.urlParams_.Set("alt", alt)
8630 c.urlParams_.Set("prettyPrint", "false")
8631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
8632 urls += "?" + c.urlParams_.Encode()
8633 req, err := http.NewRequest("DELETE", urls, nil)
8634 if err != nil {
8635 return nil, err
8636 }
8637 req.Header = reqHeaders
8638 googleapi.Expand(req.URL, map[string]string{
8639 "name": c.name,
8640 })
8641 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.delete", "request", internallog.HTTPRequest(req, nil))
8642 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8643 }
8644
8645 // Do executes the "prod_tt_sasportal.nodes.devices.delete" call.
8646 // Any non-2xx status code is an error. Response headers are in either
8647 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
8648 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8649 // whether the returned error was because http.StatusNotModified was returned.
8650 func (c *NodesDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
8651 gensupport.SetOptions(c.urlParams_, opts...)
8652 res, err := c.doRequest("json")
8653 if res != nil && res.StatusCode == http.StatusNotModified {
8654 if res.Body != nil {
8655 res.Body.Close()
8656 }
8657 return nil, gensupport.WrapError(&googleapi.Error{
8658 Code: res.StatusCode,
8659 Header: res.Header,
8660 })
8661 }
8662 if err != nil {
8663 return nil, err
8664 }
8665 defer googleapi.CloseBody(res)
8666 if err := googleapi.CheckResponse(res); err != nil {
8667 return nil, gensupport.WrapError(err)
8668 }
8669 ret := &SasPortalEmpty{
8670 ServerResponse: googleapi.ServerResponse{
8671 Header: res.Header,
8672 HTTPStatusCode: res.StatusCode,
8673 },
8674 }
8675 target := &ret
8676 b, err := gensupport.DecodeResponseBytes(target, res)
8677 if err != nil {
8678 return nil, err
8679 }
8680 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.delete", "response", internallog.HTTPResponse(res, b))
8681 return ret, nil
8682 }
8683
8684 type NodesDevicesGetCall struct {
8685 s *Service
8686 name string
8687 urlParams_ gensupport.URLParams
8688 ifNoneMatch_ string
8689 ctx_ context.Context
8690 header_ http.Header
8691 }
8692
8693 // Get: Gets details about a device.
8694 //
8695 // - name: The name of the device.
8696 func (r *NodesDevicesService) Get(name string) *NodesDevicesGetCall {
8697 c := &NodesDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8698 c.name = name
8699 return c
8700 }
8701
8702 // Fields allows partial responses to be retrieved. See
8703 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8704 // details.
8705 func (c *NodesDevicesGetCall) Fields(s ...googleapi.Field) *NodesDevicesGetCall {
8706 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8707 return c
8708 }
8709
8710 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8711 // object's ETag matches the given value. This is useful for getting updates
8712 // only after the object has changed since the last request.
8713 func (c *NodesDevicesGetCall) IfNoneMatch(entityTag string) *NodesDevicesGetCall {
8714 c.ifNoneMatch_ = entityTag
8715 return c
8716 }
8717
8718 // Context sets the context to be used in this call's Do method.
8719 func (c *NodesDevicesGetCall) Context(ctx context.Context) *NodesDevicesGetCall {
8720 c.ctx_ = ctx
8721 return c
8722 }
8723
8724 // Header returns a http.Header that can be modified by the caller to add
8725 // headers to the request.
8726 func (c *NodesDevicesGetCall) Header() http.Header {
8727 if c.header_ == nil {
8728 c.header_ = make(http.Header)
8729 }
8730 return c.header_
8731 }
8732
8733 func (c *NodesDevicesGetCall) doRequest(alt string) (*http.Response, error) {
8734 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8735 if c.ifNoneMatch_ != "" {
8736 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8737 }
8738 c.urlParams_.Set("alt", alt)
8739 c.urlParams_.Set("prettyPrint", "false")
8740 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
8741 urls += "?" + c.urlParams_.Encode()
8742 req, err := http.NewRequest("GET", urls, nil)
8743 if err != nil {
8744 return nil, err
8745 }
8746 req.Header = reqHeaders
8747 googleapi.Expand(req.URL, map[string]string{
8748 "name": c.name,
8749 })
8750 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.get", "request", internallog.HTTPRequest(req, nil))
8751 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8752 }
8753
8754 // Do executes the "prod_tt_sasportal.nodes.devices.get" call.
8755 // Any non-2xx status code is an error. Response headers are in either
8756 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
8757 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8758 // check whether the returned error was because http.StatusNotModified was
8759 // returned.
8760 func (c *NodesDevicesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
8761 gensupport.SetOptions(c.urlParams_, opts...)
8762 res, err := c.doRequest("json")
8763 if res != nil && res.StatusCode == http.StatusNotModified {
8764 if res.Body != nil {
8765 res.Body.Close()
8766 }
8767 return nil, gensupport.WrapError(&googleapi.Error{
8768 Code: res.StatusCode,
8769 Header: res.Header,
8770 })
8771 }
8772 if err != nil {
8773 return nil, err
8774 }
8775 defer googleapi.CloseBody(res)
8776 if err := googleapi.CheckResponse(res); err != nil {
8777 return nil, gensupport.WrapError(err)
8778 }
8779 ret := &SasPortalDevice{
8780 ServerResponse: googleapi.ServerResponse{
8781 Header: res.Header,
8782 HTTPStatusCode: res.StatusCode,
8783 },
8784 }
8785 target := &ret
8786 b, err := gensupport.DecodeResponseBytes(target, res)
8787 if err != nil {
8788 return nil, err
8789 }
8790 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.get", "response", internallog.HTTPResponse(res, b))
8791 return ret, nil
8792 }
8793
8794 type NodesDevicesListCall struct {
8795 s *Service
8796 parent string
8797 urlParams_ gensupport.URLParams
8798 ifNoneMatch_ string
8799 ctx_ context.Context
8800 header_ http.Header
8801 }
8802
8803 // List: Lists devices under a node or customer.
8804 //
8805 // - parent: The name of the parent resource.
8806 func (r *NodesDevicesService) List(parent string) *NodesDevicesListCall {
8807 c := &NodesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8808 c.parent = parent
8809 return c
8810 }
8811
8812 // Filter sets the optional parameter "filter": The filter expression. The
8813 // filter should have one of the following formats: "sn=123454" or
8814 // "display_name=MyDevice". sn corresponds to serial number of the device. The
8815 // filter is case insensitive.
8816 func (c *NodesDevicesListCall) Filter(filter string) *NodesDevicesListCall {
8817 c.urlParams_.Set("filter", filter)
8818 return c
8819 }
8820
8821 // PageSize sets the optional parameter "pageSize": The maximum number of
8822 // devices to return in the response. If empty or zero, all devices will be
8823 // listed. Must be in the range [0, 1000].
8824 func (c *NodesDevicesListCall) PageSize(pageSize int64) *NodesDevicesListCall {
8825 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8826 return c
8827 }
8828
8829 // PageToken sets the optional parameter "pageToken": A pagination token
8830 // returned from a previous call to ListDevices that indicates where this
8831 // listing should continue from.
8832 func (c *NodesDevicesListCall) PageToken(pageToken string) *NodesDevicesListCall {
8833 c.urlParams_.Set("pageToken", pageToken)
8834 return c
8835 }
8836
8837 // Fields allows partial responses to be retrieved. See
8838 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8839 // details.
8840 func (c *NodesDevicesListCall) Fields(s ...googleapi.Field) *NodesDevicesListCall {
8841 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8842 return c
8843 }
8844
8845 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8846 // object's ETag matches the given value. This is useful for getting updates
8847 // only after the object has changed since the last request.
8848 func (c *NodesDevicesListCall) IfNoneMatch(entityTag string) *NodesDevicesListCall {
8849 c.ifNoneMatch_ = entityTag
8850 return c
8851 }
8852
8853 // Context sets the context to be used in this call's Do method.
8854 func (c *NodesDevicesListCall) Context(ctx context.Context) *NodesDevicesListCall {
8855 c.ctx_ = ctx
8856 return c
8857 }
8858
8859 // Header returns a http.Header that can be modified by the caller to add
8860 // headers to the request.
8861 func (c *NodesDevicesListCall) Header() http.Header {
8862 if c.header_ == nil {
8863 c.header_ = make(http.Header)
8864 }
8865 return c.header_
8866 }
8867
8868 func (c *NodesDevicesListCall) doRequest(alt string) (*http.Response, error) {
8869 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8870 if c.ifNoneMatch_ != "" {
8871 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8872 }
8873 c.urlParams_.Set("alt", alt)
8874 c.urlParams_.Set("prettyPrint", "false")
8875 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
8876 urls += "?" + c.urlParams_.Encode()
8877 req, err := http.NewRequest("GET", urls, nil)
8878 if err != nil {
8879 return nil, err
8880 }
8881 req.Header = reqHeaders
8882 googleapi.Expand(req.URL, map[string]string{
8883 "parent": c.parent,
8884 })
8885 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.list", "request", internallog.HTTPRequest(req, nil))
8886 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8887 }
8888
8889 // Do executes the "prod_tt_sasportal.nodes.devices.list" call.
8890 // Any non-2xx status code is an error. Response headers are in either
8891 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
8892 // returned at all) in error.(*googleapi.Error).Header. Use
8893 // googleapi.IsNotModified to check whether the returned error was because
8894 // http.StatusNotModified was returned.
8895 func (c *NodesDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
8896 gensupport.SetOptions(c.urlParams_, opts...)
8897 res, err := c.doRequest("json")
8898 if res != nil && res.StatusCode == http.StatusNotModified {
8899 if res.Body != nil {
8900 res.Body.Close()
8901 }
8902 return nil, gensupport.WrapError(&googleapi.Error{
8903 Code: res.StatusCode,
8904 Header: res.Header,
8905 })
8906 }
8907 if err != nil {
8908 return nil, err
8909 }
8910 defer googleapi.CloseBody(res)
8911 if err := googleapi.CheckResponse(res); err != nil {
8912 return nil, gensupport.WrapError(err)
8913 }
8914 ret := &SasPortalListDevicesResponse{
8915 ServerResponse: googleapi.ServerResponse{
8916 Header: res.Header,
8917 HTTPStatusCode: res.StatusCode,
8918 },
8919 }
8920 target := &ret
8921 b, err := gensupport.DecodeResponseBytes(target, res)
8922 if err != nil {
8923 return nil, err
8924 }
8925 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.list", "response", internallog.HTTPResponse(res, b))
8926 return ret, nil
8927 }
8928
8929 // Pages invokes f for each page of results.
8930 // A non-nil error returned from f will halt the iteration.
8931 // The provided context supersedes any context provided to the Context method.
8932 func (c *NodesDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
8933 c.ctx_ = ctx
8934 defer c.PageToken(c.urlParams_.Get("pageToken"))
8935 for {
8936 x, err := c.Do()
8937 if err != nil {
8938 return err
8939 }
8940 if err := f(x); err != nil {
8941 return err
8942 }
8943 if x.NextPageToken == "" {
8944 return nil
8945 }
8946 c.PageToken(x.NextPageToken)
8947 }
8948 }
8949
8950 type NodesDevicesMoveCall struct {
8951 s *Service
8952 name string
8953 sasportalmovedevicerequest *SasPortalMoveDeviceRequest
8954 urlParams_ gensupport.URLParams
8955 ctx_ context.Context
8956 header_ http.Header
8957 }
8958
8959 // Move: Moves a device under another node or customer.
8960 //
8961 // - name: The name of the device to move.
8962 func (r *NodesDevicesService) Move(name string, sasportalmovedevicerequest *SasPortalMoveDeviceRequest) *NodesDevicesMoveCall {
8963 c := &NodesDevicesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8964 c.name = name
8965 c.sasportalmovedevicerequest = sasportalmovedevicerequest
8966 return c
8967 }
8968
8969 // Fields allows partial responses to be retrieved. See
8970 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8971 // details.
8972 func (c *NodesDevicesMoveCall) Fields(s ...googleapi.Field) *NodesDevicesMoveCall {
8973 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8974 return c
8975 }
8976
8977 // Context sets the context to be used in this call's Do method.
8978 func (c *NodesDevicesMoveCall) Context(ctx context.Context) *NodesDevicesMoveCall {
8979 c.ctx_ = ctx
8980 return c
8981 }
8982
8983 // Header returns a http.Header that can be modified by the caller to add
8984 // headers to the request.
8985 func (c *NodesDevicesMoveCall) Header() http.Header {
8986 if c.header_ == nil {
8987 c.header_ = make(http.Header)
8988 }
8989 return c.header_
8990 }
8991
8992 func (c *NodesDevicesMoveCall) doRequest(alt string) (*http.Response, error) {
8993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8994 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovedevicerequest)
8995 if err != nil {
8996 return nil, err
8997 }
8998 c.urlParams_.Set("alt", alt)
8999 c.urlParams_.Set("prettyPrint", "false")
9000 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
9001 urls += "?" + c.urlParams_.Encode()
9002 req, err := http.NewRequest("POST", urls, body)
9003 if err != nil {
9004 return nil, err
9005 }
9006 req.Header = reqHeaders
9007 googleapi.Expand(req.URL, map[string]string{
9008 "name": c.name,
9009 })
9010 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.move", "request", internallog.HTTPRequest(req, body.Bytes()))
9011 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9012 }
9013
9014 // Do executes the "prod_tt_sasportal.nodes.devices.move" call.
9015 // Any non-2xx status code is an error. Response headers are in either
9016 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
9017 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9018 // check whether the returned error was because http.StatusNotModified was
9019 // returned.
9020 func (c *NodesDevicesMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
9021 gensupport.SetOptions(c.urlParams_, opts...)
9022 res, err := c.doRequest("json")
9023 if res != nil && res.StatusCode == http.StatusNotModified {
9024 if res.Body != nil {
9025 res.Body.Close()
9026 }
9027 return nil, gensupport.WrapError(&googleapi.Error{
9028 Code: res.StatusCode,
9029 Header: res.Header,
9030 })
9031 }
9032 if err != nil {
9033 return nil, err
9034 }
9035 defer googleapi.CloseBody(res)
9036 if err := googleapi.CheckResponse(res); err != nil {
9037 return nil, gensupport.WrapError(err)
9038 }
9039 ret := &SasPortalOperation{
9040 ServerResponse: googleapi.ServerResponse{
9041 Header: res.Header,
9042 HTTPStatusCode: res.StatusCode,
9043 },
9044 }
9045 target := &ret
9046 b, err := gensupport.DecodeResponseBytes(target, res)
9047 if err != nil {
9048 return nil, err
9049 }
9050 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.move", "response", internallog.HTTPResponse(res, b))
9051 return ret, nil
9052 }
9053
9054 type NodesDevicesPatchCall struct {
9055 s *Service
9056 name string
9057 sasportaldevice *SasPortalDevice
9058 urlParams_ gensupport.URLParams
9059 ctx_ context.Context
9060 header_ http.Header
9061 }
9062
9063 // Patch: Updates a device.
9064 //
9065 // - name: Output only. The resource path name.
9066 func (r *NodesDevicesService) Patch(name string, sasportaldevice *SasPortalDevice) *NodesDevicesPatchCall {
9067 c := &NodesDevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9068 c.name = name
9069 c.sasportaldevice = sasportaldevice
9070 return c
9071 }
9072
9073 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
9074 func (c *NodesDevicesPatchCall) UpdateMask(updateMask string) *NodesDevicesPatchCall {
9075 c.urlParams_.Set("updateMask", updateMask)
9076 return c
9077 }
9078
9079 // Fields allows partial responses to be retrieved. See
9080 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9081 // details.
9082 func (c *NodesDevicesPatchCall) Fields(s ...googleapi.Field) *NodesDevicesPatchCall {
9083 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9084 return c
9085 }
9086
9087 // Context sets the context to be used in this call's Do method.
9088 func (c *NodesDevicesPatchCall) Context(ctx context.Context) *NodesDevicesPatchCall {
9089 c.ctx_ = ctx
9090 return c
9091 }
9092
9093 // Header returns a http.Header that can be modified by the caller to add
9094 // headers to the request.
9095 func (c *NodesDevicesPatchCall) Header() http.Header {
9096 if c.header_ == nil {
9097 c.header_ = make(http.Header)
9098 }
9099 return c.header_
9100 }
9101
9102 func (c *NodesDevicesPatchCall) doRequest(alt string) (*http.Response, error) {
9103 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9104 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
9105 if err != nil {
9106 return nil, err
9107 }
9108 c.urlParams_.Set("alt", alt)
9109 c.urlParams_.Set("prettyPrint", "false")
9110 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
9111 urls += "?" + c.urlParams_.Encode()
9112 req, err := http.NewRequest("PATCH", urls, body)
9113 if err != nil {
9114 return nil, err
9115 }
9116 req.Header = reqHeaders
9117 googleapi.Expand(req.URL, map[string]string{
9118 "name": c.name,
9119 })
9120 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9121 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9122 }
9123
9124 // Do executes the "prod_tt_sasportal.nodes.devices.patch" call.
9125 // Any non-2xx status code is an error. Response headers are in either
9126 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
9127 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9128 // check whether the returned error was because http.StatusNotModified was
9129 // returned.
9130 func (c *NodesDevicesPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
9131 gensupport.SetOptions(c.urlParams_, opts...)
9132 res, err := c.doRequest("json")
9133 if res != nil && res.StatusCode == http.StatusNotModified {
9134 if res.Body != nil {
9135 res.Body.Close()
9136 }
9137 return nil, gensupport.WrapError(&googleapi.Error{
9138 Code: res.StatusCode,
9139 Header: res.Header,
9140 })
9141 }
9142 if err != nil {
9143 return nil, err
9144 }
9145 defer googleapi.CloseBody(res)
9146 if err := googleapi.CheckResponse(res); err != nil {
9147 return nil, gensupport.WrapError(err)
9148 }
9149 ret := &SasPortalDevice{
9150 ServerResponse: googleapi.ServerResponse{
9151 Header: res.Header,
9152 HTTPStatusCode: res.StatusCode,
9153 },
9154 }
9155 target := &ret
9156 b, err := gensupport.DecodeResponseBytes(target, res)
9157 if err != nil {
9158 return nil, err
9159 }
9160 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.patch", "response", internallog.HTTPResponse(res, b))
9161 return ret, nil
9162 }
9163
9164 type NodesDevicesSignDeviceCall struct {
9165 s *Service
9166 name string
9167 sasportalsigndevicerequest *SasPortalSignDeviceRequest
9168 urlParams_ gensupport.URLParams
9169 ctx_ context.Context
9170 header_ http.Header
9171 }
9172
9173 // SignDevice: Signs a device.
9174 //
9175 // - name: Output only. The resource path name.
9176 func (r *NodesDevicesService) SignDevice(name string, sasportalsigndevicerequest *SasPortalSignDeviceRequest) *NodesDevicesSignDeviceCall {
9177 c := &NodesDevicesSignDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9178 c.name = name
9179 c.sasportalsigndevicerequest = sasportalsigndevicerequest
9180 return c
9181 }
9182
9183 // Fields allows partial responses to be retrieved. See
9184 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9185 // details.
9186 func (c *NodesDevicesSignDeviceCall) Fields(s ...googleapi.Field) *NodesDevicesSignDeviceCall {
9187 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9188 return c
9189 }
9190
9191 // Context sets the context to be used in this call's Do method.
9192 func (c *NodesDevicesSignDeviceCall) Context(ctx context.Context) *NodesDevicesSignDeviceCall {
9193 c.ctx_ = ctx
9194 return c
9195 }
9196
9197 // Header returns a http.Header that can be modified by the caller to add
9198 // headers to the request.
9199 func (c *NodesDevicesSignDeviceCall) Header() http.Header {
9200 if c.header_ == nil {
9201 c.header_ = make(http.Header)
9202 }
9203 return c.header_
9204 }
9205
9206 func (c *NodesDevicesSignDeviceCall) doRequest(alt string) (*http.Response, error) {
9207 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9208 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsigndevicerequest)
9209 if err != nil {
9210 return nil, err
9211 }
9212 c.urlParams_.Set("alt", alt)
9213 c.urlParams_.Set("prettyPrint", "false")
9214 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:signDevice")
9215 urls += "?" + c.urlParams_.Encode()
9216 req, err := http.NewRequest("POST", urls, body)
9217 if err != nil {
9218 return nil, err
9219 }
9220 req.Header = reqHeaders
9221 googleapi.Expand(req.URL, map[string]string{
9222 "name": c.name,
9223 })
9224 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.signDevice", "request", internallog.HTTPRequest(req, body.Bytes()))
9225 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9226 }
9227
9228 // Do executes the "prod_tt_sasportal.nodes.devices.signDevice" call.
9229 // Any non-2xx status code is an error. Response headers are in either
9230 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
9231 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9232 // whether the returned error was because http.StatusNotModified was returned.
9233 func (c *NodesDevicesSignDeviceCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
9234 gensupport.SetOptions(c.urlParams_, opts...)
9235 res, err := c.doRequest("json")
9236 if res != nil && res.StatusCode == http.StatusNotModified {
9237 if res.Body != nil {
9238 res.Body.Close()
9239 }
9240 return nil, gensupport.WrapError(&googleapi.Error{
9241 Code: res.StatusCode,
9242 Header: res.Header,
9243 })
9244 }
9245 if err != nil {
9246 return nil, err
9247 }
9248 defer googleapi.CloseBody(res)
9249 if err := googleapi.CheckResponse(res); err != nil {
9250 return nil, gensupport.WrapError(err)
9251 }
9252 ret := &SasPortalEmpty{
9253 ServerResponse: googleapi.ServerResponse{
9254 Header: res.Header,
9255 HTTPStatusCode: res.StatusCode,
9256 },
9257 }
9258 target := &ret
9259 b, err := gensupport.DecodeResponseBytes(target, res)
9260 if err != nil {
9261 return nil, err
9262 }
9263 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.signDevice", "response", internallog.HTTPResponse(res, b))
9264 return ret, nil
9265 }
9266
9267 type NodesDevicesUpdateSignedCall struct {
9268 s *Service
9269 name string
9270 sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest
9271 urlParams_ gensupport.URLParams
9272 ctx_ context.Context
9273 header_ http.Header
9274 }
9275
9276 // UpdateSigned: Updates a signed device.
9277 //
9278 // - name: The name of the device to update.
9279 func (r *NodesDevicesService) UpdateSigned(name string, sasportalupdatesigneddevicerequest *SasPortalUpdateSignedDeviceRequest) *NodesDevicesUpdateSignedCall {
9280 c := &NodesDevicesUpdateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9281 c.name = name
9282 c.sasportalupdatesigneddevicerequest = sasportalupdatesigneddevicerequest
9283 return c
9284 }
9285
9286 // Fields allows partial responses to be retrieved. See
9287 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9288 // details.
9289 func (c *NodesDevicesUpdateSignedCall) Fields(s ...googleapi.Field) *NodesDevicesUpdateSignedCall {
9290 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9291 return c
9292 }
9293
9294 // Context sets the context to be used in this call's Do method.
9295 func (c *NodesDevicesUpdateSignedCall) Context(ctx context.Context) *NodesDevicesUpdateSignedCall {
9296 c.ctx_ = ctx
9297 return c
9298 }
9299
9300 // Header returns a http.Header that can be modified by the caller to add
9301 // headers to the request.
9302 func (c *NodesDevicesUpdateSignedCall) Header() http.Header {
9303 if c.header_ == nil {
9304 c.header_ = make(http.Header)
9305 }
9306 return c.header_
9307 }
9308
9309 func (c *NodesDevicesUpdateSignedCall) doRequest(alt string) (*http.Response, error) {
9310 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9311 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalupdatesigneddevicerequest)
9312 if err != nil {
9313 return nil, err
9314 }
9315 c.urlParams_.Set("alt", alt)
9316 c.urlParams_.Set("prettyPrint", "false")
9317 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:updateSigned")
9318 urls += "?" + c.urlParams_.Encode()
9319 req, err := http.NewRequest("PATCH", urls, body)
9320 if err != nil {
9321 return nil, err
9322 }
9323 req.Header = reqHeaders
9324 googleapi.Expand(req.URL, map[string]string{
9325 "name": c.name,
9326 })
9327 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.updateSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
9328 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9329 }
9330
9331 // Do executes the "prod_tt_sasportal.nodes.devices.updateSigned" call.
9332 // Any non-2xx status code is an error. Response headers are in either
9333 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
9334 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9335 // check whether the returned error was because http.StatusNotModified was
9336 // returned.
9337 func (c *NodesDevicesUpdateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
9338 gensupport.SetOptions(c.urlParams_, opts...)
9339 res, err := c.doRequest("json")
9340 if res != nil && res.StatusCode == http.StatusNotModified {
9341 if res.Body != nil {
9342 res.Body.Close()
9343 }
9344 return nil, gensupport.WrapError(&googleapi.Error{
9345 Code: res.StatusCode,
9346 Header: res.Header,
9347 })
9348 }
9349 if err != nil {
9350 return nil, err
9351 }
9352 defer googleapi.CloseBody(res)
9353 if err := googleapi.CheckResponse(res); err != nil {
9354 return nil, gensupport.WrapError(err)
9355 }
9356 ret := &SasPortalDevice{
9357 ServerResponse: googleapi.ServerResponse{
9358 Header: res.Header,
9359 HTTPStatusCode: res.StatusCode,
9360 },
9361 }
9362 target := &ret
9363 b, err := gensupport.DecodeResponseBytes(target, res)
9364 if err != nil {
9365 return nil, err
9366 }
9367 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.devices.updateSigned", "response", internallog.HTTPResponse(res, b))
9368 return ret, nil
9369 }
9370
9371 type NodesNodesCreateCall struct {
9372 s *Service
9373 parent string
9374 sasportalnode *SasPortalNode
9375 urlParams_ gensupport.URLParams
9376 ctx_ context.Context
9377 header_ http.Header
9378 }
9379
9380 // Create: Creates a new node.
9381 //
9382 // - parent: The parent resource name where the node is to be created.
9383 func (r *NodesNodesService) Create(parent string, sasportalnode *SasPortalNode) *NodesNodesCreateCall {
9384 c := &NodesNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9385 c.parent = parent
9386 c.sasportalnode = sasportalnode
9387 return c
9388 }
9389
9390 // Fields allows partial responses to be retrieved. See
9391 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9392 // details.
9393 func (c *NodesNodesCreateCall) Fields(s ...googleapi.Field) *NodesNodesCreateCall {
9394 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9395 return c
9396 }
9397
9398 // Context sets the context to be used in this call's Do method.
9399 func (c *NodesNodesCreateCall) Context(ctx context.Context) *NodesNodesCreateCall {
9400 c.ctx_ = ctx
9401 return c
9402 }
9403
9404 // Header returns a http.Header that can be modified by the caller to add
9405 // headers to the request.
9406 func (c *NodesNodesCreateCall) Header() http.Header {
9407 if c.header_ == nil {
9408 c.header_ = make(http.Header)
9409 }
9410 return c.header_
9411 }
9412
9413 func (c *NodesNodesCreateCall) doRequest(alt string) (*http.Response, error) {
9414 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9415 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
9416 if err != nil {
9417 return nil, err
9418 }
9419 c.urlParams_.Set("alt", alt)
9420 c.urlParams_.Set("prettyPrint", "false")
9421 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
9422 urls += "?" + c.urlParams_.Encode()
9423 req, err := http.NewRequest("POST", urls, body)
9424 if err != nil {
9425 return nil, err
9426 }
9427 req.Header = reqHeaders
9428 googleapi.Expand(req.URL, map[string]string{
9429 "parent": c.parent,
9430 })
9431 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
9432 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9433 }
9434
9435 // Do executes the "prod_tt_sasportal.nodes.nodes.create" call.
9436 // Any non-2xx status code is an error. Response headers are in either
9437 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
9438 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9439 // whether the returned error was because http.StatusNotModified was returned.
9440 func (c *NodesNodesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
9441 gensupport.SetOptions(c.urlParams_, opts...)
9442 res, err := c.doRequest("json")
9443 if res != nil && res.StatusCode == http.StatusNotModified {
9444 if res.Body != nil {
9445 res.Body.Close()
9446 }
9447 return nil, gensupport.WrapError(&googleapi.Error{
9448 Code: res.StatusCode,
9449 Header: res.Header,
9450 })
9451 }
9452 if err != nil {
9453 return nil, err
9454 }
9455 defer googleapi.CloseBody(res)
9456 if err := googleapi.CheckResponse(res); err != nil {
9457 return nil, gensupport.WrapError(err)
9458 }
9459 ret := &SasPortalNode{
9460 ServerResponse: googleapi.ServerResponse{
9461 Header: res.Header,
9462 HTTPStatusCode: res.StatusCode,
9463 },
9464 }
9465 target := &ret
9466 b, err := gensupport.DecodeResponseBytes(target, res)
9467 if err != nil {
9468 return nil, err
9469 }
9470 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.create", "response", internallog.HTTPResponse(res, b))
9471 return ret, nil
9472 }
9473
9474 type NodesNodesDeleteCall struct {
9475 s *Service
9476 name string
9477 urlParams_ gensupport.URLParams
9478 ctx_ context.Context
9479 header_ http.Header
9480 }
9481
9482 // Delete: Deletes a node.
9483 //
9484 // - name: The name of the node.
9485 func (r *NodesNodesService) Delete(name string) *NodesNodesDeleteCall {
9486 c := &NodesNodesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9487 c.name = name
9488 return c
9489 }
9490
9491 // Fields allows partial responses to be retrieved. See
9492 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9493 // details.
9494 func (c *NodesNodesDeleteCall) Fields(s ...googleapi.Field) *NodesNodesDeleteCall {
9495 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9496 return c
9497 }
9498
9499 // Context sets the context to be used in this call's Do method.
9500 func (c *NodesNodesDeleteCall) Context(ctx context.Context) *NodesNodesDeleteCall {
9501 c.ctx_ = ctx
9502 return c
9503 }
9504
9505 // Header returns a http.Header that can be modified by the caller to add
9506 // headers to the request.
9507 func (c *NodesNodesDeleteCall) Header() http.Header {
9508 if c.header_ == nil {
9509 c.header_ = make(http.Header)
9510 }
9511 return c.header_
9512 }
9513
9514 func (c *NodesNodesDeleteCall) doRequest(alt string) (*http.Response, error) {
9515 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9516 c.urlParams_.Set("alt", alt)
9517 c.urlParams_.Set("prettyPrint", "false")
9518 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
9519 urls += "?" + c.urlParams_.Encode()
9520 req, err := http.NewRequest("DELETE", urls, nil)
9521 if err != nil {
9522 return nil, err
9523 }
9524 req.Header = reqHeaders
9525 googleapi.Expand(req.URL, map[string]string{
9526 "name": c.name,
9527 })
9528 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.delete", "request", internallog.HTTPRequest(req, nil))
9529 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9530 }
9531
9532 // Do executes the "prod_tt_sasportal.nodes.nodes.delete" call.
9533 // Any non-2xx status code is an error. Response headers are in either
9534 // *SasPortalEmpty.ServerResponse.Header or (if a response was returned at all)
9535 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9536 // whether the returned error was because http.StatusNotModified was returned.
9537 func (c *NodesNodesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
9538 gensupport.SetOptions(c.urlParams_, opts...)
9539 res, err := c.doRequest("json")
9540 if res != nil && res.StatusCode == http.StatusNotModified {
9541 if res.Body != nil {
9542 res.Body.Close()
9543 }
9544 return nil, gensupport.WrapError(&googleapi.Error{
9545 Code: res.StatusCode,
9546 Header: res.Header,
9547 })
9548 }
9549 if err != nil {
9550 return nil, err
9551 }
9552 defer googleapi.CloseBody(res)
9553 if err := googleapi.CheckResponse(res); err != nil {
9554 return nil, gensupport.WrapError(err)
9555 }
9556 ret := &SasPortalEmpty{
9557 ServerResponse: googleapi.ServerResponse{
9558 Header: res.Header,
9559 HTTPStatusCode: res.StatusCode,
9560 },
9561 }
9562 target := &ret
9563 b, err := gensupport.DecodeResponseBytes(target, res)
9564 if err != nil {
9565 return nil, err
9566 }
9567 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.delete", "response", internallog.HTTPResponse(res, b))
9568 return ret, nil
9569 }
9570
9571 type NodesNodesGetCall struct {
9572 s *Service
9573 name string
9574 urlParams_ gensupport.URLParams
9575 ifNoneMatch_ string
9576 ctx_ context.Context
9577 header_ http.Header
9578 }
9579
9580 // Get: Returns a requested node.
9581 //
9582 // - name: The name of the node.
9583 func (r *NodesNodesService) Get(name string) *NodesNodesGetCall {
9584 c := &NodesNodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9585 c.name = name
9586 return c
9587 }
9588
9589 // Fields allows partial responses to be retrieved. See
9590 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9591 // details.
9592 func (c *NodesNodesGetCall) Fields(s ...googleapi.Field) *NodesNodesGetCall {
9593 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9594 return c
9595 }
9596
9597 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9598 // object's ETag matches the given value. This is useful for getting updates
9599 // only after the object has changed since the last request.
9600 func (c *NodesNodesGetCall) IfNoneMatch(entityTag string) *NodesNodesGetCall {
9601 c.ifNoneMatch_ = entityTag
9602 return c
9603 }
9604
9605 // Context sets the context to be used in this call's Do method.
9606 func (c *NodesNodesGetCall) Context(ctx context.Context) *NodesNodesGetCall {
9607 c.ctx_ = ctx
9608 return c
9609 }
9610
9611 // Header returns a http.Header that can be modified by the caller to add
9612 // headers to the request.
9613 func (c *NodesNodesGetCall) Header() http.Header {
9614 if c.header_ == nil {
9615 c.header_ = make(http.Header)
9616 }
9617 return c.header_
9618 }
9619
9620 func (c *NodesNodesGetCall) doRequest(alt string) (*http.Response, error) {
9621 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9622 if c.ifNoneMatch_ != "" {
9623 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9624 }
9625 c.urlParams_.Set("alt", alt)
9626 c.urlParams_.Set("prettyPrint", "false")
9627 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
9628 urls += "?" + c.urlParams_.Encode()
9629 req, err := http.NewRequest("GET", urls, nil)
9630 if err != nil {
9631 return nil, err
9632 }
9633 req.Header = reqHeaders
9634 googleapi.Expand(req.URL, map[string]string{
9635 "name": c.name,
9636 })
9637 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.get", "request", internallog.HTTPRequest(req, nil))
9638 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9639 }
9640
9641 // Do executes the "prod_tt_sasportal.nodes.nodes.get" call.
9642 // Any non-2xx status code is an error. Response headers are in either
9643 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
9644 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9645 // whether the returned error was because http.StatusNotModified was returned.
9646 func (c *NodesNodesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
9647 gensupport.SetOptions(c.urlParams_, opts...)
9648 res, err := c.doRequest("json")
9649 if res != nil && res.StatusCode == http.StatusNotModified {
9650 if res.Body != nil {
9651 res.Body.Close()
9652 }
9653 return nil, gensupport.WrapError(&googleapi.Error{
9654 Code: res.StatusCode,
9655 Header: res.Header,
9656 })
9657 }
9658 if err != nil {
9659 return nil, err
9660 }
9661 defer googleapi.CloseBody(res)
9662 if err := googleapi.CheckResponse(res); err != nil {
9663 return nil, gensupport.WrapError(err)
9664 }
9665 ret := &SasPortalNode{
9666 ServerResponse: googleapi.ServerResponse{
9667 Header: res.Header,
9668 HTTPStatusCode: res.StatusCode,
9669 },
9670 }
9671 target := &ret
9672 b, err := gensupport.DecodeResponseBytes(target, res)
9673 if err != nil {
9674 return nil, err
9675 }
9676 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.get", "response", internallog.HTTPResponse(res, b))
9677 return ret, nil
9678 }
9679
9680 type NodesNodesListCall struct {
9681 s *Service
9682 parent string
9683 urlParams_ gensupport.URLParams
9684 ifNoneMatch_ string
9685 ctx_ context.Context
9686 header_ http.Header
9687 }
9688
9689 // List: Lists nodes.
9690 //
9691 // - parent: The parent resource name, for example, "nodes/1".
9692 func (r *NodesNodesService) List(parent string) *NodesNodesListCall {
9693 c := &NodesNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9694 c.parent = parent
9695 return c
9696 }
9697
9698 // Filter sets the optional parameter "filter": The filter expression. The
9699 // filter should have the following format: "DIRECT_CHILDREN" or format:
9700 // "direct_children". The filter is case insensitive. If empty, then no nodes
9701 // are filtered.
9702 func (c *NodesNodesListCall) Filter(filter string) *NodesNodesListCall {
9703 c.urlParams_.Set("filter", filter)
9704 return c
9705 }
9706
9707 // PageSize sets the optional parameter "pageSize": The maximum number of nodes
9708 // to return in the response.
9709 func (c *NodesNodesListCall) PageSize(pageSize int64) *NodesNodesListCall {
9710 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9711 return c
9712 }
9713
9714 // PageToken sets the optional parameter "pageToken": A pagination token
9715 // returned from a previous call to ListNodes that indicates where this listing
9716 // should continue from.
9717 func (c *NodesNodesListCall) PageToken(pageToken string) *NodesNodesListCall {
9718 c.urlParams_.Set("pageToken", pageToken)
9719 return c
9720 }
9721
9722 // Fields allows partial responses to be retrieved. See
9723 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9724 // details.
9725 func (c *NodesNodesListCall) Fields(s ...googleapi.Field) *NodesNodesListCall {
9726 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9727 return c
9728 }
9729
9730 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9731 // object's ETag matches the given value. This is useful for getting updates
9732 // only after the object has changed since the last request.
9733 func (c *NodesNodesListCall) IfNoneMatch(entityTag string) *NodesNodesListCall {
9734 c.ifNoneMatch_ = entityTag
9735 return c
9736 }
9737
9738 // Context sets the context to be used in this call's Do method.
9739 func (c *NodesNodesListCall) Context(ctx context.Context) *NodesNodesListCall {
9740 c.ctx_ = ctx
9741 return c
9742 }
9743
9744 // Header returns a http.Header that can be modified by the caller to add
9745 // headers to the request.
9746 func (c *NodesNodesListCall) Header() http.Header {
9747 if c.header_ == nil {
9748 c.header_ = make(http.Header)
9749 }
9750 return c.header_
9751 }
9752
9753 func (c *NodesNodesListCall) doRequest(alt string) (*http.Response, error) {
9754 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9755 if c.ifNoneMatch_ != "" {
9756 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9757 }
9758 c.urlParams_.Set("alt", alt)
9759 c.urlParams_.Set("prettyPrint", "false")
9760 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
9761 urls += "?" + c.urlParams_.Encode()
9762 req, err := http.NewRequest("GET", urls, nil)
9763 if err != nil {
9764 return nil, err
9765 }
9766 req.Header = reqHeaders
9767 googleapi.Expand(req.URL, map[string]string{
9768 "parent": c.parent,
9769 })
9770 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.list", "request", internallog.HTTPRequest(req, nil))
9771 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9772 }
9773
9774 // Do executes the "prod_tt_sasportal.nodes.nodes.list" call.
9775 // Any non-2xx status code is an error. Response headers are in either
9776 // *SasPortalListNodesResponse.ServerResponse.Header or (if a response was
9777 // returned at all) in error.(*googleapi.Error).Header. Use
9778 // googleapi.IsNotModified to check whether the returned error was because
9779 // http.StatusNotModified was returned.
9780 func (c *NodesNodesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListNodesResponse, error) {
9781 gensupport.SetOptions(c.urlParams_, opts...)
9782 res, err := c.doRequest("json")
9783 if res != nil && res.StatusCode == http.StatusNotModified {
9784 if res.Body != nil {
9785 res.Body.Close()
9786 }
9787 return nil, gensupport.WrapError(&googleapi.Error{
9788 Code: res.StatusCode,
9789 Header: res.Header,
9790 })
9791 }
9792 if err != nil {
9793 return nil, err
9794 }
9795 defer googleapi.CloseBody(res)
9796 if err := googleapi.CheckResponse(res); err != nil {
9797 return nil, gensupport.WrapError(err)
9798 }
9799 ret := &SasPortalListNodesResponse{
9800 ServerResponse: googleapi.ServerResponse{
9801 Header: res.Header,
9802 HTTPStatusCode: res.StatusCode,
9803 },
9804 }
9805 target := &ret
9806 b, err := gensupport.DecodeResponseBytes(target, res)
9807 if err != nil {
9808 return nil, err
9809 }
9810 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.list", "response", internallog.HTTPResponse(res, b))
9811 return ret, nil
9812 }
9813
9814 // Pages invokes f for each page of results.
9815 // A non-nil error returned from f will halt the iteration.
9816 // The provided context supersedes any context provided to the Context method.
9817 func (c *NodesNodesListCall) Pages(ctx context.Context, f func(*SasPortalListNodesResponse) error) error {
9818 c.ctx_ = ctx
9819 defer c.PageToken(c.urlParams_.Get("pageToken"))
9820 for {
9821 x, err := c.Do()
9822 if err != nil {
9823 return err
9824 }
9825 if err := f(x); err != nil {
9826 return err
9827 }
9828 if x.NextPageToken == "" {
9829 return nil
9830 }
9831 c.PageToken(x.NextPageToken)
9832 }
9833 }
9834
9835 type NodesNodesMoveCall struct {
9836 s *Service
9837 name string
9838 sasportalmovenoderequest *SasPortalMoveNodeRequest
9839 urlParams_ gensupport.URLParams
9840 ctx_ context.Context
9841 header_ http.Header
9842 }
9843
9844 // Move: Moves a node under another node or customer.
9845 //
9846 // - name: The name of the node to move.
9847 func (r *NodesNodesService) Move(name string, sasportalmovenoderequest *SasPortalMoveNodeRequest) *NodesNodesMoveCall {
9848 c := &NodesNodesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9849 c.name = name
9850 c.sasportalmovenoderequest = sasportalmovenoderequest
9851 return c
9852 }
9853
9854 // Fields allows partial responses to be retrieved. See
9855 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9856 // details.
9857 func (c *NodesNodesMoveCall) Fields(s ...googleapi.Field) *NodesNodesMoveCall {
9858 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9859 return c
9860 }
9861
9862 // Context sets the context to be used in this call's Do method.
9863 func (c *NodesNodesMoveCall) Context(ctx context.Context) *NodesNodesMoveCall {
9864 c.ctx_ = ctx
9865 return c
9866 }
9867
9868 // Header returns a http.Header that can be modified by the caller to add
9869 // headers to the request.
9870 func (c *NodesNodesMoveCall) Header() http.Header {
9871 if c.header_ == nil {
9872 c.header_ = make(http.Header)
9873 }
9874 return c.header_
9875 }
9876
9877 func (c *NodesNodesMoveCall) doRequest(alt string) (*http.Response, error) {
9878 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9879 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalmovenoderequest)
9880 if err != nil {
9881 return nil, err
9882 }
9883 c.urlParams_.Set("alt", alt)
9884 c.urlParams_.Set("prettyPrint", "false")
9885 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
9886 urls += "?" + c.urlParams_.Encode()
9887 req, err := http.NewRequest("POST", urls, body)
9888 if err != nil {
9889 return nil, err
9890 }
9891 req.Header = reqHeaders
9892 googleapi.Expand(req.URL, map[string]string{
9893 "name": c.name,
9894 })
9895 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.move", "request", internallog.HTTPRequest(req, body.Bytes()))
9896 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9897 }
9898
9899 // Do executes the "prod_tt_sasportal.nodes.nodes.move" call.
9900 // Any non-2xx status code is an error. Response headers are in either
9901 // *SasPortalOperation.ServerResponse.Header or (if a response was returned at
9902 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9903 // check whether the returned error was because http.StatusNotModified was
9904 // returned.
9905 func (c *NodesNodesMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
9906 gensupport.SetOptions(c.urlParams_, opts...)
9907 res, err := c.doRequest("json")
9908 if res != nil && res.StatusCode == http.StatusNotModified {
9909 if res.Body != nil {
9910 res.Body.Close()
9911 }
9912 return nil, gensupport.WrapError(&googleapi.Error{
9913 Code: res.StatusCode,
9914 Header: res.Header,
9915 })
9916 }
9917 if err != nil {
9918 return nil, err
9919 }
9920 defer googleapi.CloseBody(res)
9921 if err := googleapi.CheckResponse(res); err != nil {
9922 return nil, gensupport.WrapError(err)
9923 }
9924 ret := &SasPortalOperation{
9925 ServerResponse: googleapi.ServerResponse{
9926 Header: res.Header,
9927 HTTPStatusCode: res.StatusCode,
9928 },
9929 }
9930 target := &ret
9931 b, err := gensupport.DecodeResponseBytes(target, res)
9932 if err != nil {
9933 return nil, err
9934 }
9935 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.move", "response", internallog.HTTPResponse(res, b))
9936 return ret, nil
9937 }
9938
9939 type NodesNodesPatchCall struct {
9940 s *Service
9941 name string
9942 sasportalnode *SasPortalNode
9943 urlParams_ gensupport.URLParams
9944 ctx_ context.Context
9945 header_ http.Header
9946 }
9947
9948 // Patch: Updates an existing node.
9949 //
9950 // - name: Output only. Resource name.
9951 func (r *NodesNodesService) Patch(name string, sasportalnode *SasPortalNode) *NodesNodesPatchCall {
9952 c := &NodesNodesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9953 c.name = name
9954 c.sasportalnode = sasportalnode
9955 return c
9956 }
9957
9958 // UpdateMask sets the optional parameter "updateMask": Fields to be updated.
9959 func (c *NodesNodesPatchCall) UpdateMask(updateMask string) *NodesNodesPatchCall {
9960 c.urlParams_.Set("updateMask", updateMask)
9961 return c
9962 }
9963
9964 // Fields allows partial responses to be retrieved. See
9965 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9966 // details.
9967 func (c *NodesNodesPatchCall) Fields(s ...googleapi.Field) *NodesNodesPatchCall {
9968 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9969 return c
9970 }
9971
9972 // Context sets the context to be used in this call's Do method.
9973 func (c *NodesNodesPatchCall) Context(ctx context.Context) *NodesNodesPatchCall {
9974 c.ctx_ = ctx
9975 return c
9976 }
9977
9978 // Header returns a http.Header that can be modified by the caller to add
9979 // headers to the request.
9980 func (c *NodesNodesPatchCall) Header() http.Header {
9981 if c.header_ == nil {
9982 c.header_ = make(http.Header)
9983 }
9984 return c.header_
9985 }
9986
9987 func (c *NodesNodesPatchCall) doRequest(alt string) (*http.Response, error) {
9988 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9989 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
9990 if err != nil {
9991 return nil, err
9992 }
9993 c.urlParams_.Set("alt", alt)
9994 c.urlParams_.Set("prettyPrint", "false")
9995 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
9996 urls += "?" + c.urlParams_.Encode()
9997 req, err := http.NewRequest("PATCH", urls, body)
9998 if err != nil {
9999 return nil, err
10000 }
10001 req.Header = reqHeaders
10002 googleapi.Expand(req.URL, map[string]string{
10003 "name": c.name,
10004 })
10005 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
10006 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10007 }
10008
10009 // Do executes the "prod_tt_sasportal.nodes.nodes.patch" call.
10010 // Any non-2xx status code is an error. Response headers are in either
10011 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
10012 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10013 // whether the returned error was because http.StatusNotModified was returned.
10014 func (c *NodesNodesPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
10015 gensupport.SetOptions(c.urlParams_, opts...)
10016 res, err := c.doRequest("json")
10017 if res != nil && res.StatusCode == http.StatusNotModified {
10018 if res.Body != nil {
10019 res.Body.Close()
10020 }
10021 return nil, gensupport.WrapError(&googleapi.Error{
10022 Code: res.StatusCode,
10023 Header: res.Header,
10024 })
10025 }
10026 if err != nil {
10027 return nil, err
10028 }
10029 defer googleapi.CloseBody(res)
10030 if err := googleapi.CheckResponse(res); err != nil {
10031 return nil, gensupport.WrapError(err)
10032 }
10033 ret := &SasPortalNode{
10034 ServerResponse: googleapi.ServerResponse{
10035 Header: res.Header,
10036 HTTPStatusCode: res.StatusCode,
10037 },
10038 }
10039 target := &ret
10040 b, err := gensupport.DecodeResponseBytes(target, res)
10041 if err != nil {
10042 return nil, err
10043 }
10044 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.patch", "response", internallog.HTTPResponse(res, b))
10045 return ret, nil
10046 }
10047
10048 type NodesNodesDeploymentsCreateCall struct {
10049 s *Service
10050 parent string
10051 sasportaldeployment *SasPortalDeployment
10052 urlParams_ gensupport.URLParams
10053 ctx_ context.Context
10054 header_ http.Header
10055 }
10056
10057 // Create: Creates a new deployment.
10058 //
10059 // - parent: The parent resource name where the deployment is to be created.
10060 func (r *NodesNodesDeploymentsService) Create(parent string, sasportaldeployment *SasPortalDeployment) *NodesNodesDeploymentsCreateCall {
10061 c := &NodesNodesDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10062 c.parent = parent
10063 c.sasportaldeployment = sasportaldeployment
10064 return c
10065 }
10066
10067 // Fields allows partial responses to be retrieved. See
10068 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10069 // details.
10070 func (c *NodesNodesDeploymentsCreateCall) Fields(s ...googleapi.Field) *NodesNodesDeploymentsCreateCall {
10071 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10072 return c
10073 }
10074
10075 // Context sets the context to be used in this call's Do method.
10076 func (c *NodesNodesDeploymentsCreateCall) Context(ctx context.Context) *NodesNodesDeploymentsCreateCall {
10077 c.ctx_ = ctx
10078 return c
10079 }
10080
10081 // Header returns a http.Header that can be modified by the caller to add
10082 // headers to the request.
10083 func (c *NodesNodesDeploymentsCreateCall) Header() http.Header {
10084 if c.header_ == nil {
10085 c.header_ = make(http.Header)
10086 }
10087 return c.header_
10088 }
10089
10090 func (c *NodesNodesDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
10091 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10092 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldeployment)
10093 if err != nil {
10094 return nil, err
10095 }
10096 c.urlParams_.Set("alt", alt)
10097 c.urlParams_.Set("prettyPrint", "false")
10098 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
10099 urls += "?" + c.urlParams_.Encode()
10100 req, err := http.NewRequest("POST", urls, body)
10101 if err != nil {
10102 return nil, err
10103 }
10104 req.Header = reqHeaders
10105 googleapi.Expand(req.URL, map[string]string{
10106 "parent": c.parent,
10107 })
10108 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.deployments.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10109 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10110 }
10111
10112 // Do executes the "prod_tt_sasportal.nodes.nodes.deployments.create" call.
10113 // Any non-2xx status code is an error. Response headers are in either
10114 // *SasPortalDeployment.ServerResponse.Header or (if a response was returned at
10115 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10116 // check whether the returned error was because http.StatusNotModified was
10117 // returned.
10118 func (c *NodesNodesDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDeployment, error) {
10119 gensupport.SetOptions(c.urlParams_, opts...)
10120 res, err := c.doRequest("json")
10121 if res != nil && res.StatusCode == http.StatusNotModified {
10122 if res.Body != nil {
10123 res.Body.Close()
10124 }
10125 return nil, gensupport.WrapError(&googleapi.Error{
10126 Code: res.StatusCode,
10127 Header: res.Header,
10128 })
10129 }
10130 if err != nil {
10131 return nil, err
10132 }
10133 defer googleapi.CloseBody(res)
10134 if err := googleapi.CheckResponse(res); err != nil {
10135 return nil, gensupport.WrapError(err)
10136 }
10137 ret := &SasPortalDeployment{
10138 ServerResponse: googleapi.ServerResponse{
10139 Header: res.Header,
10140 HTTPStatusCode: res.StatusCode,
10141 },
10142 }
10143 target := &ret
10144 b, err := gensupport.DecodeResponseBytes(target, res)
10145 if err != nil {
10146 return nil, err
10147 }
10148 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.deployments.create", "response", internallog.HTTPResponse(res, b))
10149 return ret, nil
10150 }
10151
10152 type NodesNodesDeploymentsListCall struct {
10153 s *Service
10154 parent string
10155 urlParams_ gensupport.URLParams
10156 ifNoneMatch_ string
10157 ctx_ context.Context
10158 header_ http.Header
10159 }
10160
10161 // List: Lists deployments.
10162 //
10163 // - parent: The parent resource name, for example, "nodes/1",
10164 // customer/1/nodes/2.
10165 func (r *NodesNodesDeploymentsService) List(parent string) *NodesNodesDeploymentsListCall {
10166 c := &NodesNodesDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10167 c.parent = parent
10168 return c
10169 }
10170
10171 // Filter sets the optional parameter "filter": The filter expression. The
10172 // filter should have the following format: "DIRECT_CHILDREN" or format:
10173 // "direct_children". The filter is case insensitive. If empty, then no
10174 // deployments are filtered.
10175 func (c *NodesNodesDeploymentsListCall) Filter(filter string) *NodesNodesDeploymentsListCall {
10176 c.urlParams_.Set("filter", filter)
10177 return c
10178 }
10179
10180 // PageSize sets the optional parameter "pageSize": The maximum number of
10181 // deployments to return in the response.
10182 func (c *NodesNodesDeploymentsListCall) PageSize(pageSize int64) *NodesNodesDeploymentsListCall {
10183 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10184 return c
10185 }
10186
10187 // PageToken sets the optional parameter "pageToken": A pagination token
10188 // returned from a previous call to ListDeployments that indicates where this
10189 // listing should continue from.
10190 func (c *NodesNodesDeploymentsListCall) PageToken(pageToken string) *NodesNodesDeploymentsListCall {
10191 c.urlParams_.Set("pageToken", pageToken)
10192 return c
10193 }
10194
10195 // Fields allows partial responses to be retrieved. See
10196 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10197 // details.
10198 func (c *NodesNodesDeploymentsListCall) Fields(s ...googleapi.Field) *NodesNodesDeploymentsListCall {
10199 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10200 return c
10201 }
10202
10203 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10204 // object's ETag matches the given value. This is useful for getting updates
10205 // only after the object has changed since the last request.
10206 func (c *NodesNodesDeploymentsListCall) IfNoneMatch(entityTag string) *NodesNodesDeploymentsListCall {
10207 c.ifNoneMatch_ = entityTag
10208 return c
10209 }
10210
10211 // Context sets the context to be used in this call's Do method.
10212 func (c *NodesNodesDeploymentsListCall) Context(ctx context.Context) *NodesNodesDeploymentsListCall {
10213 c.ctx_ = ctx
10214 return c
10215 }
10216
10217 // Header returns a http.Header that can be modified by the caller to add
10218 // headers to the request.
10219 func (c *NodesNodesDeploymentsListCall) Header() http.Header {
10220 if c.header_ == nil {
10221 c.header_ = make(http.Header)
10222 }
10223 return c.header_
10224 }
10225
10226 func (c *NodesNodesDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
10227 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10228 if c.ifNoneMatch_ != "" {
10229 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10230 }
10231 c.urlParams_.Set("alt", alt)
10232 c.urlParams_.Set("prettyPrint", "false")
10233 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/deployments")
10234 urls += "?" + c.urlParams_.Encode()
10235 req, err := http.NewRequest("GET", urls, nil)
10236 if err != nil {
10237 return nil, err
10238 }
10239 req.Header = reqHeaders
10240 googleapi.Expand(req.URL, map[string]string{
10241 "parent": c.parent,
10242 })
10243 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.deployments.list", "request", internallog.HTTPRequest(req, nil))
10244 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10245 }
10246
10247 // Do executes the "prod_tt_sasportal.nodes.nodes.deployments.list" call.
10248 // Any non-2xx status code is an error. Response headers are in either
10249 // *SasPortalListDeploymentsResponse.ServerResponse.Header or (if a response
10250 // was returned at all) in error.(*googleapi.Error).Header. Use
10251 // googleapi.IsNotModified to check whether the returned error was because
10252 // http.StatusNotModified was returned.
10253 func (c *NodesNodesDeploymentsListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDeploymentsResponse, error) {
10254 gensupport.SetOptions(c.urlParams_, opts...)
10255 res, err := c.doRequest("json")
10256 if res != nil && res.StatusCode == http.StatusNotModified {
10257 if res.Body != nil {
10258 res.Body.Close()
10259 }
10260 return nil, gensupport.WrapError(&googleapi.Error{
10261 Code: res.StatusCode,
10262 Header: res.Header,
10263 })
10264 }
10265 if err != nil {
10266 return nil, err
10267 }
10268 defer googleapi.CloseBody(res)
10269 if err := googleapi.CheckResponse(res); err != nil {
10270 return nil, gensupport.WrapError(err)
10271 }
10272 ret := &SasPortalListDeploymentsResponse{
10273 ServerResponse: googleapi.ServerResponse{
10274 Header: res.Header,
10275 HTTPStatusCode: res.StatusCode,
10276 },
10277 }
10278 target := &ret
10279 b, err := gensupport.DecodeResponseBytes(target, res)
10280 if err != nil {
10281 return nil, err
10282 }
10283 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.deployments.list", "response", internallog.HTTPResponse(res, b))
10284 return ret, nil
10285 }
10286
10287 // Pages invokes f for each page of results.
10288 // A non-nil error returned from f will halt the iteration.
10289 // The provided context supersedes any context provided to the Context method.
10290 func (c *NodesNodesDeploymentsListCall) Pages(ctx context.Context, f func(*SasPortalListDeploymentsResponse) error) error {
10291 c.ctx_ = ctx
10292 defer c.PageToken(c.urlParams_.Get("pageToken"))
10293 for {
10294 x, err := c.Do()
10295 if err != nil {
10296 return err
10297 }
10298 if err := f(x); err != nil {
10299 return err
10300 }
10301 if x.NextPageToken == "" {
10302 return nil
10303 }
10304 c.PageToken(x.NextPageToken)
10305 }
10306 }
10307
10308 type NodesNodesDevicesCreateCall struct {
10309 s *Service
10310 parent string
10311 sasportaldevice *SasPortalDevice
10312 urlParams_ gensupport.URLParams
10313 ctx_ context.Context
10314 header_ http.Header
10315 }
10316
10317 // Create: Creates a device under a node or customer.
10318 //
10319 // - parent: The name of the parent resource.
10320 func (r *NodesNodesDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *NodesNodesDevicesCreateCall {
10321 c := &NodesNodesDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10322 c.parent = parent
10323 c.sasportaldevice = sasportaldevice
10324 return c
10325 }
10326
10327 // Fields allows partial responses to be retrieved. See
10328 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10329 // details.
10330 func (c *NodesNodesDevicesCreateCall) Fields(s ...googleapi.Field) *NodesNodesDevicesCreateCall {
10331 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10332 return c
10333 }
10334
10335 // Context sets the context to be used in this call's Do method.
10336 func (c *NodesNodesDevicesCreateCall) Context(ctx context.Context) *NodesNodesDevicesCreateCall {
10337 c.ctx_ = ctx
10338 return c
10339 }
10340
10341 // Header returns a http.Header that can be modified by the caller to add
10342 // headers to the request.
10343 func (c *NodesNodesDevicesCreateCall) Header() http.Header {
10344 if c.header_ == nil {
10345 c.header_ = make(http.Header)
10346 }
10347 return c.header_
10348 }
10349
10350 func (c *NodesNodesDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
10351 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10352 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaldevice)
10353 if err != nil {
10354 return nil, err
10355 }
10356 c.urlParams_.Set("alt", alt)
10357 c.urlParams_.Set("prettyPrint", "false")
10358 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
10359 urls += "?" + c.urlParams_.Encode()
10360 req, err := http.NewRequest("POST", urls, body)
10361 if err != nil {
10362 return nil, err
10363 }
10364 req.Header = reqHeaders
10365 googleapi.Expand(req.URL, map[string]string{
10366 "parent": c.parent,
10367 })
10368 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10369 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10370 }
10371
10372 // Do executes the "prod_tt_sasportal.nodes.nodes.devices.create" call.
10373 // Any non-2xx status code is an error. Response headers are in either
10374 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
10375 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10376 // check whether the returned error was because http.StatusNotModified was
10377 // returned.
10378 func (c *NodesNodesDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
10379 gensupport.SetOptions(c.urlParams_, opts...)
10380 res, err := c.doRequest("json")
10381 if res != nil && res.StatusCode == http.StatusNotModified {
10382 if res.Body != nil {
10383 res.Body.Close()
10384 }
10385 return nil, gensupport.WrapError(&googleapi.Error{
10386 Code: res.StatusCode,
10387 Header: res.Header,
10388 })
10389 }
10390 if err != nil {
10391 return nil, err
10392 }
10393 defer googleapi.CloseBody(res)
10394 if err := googleapi.CheckResponse(res); err != nil {
10395 return nil, gensupport.WrapError(err)
10396 }
10397 ret := &SasPortalDevice{
10398 ServerResponse: googleapi.ServerResponse{
10399 Header: res.Header,
10400 HTTPStatusCode: res.StatusCode,
10401 },
10402 }
10403 target := &ret
10404 b, err := gensupport.DecodeResponseBytes(target, res)
10405 if err != nil {
10406 return nil, err
10407 }
10408 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.create", "response", internallog.HTTPResponse(res, b))
10409 return ret, nil
10410 }
10411
10412 type NodesNodesDevicesCreateSignedCall struct {
10413 s *Service
10414 parent string
10415 sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
10416 urlParams_ gensupport.URLParams
10417 ctx_ context.Context
10418 header_ http.Header
10419 }
10420
10421 // CreateSigned: Creates a signed device under a node or customer.
10422 //
10423 // - parent: The name of the parent resource.
10424 func (r *NodesNodesDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *NodesNodesDevicesCreateSignedCall {
10425 c := &NodesNodesDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10426 c.parent = parent
10427 c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
10428 return c
10429 }
10430
10431 // Fields allows partial responses to be retrieved. See
10432 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10433 // details.
10434 func (c *NodesNodesDevicesCreateSignedCall) Fields(s ...googleapi.Field) *NodesNodesDevicesCreateSignedCall {
10435 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10436 return c
10437 }
10438
10439 // Context sets the context to be used in this call's Do method.
10440 func (c *NodesNodesDevicesCreateSignedCall) Context(ctx context.Context) *NodesNodesDevicesCreateSignedCall {
10441 c.ctx_ = ctx
10442 return c
10443 }
10444
10445 // Header returns a http.Header that can be modified by the caller to add
10446 // headers to the request.
10447 func (c *NodesNodesDevicesCreateSignedCall) Header() http.Header {
10448 if c.header_ == nil {
10449 c.header_ = make(http.Header)
10450 }
10451 return c.header_
10452 }
10453
10454 func (c *NodesNodesDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
10455 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10456 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalcreatesigneddevicerequest)
10457 if err != nil {
10458 return nil, err
10459 }
10460 c.urlParams_.Set("alt", alt)
10461 c.urlParams_.Set("prettyPrint", "false")
10462 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
10463 urls += "?" + c.urlParams_.Encode()
10464 req, err := http.NewRequest("POST", urls, body)
10465 if err != nil {
10466 return nil, err
10467 }
10468 req.Header = reqHeaders
10469 googleapi.Expand(req.URL, map[string]string{
10470 "parent": c.parent,
10471 })
10472 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.createSigned", "request", internallog.HTTPRequest(req, body.Bytes()))
10473 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10474 }
10475
10476 // Do executes the "prod_tt_sasportal.nodes.nodes.devices.createSigned" call.
10477 // Any non-2xx status code is an error. Response headers are in either
10478 // *SasPortalDevice.ServerResponse.Header or (if a response was returned at
10479 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10480 // check whether the returned error was because http.StatusNotModified was
10481 // returned.
10482 func (c *NodesNodesDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
10483 gensupport.SetOptions(c.urlParams_, opts...)
10484 res, err := c.doRequest("json")
10485 if res != nil && res.StatusCode == http.StatusNotModified {
10486 if res.Body != nil {
10487 res.Body.Close()
10488 }
10489 return nil, gensupport.WrapError(&googleapi.Error{
10490 Code: res.StatusCode,
10491 Header: res.Header,
10492 })
10493 }
10494 if err != nil {
10495 return nil, err
10496 }
10497 defer googleapi.CloseBody(res)
10498 if err := googleapi.CheckResponse(res); err != nil {
10499 return nil, gensupport.WrapError(err)
10500 }
10501 ret := &SasPortalDevice{
10502 ServerResponse: googleapi.ServerResponse{
10503 Header: res.Header,
10504 HTTPStatusCode: res.StatusCode,
10505 },
10506 }
10507 target := &ret
10508 b, err := gensupport.DecodeResponseBytes(target, res)
10509 if err != nil {
10510 return nil, err
10511 }
10512 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.createSigned", "response", internallog.HTTPResponse(res, b))
10513 return ret, nil
10514 }
10515
10516 type NodesNodesDevicesListCall struct {
10517 s *Service
10518 parent string
10519 urlParams_ gensupport.URLParams
10520 ifNoneMatch_ string
10521 ctx_ context.Context
10522 header_ http.Header
10523 }
10524
10525 // List: Lists devices under a node or customer.
10526 //
10527 // - parent: The name of the parent resource.
10528 func (r *NodesNodesDevicesService) List(parent string) *NodesNodesDevicesListCall {
10529 c := &NodesNodesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10530 c.parent = parent
10531 return c
10532 }
10533
10534 // Filter sets the optional parameter "filter": The filter expression. The
10535 // filter should have one of the following formats: "sn=123454" or
10536 // "display_name=MyDevice". sn corresponds to serial number of the device. The
10537 // filter is case insensitive.
10538 func (c *NodesNodesDevicesListCall) Filter(filter string) *NodesNodesDevicesListCall {
10539 c.urlParams_.Set("filter", filter)
10540 return c
10541 }
10542
10543 // PageSize sets the optional parameter "pageSize": The maximum number of
10544 // devices to return in the response. If empty or zero, all devices will be
10545 // listed. Must be in the range [0, 1000].
10546 func (c *NodesNodesDevicesListCall) PageSize(pageSize int64) *NodesNodesDevicesListCall {
10547 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10548 return c
10549 }
10550
10551 // PageToken sets the optional parameter "pageToken": A pagination token
10552 // returned from a previous call to ListDevices that indicates where this
10553 // listing should continue from.
10554 func (c *NodesNodesDevicesListCall) PageToken(pageToken string) *NodesNodesDevicesListCall {
10555 c.urlParams_.Set("pageToken", pageToken)
10556 return c
10557 }
10558
10559 // Fields allows partial responses to be retrieved. See
10560 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10561 // details.
10562 func (c *NodesNodesDevicesListCall) Fields(s ...googleapi.Field) *NodesNodesDevicesListCall {
10563 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10564 return c
10565 }
10566
10567 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10568 // object's ETag matches the given value. This is useful for getting updates
10569 // only after the object has changed since the last request.
10570 func (c *NodesNodesDevicesListCall) IfNoneMatch(entityTag string) *NodesNodesDevicesListCall {
10571 c.ifNoneMatch_ = entityTag
10572 return c
10573 }
10574
10575 // Context sets the context to be used in this call's Do method.
10576 func (c *NodesNodesDevicesListCall) Context(ctx context.Context) *NodesNodesDevicesListCall {
10577 c.ctx_ = ctx
10578 return c
10579 }
10580
10581 // Header returns a http.Header that can be modified by the caller to add
10582 // headers to the request.
10583 func (c *NodesNodesDevicesListCall) Header() http.Header {
10584 if c.header_ == nil {
10585 c.header_ = make(http.Header)
10586 }
10587 return c.header_
10588 }
10589
10590 func (c *NodesNodesDevicesListCall) doRequest(alt string) (*http.Response, error) {
10591 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10592 if c.ifNoneMatch_ != "" {
10593 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10594 }
10595 c.urlParams_.Set("alt", alt)
10596 c.urlParams_.Set("prettyPrint", "false")
10597 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
10598 urls += "?" + c.urlParams_.Encode()
10599 req, err := http.NewRequest("GET", urls, nil)
10600 if err != nil {
10601 return nil, err
10602 }
10603 req.Header = reqHeaders
10604 googleapi.Expand(req.URL, map[string]string{
10605 "parent": c.parent,
10606 })
10607 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.list", "request", internallog.HTTPRequest(req, nil))
10608 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10609 }
10610
10611 // Do executes the "prod_tt_sasportal.nodes.nodes.devices.list" call.
10612 // Any non-2xx status code is an error. Response headers are in either
10613 // *SasPortalListDevicesResponse.ServerResponse.Header or (if a response was
10614 // returned at all) in error.(*googleapi.Error).Header. Use
10615 // googleapi.IsNotModified to check whether the returned error was because
10616 // http.StatusNotModified was returned.
10617 func (c *NodesNodesDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
10618 gensupport.SetOptions(c.urlParams_, opts...)
10619 res, err := c.doRequest("json")
10620 if res != nil && res.StatusCode == http.StatusNotModified {
10621 if res.Body != nil {
10622 res.Body.Close()
10623 }
10624 return nil, gensupport.WrapError(&googleapi.Error{
10625 Code: res.StatusCode,
10626 Header: res.Header,
10627 })
10628 }
10629 if err != nil {
10630 return nil, err
10631 }
10632 defer googleapi.CloseBody(res)
10633 if err := googleapi.CheckResponse(res); err != nil {
10634 return nil, gensupport.WrapError(err)
10635 }
10636 ret := &SasPortalListDevicesResponse{
10637 ServerResponse: googleapi.ServerResponse{
10638 Header: res.Header,
10639 HTTPStatusCode: res.StatusCode,
10640 },
10641 }
10642 target := &ret
10643 b, err := gensupport.DecodeResponseBytes(target, res)
10644 if err != nil {
10645 return nil, err
10646 }
10647 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.devices.list", "response", internallog.HTTPResponse(res, b))
10648 return ret, nil
10649 }
10650
10651 // Pages invokes f for each page of results.
10652 // A non-nil error returned from f will halt the iteration.
10653 // The provided context supersedes any context provided to the Context method.
10654 func (c *NodesNodesDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
10655 c.ctx_ = ctx
10656 defer c.PageToken(c.urlParams_.Get("pageToken"))
10657 for {
10658 x, err := c.Do()
10659 if err != nil {
10660 return err
10661 }
10662 if err := f(x); err != nil {
10663 return err
10664 }
10665 if x.NextPageToken == "" {
10666 return nil
10667 }
10668 c.PageToken(x.NextPageToken)
10669 }
10670 }
10671
10672 type NodesNodesNodesCreateCall struct {
10673 s *Service
10674 parent string
10675 sasportalnode *SasPortalNode
10676 urlParams_ gensupport.URLParams
10677 ctx_ context.Context
10678 header_ http.Header
10679 }
10680
10681 // Create: Creates a new node.
10682 //
10683 // - parent: The parent resource name where the node is to be created.
10684 func (r *NodesNodesNodesService) Create(parent string, sasportalnode *SasPortalNode) *NodesNodesNodesCreateCall {
10685 c := &NodesNodesNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10686 c.parent = parent
10687 c.sasportalnode = sasportalnode
10688 return c
10689 }
10690
10691 // Fields allows partial responses to be retrieved. See
10692 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10693 // details.
10694 func (c *NodesNodesNodesCreateCall) Fields(s ...googleapi.Field) *NodesNodesNodesCreateCall {
10695 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10696 return c
10697 }
10698
10699 // Context sets the context to be used in this call's Do method.
10700 func (c *NodesNodesNodesCreateCall) Context(ctx context.Context) *NodesNodesNodesCreateCall {
10701 c.ctx_ = ctx
10702 return c
10703 }
10704
10705 // Header returns a http.Header that can be modified by the caller to add
10706 // headers to the request.
10707 func (c *NodesNodesNodesCreateCall) Header() http.Header {
10708 if c.header_ == nil {
10709 c.header_ = make(http.Header)
10710 }
10711 return c.header_
10712 }
10713
10714 func (c *NodesNodesNodesCreateCall) doRequest(alt string) (*http.Response, error) {
10715 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10716 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalnode)
10717 if err != nil {
10718 return nil, err
10719 }
10720 c.urlParams_.Set("alt", alt)
10721 c.urlParams_.Set("prettyPrint", "false")
10722 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
10723 urls += "?" + c.urlParams_.Encode()
10724 req, err := http.NewRequest("POST", urls, body)
10725 if err != nil {
10726 return nil, err
10727 }
10728 req.Header = reqHeaders
10729 googleapi.Expand(req.URL, map[string]string{
10730 "parent": c.parent,
10731 })
10732 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.nodes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10733 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10734 }
10735
10736 // Do executes the "prod_tt_sasportal.nodes.nodes.nodes.create" call.
10737 // Any non-2xx status code is an error. Response headers are in either
10738 // *SasPortalNode.ServerResponse.Header or (if a response was returned at all)
10739 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10740 // whether the returned error was because http.StatusNotModified was returned.
10741 func (c *NodesNodesNodesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalNode, error) {
10742 gensupport.SetOptions(c.urlParams_, opts...)
10743 res, err := c.doRequest("json")
10744 if res != nil && res.StatusCode == http.StatusNotModified {
10745 if res.Body != nil {
10746 res.Body.Close()
10747 }
10748 return nil, gensupport.WrapError(&googleapi.Error{
10749 Code: res.StatusCode,
10750 Header: res.Header,
10751 })
10752 }
10753 if err != nil {
10754 return nil, err
10755 }
10756 defer googleapi.CloseBody(res)
10757 if err := googleapi.CheckResponse(res); err != nil {
10758 return nil, gensupport.WrapError(err)
10759 }
10760 ret := &SasPortalNode{
10761 ServerResponse: googleapi.ServerResponse{
10762 Header: res.Header,
10763 HTTPStatusCode: res.StatusCode,
10764 },
10765 }
10766 target := &ret
10767 b, err := gensupport.DecodeResponseBytes(target, res)
10768 if err != nil {
10769 return nil, err
10770 }
10771 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.nodes.create", "response", internallog.HTTPResponse(res, b))
10772 return ret, nil
10773 }
10774
10775 type NodesNodesNodesListCall struct {
10776 s *Service
10777 parent string
10778 urlParams_ gensupport.URLParams
10779 ifNoneMatch_ string
10780 ctx_ context.Context
10781 header_ http.Header
10782 }
10783
10784 // List: Lists nodes.
10785 //
10786 // - parent: The parent resource name, for example, "nodes/1".
10787 func (r *NodesNodesNodesService) List(parent string) *NodesNodesNodesListCall {
10788 c := &NodesNodesNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10789 c.parent = parent
10790 return c
10791 }
10792
10793 // Filter sets the optional parameter "filter": The filter expression. The
10794 // filter should have the following format: "DIRECT_CHILDREN" or format:
10795 // "direct_children". The filter is case insensitive. If empty, then no nodes
10796 // are filtered.
10797 func (c *NodesNodesNodesListCall) Filter(filter string) *NodesNodesNodesListCall {
10798 c.urlParams_.Set("filter", filter)
10799 return c
10800 }
10801
10802 // PageSize sets the optional parameter "pageSize": The maximum number of nodes
10803 // to return in the response.
10804 func (c *NodesNodesNodesListCall) PageSize(pageSize int64) *NodesNodesNodesListCall {
10805 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10806 return c
10807 }
10808
10809 // PageToken sets the optional parameter "pageToken": A pagination token
10810 // returned from a previous call to ListNodes that indicates where this listing
10811 // should continue from.
10812 func (c *NodesNodesNodesListCall) PageToken(pageToken string) *NodesNodesNodesListCall {
10813 c.urlParams_.Set("pageToken", pageToken)
10814 return c
10815 }
10816
10817 // Fields allows partial responses to be retrieved. See
10818 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10819 // details.
10820 func (c *NodesNodesNodesListCall) Fields(s ...googleapi.Field) *NodesNodesNodesListCall {
10821 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10822 return c
10823 }
10824
10825 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10826 // object's ETag matches the given value. This is useful for getting updates
10827 // only after the object has changed since the last request.
10828 func (c *NodesNodesNodesListCall) IfNoneMatch(entityTag string) *NodesNodesNodesListCall {
10829 c.ifNoneMatch_ = entityTag
10830 return c
10831 }
10832
10833 // Context sets the context to be used in this call's Do method.
10834 func (c *NodesNodesNodesListCall) Context(ctx context.Context) *NodesNodesNodesListCall {
10835 c.ctx_ = ctx
10836 return c
10837 }
10838
10839 // Header returns a http.Header that can be modified by the caller to add
10840 // headers to the request.
10841 func (c *NodesNodesNodesListCall) Header() http.Header {
10842 if c.header_ == nil {
10843 c.header_ = make(http.Header)
10844 }
10845 return c.header_
10846 }
10847
10848 func (c *NodesNodesNodesListCall) doRequest(alt string) (*http.Response, error) {
10849 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10850 if c.ifNoneMatch_ != "" {
10851 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10852 }
10853 c.urlParams_.Set("alt", alt)
10854 c.urlParams_.Set("prettyPrint", "false")
10855 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
10856 urls += "?" + c.urlParams_.Encode()
10857 req, err := http.NewRequest("GET", urls, nil)
10858 if err != nil {
10859 return nil, err
10860 }
10861 req.Header = reqHeaders
10862 googleapi.Expand(req.URL, map[string]string{
10863 "parent": c.parent,
10864 })
10865 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.nodes.list", "request", internallog.HTTPRequest(req, nil))
10866 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10867 }
10868
10869 // Do executes the "prod_tt_sasportal.nodes.nodes.nodes.list" call.
10870 // Any non-2xx status code is an error. Response headers are in either
10871 // *SasPortalListNodesResponse.ServerResponse.Header or (if a response was
10872 // returned at all) in error.(*googleapi.Error).Header. Use
10873 // googleapi.IsNotModified to check whether the returned error was because
10874 // http.StatusNotModified was returned.
10875 func (c *NodesNodesNodesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListNodesResponse, error) {
10876 gensupport.SetOptions(c.urlParams_, opts...)
10877 res, err := c.doRequest("json")
10878 if res != nil && res.StatusCode == http.StatusNotModified {
10879 if res.Body != nil {
10880 res.Body.Close()
10881 }
10882 return nil, gensupport.WrapError(&googleapi.Error{
10883 Code: res.StatusCode,
10884 Header: res.Header,
10885 })
10886 }
10887 if err != nil {
10888 return nil, err
10889 }
10890 defer googleapi.CloseBody(res)
10891 if err := googleapi.CheckResponse(res); err != nil {
10892 return nil, gensupport.WrapError(err)
10893 }
10894 ret := &SasPortalListNodesResponse{
10895 ServerResponse: googleapi.ServerResponse{
10896 Header: res.Header,
10897 HTTPStatusCode: res.StatusCode,
10898 },
10899 }
10900 target := &ret
10901 b, err := gensupport.DecodeResponseBytes(target, res)
10902 if err != nil {
10903 return nil, err
10904 }
10905 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.nodes.nodes.nodes.list", "response", internallog.HTTPResponse(res, b))
10906 return ret, nil
10907 }
10908
10909 // Pages invokes f for each page of results.
10910 // A non-nil error returned from f will halt the iteration.
10911 // The provided context supersedes any context provided to the Context method.
10912 func (c *NodesNodesNodesListCall) Pages(ctx context.Context, f func(*SasPortalListNodesResponse) error) error {
10913 c.ctx_ = ctx
10914 defer c.PageToken(c.urlParams_.Get("pageToken"))
10915 for {
10916 x, err := c.Do()
10917 if err != nil {
10918 return err
10919 }
10920 if err := f(x); err != nil {
10921 return err
10922 }
10923 if x.NextPageToken == "" {
10924 return nil
10925 }
10926 c.PageToken(x.NextPageToken)
10927 }
10928 }
10929
10930 type PoliciesGetCall struct {
10931 s *Service
10932 sasportalgetpolicyrequest *SasPortalGetPolicyRequest
10933 urlParams_ gensupport.URLParams
10934 ctx_ context.Context
10935 header_ http.Header
10936 }
10937
10938 // Get: Gets the access control policy for a resource. Returns an empty policy
10939 // if the resource exists and does not have a policy set.
10940 func (r *PoliciesService) Get(sasportalgetpolicyrequest *SasPortalGetPolicyRequest) *PoliciesGetCall {
10941 c := &PoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10942 c.sasportalgetpolicyrequest = sasportalgetpolicyrequest
10943 return c
10944 }
10945
10946 // Fields allows partial responses to be retrieved. See
10947 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10948 // details.
10949 func (c *PoliciesGetCall) Fields(s ...googleapi.Field) *PoliciesGetCall {
10950 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10951 return c
10952 }
10953
10954 // Context sets the context to be used in this call's Do method.
10955 func (c *PoliciesGetCall) Context(ctx context.Context) *PoliciesGetCall {
10956 c.ctx_ = ctx
10957 return c
10958 }
10959
10960 // Header returns a http.Header that can be modified by the caller to add
10961 // headers to the request.
10962 func (c *PoliciesGetCall) Header() http.Header {
10963 if c.header_ == nil {
10964 c.header_ = make(http.Header)
10965 }
10966 return c.header_
10967 }
10968
10969 func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) {
10970 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10971 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalgetpolicyrequest)
10972 if err != nil {
10973 return nil, err
10974 }
10975 c.urlParams_.Set("alt", alt)
10976 c.urlParams_.Set("prettyPrint", "false")
10977 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/policies:get")
10978 urls += "?" + c.urlParams_.Encode()
10979 req, err := http.NewRequest("POST", urls, body)
10980 if err != nil {
10981 return nil, err
10982 }
10983 req.Header = reqHeaders
10984 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.get", "request", internallog.HTTPRequest(req, body.Bytes()))
10985 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10986 }
10987
10988 // Do executes the "prod_tt_sasportal.policies.get" call.
10989 // Any non-2xx status code is an error. Response headers are in either
10990 // *SasPortalPolicy.ServerResponse.Header or (if a response was returned at
10991 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10992 // check whether the returned error was because http.StatusNotModified was
10993 // returned.
10994 func (c *PoliciesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalPolicy, error) {
10995 gensupport.SetOptions(c.urlParams_, opts...)
10996 res, err := c.doRequest("json")
10997 if res != nil && res.StatusCode == http.StatusNotModified {
10998 if res.Body != nil {
10999 res.Body.Close()
11000 }
11001 return nil, gensupport.WrapError(&googleapi.Error{
11002 Code: res.StatusCode,
11003 Header: res.Header,
11004 })
11005 }
11006 if err != nil {
11007 return nil, err
11008 }
11009 defer googleapi.CloseBody(res)
11010 if err := googleapi.CheckResponse(res); err != nil {
11011 return nil, gensupport.WrapError(err)
11012 }
11013 ret := &SasPortalPolicy{
11014 ServerResponse: googleapi.ServerResponse{
11015 Header: res.Header,
11016 HTTPStatusCode: res.StatusCode,
11017 },
11018 }
11019 target := &ret
11020 b, err := gensupport.DecodeResponseBytes(target, res)
11021 if err != nil {
11022 return nil, err
11023 }
11024 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.get", "response", internallog.HTTPResponse(res, b))
11025 return ret, nil
11026 }
11027
11028 type PoliciesSetCall struct {
11029 s *Service
11030 sasportalsetpolicyrequest *SasPortalSetPolicyRequest
11031 urlParams_ gensupport.URLParams
11032 ctx_ context.Context
11033 header_ http.Header
11034 }
11035
11036 // Set: Sets the access control policy on the specified resource. Replaces any
11037 // existing policy.
11038 func (r *PoliciesService) Set(sasportalsetpolicyrequest *SasPortalSetPolicyRequest) *PoliciesSetCall {
11039 c := &PoliciesSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11040 c.sasportalsetpolicyrequest = sasportalsetpolicyrequest
11041 return c
11042 }
11043
11044 // Fields allows partial responses to be retrieved. See
11045 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11046 // details.
11047 func (c *PoliciesSetCall) Fields(s ...googleapi.Field) *PoliciesSetCall {
11048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11049 return c
11050 }
11051
11052 // Context sets the context to be used in this call's Do method.
11053 func (c *PoliciesSetCall) Context(ctx context.Context) *PoliciesSetCall {
11054 c.ctx_ = ctx
11055 return c
11056 }
11057
11058 // Header returns a http.Header that can be modified by the caller to add
11059 // headers to the request.
11060 func (c *PoliciesSetCall) Header() http.Header {
11061 if c.header_ == nil {
11062 c.header_ = make(http.Header)
11063 }
11064 return c.header_
11065 }
11066
11067 func (c *PoliciesSetCall) doRequest(alt string) (*http.Response, error) {
11068 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11069 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportalsetpolicyrequest)
11070 if err != nil {
11071 return nil, err
11072 }
11073 c.urlParams_.Set("alt", alt)
11074 c.urlParams_.Set("prettyPrint", "false")
11075 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/policies:set")
11076 urls += "?" + c.urlParams_.Encode()
11077 req, err := http.NewRequest("POST", urls, body)
11078 if err != nil {
11079 return nil, err
11080 }
11081 req.Header = reqHeaders
11082 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.set", "request", internallog.HTTPRequest(req, body.Bytes()))
11083 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11084 }
11085
11086 // Do executes the "prod_tt_sasportal.policies.set" call.
11087 // Any non-2xx status code is an error. Response headers are in either
11088 // *SasPortalPolicy.ServerResponse.Header or (if a response was returned at
11089 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11090 // check whether the returned error was because http.StatusNotModified was
11091 // returned.
11092 func (c *PoliciesSetCall) Do(opts ...googleapi.CallOption) (*SasPortalPolicy, error) {
11093 gensupport.SetOptions(c.urlParams_, opts...)
11094 res, err := c.doRequest("json")
11095 if res != nil && res.StatusCode == http.StatusNotModified {
11096 if res.Body != nil {
11097 res.Body.Close()
11098 }
11099 return nil, gensupport.WrapError(&googleapi.Error{
11100 Code: res.StatusCode,
11101 Header: res.Header,
11102 })
11103 }
11104 if err != nil {
11105 return nil, err
11106 }
11107 defer googleapi.CloseBody(res)
11108 if err := googleapi.CheckResponse(res); err != nil {
11109 return nil, gensupport.WrapError(err)
11110 }
11111 ret := &SasPortalPolicy{
11112 ServerResponse: googleapi.ServerResponse{
11113 Header: res.Header,
11114 HTTPStatusCode: res.StatusCode,
11115 },
11116 }
11117 target := &ret
11118 b, err := gensupport.DecodeResponseBytes(target, res)
11119 if err != nil {
11120 return nil, err
11121 }
11122 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.set", "response", internallog.HTTPResponse(res, b))
11123 return ret, nil
11124 }
11125
11126 type PoliciesTestCall struct {
11127 s *Service
11128 sasportaltestpermissionsrequest *SasPortalTestPermissionsRequest
11129 urlParams_ gensupport.URLParams
11130 ctx_ context.Context
11131 header_ http.Header
11132 }
11133
11134 // Test: Returns permissions that a caller has on the specified resource.
11135 func (r *PoliciesService) Test(sasportaltestpermissionsrequest *SasPortalTestPermissionsRequest) *PoliciesTestCall {
11136 c := &PoliciesTestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11137 c.sasportaltestpermissionsrequest = sasportaltestpermissionsrequest
11138 return c
11139 }
11140
11141 // Fields allows partial responses to be retrieved. See
11142 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11143 // details.
11144 func (c *PoliciesTestCall) Fields(s ...googleapi.Field) *PoliciesTestCall {
11145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11146 return c
11147 }
11148
11149 // Context sets the context to be used in this call's Do method.
11150 func (c *PoliciesTestCall) Context(ctx context.Context) *PoliciesTestCall {
11151 c.ctx_ = ctx
11152 return c
11153 }
11154
11155 // Header returns a http.Header that can be modified by the caller to add
11156 // headers to the request.
11157 func (c *PoliciesTestCall) Header() http.Header {
11158 if c.header_ == nil {
11159 c.header_ = make(http.Header)
11160 }
11161 return c.header_
11162 }
11163
11164 func (c *PoliciesTestCall) doRequest(alt string) (*http.Response, error) {
11165 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11166 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sasportaltestpermissionsrequest)
11167 if err != nil {
11168 return nil, err
11169 }
11170 c.urlParams_.Set("alt", alt)
11171 c.urlParams_.Set("prettyPrint", "false")
11172 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/policies:test")
11173 urls += "?" + c.urlParams_.Encode()
11174 req, err := http.NewRequest("POST", urls, body)
11175 if err != nil {
11176 return nil, err
11177 }
11178 req.Header = reqHeaders
11179 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.test", "request", internallog.HTTPRequest(req, body.Bytes()))
11180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11181 }
11182
11183 // Do executes the "prod_tt_sasportal.policies.test" call.
11184 // Any non-2xx status code is an error. Response headers are in either
11185 // *SasPortalTestPermissionsResponse.ServerResponse.Header or (if a response
11186 // was returned at all) in error.(*googleapi.Error).Header. Use
11187 // googleapi.IsNotModified to check whether the returned error was because
11188 // http.StatusNotModified was returned.
11189 func (c *PoliciesTestCall) Do(opts ...googleapi.CallOption) (*SasPortalTestPermissionsResponse, error) {
11190 gensupport.SetOptions(c.urlParams_, opts...)
11191 res, err := c.doRequest("json")
11192 if res != nil && res.StatusCode == http.StatusNotModified {
11193 if res.Body != nil {
11194 res.Body.Close()
11195 }
11196 return nil, gensupport.WrapError(&googleapi.Error{
11197 Code: res.StatusCode,
11198 Header: res.Header,
11199 })
11200 }
11201 if err != nil {
11202 return nil, err
11203 }
11204 defer googleapi.CloseBody(res)
11205 if err := googleapi.CheckResponse(res); err != nil {
11206 return nil, gensupport.WrapError(err)
11207 }
11208 ret := &SasPortalTestPermissionsResponse{
11209 ServerResponse: googleapi.ServerResponse{
11210 Header: res.Header,
11211 HTTPStatusCode: res.StatusCode,
11212 },
11213 }
11214 target := &ret
11215 b, err := gensupport.DecodeResponseBytes(target, res)
11216 if err != nil {
11217 return nil, err
11218 }
11219 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "prod_tt_sasportal.policies.test", "response", internallog.HTTPResponse(res, b))
11220 return ret, nil
11221 }