...

Source file src/google.golang.org/api/baremetalsolution/v1alpha1/baremetalsolution-gen.go

Documentation: google.golang.org/api/baremetalsolution/v1alpha1

     1  // Copyright 2022 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package baremetalsolution provides access to the Bare Metal Solution API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/bare-metal
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/baremetalsolution/v1alpha1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	baremetalsolutionService, err := baremetalsolution.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    27  //
    28  //	baremetalsolutionService, err := baremetalsolution.NewService(ctx, option.WithAPIKey("AIza..."))
    29  //
    30  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    31  //
    32  //	config := &oauth2.Config{...}
    33  //	// ...
    34  //	token, err := config.Exchange(ctx, ...)
    35  //	baremetalsolutionService, err := baremetalsolution.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    36  //
    37  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    38  package baremetalsolution // import "google.golang.org/api/baremetalsolution/v1alpha1"
    39  
    40  import (
    41  	"bytes"
    42  	"context"
    43  	"encoding/json"
    44  	"errors"
    45  	"fmt"
    46  	"io"
    47  	"net/http"
    48  	"net/url"
    49  	"strconv"
    50  	"strings"
    51  
    52  	googleapi "google.golang.org/api/googleapi"
    53  	internal "google.golang.org/api/internal"
    54  	gensupport "google.golang.org/api/internal/gensupport"
    55  	option "google.golang.org/api/option"
    56  	internaloption "google.golang.org/api/option/internaloption"
    57  	htransport "google.golang.org/api/transport/http"
    58  )
    59  
    60  // Always reference these packages, just in case the auto-generated code
    61  // below doesn't.
    62  var _ = bytes.NewBuffer
    63  var _ = strconv.Itoa
    64  var _ = fmt.Sprintf
    65  var _ = json.NewDecoder
    66  var _ = io.Copy
    67  var _ = url.Parse
    68  var _ = gensupport.MarshalJSON
    69  var _ = googleapi.Version
    70  var _ = errors.New
    71  var _ = strings.Replace
    72  var _ = context.Canceled
    73  var _ = internaloption.WithDefaultEndpoint
    74  
    75  const apiId = "baremetalsolution:v1alpha1"
    76  const apiName = "baremetalsolution"
    77  const apiVersion = "v1alpha1"
    78  const basePath = "https://baremetalsolution.googleapis.com/"
    79  const mtlsBasePath = "https://baremetalsolution.mtls.googleapis.com/"
    80  
    81  // OAuth2 scopes used by this API.
    82  const (
    83  	// See, edit, configure, and delete your Google Cloud data and see the
    84  	// email address for your Google Account.
    85  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
    86  )
    87  
    88  // NewService creates a new Service.
    89  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    90  	scopesOption := internaloption.WithDefaultScopes(
    91  		"https://www.googleapis.com/auth/cloud-platform",
    92  	)
    93  	// NOTE: prepend, so we don't override user-specified scopes.
    94  	opts = append([]option.ClientOption{scopesOption}, opts...)
    95  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    96  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
    97  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	s, err := New(client)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	if endpoint != "" {
   106  		s.BasePath = endpoint
   107  	}
   108  	return s, nil
   109  }
   110  
   111  // New creates a new Service. It uses the provided http.Client for requests.
   112  //
   113  // Deprecated: please use NewService instead.
   114  // To provide a custom HTTP client, use option.WithHTTPClient.
   115  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   116  func New(client *http.Client) (*Service, error) {
   117  	if client == nil {
   118  		return nil, errors.New("client is nil")
   119  	}
   120  	s := &Service{client: client, BasePath: basePath}
   121  	s.Projects = NewProjectsService(s)
   122  	return s, nil
   123  }
   124  
   125  type Service struct {
   126  	client    *http.Client
   127  	BasePath  string // API endpoint base URL
   128  	UserAgent string // optional additional User-Agent fragment
   129  
   130  	Projects *ProjectsService
   131  }
   132  
   133  func (s *Service) userAgent() string {
   134  	if s.UserAgent == "" {
   135  		return googleapi.UserAgent
   136  	}
   137  	return googleapi.UserAgent + " " + s.UserAgent
   138  }
   139  
   140  func NewProjectsService(s *Service) *ProjectsService {
   141  	rs := &ProjectsService{s: s}
   142  	rs.Locations = NewProjectsLocationsService(s)
   143  	rs.ProvisioningQuotas = NewProjectsProvisioningQuotasService(s)
   144  	return rs
   145  }
   146  
   147  type ProjectsService struct {
   148  	s *Service
   149  
   150  	Locations *ProjectsLocationsService
   151  
   152  	ProvisioningQuotas *ProjectsProvisioningQuotasService
   153  }
   154  
   155  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   156  	rs := &ProjectsLocationsService{s: s}
   157  	return rs
   158  }
   159  
   160  type ProjectsLocationsService struct {
   161  	s *Service
   162  }
   163  
   164  func NewProjectsProvisioningQuotasService(s *Service) *ProjectsProvisioningQuotasService {
   165  	rs := &ProjectsProvisioningQuotasService{s: s}
   166  	return rs
   167  }
   168  
   169  type ProjectsProvisioningQuotasService struct {
   170  	s *Service
   171  }
   172  
   173  // InstanceConfig: Configuration parameters for a new instance.
   174  type InstanceConfig struct {
   175  	// ClientNetwork: Client network address.
   176  	ClientNetwork *NetworkAddress `json:"clientNetwork,omitempty"`
   177  
   178  	// Hyperthreading: Whether the instance should be provisioned with
   179  	// Hyperthreading enabled.
   180  	Hyperthreading bool `json:"hyperthreading,omitempty"`
   181  
   182  	// Id: A transient unique identifier to idenfity an instance within an
   183  	// ProvisioningConfig request.
   184  	Id string `json:"id,omitempty"`
   185  
   186  	// InstanceType: Instance type.
   187  	InstanceType string `json:"instanceType,omitempty"`
   188  
   189  	// Location: Location where to deploy the instance.
   190  	Location string `json:"location,omitempty"`
   191  
   192  	// OsImage: OS image to initialize the instance.
   193  	OsImage string `json:"osImage,omitempty"`
   194  
   195  	// PrivateNetwork: Private network address, if any.
   196  	PrivateNetwork *NetworkAddress `json:"privateNetwork,omitempty"`
   197  
   198  	// UserNote: User note field, it can be used by customers to add
   199  	// additional information for the BMS Ops team (b/194021617).
   200  	UserNote string `json:"userNote,omitempty"`
   201  
   202  	// ForceSendFields is a list of field names (e.g. "ClientNetwork") to
   203  	// unconditionally include in API requests. By default, fields with
   204  	// empty or default values are omitted from API requests. However, any
   205  	// non-pointer, non-interface field appearing in ForceSendFields will be
   206  	// sent to the server regardless of whether the field is empty or not.
   207  	// This may be used to include empty fields in Patch requests.
   208  	ForceSendFields []string `json:"-"`
   209  
   210  	// NullFields is a list of field names (e.g. "ClientNetwork") to include
   211  	// in API requests with the JSON null value. By default, fields with
   212  	// empty values are omitted from API requests. However, any field with
   213  	// an empty value appearing in NullFields will be sent to the server as
   214  	// null. It is an error if a field in this list has a non-empty value.
   215  	// This may be used to include null fields in Patch requests.
   216  	NullFields []string `json:"-"`
   217  }
   218  
   219  func (s *InstanceConfig) MarshalJSON() ([]byte, error) {
   220  	type NoMethod InstanceConfig
   221  	raw := NoMethod(*s)
   222  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   223  }
   224  
   225  // InstanceQuota: A resource budget.
   226  type InstanceQuota struct {
   227  	// AvailableMachineCount: Number of machines than can be created for the
   228  	// given location and instance_type.
   229  	AvailableMachineCount int64 `json:"availableMachineCount,omitempty"`
   230  
   231  	// InstanceType: Instance type.
   232  	InstanceType string `json:"instanceType,omitempty"`
   233  
   234  	// Location: Location where the quota applies.
   235  	Location string `json:"location,omitempty"`
   236  
   237  	// ForceSendFields is a list of field names (e.g.
   238  	// "AvailableMachineCount") to unconditionally include in API requests.
   239  	// By default, fields with empty or default values are omitted from API
   240  	// requests. However, any non-pointer, non-interface field appearing in
   241  	// ForceSendFields will be sent to the server regardless of whether the
   242  	// field is empty or not. This may be used to include empty fields in
   243  	// Patch requests.
   244  	ForceSendFields []string `json:"-"`
   245  
   246  	// NullFields is a list of field names (e.g. "AvailableMachineCount") to
   247  	// include in API requests with the JSON null value. By default, fields
   248  	// with empty values are omitted from API requests. However, any field
   249  	// with an empty value appearing in NullFields will be sent to the
   250  	// server as null. It is an error if a field in this list has a
   251  	// non-empty value. This may be used to include null fields in Patch
   252  	// requests.
   253  	NullFields []string `json:"-"`
   254  }
   255  
   256  func (s *InstanceQuota) MarshalJSON() ([]byte, error) {
   257  	type NoMethod InstanceQuota
   258  	raw := NoMethod(*s)
   259  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   260  }
   261  
   262  // ListProvisioningQuotasResponse: Response for ListProvisioningQuotas.
   263  type ListProvisioningQuotasResponse struct {
   264  	// NextPageToken: Token to retrieve the next page of results, or empty
   265  	// if there are no more results in the list.
   266  	NextPageToken string `json:"nextPageToken,omitempty"`
   267  
   268  	// ProvisioningQuotas: The provisioning quotas registered in this
   269  	// project.
   270  	ProvisioningQuotas []*ProvisioningQuota `json:"provisioningQuotas,omitempty"`
   271  
   272  	// ServerResponse contains the HTTP response code and headers from the
   273  	// server.
   274  	googleapi.ServerResponse `json:"-"`
   275  
   276  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   277  	// unconditionally include in API requests. By default, fields with
   278  	// empty or default values are omitted from API requests. However, any
   279  	// non-pointer, non-interface field appearing in ForceSendFields will be
   280  	// sent to the server regardless of whether the field is empty or not.
   281  	// This may be used to include empty fields in Patch requests.
   282  	ForceSendFields []string `json:"-"`
   283  
   284  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   285  	// in API requests with the JSON null value. By default, fields with
   286  	// empty values are omitted from API requests. However, any field with
   287  	// an empty value appearing in NullFields will be sent to the server as
   288  	// null. It is an error if a field in this list has a non-empty value.
   289  	// This may be used to include null fields in Patch requests.
   290  	NullFields []string `json:"-"`
   291  }
   292  
   293  func (s *ListProvisioningQuotasResponse) MarshalJSON() ([]byte, error) {
   294  	type NoMethod ListProvisioningQuotasResponse
   295  	raw := NoMethod(*s)
   296  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   297  }
   298  
   299  // LunRange: A LUN range.
   300  type LunRange struct {
   301  	// Quantity: Number of LUNs to create.
   302  	Quantity int64 `json:"quantity,omitempty"`
   303  
   304  	// SizeGb: The requested size of each LUN, in GB.
   305  	SizeGb int64 `json:"sizeGb,omitempty"`
   306  
   307  	// ForceSendFields is a list of field names (e.g. "Quantity") to
   308  	// unconditionally include in API requests. By default, fields with
   309  	// empty or default values are omitted from API requests. However, any
   310  	// non-pointer, non-interface field appearing in ForceSendFields will be
   311  	// sent to the server regardless of whether the field is empty or not.
   312  	// This may be used to include empty fields in Patch requests.
   313  	ForceSendFields []string `json:"-"`
   314  
   315  	// NullFields is a list of field names (e.g. "Quantity") to include in
   316  	// API requests with the JSON null value. By default, fields with empty
   317  	// values are omitted from API requests. However, any field with an
   318  	// empty value appearing in NullFields will be sent to the server as
   319  	// null. It is an error if a field in this list has a non-empty value.
   320  	// This may be used to include null fields in Patch requests.
   321  	NullFields []string `json:"-"`
   322  }
   323  
   324  func (s *LunRange) MarshalJSON() ([]byte, error) {
   325  	type NoMethod LunRange
   326  	raw := NoMethod(*s)
   327  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   328  }
   329  
   330  // NetworkAddress: A network.
   331  type NetworkAddress struct {
   332  	// Address: IP address to be assigned to the server.
   333  	Address string `json:"address,omitempty"`
   334  
   335  	// ExistingNetworkId: Name of the existing network to use. Will be of
   336  	// the format at--vlan for pre-intake UI networks like for eg,
   337  	// at-123456-vlan001 or any user-defined name like for eg,
   338  	// my-network-name for networks provisioned using intake UI. The field
   339  	// is exclusively filled only in case of an already existing network.
   340  	// Mutually exclusive with network_id.
   341  	ExistingNetworkId string `json:"existingNetworkId,omitempty"`
   342  
   343  	// NetworkId: Name of the network to use, within the same
   344  	// ProvisioningConfig request. This represents a new network being
   345  	// provisioned in the same request. Can have any user-defined name like
   346  	// for eg, my-network-name. Mutually exclusive with existing_network_id.
   347  	NetworkId string `json:"networkId,omitempty"`
   348  
   349  	// ForceSendFields is a list of field names (e.g. "Address") to
   350  	// unconditionally include in API requests. By default, fields with
   351  	// empty or default values are omitted from API requests. However, any
   352  	// non-pointer, non-interface field appearing in ForceSendFields will be
   353  	// sent to the server regardless of whether the field is empty or not.
   354  	// This may be used to include empty fields in Patch requests.
   355  	ForceSendFields []string `json:"-"`
   356  
   357  	// NullFields is a list of field names (e.g. "Address") to include in
   358  	// API requests with the JSON null value. By default, fields with empty
   359  	// values are omitted from API requests. However, any field with an
   360  	// empty value appearing in NullFields will be sent to the server as
   361  	// null. It is an error if a field in this list has a non-empty value.
   362  	// This may be used to include null fields in Patch requests.
   363  	NullFields []string `json:"-"`
   364  }
   365  
   366  func (s *NetworkAddress) MarshalJSON() ([]byte, error) {
   367  	type NoMethod NetworkAddress
   368  	raw := NoMethod(*s)
   369  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   370  }
   371  
   372  // NetworkConfig: Configuration parameters for a new network.
   373  type NetworkConfig struct {
   374  	// Bandwidth: Interconnect bandwidth. Set only when type is CLIENT.
   375  	//
   376  	// Possible values:
   377  	//   "BANDWIDTH_UNSPECIFIED" - Unspecified value.
   378  	//   "BW_1_GBPS" - 1 Gbps.
   379  	//   "BW_2_GBPS" - 2 Gbps.
   380  	//   "BW_5_GBPS" - 5 Gbps.
   381  	//   "BW_10_GBPS" - 10 Gbps.
   382  	Bandwidth string `json:"bandwidth,omitempty"`
   383  
   384  	// Cidr: CIDR range of the network.
   385  	Cidr string `json:"cidr,omitempty"`
   386  
   387  	// Id: A transient unique identifier to identify a volume within an
   388  	// ProvisioningConfig request.
   389  	Id string `json:"id,omitempty"`
   390  
   391  	// Location: Location where to deploy the network.
   392  	Location string `json:"location,omitempty"`
   393  
   394  	// ServiceCidr: Service CIDR, if any.
   395  	//
   396  	// Possible values:
   397  	//   "SERVICE_CIDR_UNSPECIFIED" - Unspecified value.
   398  	//   "DISABLED" - Services are disabled for the given network.
   399  	//   "HIGH_26" - Use the highest /26 block of the network to host
   400  	// services.
   401  	//   "HIGH_27" - Use the highest /27 block of the network to host
   402  	// services.
   403  	//   "HIGH_28" - Use the highest /28 block of the network to host
   404  	// services.
   405  	ServiceCidr string `json:"serviceCidr,omitempty"`
   406  
   407  	// Type: The type of this network.
   408  	//
   409  	// Possible values:
   410  	//   "TYPE_UNSPECIFIED" - Unspecified value.
   411  	//   "CLIENT" - Client network, that is a network peered to a GCP VPC.
   412  	//   "PRIVATE" - Private network, that is a network local to the BMS
   413  	// POD.
   414  	Type string `json:"type,omitempty"`
   415  
   416  	// UserNote: User note field, it can be used by customers to add
   417  	// additional information for the BMS Ops team (b/194021617).
   418  	UserNote string `json:"userNote,omitempty"`
   419  
   420  	// VlanAttachments: List of VLAN attachments. As of now there are always
   421  	// 2 attachments, but it is going to change in the future (multi vlan).
   422  	VlanAttachments []*VlanAttachment `json:"vlanAttachments,omitempty"`
   423  
   424  	// ForceSendFields is a list of field names (e.g. "Bandwidth") to
   425  	// unconditionally include in API requests. By default, fields with
   426  	// empty or default values are omitted from API requests. However, any
   427  	// non-pointer, non-interface field appearing in ForceSendFields will be
   428  	// sent to the server regardless of whether the field is empty or not.
   429  	// This may be used to include empty fields in Patch requests.
   430  	ForceSendFields []string `json:"-"`
   431  
   432  	// NullFields is a list of field names (e.g. "Bandwidth") to include in
   433  	// API requests with the JSON null value. By default, fields with empty
   434  	// values are omitted from API requests. However, any field with an
   435  	// empty value appearing in NullFields will be sent to the server as
   436  	// null. It is an error if a field in this list has a non-empty value.
   437  	// This may be used to include null fields in Patch requests.
   438  	NullFields []string `json:"-"`
   439  }
   440  
   441  func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
   442  	type NoMethod NetworkConfig
   443  	raw := NoMethod(*s)
   444  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   445  }
   446  
   447  // NfsExport: A NFS export entry.
   448  type NfsExport struct {
   449  	// AllowDev: Allow dev.
   450  	AllowDev bool `json:"allowDev,omitempty"`
   451  
   452  	// AllowSuid: Allow the setuid flag.
   453  	AllowSuid bool `json:"allowSuid,omitempty"`
   454  
   455  	// Cidr: A CIDR range.
   456  	Cidr string `json:"cidr,omitempty"`
   457  
   458  	// MachineId: Either a single machine, identified by an ID, or a
   459  	// comma-separated list of machine IDs.
   460  	MachineId string `json:"machineId,omitempty"`
   461  
   462  	// NetworkId: Network to use to publish the export.
   463  	NetworkId string `json:"networkId,omitempty"`
   464  
   465  	// NoRootSquash: Disable root squashing.
   466  	NoRootSquash bool `json:"noRootSquash,omitempty"`
   467  
   468  	// Permissions: Export permissions.
   469  	//
   470  	// Possible values:
   471  	//   "PERMISSIONS_UNSPECIFIED" - Unspecified value.
   472  	//   "READ_ONLY" - Read-only permission.
   473  	//   "READ_WRITE" - Read-write permission.
   474  	Permissions string `json:"permissions,omitempty"`
   475  
   476  	// ForceSendFields is a list of field names (e.g. "AllowDev") to
   477  	// unconditionally include in API requests. By default, fields with
   478  	// empty or default values are omitted from API requests. However, any
   479  	// non-pointer, non-interface field appearing in ForceSendFields will be
   480  	// sent to the server regardless of whether the field is empty or not.
   481  	// This may be used to include empty fields in Patch requests.
   482  	ForceSendFields []string `json:"-"`
   483  
   484  	// NullFields is a list of field names (e.g. "AllowDev") to include in
   485  	// API requests with the JSON null value. By default, fields with empty
   486  	// values are omitted from API requests. However, any field with an
   487  	// empty value appearing in NullFields will be sent to the server as
   488  	// null. It is an error if a field in this list has a non-empty value.
   489  	// This may be used to include null fields in Patch requests.
   490  	NullFields []string `json:"-"`
   491  }
   492  
   493  func (s *NfsExport) MarshalJSON() ([]byte, error) {
   494  	type NoMethod NfsExport
   495  	raw := NoMethod(*s)
   496  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   497  }
   498  
   499  // ProvisioningConfig: An provisioning configuration.
   500  type ProvisioningConfig struct {
   501  	// Instances: Instances to be created.
   502  	Instances []*InstanceConfig `json:"instances,omitempty"`
   503  
   504  	// Networks: Networks to be created.
   505  	Networks []*NetworkConfig `json:"networks,omitempty"`
   506  
   507  	// TicketId: A reference to track the request.
   508  	TicketId string `json:"ticketId,omitempty"`
   509  
   510  	// Volumes: Volumes to be created.
   511  	Volumes []*VolumeConfig `json:"volumes,omitempty"`
   512  
   513  	// ServerResponse contains the HTTP response code and headers from the
   514  	// server.
   515  	googleapi.ServerResponse `json:"-"`
   516  
   517  	// ForceSendFields is a list of field names (e.g. "Instances") to
   518  	// unconditionally include in API requests. By default, fields with
   519  	// empty or default values are omitted from API requests. However, any
   520  	// non-pointer, non-interface field appearing in ForceSendFields will be
   521  	// sent to the server regardless of whether the field is empty or not.
   522  	// This may be used to include empty fields in Patch requests.
   523  	ForceSendFields []string `json:"-"`
   524  
   525  	// NullFields is a list of field names (e.g. "Instances") to include in
   526  	// API requests with the JSON null value. By default, fields with empty
   527  	// values are omitted from API requests. However, any field with an
   528  	// empty value appearing in NullFields will be sent to the server as
   529  	// null. It is an error if a field in this list has a non-empty value.
   530  	// This may be used to include null fields in Patch requests.
   531  	NullFields []string `json:"-"`
   532  }
   533  
   534  func (s *ProvisioningConfig) MarshalJSON() ([]byte, error) {
   535  	type NoMethod ProvisioningConfig
   536  	raw := NoMethod(*s)
   537  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   538  }
   539  
   540  // ProvisioningQuota: A provisioning quota for a given project.
   541  type ProvisioningQuota struct {
   542  	// InstanceQuota: Instance quota.
   543  	InstanceQuota *InstanceQuota `json:"instanceQuota,omitempty"`
   544  
   545  	// ForceSendFields is a list of field names (e.g. "InstanceQuota") to
   546  	// unconditionally include in API requests. By default, fields with
   547  	// empty or default values are omitted from API requests. However, any
   548  	// non-pointer, non-interface field appearing in ForceSendFields will be
   549  	// sent to the server regardless of whether the field is empty or not.
   550  	// This may be used to include empty fields in Patch requests.
   551  	ForceSendFields []string `json:"-"`
   552  
   553  	// NullFields is a list of field names (e.g. "InstanceQuota") to include
   554  	// in API requests with the JSON null value. By default, fields with
   555  	// empty values are omitted from API requests. However, any field with
   556  	// an empty value appearing in NullFields will be sent to the server as
   557  	// null. It is an error if a field in this list has a non-empty value.
   558  	// This may be used to include null fields in Patch requests.
   559  	NullFields []string `json:"-"`
   560  }
   561  
   562  func (s *ProvisioningQuota) MarshalJSON() ([]byte, error) {
   563  	type NoMethod ProvisioningQuota
   564  	raw := NoMethod(*s)
   565  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   566  }
   567  
   568  // SubmitProvisioningConfigRequest: Request for
   569  // SubmitProvisioningConfig.
   570  type SubmitProvisioningConfigRequest struct {
   571  	// Email: Optional. Email provided to send a confirmation with
   572  	// provisioning config to.
   573  	Email string `json:"email,omitempty"`
   574  
   575  	// ProvisioningConfig: Required. The ProvisioningConfig to submit.
   576  	ProvisioningConfig *ProvisioningConfig `json:"provisioningConfig,omitempty"`
   577  
   578  	// ForceSendFields is a list of field names (e.g. "Email") to
   579  	// unconditionally include in API requests. By default, fields with
   580  	// empty or default values are omitted from API requests. However, any
   581  	// non-pointer, non-interface field appearing in ForceSendFields will be
   582  	// sent to the server regardless of whether the field is empty or not.
   583  	// This may be used to include empty fields in Patch requests.
   584  	ForceSendFields []string `json:"-"`
   585  
   586  	// NullFields is a list of field names (e.g. "Email") to include in API
   587  	// requests with the JSON null value. By default, fields with empty
   588  	// values are omitted from API requests. However, any field with an
   589  	// empty value appearing in NullFields will be sent to the server as
   590  	// null. It is an error if a field in this list has a non-empty value.
   591  	// This may be used to include null fields in Patch requests.
   592  	NullFields []string `json:"-"`
   593  }
   594  
   595  func (s *SubmitProvisioningConfigRequest) MarshalJSON() ([]byte, error) {
   596  	type NoMethod SubmitProvisioningConfigRequest
   597  	raw := NoMethod(*s)
   598  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   599  }
   600  
   601  // VlanAttachment: A GCP vlan attachment.
   602  type VlanAttachment struct {
   603  	// Id: Identifier of the VLAN attachment.
   604  	Id string `json:"id,omitempty"`
   605  
   606  	// PairingKey: Attachment pairing key.
   607  	PairingKey string `json:"pairingKey,omitempty"`
   608  
   609  	// ForceSendFields is a list of field names (e.g. "Id") to
   610  	// unconditionally include in API requests. By default, fields with
   611  	// empty or default values are omitted from API requests. However, any
   612  	// non-pointer, non-interface field appearing in ForceSendFields will be
   613  	// sent to the server regardless of whether the field is empty or not.
   614  	// This may be used to include empty fields in Patch requests.
   615  	ForceSendFields []string `json:"-"`
   616  
   617  	// NullFields is a list of field names (e.g. "Id") to include in API
   618  	// requests with the JSON null value. By default, fields with empty
   619  	// values are omitted from API requests. However, any field with an
   620  	// empty value appearing in NullFields will be sent to the server as
   621  	// null. It is an error if a field in this list has a non-empty value.
   622  	// This may be used to include null fields in Patch requests.
   623  	NullFields []string `json:"-"`
   624  }
   625  
   626  func (s *VlanAttachment) MarshalJSON() ([]byte, error) {
   627  	type NoMethod VlanAttachment
   628  	raw := NoMethod(*s)
   629  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   630  }
   631  
   632  // VolumeConfig: Configuration parameters for a new volume.
   633  type VolumeConfig struct {
   634  	// Id: A transient unique identifier to identify a volume within an
   635  	// ProvisioningConfig request.
   636  	Id string `json:"id,omitempty"`
   637  
   638  	// Location: Location where to deploy the volume.
   639  	Location string `json:"location,omitempty"`
   640  
   641  	// LunRanges: LUN ranges to be configured. Set only when protocol is
   642  	// PROTOCOL_FC.
   643  	LunRanges []*LunRange `json:"lunRanges,omitempty"`
   644  
   645  	// MachineIds: Machine ids connected to this volume. Set only when
   646  	// protocol is PROTOCOL_FC.
   647  	MachineIds []string `json:"machineIds,omitempty"`
   648  
   649  	// NfsExports: NFS exports. Set only when protocol is PROTOCOL_NFS.
   650  	NfsExports []*NfsExport `json:"nfsExports,omitempty"`
   651  
   652  	// Protocol: Volume protocol.
   653  	//
   654  	// Possible values:
   655  	//   "PROTOCOL_UNSPECIFIED" - Unspecified value.
   656  	//   "PROTOCOL_FC" - Fibre channel.
   657  	//   "PROTOCOL_NFS" - Network file system.
   658  	Protocol string `json:"protocol,omitempty"`
   659  
   660  	// SizeGb: The requested size of this volume, in GB. This will be
   661  	// updated in a later iteration with a generic size field.
   662  	SizeGb int64 `json:"sizeGb,omitempty"`
   663  
   664  	// SnapshotsEnabled: Whether snapshots should be enabled.
   665  	SnapshotsEnabled bool `json:"snapshotsEnabled,omitempty"`
   666  
   667  	// Type: The type of this Volume.
   668  	//
   669  	// Possible values:
   670  	//   "TYPE_UNSPECIFIED" - The unspecified type.
   671  	//   "FLASH" - This Volume is on flash.
   672  	//   "DISK" - This Volume is on disk.
   673  	Type string `json:"type,omitempty"`
   674  
   675  	// UserNote: User note field, it can be used by customers to add
   676  	// additional information for the BMS Ops team (b/194021617).
   677  	UserNote string `json:"userNote,omitempty"`
   678  
   679  	// ForceSendFields is a list of field names (e.g. "Id") to
   680  	// unconditionally include in API requests. By default, fields with
   681  	// empty or default values are omitted from API requests. However, any
   682  	// non-pointer, non-interface field appearing in ForceSendFields will be
   683  	// sent to the server regardless of whether the field is empty or not.
   684  	// This may be used to include empty fields in Patch requests.
   685  	ForceSendFields []string `json:"-"`
   686  
   687  	// NullFields is a list of field names (e.g. "Id") to include in API
   688  	// requests with the JSON null value. By default, fields with empty
   689  	// values are omitted from API requests. However, any field with an
   690  	// empty value appearing in NullFields will be sent to the server as
   691  	// null. It is an error if a field in this list has a non-empty value.
   692  	// This may be used to include null fields in Patch requests.
   693  	NullFields []string `json:"-"`
   694  }
   695  
   696  func (s *VolumeConfig) MarshalJSON() ([]byte, error) {
   697  	type NoMethod VolumeConfig
   698  	raw := NoMethod(*s)
   699  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   700  }
   701  
   702  // method id "baremetalsolution.projects.locations.submitProvisioningConfig":
   703  
   704  type ProjectsLocationsSubmitProvisioningConfigCall struct {
   705  	s                               *Service
   706  	project                         string
   707  	location                        string
   708  	submitprovisioningconfigrequest *SubmitProvisioningConfigRequest
   709  	urlParams_                      gensupport.URLParams
   710  	ctx_                            context.Context
   711  	header_                         http.Header
   712  }
   713  
   714  // SubmitProvisioningConfig: Submit a provisiong configuration for a
   715  // given project.
   716  //
   717  // - location: The target location of the provisioning request.
   718  // - project: The target project of the provisioning request.
   719  func (r *ProjectsLocationsService) SubmitProvisioningConfig(project string, location string, submitprovisioningconfigrequest *SubmitProvisioningConfigRequest) *ProjectsLocationsSubmitProvisioningConfigCall {
   720  	c := &ProjectsLocationsSubmitProvisioningConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   721  	c.project = project
   722  	c.location = location
   723  	c.submitprovisioningconfigrequest = submitprovisioningconfigrequest
   724  	return c
   725  }
   726  
   727  // Fields allows partial responses to be retrieved. See
   728  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   729  // for more information.
   730  func (c *ProjectsLocationsSubmitProvisioningConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubmitProvisioningConfigCall {
   731  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   732  	return c
   733  }
   734  
   735  // Context sets the context to be used in this call's Do method. Any
   736  // pending HTTP request will be aborted if the provided context is
   737  // canceled.
   738  func (c *ProjectsLocationsSubmitProvisioningConfigCall) Context(ctx context.Context) *ProjectsLocationsSubmitProvisioningConfigCall {
   739  	c.ctx_ = ctx
   740  	return c
   741  }
   742  
   743  // Header returns an http.Header that can be modified by the caller to
   744  // add HTTP headers to the request.
   745  func (c *ProjectsLocationsSubmitProvisioningConfigCall) Header() http.Header {
   746  	if c.header_ == nil {
   747  		c.header_ = make(http.Header)
   748  	}
   749  	return c.header_
   750  }
   751  
   752  func (c *ProjectsLocationsSubmitProvisioningConfigCall) doRequest(alt string) (*http.Response, error) {
   753  	reqHeaders := make(http.Header)
   754  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
   755  	for k, v := range c.header_ {
   756  		reqHeaders[k] = v
   757  	}
   758  	reqHeaders.Set("User-Agent", c.s.userAgent())
   759  	var body io.Reader = nil
   760  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitprovisioningconfigrequest)
   761  	if err != nil {
   762  		return nil, err
   763  	}
   764  	reqHeaders.Set("Content-Type", "application/json")
   765  	c.urlParams_.Set("alt", alt)
   766  	c.urlParams_.Set("prettyPrint", "false")
   767  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+project}/{+location}:submitProvisioningConfig")
   768  	urls += "?" + c.urlParams_.Encode()
   769  	req, err := http.NewRequest("POST", urls, body)
   770  	if err != nil {
   771  		return nil, err
   772  	}
   773  	req.Header = reqHeaders
   774  	googleapi.Expand(req.URL, map[string]string{
   775  		"project":  c.project,
   776  		"location": c.location,
   777  	})
   778  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   779  }
   780  
   781  // Do executes the "baremetalsolution.projects.locations.submitProvisioningConfig" call.
   782  // Exactly one of *ProvisioningConfig or error will be non-nil. Any
   783  // non-2xx status code is an error. Response headers are in either
   784  // *ProvisioningConfig.ServerResponse.Header or (if a response was
   785  // returned at all) in error.(*googleapi.Error).Header. Use
   786  // googleapi.IsNotModified to check whether the returned error was
   787  // because http.StatusNotModified was returned.
   788  func (c *ProjectsLocationsSubmitProvisioningConfigCall) Do(opts ...googleapi.CallOption) (*ProvisioningConfig, error) {
   789  	gensupport.SetOptions(c.urlParams_, opts...)
   790  	res, err := c.doRequest("json")
   791  	if res != nil && res.StatusCode == http.StatusNotModified {
   792  		if res.Body != nil {
   793  			res.Body.Close()
   794  		}
   795  		return nil, &googleapi.Error{
   796  			Code:   res.StatusCode,
   797  			Header: res.Header,
   798  		}
   799  	}
   800  	if err != nil {
   801  		return nil, err
   802  	}
   803  	defer googleapi.CloseBody(res)
   804  	if err := googleapi.CheckResponse(res); err != nil {
   805  		return nil, err
   806  	}
   807  	ret := &ProvisioningConfig{
   808  		ServerResponse: googleapi.ServerResponse{
   809  			Header:         res.Header,
   810  			HTTPStatusCode: res.StatusCode,
   811  		},
   812  	}
   813  	target := &ret
   814  	if err := gensupport.DecodeResponse(target, res); err != nil {
   815  		return nil, err
   816  	}
   817  	return ret, nil
   818  	// {
   819  	//   "description": "Submit a provisiong configuration for a given project.",
   820  	//   "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}:submitProvisioningConfig",
   821  	//   "httpMethod": "POST",
   822  	//   "id": "baremetalsolution.projects.locations.submitProvisioningConfig",
   823  	//   "parameterOrder": [
   824  	//     "project",
   825  	//     "location"
   826  	//   ],
   827  	//   "parameters": {
   828  	//     "location": {
   829  	//       "description": "Required. The target location of the provisioning request.",
   830  	//       "location": "path",
   831  	//       "pattern": "^locations/[^/]+$",
   832  	//       "required": true,
   833  	//       "type": "string"
   834  	//     },
   835  	//     "project": {
   836  	//       "description": "Required. The target project of the provisioning request.",
   837  	//       "location": "path",
   838  	//       "pattern": "^projects/[^/]+$",
   839  	//       "required": true,
   840  	//       "type": "string"
   841  	//     }
   842  	//   },
   843  	//   "path": "v1alpha1/{+project}/{+location}:submitProvisioningConfig",
   844  	//   "request": {
   845  	//     "$ref": "SubmitProvisioningConfigRequest"
   846  	//   },
   847  	//   "response": {
   848  	//     "$ref": "ProvisioningConfig"
   849  	//   },
   850  	//   "scopes": [
   851  	//     "https://www.googleapis.com/auth/cloud-platform"
   852  	//   ]
   853  	// }
   854  
   855  }
   856  
   857  // method id "baremetalsolution.projects.provisioningQuotas.list":
   858  
   859  type ProjectsProvisioningQuotasListCall struct {
   860  	s            *Service
   861  	parent       string
   862  	urlParams_   gensupport.URLParams
   863  	ifNoneMatch_ string
   864  	ctx_         context.Context
   865  	header_      http.Header
   866  }
   867  
   868  // List: List the budget details to provision resources on a given
   869  // project.
   870  //
   871  // - parent: The parent project containing the provisioning quotas.
   872  func (r *ProjectsProvisioningQuotasService) List(parent string) *ProjectsProvisioningQuotasListCall {
   873  	c := &ProjectsProvisioningQuotasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   874  	c.parent = parent
   875  	return c
   876  }
   877  
   878  // PageSize sets the optional parameter "pageSize": The maximum number
   879  // of items to return.
   880  func (c *ProjectsProvisioningQuotasListCall) PageSize(pageSize int64) *ProjectsProvisioningQuotasListCall {
   881  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   882  	return c
   883  }
   884  
   885  // PageToken sets the optional parameter "pageToken": The
   886  // next_page_token value returned from a previous List request, if any.
   887  func (c *ProjectsProvisioningQuotasListCall) PageToken(pageToken string) *ProjectsProvisioningQuotasListCall {
   888  	c.urlParams_.Set("pageToken", pageToken)
   889  	return c
   890  }
   891  
   892  // Fields allows partial responses to be retrieved. See
   893  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   894  // for more information.
   895  func (c *ProjectsProvisioningQuotasListCall) Fields(s ...googleapi.Field) *ProjectsProvisioningQuotasListCall {
   896  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   897  	return c
   898  }
   899  
   900  // IfNoneMatch sets the optional parameter which makes the operation
   901  // fail if the object's ETag matches the given value. This is useful for
   902  // getting updates only after the object has changed since the last
   903  // request. Use googleapi.IsNotModified to check whether the response
   904  // error from Do is the result of In-None-Match.
   905  func (c *ProjectsProvisioningQuotasListCall) IfNoneMatch(entityTag string) *ProjectsProvisioningQuotasListCall {
   906  	c.ifNoneMatch_ = entityTag
   907  	return c
   908  }
   909  
   910  // Context sets the context to be used in this call's Do method. Any
   911  // pending HTTP request will be aborted if the provided context is
   912  // canceled.
   913  func (c *ProjectsProvisioningQuotasListCall) Context(ctx context.Context) *ProjectsProvisioningQuotasListCall {
   914  	c.ctx_ = ctx
   915  	return c
   916  }
   917  
   918  // Header returns an http.Header that can be modified by the caller to
   919  // add HTTP headers to the request.
   920  func (c *ProjectsProvisioningQuotasListCall) Header() http.Header {
   921  	if c.header_ == nil {
   922  		c.header_ = make(http.Header)
   923  	}
   924  	return c.header_
   925  }
   926  
   927  func (c *ProjectsProvisioningQuotasListCall) doRequest(alt string) (*http.Response, error) {
   928  	reqHeaders := make(http.Header)
   929  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
   930  	for k, v := range c.header_ {
   931  		reqHeaders[k] = v
   932  	}
   933  	reqHeaders.Set("User-Agent", c.s.userAgent())
   934  	if c.ifNoneMatch_ != "" {
   935  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   936  	}
   937  	var body io.Reader = nil
   938  	c.urlParams_.Set("alt", alt)
   939  	c.urlParams_.Set("prettyPrint", "false")
   940  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/provisioningQuotas")
   941  	urls += "?" + c.urlParams_.Encode()
   942  	req, err := http.NewRequest("GET", urls, body)
   943  	if err != nil {
   944  		return nil, err
   945  	}
   946  	req.Header = reqHeaders
   947  	googleapi.Expand(req.URL, map[string]string{
   948  		"parent": c.parent,
   949  	})
   950  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   951  }
   952  
   953  // Do executes the "baremetalsolution.projects.provisioningQuotas.list" call.
   954  // Exactly one of *ListProvisioningQuotasResponse or error will be
   955  // non-nil. Any non-2xx status code is an error. Response headers are in
   956  // either *ListProvisioningQuotasResponse.ServerResponse.Header or (if a
   957  // response was returned at all) in error.(*googleapi.Error).Header. Use
   958  // googleapi.IsNotModified to check whether the returned error was
   959  // because http.StatusNotModified was returned.
   960  func (c *ProjectsProvisioningQuotasListCall) Do(opts ...googleapi.CallOption) (*ListProvisioningQuotasResponse, error) {
   961  	gensupport.SetOptions(c.urlParams_, opts...)
   962  	res, err := c.doRequest("json")
   963  	if res != nil && res.StatusCode == http.StatusNotModified {
   964  		if res.Body != nil {
   965  			res.Body.Close()
   966  		}
   967  		return nil, &googleapi.Error{
   968  			Code:   res.StatusCode,
   969  			Header: res.Header,
   970  		}
   971  	}
   972  	if err != nil {
   973  		return nil, err
   974  	}
   975  	defer googleapi.CloseBody(res)
   976  	if err := googleapi.CheckResponse(res); err != nil {
   977  		return nil, err
   978  	}
   979  	ret := &ListProvisioningQuotasResponse{
   980  		ServerResponse: googleapi.ServerResponse{
   981  			Header:         res.Header,
   982  			HTTPStatusCode: res.StatusCode,
   983  		},
   984  	}
   985  	target := &ret
   986  	if err := gensupport.DecodeResponse(target, res); err != nil {
   987  		return nil, err
   988  	}
   989  	return ret, nil
   990  	// {
   991  	//   "description": "List the budget details to provision resources on a given project.",
   992  	//   "flatPath": "v1alpha1/projects/{projectsId}/provisioningQuotas",
   993  	//   "httpMethod": "GET",
   994  	//   "id": "baremetalsolution.projects.provisioningQuotas.list",
   995  	//   "parameterOrder": [
   996  	//     "parent"
   997  	//   ],
   998  	//   "parameters": {
   999  	//     "pageSize": {
  1000  	//       "description": "The maximum number of items to return.",
  1001  	//       "format": "int32",
  1002  	//       "location": "query",
  1003  	//       "type": "integer"
  1004  	//     },
  1005  	//     "pageToken": {
  1006  	//       "description": "The next_page_token value returned from a previous List request, if any.",
  1007  	//       "location": "query",
  1008  	//       "type": "string"
  1009  	//     },
  1010  	//     "parent": {
  1011  	//       "description": "Required. The parent project containing the provisioning quotas.",
  1012  	//       "location": "path",
  1013  	//       "pattern": "^projects/[^/]+$",
  1014  	//       "required": true,
  1015  	//       "type": "string"
  1016  	//     }
  1017  	//   },
  1018  	//   "path": "v1alpha1/{+parent}/provisioningQuotas",
  1019  	//   "response": {
  1020  	//     "$ref": "ListProvisioningQuotasResponse"
  1021  	//   },
  1022  	//   "scopes": [
  1023  	//     "https://www.googleapis.com/auth/cloud-platform"
  1024  	//   ]
  1025  	// }
  1026  
  1027  }
  1028  
  1029  // Pages invokes f for each page of results.
  1030  // A non-nil error returned from f will halt the iteration.
  1031  // The provided context supersedes any context provided to the Context method.
  1032  func (c *ProjectsProvisioningQuotasListCall) Pages(ctx context.Context, f func(*ListProvisioningQuotasResponse) error) error {
  1033  	c.ctx_ = ctx
  1034  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1035  	for {
  1036  		x, err := c.Do()
  1037  		if err != nil {
  1038  			return err
  1039  		}
  1040  		if err := f(x); err != nil {
  1041  			return err
  1042  		}
  1043  		if x.NextPageToken == "" {
  1044  			return nil
  1045  		}
  1046  		c.PageToken(x.NextPageToken)
  1047  	}
  1048  }
  1049  

View as plain text