blob: 1f1b1e1322c31fde6863d11a7174adfecb834954 [file] [log] [blame]
// Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package prod_tt_sasportal provides access to the SAS Portal API (Testing).
//
// For product documentation, see: https://developers.google.com/spectrum-access-system/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/prod_tt_sasportal/v1alpha1"
// ...
// ctx := context.Background()
// prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// prod_tt_sasportalService, err := prod_tt_sasportal.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package prod_tt_sasportal // import "google.golang.org/api/prod_tt_sasportal/v1alpha1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "prod_tt_sasportal:v1alpha1"
const apiName = "prod_tt_sasportal"
const apiVersion = "v1alpha1"
const basePath = "https://prod-tt-sasportal.googleapis.com/"
const mtlsBasePath = "https://prod-tt-sasportal.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View your email address
UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/userinfo.email",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Customers = NewCustomersService(s)
s.Deployments = NewDeploymentsService(s)
s.Installer = NewInstallerService(s)
s.Nodes = NewNodesService(s)
s.Policies = NewPoliciesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Customers *CustomersService
Deployments *DeploymentsService
Installer *InstallerService
Nodes *NodesService
Policies *PoliciesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewCustomersService(s *Service) *CustomersService {
rs := &CustomersService{s: s}
rs.Deployments = NewCustomersDeploymentsService(s)
rs.Devices = NewCustomersDevicesService(s)
rs.Nodes = NewCustomersNodesService(s)
return rs
}
type CustomersService struct {
s *Service
Deployments *CustomersDeploymentsService
Devices *CustomersDevicesService
Nodes *CustomersNodesService
}
func NewCustomersDeploymentsService(s *Service) *CustomersDeploymentsService {
rs := &CustomersDeploymentsService{s: s}
rs.Devices = NewCustomersDeploymentsDevicesService(s)
return rs
}
type CustomersDeploymentsService struct {
s *Service
Devices *CustomersDeploymentsDevicesService
}
func NewCustomersDeploymentsDevicesService(s *Service) *CustomersDeploymentsDevicesService {
rs := &CustomersDeploymentsDevicesService{s: s}
return rs
}
type CustomersDeploymentsDevicesService struct {
s *Service
}
func NewCustomersDevicesService(s *Service) *CustomersDevicesService {
rs := &CustomersDevicesService{s: s}
return rs
}
type CustomersDevicesService struct {
s *Service
}
func NewCustomersNodesService(s *Service) *CustomersNodesService {
rs := &CustomersNodesService{s: s}
rs.Nodes = NewCustomersNodesNodesService(s)
return rs
}
type CustomersNodesService struct {
s *Service
Nodes *CustomersNodesNodesService
}
func NewCustomersNodesNodesService(s *Service) *CustomersNodesNodesService {
rs := &CustomersNodesNodesService{s: s}
return rs
}
type CustomersNodesNodesService struct {
s *Service
}
func NewDeploymentsService(s *Service) *DeploymentsService {
rs := &DeploymentsService{s: s}
rs.Devices = NewDeploymentsDevicesService(s)
return rs
}
type DeploymentsService struct {
s *Service
Devices *DeploymentsDevicesService
}
func NewDeploymentsDevicesService(s *Service) *DeploymentsDevicesService {
rs := &DeploymentsDevicesService{s: s}
return rs
}
type DeploymentsDevicesService struct {
s *Service
}
func NewInstallerService(s *Service) *InstallerService {
rs := &InstallerService{s: s}
return rs
}
type InstallerService struct {
s *Service
}
func NewNodesService(s *Service) *NodesService {
rs := &NodesService{s: s}
rs.Deployments = NewNodesDeploymentsService(s)
rs.Devices = NewNodesDevicesService(s)
rs.Nodes = NewNodesNodesService(s)
return rs
}
type NodesService struct {
s *Service
Deployments *NodesDeploymentsService
Devices *NodesDevicesService
Nodes *NodesNodesService
}
func NewNodesDeploymentsService(s *Service) *NodesDeploymentsService {
rs := &NodesDeploymentsService{s: s}
rs.Devices = NewNodesDeploymentsDevicesService(s)
return rs
}
type NodesDeploymentsService struct {
s *Service
Devices *NodesDeploymentsDevicesService
}
func NewNodesDeploymentsDevicesService(s *Service) *NodesDeploymentsDevicesService {
rs := &NodesDeploymentsDevicesService{s: s}
return rs
}
type NodesDeploymentsDevicesService struct {
s *Service
}
func NewNodesDevicesService(s *Service) *NodesDevicesService {
rs := &NodesDevicesService{s: s}
return rs
}
type NodesDevicesService struct {
s *Service
}
func NewNodesNodesService(s *Service) *NodesNodesService {
rs := &NodesNodesService{s: s}
rs.Devices = NewNodesNodesDevicesService(s)
rs.Nodes = NewNodesNodesNodesService(s)
return rs
}
type NodesNodesService struct {
s *Service
Devices *NodesNodesDevicesService
Nodes *NodesNodesNodesService
}
func NewNodesNodesDevicesService(s *Service) *NodesNodesDevicesService {
rs := &NodesNodesDevicesService{s: s}
return rs
}
type NodesNodesDevicesService struct {
s *Service
}
func NewNodesNodesNodesService(s *Service) *NodesNodesNodesService {
rs := &NodesNodesNodesService{s: s}
return rs
}
type NodesNodesNodesService struct {
s *Service
}
func NewPoliciesService(s *Service) *PoliciesService {
rs := &PoliciesService{s: s}
return rs
}
type PoliciesService struct {
s *Service
}
// SasPortalAssignment: Associates `members` with a `role`.
type SasPortalAssignment struct {
// Members: The identities the role is assigned to. It can have the
// following values: * `{user_email}`: An email address that represents
// a specific Google account. For example: `alice@gmail.com`. *
// `{group_email}`: An email address that represents a Google group. For
// example, `viewers@gmail.com`.
Members []string `json:"members,omitempty"`
// Role: Required. Role that is assigned to `members`.
Role string `json:"role,omitempty"`
// ForceSendFields is a list of field names (e.g. "Members") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Members") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalAssignment) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalAssignment
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalBulkCreateDeviceRequest: Request for BulkCreateDevice
// method.
type SasPortalBulkCreateDeviceRequest struct {
// Csv: Required. A csv with each row representing a [device]. Each row
// must conform to the regulations described on CreateDeviceRequest's
// device field.
Csv string `json:"csv,omitempty"`
// ForceSendFields is a list of field names (e.g. "Csv") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Csv") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalBulkCreateDeviceRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalBulkCreateDeviceRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalBulkCreateDeviceResponse: Response for BulkCreateDevice
// method.
type SasPortalBulkCreateDeviceResponse struct {
// Devices: Required. The devices that were imported.
Devices []*SasPortalDevice `json:"devices,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Devices") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Devices") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalBulkCreateDeviceResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalBulkCreateDeviceResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalCreateSignedDeviceRequest: Request for CreateSignedDevice
// method.
type SasPortalCreateSignedDeviceRequest struct {
// EncodedDevice: Required. JSON Web Token signed using a CPI private
// key. Payload must be the JSON encoding of the [Device]. The user_id
// field must be set.
EncodedDevice string `json:"encodedDevice,omitempty"`
// InstallerId: Required. Unique installer id (cpiId) from the Certified
// Professional Installers database.
InstallerId string `json:"installerId,omitempty"`
// ForceSendFields is a list of field names (e.g. "EncodedDevice") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EncodedDevice") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalCreateSignedDeviceRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalCreateSignedDeviceRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalCustomer: Entity representing a SAS customer.
type SasPortalCustomer struct {
// DisplayName: Required. Name of the organization that the customer
// entity represents.
DisplayName string `json:"displayName,omitempty"`
// Name: Output only. Resource name of the customer.
Name string `json:"name,omitempty"`
// SasUserIds: User IDs used by the devices belonging to this customer.
SasUserIds []string `json:"sasUserIds,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalCustomer) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalCustomer
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type SasPortalDevice struct {
// ActiveConfig: Output only. Current configuration of the device as
// registered to the SAS.
ActiveConfig *SasPortalDeviceConfig `json:"activeConfig,omitempty"`
// DeviceMetadata: Device parameters that can be overridden by both SAS
// Portal and SAS registration requests.
DeviceMetadata *SasPortalDeviceMetadata `json:"deviceMetadata,omitempty"`
// DisplayName: Device display name.
DisplayName string `json:"displayName,omitempty"`
// FccId: The FCC identifier of the device.
FccId string `json:"fccId,omitempty"`
// Grants: Output only. Grants held by the device.
Grants []*SasPortalDeviceGrant `json:"grants,omitempty"`
// Name: Output only. The resource path name.
Name string `json:"name,omitempty"`
// PreloadedConfig: Configuration of the device, as specified via SAS
// Portal API.
PreloadedConfig *SasPortalDeviceConfig `json:"preloadedConfig,omitempty"`
// SerialNumber: A serial number assigned to the device by the device
// manufacturer.
SerialNumber string `json:"serialNumber,omitempty"`
// State: Output only. Device state.
//
// Possible values:
// "DEVICE_STATE_UNSPECIFIED" - Unspecified state.
// "RESERVED" - Device created in the SAS Portal, however, not yet
// registered with SAS.
// "REGISTERED" - Device registered with SAS.
// "DEREGISTERED" - Device de-registered with SAS.
State string `json:"state,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ActiveConfig") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ActiveConfig") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDevice) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDevice
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalDeviceAirInterface: Information about the device's air
// interface.
type SasPortalDeviceAirInterface struct {
// RadioTechnology: This field specifies the radio access technology
// that is used for the CBSD. Conditional
//
// Possible values:
// "RADIO_TECHNOLOGY_UNSPECIFIED"
// "E_UTRA"
// "CAMBIUM_NETWORKS"
// "FOUR_G_BBW_SAA_1"
// "NR"
// "DOODLE_CBRS"
// "CW"
// "REDLINE"
// "TARANA_WIRELESS"
RadioTechnology string `json:"radioTechnology,omitempty"`
// SupportedSpec: This field is related to the radioTechnology field and
// provides the air interface specification that the CBSD is compliant
// with at the time of registration. Optional
SupportedSpec string `json:"supportedSpec,omitempty"`
// ForceSendFields is a list of field names (e.g. "RadioTechnology") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "RadioTechnology") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDeviceAirInterface) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDeviceAirInterface
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalDeviceConfig: Information about the device configuration.
type SasPortalDeviceConfig struct {
// AirInterface: Information about this device's air interface.
AirInterface *SasPortalDeviceAirInterface `json:"airInterface,omitempty"`
// CallSign: The call sign of the device operator.
CallSign string `json:"callSign,omitempty"`
// Category: FCC category of the device.
//
// Possible values:
// "DEVICE_CATEGORY_UNSPECIFIED" - Unspecified device category.
// "DEVICE_CATEGORY_A" - Category A.
// "DEVICE_CATEGORY_B" - Category B.
Category string `json:"category,omitempty"`
// InstallationParams: Installation parameters for the device.
InstallationParams *SasPortalInstallationParams `json:"installationParams,omitempty"`
// IsSigned: Output-only. Whether the configuration has been signed by a
// CPI.
IsSigned bool `json:"isSigned,omitempty"`
// MeasurementCapabilities: Measurement reporting capabilities of the
// device.
//
// Possible values:
// "MEASUREMENT_CAPABILITY_UNSPECIFIED"
// "MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITH_GRANT"
// "MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITHOUT_GRANT"
MeasurementCapabilities []string `json:"measurementCapabilities,omitempty"`
// Model: Information about this device model.
Model *SasPortalDeviceModel `json:"model,omitempty"`
// State: State of the configuration.
//
// Possible values:
// "DEVICE_CONFIG_STATE_UNSPECIFIED"
// "DRAFT"
// "FINAL"
State string `json:"state,omitempty"`
// UpdateTime: Output-only. The last time the device configuration was
// edited.
UpdateTime string `json:"updateTime,omitempty"`
// UserId: The identifier of a device user.
UserId string `json:"userId,omitempty"`
// ForceSendFields is a list of field names (e.g. "AirInterface") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AirInterface") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDeviceConfig) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDeviceConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalDeviceGrant: Device grant. It is an authorization provided
// by the Spectrum Access System to a device to transmit using specified
// operating parameters after a successful heartbeat by the device.
type SasPortalDeviceGrant struct {
// ChannelType: Type of channel used.
//
// Possible values:
// "CHANNEL_TYPE_UNSPECIFIED"
// "CHANNEL_TYPE_GAA"
// "CHANNEL_TYPE_PAL"
ChannelType string `json:"channelType,omitempty"`
// ExpireTime: The expiration time of the grant.
ExpireTime string `json:"expireTime,omitempty"`
// FrequencyRange: The transmission frequency range.
FrequencyRange *SasPortalFrequencyRange `json:"frequencyRange,omitempty"`
// GrantId: Grant Id.
GrantId string `json:"grantId,omitempty"`
// MaxEirp: Maximum Equivalent Isotropically Radiated Power (EIRP)
// permitted by the grant. The maximum EIRP is in units of dBm/MHz. The
// value of maxEirp represents the average (RMS) EIRP that would be
// measured by the procedure defined in FCC part 96.41(e)(3).
MaxEirp float64 `json:"maxEirp,omitempty"`
// MoveList: The DPA move lists on which this grant appears.
MoveList []*SasPortalDpaMoveList `json:"moveList,omitempty"`
// State: State of the grant.
//
// Possible values:
// "GRANT_STATE_UNSPECIFIED"
// "GRANT_STATE_GRANTED" - The grant has been granted but the device
// is not heartbeating on it.
// "GRANT_STATE_TERMINATED" - The grant has been terminated by the
// SAS.
// "GRANT_STATE_SUSPENDED" - The grant has been suspended by the SAS.
// "GRANT_STATE_AUTHORIZED" - The device is currently transmitting.
// "GRANT_STATE_EXPIRED" - The grant has expired.
State string `json:"state,omitempty"`
// SuspensionReason: If the grant is suspended, the reason(s) for
// suspension.
SuspensionReason []string `json:"suspensionReason,omitempty"`
// ForceSendFields is a list of field names (e.g. "ChannelType") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ChannelType") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDeviceGrant) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDeviceGrant
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *SasPortalDeviceGrant) UnmarshalJSON(data []byte) error {
type NoMethod SasPortalDeviceGrant
var s1 struct {
MaxEirp gensupport.JSONFloat64 `json:"maxEirp"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.MaxEirp = float64(s1.MaxEirp)
return nil
}
// SasPortalDeviceMetadata: Device data overridable by both SAS Portal
// and registration requests.
type SasPortalDeviceMetadata struct {
}
// SasPortalDeviceModel: Information about the model of the device.
type SasPortalDeviceModel struct {
// FirmwareVersion: The firmware version of the device.
FirmwareVersion string `json:"firmwareVersion,omitempty"`
// HardwareVersion: The hardware version of the device.
HardwareVersion string `json:"hardwareVersion,omitempty"`
// Name: The name of the device model.
Name string `json:"name,omitempty"`
// SoftwareVersion: The software version of the device.
SoftwareVersion string `json:"softwareVersion,omitempty"`
// Vendor: The name of the device vendor.
Vendor string `json:"vendor,omitempty"`
// ForceSendFields is a list of field names (e.g. "FirmwareVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FirmwareVersion") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDeviceModel) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDeviceModel
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalDpaMoveList: An entry in a DPA's move list.
type SasPortalDpaMoveList struct {
// DpaId: The ID of the DPA.
DpaId string `json:"dpaId,omitempty"`
// FrequencyRange: The frequency range that the move list affects.
FrequencyRange *SasPortalFrequencyRange `json:"frequencyRange,omitempty"`
// ForceSendFields is a list of field names (e.g. "DpaId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DpaId") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalDpaMoveList) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalDpaMoveList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalEmpty: A generic empty message that you can re-use to avoid
// defining duplicated empty messages in your APIs. A typical example is
// to use it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); } The JSON representation for `Empty` is
// empty JSON object `{}`.
type SasPortalEmpty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// SasPortalFrequencyRange: Frequency range from `low_frequency` to
// `high_frequency`.
type SasPortalFrequencyRange struct {
// HighFrequencyMhz: The highest frequency of the frequency range in
// MHz.
HighFrequencyMhz float64 `json:"highFrequencyMhz,omitempty"`
// LowFrequencyMhz: The lowest frequency of the frequency range in MHz.
LowFrequencyMhz float64 `json:"lowFrequencyMhz,omitempty"`
// ForceSendFields is a list of field names (e.g. "HighFrequencyMhz") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "HighFrequencyMhz") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SasPortalFrequencyRange) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalFrequencyRange
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *SasPortalFrequencyRange) UnmarshalJSON(data []byte) error {
type NoMethod SasPortalFrequencyRange
var s1 struct {
HighFrequencyMhz gensupport.JSONFloat64 `json:"highFrequencyMhz"`
LowFrequencyMhz gensupport.JSONFloat64 `json:"lowFrequencyMhz"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.HighFrequencyMhz = float64(s1.HighFrequencyMhz)
s.LowFrequencyMhz = float64(s1.LowFrequencyMhz)
return nil
}
// SasPortalGenerateSecretRequest: Request for GenerateSecret method]
// [spectrum.sas.portal.v1alpha1.DeviceManager.GenerateSecret].
type SasPortalGenerateSecretRequest struct {
}
// SasPortalGenerateSecretResponse: Response for GenerateSecret method.
type SasPortalGenerateSecretResponse struct {
// Secret: The secret generated by the string and used by
// [ValidateInstaller] method.
Secret string `json:"secret,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Secret") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Secret") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalGenerateSecretResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalGenerateSecretResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalGetPolicyRequest: Request message for `GetPolicy` method.
type SasPortalGetPolicyRequest struct {
// Resource: Required. The resource for which the policy is being
// requested.
Resource string `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Resource") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Resource") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalGetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalGetPolicyRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalInstallationParams: Information about the device
// installation parameters.
type SasPortalInstallationParams struct {
// AntennaAzimuth: Boresight direction of the horizontal plane of the
// antenna in degrees with respect to true north. The value of this
// parameter is an integer with a value between 0 and 359 inclusive. A
// value of 0 degrees means true north; a value of 90 degrees means
// east. This parameter is optional for Category A devices and
// conditional for Category B devices.
AntennaAzimuth int64 `json:"antennaAzimuth,omitempty"`
// AntennaBeamwidth: 3-dB antenna beamwidth of the antenna in the
// horizontal-plane in degrees. This parameter is an unsigned integer
// having a value between 0 and 360 (degrees) inclusive; it is optional
// for Category A devices and conditional for Category B devices.
AntennaBeamwidth int64 `json:"antennaBeamwidth,omitempty"`
// AntennaDowntilt: Antenna downtilt in degrees and is an integer with a
// value between -90 and +90 inclusive; a negative value means the
// antenna is tilted up (above horizontal). This parameter is optional
// for Category A devices and conditional for Category B devices.
AntennaDowntilt int64 `json:"antennaDowntilt,omitempty"`
// AntennaGain: Peak antenna gain in dBi. This parameter is an integer
// with a value between -127 and +128 (dBi) inclusive.
AntennaGain int64 `json:"antennaGain,omitempty"`
// AntennaModel: If an external antenna is used, the antenna model is
// optionally provided in this field. The string has a maximum length of
// 128 octets.
AntennaModel string `json:"antennaModel,omitempty"`
// CpeCbsdIndication: If present, this parameter specifies whether the
// CBSD is a CPE-CBSD or not.
CpeCbsdIndication bool `json:"cpeCbsdIndication,omitempty"`
// EirpCapability: This parameter is the maximum device EIRP in units of
// dBm/10MHz and is an integer with a value between -127 and +47 (dBm/10
// MHz) inclusive. If not included, SAS interprets it as maximum
// allowable EIRP in units of dBm/10MHz for device category.
EirpCapability int64 `json:"eirpCapability,omitempty"`
// Height: Device antenna height in meters. When the heightType
// parameter value is "AGL", the antenna height should be given relative
// to ground level. When the heightType parameter value is "AMSL", it is
// given with respect to WGS84 datum.
Height float64 `json:"height,omitempty"`
// HeightType: Specifies how the height is measured.
//
// Possible values:
// "HEIGHT_TYPE_UNSPECIFIED" - Unspecified height type.
// "HEIGHT_TYPE_AGL" - AGL height is measured relative to the ground
// level.
// "HEIGHT_TYPE_AMSL" - AMSL height is measured relative to the mean
// sea level.
HeightType string `json:"heightType,omitempty"`
// HorizontalAccuracy: A positive number in meters to indicate accuracy
// of the device antenna horizontal location. This optional parameter
// should only be present if its value is less than the FCC requirement
// of 50 meters.
HorizontalAccuracy float64 `json:"horizontalAccuracy,omitempty"`
// IndoorDeployment: Whether the device antenna is indoor or not. True:
// indoor. False: outdoor.
IndoorDeployment bool `json:"indoorDeployment,omitempty"`
// Latitude: Latitude of the device antenna location in degrees relative
// to the WGS 84 datum. The allowed range is from -90.000000 to
// +90.000000. Positive values represent latitudes north of the equator;
// negative values south of the equator.
Latitude float64 `json:"latitude,omitempty"`
// Longitude: Longitude of the device antenna location. in degrees
// relative to the WGS 84 datum. The allowed range is from -180.000000
// to +180.000000. Positive values represent longitudes east of the
// prime meridian; negative values west of the prime meridian.
Longitude float64 `json:"longitude,omitempty"`
// VerticalAccuracy: A positive number in meters to indicate accuracy of
// the device antenna vertical location. This optional parameter should
// only be present if its value is less than the FCC requirement of 3
// meters.
VerticalAccuracy float64 `json:"verticalAccuracy,omitempty"`
// ForceSendFields is a list of field names (e.g. "AntennaAzimuth") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AntennaAzimuth") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SasPortalInstallationParams) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalInstallationParams
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *SasPortalInstallationParams) UnmarshalJSON(data []byte) error {
type NoMethod SasPortalInstallationParams
var s1 struct {
Height gensupport.JSONFloat64 `json:"height"`
HorizontalAccuracy gensupport.JSONFloat64 `json:"horizontalAccuracy"`
Latitude gensupport.JSONFloat64 `json:"latitude"`
Longitude gensupport.JSONFloat64 `json:"longitude"`
VerticalAccuracy gensupport.JSONFloat64 `json:"verticalAccuracy"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Height = float64(s1.Height)
s.HorizontalAccuracy = float64(s1.HorizontalAccuracy)
s.Latitude = float64(s1.Latitude)
s.Longitude = float64(s1.Longitude)
s.VerticalAccuracy = float64(s1.VerticalAccuracy)
return nil
}
// SasPortalListCustomersResponse: Response for `ListCustomers`.
type SasPortalListCustomersResponse struct {
// Customers: The list of customers that match the request.
Customers []*SasPortalCustomer `json:"customers,omitempty"`
// NextPageToken: A pagination token returned from a previous call to
// ListCustomers method that indicates from where listing should
// continue. If the field is missing or empty, it means there are no
// more customers.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Customers") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Customers") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalListCustomersResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalListCustomersResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalListDevicesResponse: Response for ListDevices method.
type SasPortalListDevicesResponse struct {
// Devices: The devices that match the request.
Devices []*SasPortalDevice `json:"devices,omitempty"`
// NextPageToken: A pagination token returned from a previous call to
// ListDevices method that indicates from where listing should continue.
// If the field is missing or empty, it means there is no more devices.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Devices") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Devices") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalListDevicesResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalListDevicesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalListNodesResponse: Response for ListNodes method.
type SasPortalListNodesResponse struct {
// NextPageToken: A pagination token returned from a previous call to
// ListNodes method that indicates from where listing should continue.
// If the field is missing or empty, it means there is no more nodes.
NextPageToken string `json:"nextPageToken,omitempty"`
// Nodes: The nodes that match the request.
Nodes []*SasPortalNode `json:"nodes,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalListNodesResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalListNodesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalMoveDeploymentRequest: Request for MoveDeployment method.
type SasPortalMoveDeploymentRequest struct {
// Destination: Required. The name of the new parent resource Node or
// Customer to reparent the deployment under.
Destination string `json:"destination,omitempty"`
// ForceSendFields is a list of field names (e.g. "Destination") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Destination") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalMoveDeploymentRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalMoveDeploymentRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalMoveDeviceRequest: Request for MoveDevice method.
type SasPortalMoveDeviceRequest struct {
// Destination: Required. The name of the new parent resource (Node or
// Customer) to reparent the device under.
Destination string `json:"destination,omitempty"`
// ForceSendFields is a list of field names (e.g. "Destination") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Destination") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalMoveDeviceRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalMoveDeviceRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalMoveNodeRequest: Request for MoveNode method.
type SasPortalMoveNodeRequest struct {
// Destination: Required. The name of the new parent resource node or
// Customer) to reparent the node under.
Destination string `json:"destination,omitempty"`
// ForceSendFields is a list of field names (e.g. "Destination") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Destination") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalMoveNodeRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalMoveNodeRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalNode: The Node.
type SasPortalNode struct {
// DisplayName: The node's display name.
DisplayName string `json:"displayName,omitempty"`
// Name: Output only. Resource name.
Name string `json:"name,omitempty"`
// SasUserIds: User ids used by the devices belonging to this node.
SasUserIds []string `json:"sasUserIds,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalNode) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalNode
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalOperation: This resource represents a long-running operation
// that is the result of a network API call.
type SasPortalOperation struct {
// Done: If the value is `false`, it means the operation is still in
// progress. If `true`, the operation is completed, and either `error`
// or `response` is available.
Done bool `json:"done,omitempty"`
// Error: The error result of the operation in case of failure or
// cancellation.
Error *SasPortalStatus `json:"error,omitempty"`
// Metadata: Service-specific metadata associated with the operation. It
// typically contains progress information and common metadata such as
// create time. Some services might not provide such metadata. Any
// method that returns a long-running operation should document the
// metadata type, if any.
Metadata googleapi.RawMessage `json:"metadata,omitempty"`
// Name: The server-assigned name, which is only unique within the same
// service that originally returns it. If you use the default HTTP
// mapping, the `name` should be a resource name ending with
// `operations/{unique_id}`.
Name string `json:"name,omitempty"`
// Response: The normal response of the operation in case of success. If
// the original method returns no data on success, such as `Delete`, the
// response is `google.protobuf.Empty`. If the original method is
// standard `Get`/`Create`/`Update`, the response should be the
// resource. For other methods, the response should have the type
// `XxxResponse`, where `Xxx` is the original method name. For example,
// if the original method name is `TakeSnapshot()`, the inferred
// response type is `TakeSnapshotResponse`.
Response googleapi.RawMessage `json:"response,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Done") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Done") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalOperation) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalOperation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalPolicy: Defines an access control policy to the resources.
type SasPortalPolicy struct {
Assignments []*SasPortalAssignment `json:"assignments,omitempty"`
// Etag: The [etag] is used for optimistic concurrency control as a way
// to help prevent simultaneous updates of a policy from overwriting
// each other. It is strongly suggested that systems make use of the
// [etag] in the read-modify-write cycle to perform policy updates in
// order to avoid race conditions: An [etag] is returned in the response
// to [GetPolicy], and systems are expected to put that etag in the
// request to [SetPolicy] to ensure that their change will be applied to
// the same version of the policy. If no [etag] is provided in the call
// to [SetPolicy], then the existing policy is overwritten blindly.
Etag string `json:"etag,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Assignments") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Assignments") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalPolicy) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalSetPolicyRequest: Request message for `SetPolicy` method.
type SasPortalSetPolicyRequest struct {
// Policy: Required. The policy to be applied to the `resource`.
Policy *SasPortalPolicy `json:"policy,omitempty"`
// Resource: Required. The resource for which the policy is being
// specified. This policy replaces any existing policy.
Resource string `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Policy") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Policy") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalSetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalSetPolicyRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalSignDeviceRequest: Request for SignDevice method.
type SasPortalSignDeviceRequest struct {
// Device: Required. The device to sign. The device fields name, fcc_id
// and serial_number must be set. The user_id field must be set.
Device *SasPortalDevice `json:"device,omitempty"`
// ForceSendFields is a list of field names (e.g. "Device") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Device") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalSignDeviceRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalSignDeviceRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalStatus: The `Status` type defines a logical error model that
// is suitable for different programming environments, including REST
// APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc).
// Each `Status` message contains three pieces of data: error code,
// error message, and error details. You can find out more about this
// error model and how to work with it in the [API Design
// Guide](https://cloud.google.com/apis/design/errors).
type SasPortalStatus struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any user-facing error message should be localized and sent
// in the google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalStatus) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalStatus
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalTestPermissionsRequest: Request message for
// `TestPermissions` method.
type SasPortalTestPermissionsRequest struct {
// Permissions: The set of permissions to check for the `resource`.
Permissions []string `json:"permissions,omitempty"`
// Resource: Required. The resource for which the permissions are being
// requested.
Resource string `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Permissions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Permissions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalTestPermissionsRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalTestPermissionsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalTestPermissionsResponse: Response message for
// `TestPermissions` method.
type SasPortalTestPermissionsResponse struct {
// Permissions: A set of permissions that the caller is allowed.
Permissions []string `json:"permissions,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Permissions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Permissions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalTestPermissionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalTestPermissionsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalUpdateSignedDeviceRequest: Request for UpdateSignedDevice
// method.
type SasPortalUpdateSignedDeviceRequest struct {
// EncodedDevice: Required. The JSON Web Token signed using a CPI
// private key. Payload must be the JSON encoding of the device. The
// user_id field must be set.
EncodedDevice string `json:"encodedDevice,omitempty"`
// InstallerId: Required. Unique installer ID (CPI ID) from the
// Certified Professional Installers database.
InstallerId string `json:"installerId,omitempty"`
// ForceSendFields is a list of field names (e.g. "EncodedDevice") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EncodedDevice") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalUpdateSignedDeviceRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalUpdateSignedDeviceRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalValidateInstallerRequest: Request for ValidateInstaller
// method.
type SasPortalValidateInstallerRequest struct {
// EncodedSecret: Required. JSON Web Token signed using a CPI private
// key. Payload must include a "secret" claim whose value is the secret.
EncodedSecret string `json:"encodedSecret,omitempty"`
// InstallerId: Required. Unique installer id (cpiId) from the Certified
// Professional Installers database.
InstallerId string `json:"installerId,omitempty"`
// Secret: Required. Secret returned by the GenerateSecret method.
Secret string `json:"secret,omitempty"`
// ForceSendFields is a list of field names (e.g. "EncodedSecret") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EncodedSecret") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SasPortalValidateInstallerRequest) MarshalJSON() ([]byte, error) {
type NoMethod SasPortalValidateInstallerRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SasPortalValidateInstallerResponse: Response for ValidateInstaller
// method]
// [spectrum.sas.portal.v1alpha1.DeviceManager.ValidateInstaller].
type SasPortalValidateInstallerResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// method id "prod_tt_sasportal.customers.get":
type CustomersGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Returns a requested customer.
func (r *CustomersService) Get(name string) *CustomersGetCall {
c := &CustomersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.get" call.
// Exactly one of *SasPortalCustomer or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SasPortalCustomer.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersGetCall) Do(opts ...googleapi.CallOption) (*SasPortalCustomer, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalCustomer{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns a requested customer.",
// "flatPath": "v1alpha1/customers/{customersId}",
// "httpMethod": "GET",
// "id": "prod_tt_sasportal.customers.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the customer.",
// "location": "path",
// "pattern": "^customers/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "SasPortalCustomer"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.list":
type CustomersListCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Returns a list of requested customers.
func (r *CustomersService) List() *CustomersListCall {
c := &CustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of customers to return in the response.
func (c *CustomersListCall) PageSize(pageSize int64) *CustomersListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A pagination token
// returned from a previous call to ListCustomers method that indicates
// where this listing should continue from.
func (c *CustomersListCall) PageToken(pageToken string) *CustomersListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersListCall) Fields(s ...googleapi.Field) *CustomersListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomersListCall) IfNoneMatch(entityTag string) *CustomersListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersListCall) Context(ctx context.Context) *CustomersListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/customers")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.list" call.
// Exactly one of *SasPortalListCustomersResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SasPortalListCustomersResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersListCall) Do(opts ...googleapi.CallOption) (*SasPortalListCustomersResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalListCustomersResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns a list of requested customers.",
// "flatPath": "v1alpha1/customers",
// "httpMethod": "GET",
// "id": "prod_tt_sasportal.customers.list",
// "parameterOrder": [],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of customers to return in the response.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A pagination token returned from a previous call to ListCustomers method that indicates where this listing should continue from.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/customers",
// "response": {
// "$ref": "SasPortalListCustomersResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *CustomersListCall) Pages(ctx context.Context, f func(*SasPortalListCustomersResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "prod_tt_sasportal.customers.patch":
type CustomersPatchCall struct {
s *Service
name string
sasportalcustomer *SasPortalCustomer
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates an existing customer.
func (r *CustomersService) Patch(name string, sasportalcustomer *SasPortalCustomer) *CustomersPatchCall {
c := &CustomersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.sasportalcustomer = sasportalcustomer
return c
}
// UpdateMask sets the optional parameter "updateMask": Fields to be
// updated.
func (c *CustomersPatchCall) UpdateMask(updateMask string) *CustomersPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcustomer)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.patch" call.
// Exactly one of *SasPortalCustomer or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SasPortalCustomer.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*SasPortalCustomer, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalCustomer{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates an existing customer.",
// "flatPath": "v1alpha1/customers/{customersId}",
// "httpMethod": "PATCH",
// "id": "prod_tt_sasportal.customers.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Output only. Resource name of the customer.",
// "location": "path",
// "pattern": "^customers/[^/]+$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "Fields to be updated.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "request": {
// "$ref": "SasPortalCustomer"
// },
// "response": {
// "$ref": "SasPortalCustomer"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.deployments.move":
type CustomersDeploymentsMoveCall struct {
s *Service
name string
sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Move: Moves a deployment under another node or customer.
func (r *CustomersDeploymentsService) Move(name string, sasportalmovedeploymentrequest *SasPortalMoveDeploymentRequest) *CustomersDeploymentsMoveCall {
c := &CustomersDeploymentsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.sasportalmovedeploymentrequest = sasportalmovedeploymentrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDeploymentsMoveCall) Fields(s ...googleapi.Field) *CustomersDeploymentsMoveCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDeploymentsMoveCall) Context(ctx context.Context) *CustomersDeploymentsMoveCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDeploymentsMoveCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDeploymentsMoveCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalmovedeploymentrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:move")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.deployments.move" call.
// Exactly one of *SasPortalOperation or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SasPortalOperation.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDeploymentsMoveCall) Do(opts ...googleapi.CallOption) (*SasPortalOperation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalOperation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Moves a deployment under another node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/deployments/{deploymentsId}:move",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.deployments.move",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the deployment to move.",
// "location": "path",
// "pattern": "^customers/[^/]+/deployments/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}:move",
// "request": {
// "$ref": "SasPortalMoveDeploymentRequest"
// },
// "response": {
// "$ref": "SasPortalOperation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.deployments.devices.create":
type CustomersDeploymentsDevicesCreateCall struct {
s *Service
parent string
sasportaldevice *SasPortalDevice
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a device under a node or customer.
func (r *CustomersDeploymentsDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *CustomersDeploymentsDevicesCreateCall {
c := &CustomersDeploymentsDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.sasportaldevice = sasportaldevice
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDeploymentsDevicesCreateCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDeploymentsDevicesCreateCall) Context(ctx context.Context) *CustomersDeploymentsDevicesCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDeploymentsDevicesCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDeploymentsDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.deployments.devices.create" call.
// Exactly one of *SasPortalDevice or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalDevice.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDeploymentsDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalDevice{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a device under a node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/deployments/{deploymentsId}/devices",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.deployments.devices.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+/deployments/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices",
// "request": {
// "$ref": "SasPortalDevice"
// },
// "response": {
// "$ref": "SasPortalDevice"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.deployments.devices.createSigned":
type CustomersDeploymentsDevicesCreateSignedCall struct {
s *Service
parent string
sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// CreateSigned: Creates a signed device under a node or customer.
func (r *CustomersDeploymentsDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *CustomersDeploymentsDevicesCreateSignedCall {
c := &CustomersDeploymentsDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDeploymentsDevicesCreateSignedCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesCreateSignedCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDeploymentsDevicesCreateSignedCall) Context(ctx context.Context) *CustomersDeploymentsDevicesCreateSignedCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDeploymentsDevicesCreateSignedCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDeploymentsDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.deployments.devices.createSigned" call.
// Exactly one of *SasPortalDevice or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalDevice.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDeploymentsDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalDevice{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a signed device under a node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/deployments/{deploymentsId}/devices:createSigned",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.deployments.devices.createSigned",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+/deployments/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices:createSigned",
// "request": {
// "$ref": "SasPortalCreateSignedDeviceRequest"
// },
// "response": {
// "$ref": "SasPortalDevice"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.deployments.devices.list":
type CustomersDeploymentsDevicesListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists devices under a node or customer.
func (r *CustomersDeploymentsDevicesService) List(parent string) *CustomersDeploymentsDevicesListCall {
c := &CustomersDeploymentsDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Filter sets the optional parameter "filter": The filter expression.
// The filter should have one of the following formats: "sn=123454" or
// "display_name=MyDevice". sn corresponds to serial_number of the
// device. The filter is case insensitive.
func (c *CustomersDeploymentsDevicesListCall) Filter(filter string) *CustomersDeploymentsDevicesListCall {
c.urlParams_.Set("filter", filter)
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of devices to return in the response. If empty or zero, all devices
// will be listed. Must be in the range [0, 1000].
func (c *CustomersDeploymentsDevicesListCall) PageSize(pageSize int64) *CustomersDeploymentsDevicesListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A pagination token
// returned from a previous call to ListDevices that indicates where
// this listing should continue from.
func (c *CustomersDeploymentsDevicesListCall) PageToken(pageToken string) *CustomersDeploymentsDevicesListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDeploymentsDevicesListCall) Fields(s ...googleapi.Field) *CustomersDeploymentsDevicesListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomersDeploymentsDevicesListCall) IfNoneMatch(entityTag string) *CustomersDeploymentsDevicesListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDeploymentsDevicesListCall) Context(ctx context.Context) *CustomersDeploymentsDevicesListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDeploymentsDevicesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDeploymentsDevicesListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.deployments.devices.list" call.
// Exactly one of *SasPortalListDevicesResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SasPortalListDevicesResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDeploymentsDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalListDevicesResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists devices under a node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/deployments/{deploymentsId}/devices",
// "httpMethod": "GET",
// "id": "prod_tt_sasportal.customers.deployments.devices.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "filter": {
// "description": "The filter expression. The filter should have one of the following formats: \"sn=123454\" or \"display_name=MyDevice\". sn corresponds to serial_number of the device. The filter is case insensitive.",
// "location": "query",
// "type": "string"
// },
// "pageSize": {
// "description": "The maximum number of devices to return in the response. If empty or zero, all devices will be listed. Must be in the range [0, 1000].",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A pagination token returned from a previous call to ListDevices that indicates where this listing should continue from.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+/deployments/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices",
// "response": {
// "$ref": "SasPortalListDevicesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *CustomersDeploymentsDevicesListCall) Pages(ctx context.Context, f func(*SasPortalListDevicesResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "prod_tt_sasportal.customers.devices.bulk":
type CustomersDevicesBulkCall struct {
s *Service
parent string
sasportalbulkcreatedevicerequest *SasPortalBulkCreateDeviceRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Bulk: Creates a device under a node or customer. Returned devices are
// unordered.
func (r *CustomersDevicesService) Bulk(parent string, sasportalbulkcreatedevicerequest *SasPortalBulkCreateDeviceRequest) *CustomersDevicesBulkCall {
c := &CustomersDevicesBulkCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.sasportalbulkcreatedevicerequest = sasportalbulkcreatedevicerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesBulkCall) Fields(s ...googleapi.Field) *CustomersDevicesBulkCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesBulkCall) Context(ctx context.Context) *CustomersDevicesBulkCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesBulkCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesBulkCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalbulkcreatedevicerequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:bulk")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.bulk" call.
// Exactly one of *SasPortalBulkCreateDeviceResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SasPortalBulkCreateDeviceResponse.ServerResponse.Header or
// (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *CustomersDevicesBulkCall) Do(opts ...googleapi.CallOption) (*SasPortalBulkCreateDeviceResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalBulkCreateDeviceResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a device under a node or customer. Returned devices are unordered.",
// "flatPath": "v1alpha1/customers/{customersId}/devices:bulk",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.devices.bulk",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices:bulk",
// "request": {
// "$ref": "SasPortalBulkCreateDeviceRequest"
// },
// "response": {
// "$ref": "SasPortalBulkCreateDeviceResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.devices.create":
type CustomersDevicesCreateCall struct {
s *Service
parent string
sasportaldevice *SasPortalDevice
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a device under a node or customer.
func (r *CustomersDevicesService) Create(parent string, sasportaldevice *SasPortalDevice) *CustomersDevicesCreateCall {
c := &CustomersDevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.sasportaldevice = sasportaldevice
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesCreateCall) Fields(s ...googleapi.Field) *CustomersDevicesCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesCreateCall) Context(ctx context.Context) *CustomersDevicesCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportaldevice)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.create" call.
// Exactly one of *SasPortalDevice or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalDevice.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDevicesCreateCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalDevice{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a device under a node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/devices",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.devices.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices",
// "request": {
// "$ref": "SasPortalDevice"
// },
// "response": {
// "$ref": "SasPortalDevice"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.devices.createSigned":
type CustomersDevicesCreateSignedCall struct {
s *Service
parent string
sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// CreateSigned: Creates a signed device under a node or customer.
func (r *CustomersDevicesService) CreateSigned(parent string, sasportalcreatesigneddevicerequest *SasPortalCreateSignedDeviceRequest) *CustomersDevicesCreateSignedCall {
c := &CustomersDevicesCreateSignedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.sasportalcreatesigneddevicerequest = sasportalcreatesigneddevicerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesCreateSignedCall) Fields(s ...googleapi.Field) *CustomersDevicesCreateSignedCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesCreateSignedCall) Context(ctx context.Context) *CustomersDevicesCreateSignedCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesCreateSignedCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesCreateSignedCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sasportalcreatesigneddevicerequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices:createSigned")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.createSigned" call.
// Exactly one of *SasPortalDevice or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalDevice.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDevicesCreateSignedCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalDevice{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a signed device under a node or customer.",
// "flatPath": "v1alpha1/customers/{customersId}/devices:createSigned",
// "httpMethod": "POST",
// "id": "prod_tt_sasportal.customers.devices.createSigned",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The name of the parent resource.",
// "location": "path",
// "pattern": "^customers/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/devices:createSigned",
// "request": {
// "$ref": "SasPortalCreateSignedDeviceRequest"
// },
// "response": {
// "$ref": "SasPortalDevice"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.devices.delete":
type CustomersDevicesDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a device.
func (r *CustomersDevicesService) Delete(name string) *CustomersDevicesDeleteCall {
c := &CustomersDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesDeleteCall) Fields(s ...googleapi.Field) *CustomersDevicesDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesDeleteCall) Context(ctx context.Context) *CustomersDevicesDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.delete" call.
// Exactly one of *SasPortalEmpty or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalEmpty.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*SasPortalEmpty, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalEmpty{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a device.",
// "flatPath": "v1alpha1/customers/{customersId}/devices/{devicesId}",
// "httpMethod": "DELETE",
// "id": "prod_tt_sasportal.customers.devices.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the device.",
// "location": "path",
// "pattern": "^customers/[^/]+/devices/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "SasPortalEmpty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.devices.get":
type CustomersDevicesGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets details about a device.
func (r *CustomersDevicesService) Get(name string) *CustomersDevicesGetCall {
c := &CustomersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesGetCall) Fields(s ...googleapi.Field) *CustomersDevicesGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomersDevicesGetCall) IfNoneMatch(entityTag string) *CustomersDevicesGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesGetCall) Context(ctx context.Context) *CustomersDevicesGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.get" call.
// Exactly one of *SasPortalDevice or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *SasPortalDevice.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDevicesGetCall) Do(opts ...googleapi.CallOption) (*SasPortalDevice, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SasPortalDevice{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets details about a device.",
// "flatPath": "v1alpha1/customers/{customersId}/devices/{devicesId}",
// "httpMethod": "GET",
// "id": "prod_tt_sasportal.customers.devices.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the device.",
// "location": "path",
// "pattern": "^customers/[^/]+/devices/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "SasPortalDevice"
// },
// "scopes": [
// "https://www.googleapis.com/auth/userinfo.email"
// ]
// }
}
// method id "prod_tt_sasportal.customers.devices.list":
type CustomersDevicesListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists devices under a node or customer.
func (r *CustomersDevicesService) List(parent string) *CustomersDevicesListCall {
c := &CustomersDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Filter sets the optional parameter "filter": The filter expression.
// The filter should have one of the following formats: "sn=123454" or
// "display_name=MyDevice". sn corresponds to serial_number of the
// device. The filter is case insensitive.
func (c *CustomersDevicesListCall) Filter(filter string) *CustomersDevicesListCall {
c.urlParams_.Set("filter", filter)
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of devices to return in the response. If empty or zero, all devices
// will be listed. Must be in the range [0, 1000].
func (c *CustomersDevicesListCall) PageSize(pageSize int64) *CustomersDevicesListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A pagination token
// returned from a previous call to ListDevices that indicates where
// this listing should continue from.
func (c *CustomersDevicesListCall) PageToken(pageToken string) *CustomersDevicesListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomersDevicesListCall) Fields(s ...googleapi.Field) *CustomersDevicesListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomersDevicesListCall) IfNoneMatch(entityTag string) *CustomersDevicesListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomersDevicesListCall) Context(ctx context.Context) *CustomersDevicesListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomersDevicesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200926")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/devices")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "prod_tt_sasportal.customers.devices.list" call.
// Exactly one of *SasPortalListDevicesResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *SasPortalListDevicesResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomersDevicesListCall) Do(opts ...googleapi.CallOption) (*SasPortalListDevicesResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}