...

Source file src/google.golang.org/api/oslogin/v1/oslogin-gen.go

Documentation: google.golang.org/api/oslogin/v1

     1  // Copyright 2024 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 oslogin provides access to the Cloud OS Login API.
     8  //
     9  // This package is DEPRECATED. Use package cloud.google.com/go/oslogin/apiv1 instead.
    10  //
    11  // For product documentation, see: https://cloud.google.com/compute/docs/oslogin/
    12  //
    13  // # Library status
    14  //
    15  // These client libraries are officially supported by Google. However, this
    16  // library is considered complete and is in maintenance mode. This means
    17  // that we will address critical bugs and security issues but will not add
    18  // any new features.
    19  //
    20  // When possible, we recommend using our newer
    21  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    22  // that are still actively being worked and iterated on.
    23  //
    24  // # Creating a client
    25  //
    26  // Usage example:
    27  //
    28  //	import "google.golang.org/api/oslogin/v1"
    29  //	...
    30  //	ctx := context.Background()
    31  //	osloginService, err := oslogin.NewService(ctx)
    32  //
    33  // In this example, Google Application Default Credentials are used for
    34  // authentication. For information on how to create and obtain Application
    35  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    36  //
    37  // # Other authentication options
    38  //
    39  // By default, all available scopes (see "Constants") are used to authenticate.
    40  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    41  //
    42  //	osloginService, err := oslogin.NewService(ctx, option.WithScopes(oslogin.ComputeReadonlyScope))
    43  //
    44  // To use an API key for authentication (note: some APIs do not support API
    45  // keys), use [google.golang.org/api/option.WithAPIKey]:
    46  //
    47  //	osloginService, err := oslogin.NewService(ctx, option.WithAPIKey("AIza..."))
    48  //
    49  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    50  // flow, use [google.golang.org/api/option.WithTokenSource]:
    51  //
    52  //	config := &oauth2.Config{...}
    53  //	// ...
    54  //	token, err := config.Exchange(ctx, ...)
    55  //	osloginService, err := oslogin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    56  //
    57  // See [google.golang.org/api/option.ClientOption] for details on options.
    58  package oslogin // import "google.golang.org/api/oslogin/v1"
    59  
    60  import (
    61  	"bytes"
    62  	"context"
    63  	"encoding/json"
    64  	"errors"
    65  	"fmt"
    66  	"io"
    67  	"net/http"
    68  	"net/url"
    69  	"strconv"
    70  	"strings"
    71  
    72  	googleapi "google.golang.org/api/googleapi"
    73  	internal "google.golang.org/api/internal"
    74  	gensupport "google.golang.org/api/internal/gensupport"
    75  	option "google.golang.org/api/option"
    76  	internaloption "google.golang.org/api/option/internaloption"
    77  	htransport "google.golang.org/api/transport/http"
    78  )
    79  
    80  // Always reference these packages, just in case the auto-generated code
    81  // below doesn't.
    82  var _ = bytes.NewBuffer
    83  var _ = strconv.Itoa
    84  var _ = fmt.Sprintf
    85  var _ = json.NewDecoder
    86  var _ = io.Copy
    87  var _ = url.Parse
    88  var _ = gensupport.MarshalJSON
    89  var _ = googleapi.Version
    90  var _ = errors.New
    91  var _ = strings.Replace
    92  var _ = context.Canceled
    93  var _ = internaloption.WithDefaultEndpoint
    94  var _ = internal.Version
    95  
    96  const apiId = "oslogin:v1"
    97  const apiName = "oslogin"
    98  const apiVersion = "v1"
    99  const basePath = "https://oslogin.googleapis.com/"
   100  const basePathTemplate = "https://oslogin.UNIVERSE_DOMAIN/"
   101  const mtlsBasePath = "https://oslogin.mtls.googleapis.com/"
   102  
   103  // OAuth2 scopes used by this API.
   104  const (
   105  	// See, edit, configure, and delete your Google Cloud data and see the email
   106  	// address for your Google Account.
   107  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   108  
   109  	// View your data across Google Cloud services and see the email address of
   110  	// your Google Account
   111  	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
   112  
   113  	// View and manage your Google Compute Engine resources
   114  	ComputeScope = "https://www.googleapis.com/auth/compute"
   115  
   116  	// View your Google Compute Engine resources
   117  	ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
   118  )
   119  
   120  // NewService creates a new Service.
   121  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   122  	scopesOption := internaloption.WithDefaultScopes(
   123  		"https://www.googleapis.com/auth/cloud-platform",
   124  		"https://www.googleapis.com/auth/cloud-platform.read-only",
   125  		"https://www.googleapis.com/auth/compute",
   126  		"https://www.googleapis.com/auth/compute.readonly",
   127  	)
   128  	// NOTE: prepend, so we don't override user-specified scopes.
   129  	opts = append([]option.ClientOption{scopesOption}, opts...)
   130  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   131  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   132  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   133  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   134  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   135  	if err != nil {
   136  		return nil, err
   137  	}
   138  	s, err := New(client)
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	if endpoint != "" {
   143  		s.BasePath = endpoint
   144  	}
   145  	return s, nil
   146  }
   147  
   148  // New creates a new Service. It uses the provided http.Client for requests.
   149  //
   150  // Deprecated: please use NewService instead.
   151  // To provide a custom HTTP client, use option.WithHTTPClient.
   152  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   153  func New(client *http.Client) (*Service, error) {
   154  	if client == nil {
   155  		return nil, errors.New("client is nil")
   156  	}
   157  	s := &Service{client: client, BasePath: basePath}
   158  	s.Users = NewUsersService(s)
   159  	return s, nil
   160  }
   161  
   162  type Service struct {
   163  	client    *http.Client
   164  	BasePath  string // API endpoint base URL
   165  	UserAgent string // optional additional User-Agent fragment
   166  
   167  	Users *UsersService
   168  }
   169  
   170  func (s *Service) userAgent() string {
   171  	if s.UserAgent == "" {
   172  		return googleapi.UserAgent
   173  	}
   174  	return googleapi.UserAgent + " " + s.UserAgent
   175  }
   176  
   177  func NewUsersService(s *Service) *UsersService {
   178  	rs := &UsersService{s: s}
   179  	rs.Projects = NewUsersProjectsService(s)
   180  	rs.SshPublicKeys = NewUsersSshPublicKeysService(s)
   181  	return rs
   182  }
   183  
   184  type UsersService struct {
   185  	s *Service
   186  
   187  	Projects *UsersProjectsService
   188  
   189  	SshPublicKeys *UsersSshPublicKeysService
   190  }
   191  
   192  func NewUsersProjectsService(s *Service) *UsersProjectsService {
   193  	rs := &UsersProjectsService{s: s}
   194  	return rs
   195  }
   196  
   197  type UsersProjectsService struct {
   198  	s *Service
   199  }
   200  
   201  func NewUsersSshPublicKeysService(s *Service) *UsersSshPublicKeysService {
   202  	rs := &UsersSshPublicKeysService{s: s}
   203  	return rs
   204  }
   205  
   206  type UsersSshPublicKeysService struct {
   207  	s *Service
   208  }
   209  
   210  // Empty: A generic empty message that you can re-use to avoid defining
   211  // duplicated empty messages in your APIs. A typical example is to use it as
   212  // the request or the response type of an API method. For instance: service Foo
   213  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   214  type Empty struct {
   215  	// ServerResponse contains the HTTP response code and headers from the server.
   216  	googleapi.ServerResponse `json:"-"`
   217  }
   218  
   219  // ImportSshPublicKeyResponse: A response message for importing an SSH public
   220  // key.
   221  type ImportSshPublicKeyResponse struct {
   222  	// Details: Detailed information about import results.
   223  	Details string `json:"details,omitempty"`
   224  	// LoginProfile: The login profile information for the user.
   225  	LoginProfile *LoginProfile `json:"loginProfile,omitempty"`
   226  
   227  	// ServerResponse contains the HTTP response code and headers from the server.
   228  	googleapi.ServerResponse `json:"-"`
   229  	// ForceSendFields is a list of field names (e.g. "Details") to unconditionally
   230  	// include in API requests. By default, fields with empty or default values are
   231  	// omitted from API requests. See
   232  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   233  	// details.
   234  	ForceSendFields []string `json:"-"`
   235  	// NullFields is a list of field names (e.g. "Details") to include in API
   236  	// requests with the JSON null value. By default, fields with empty values are
   237  	// omitted from API requests. See
   238  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   239  	NullFields []string `json:"-"`
   240  }
   241  
   242  func (s *ImportSshPublicKeyResponse) MarshalJSON() ([]byte, error) {
   243  	type NoMethod ImportSshPublicKeyResponse
   244  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   245  }
   246  
   247  // LoginProfile: The user profile information used for logging in to a virtual
   248  // machine on Google Compute Engine.
   249  type LoginProfile struct {
   250  	// Name: Required. A unique user ID.
   251  	Name string `json:"name,omitempty"`
   252  	// PosixAccounts: The list of POSIX accounts associated with the user.
   253  	PosixAccounts []*PosixAccount `json:"posixAccounts,omitempty"`
   254  	// SshPublicKeys: A map from SSH public key fingerprint to the associated key
   255  	// object.
   256  	SshPublicKeys map[string]SshPublicKey `json:"sshPublicKeys,omitempty"`
   257  
   258  	// ServerResponse contains the HTTP response code and headers from the server.
   259  	googleapi.ServerResponse `json:"-"`
   260  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   261  	// include in API requests. By default, fields with empty or default values are
   262  	// omitted from API requests. See
   263  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   264  	// details.
   265  	ForceSendFields []string `json:"-"`
   266  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   267  	// with the JSON null value. By default, fields with empty values are omitted
   268  	// from API requests. See
   269  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   270  	NullFields []string `json:"-"`
   271  }
   272  
   273  func (s *LoginProfile) MarshalJSON() ([]byte, error) {
   274  	type NoMethod LoginProfile
   275  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   276  }
   277  
   278  // PosixAccount: The POSIX account information associated with a Google
   279  // account.
   280  type PosixAccount struct {
   281  	// AccountId: Output only. A POSIX account identifier.
   282  	AccountId string `json:"accountId,omitempty"`
   283  	// Gecos: The GECOS (user information) entry for this account.
   284  	Gecos string `json:"gecos,omitempty"`
   285  	// Gid: The default group ID.
   286  	Gid int64 `json:"gid,omitempty,string"`
   287  	// HomeDirectory: The path to the home directory for this account.
   288  	HomeDirectory string `json:"homeDirectory,omitempty"`
   289  	// Name: Output only. The canonical resource name.
   290  	Name string `json:"name,omitempty"`
   291  	// OperatingSystemType: The operating system type where this account applies.
   292  	//
   293  	// Possible values:
   294  	//   "OPERATING_SYSTEM_TYPE_UNSPECIFIED" - The operating system type associated
   295  	// with the user account information is unspecified.
   296  	//   "LINUX" - Linux user account information.
   297  	//   "WINDOWS" - Windows user account information.
   298  	OperatingSystemType string `json:"operatingSystemType,omitempty"`
   299  	// Primary: Only one POSIX account can be marked as primary.
   300  	Primary bool `json:"primary,omitempty"`
   301  	// Shell: The path to the logic shell for this account.
   302  	Shell string `json:"shell,omitempty"`
   303  	// SystemId: System identifier for which account the username or uid applies
   304  	// to. By default, the empty value is used.
   305  	SystemId string `json:"systemId,omitempty"`
   306  	// Uid: The user ID.
   307  	Uid int64 `json:"uid,omitempty,string"`
   308  	// Username: The username of the POSIX account.
   309  	Username string `json:"username,omitempty"`
   310  	// ForceSendFields is a list of field names (e.g. "AccountId") to
   311  	// unconditionally include in API requests. By default, fields with empty or
   312  	// default values are omitted from API requests. See
   313  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   314  	// details.
   315  	ForceSendFields []string `json:"-"`
   316  	// NullFields is a list of field names (e.g. "AccountId") to include in API
   317  	// requests with the JSON null value. By default, fields with empty values are
   318  	// omitted from API requests. See
   319  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   320  	NullFields []string `json:"-"`
   321  }
   322  
   323  func (s *PosixAccount) MarshalJSON() ([]byte, error) {
   324  	type NoMethod PosixAccount
   325  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   326  }
   327  
   328  // SshPublicKey: The SSH public key information associated with a Google
   329  // account.
   330  type SshPublicKey struct {
   331  	// ExpirationTimeUsec: An expiration time in microseconds since epoch.
   332  	ExpirationTimeUsec int64 `json:"expirationTimeUsec,omitempty,string"`
   333  	// Fingerprint: Output only. The SHA-256 fingerprint of the SSH public key.
   334  	Fingerprint string `json:"fingerprint,omitempty"`
   335  	// Key: Public key text in SSH format, defined by RFC4253 section 6.6.
   336  	Key string `json:"key,omitempty"`
   337  	// Name: Output only. The canonical resource name.
   338  	Name string `json:"name,omitempty"`
   339  
   340  	// ServerResponse contains the HTTP response code and headers from the server.
   341  	googleapi.ServerResponse `json:"-"`
   342  	// ForceSendFields is a list of field names (e.g. "ExpirationTimeUsec") to
   343  	// unconditionally include in API requests. By default, fields with empty or
   344  	// default values are omitted from API requests. See
   345  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   346  	// details.
   347  	ForceSendFields []string `json:"-"`
   348  	// NullFields is a list of field names (e.g. "ExpirationTimeUsec") to include
   349  	// in API requests with the JSON null value. By default, fields with empty
   350  	// values are omitted from API requests. See
   351  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   352  	NullFields []string `json:"-"`
   353  }
   354  
   355  func (s *SshPublicKey) MarshalJSON() ([]byte, error) {
   356  	type NoMethod SshPublicKey
   357  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   358  }
   359  
   360  type UsersGetLoginProfileCall struct {
   361  	s            *Service
   362  	name         string
   363  	urlParams_   gensupport.URLParams
   364  	ifNoneMatch_ string
   365  	ctx_         context.Context
   366  	header_      http.Header
   367  }
   368  
   369  // GetLoginProfile: Retrieves the profile information used for logging in to a
   370  // virtual machine on Google Compute Engine.
   371  //
   372  // - name: The unique ID for the user in format `users/{user}`.
   373  func (r *UsersService) GetLoginProfile(name string) *UsersGetLoginProfileCall {
   374  	c := &UsersGetLoginProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   375  	c.name = name
   376  	return c
   377  }
   378  
   379  // ProjectId sets the optional parameter "projectId": The project ID of the
   380  // Google Cloud Platform project.
   381  func (c *UsersGetLoginProfileCall) ProjectId(projectId string) *UsersGetLoginProfileCall {
   382  	c.urlParams_.Set("projectId", projectId)
   383  	return c
   384  }
   385  
   386  // SystemId sets the optional parameter "systemId": A system ID for filtering
   387  // the results of the request.
   388  func (c *UsersGetLoginProfileCall) SystemId(systemId string) *UsersGetLoginProfileCall {
   389  	c.urlParams_.Set("systemId", systemId)
   390  	return c
   391  }
   392  
   393  // Fields allows partial responses to be retrieved. See
   394  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   395  // details.
   396  func (c *UsersGetLoginProfileCall) Fields(s ...googleapi.Field) *UsersGetLoginProfileCall {
   397  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   398  	return c
   399  }
   400  
   401  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   402  // object's ETag matches the given value. This is useful for getting updates
   403  // only after the object has changed since the last request.
   404  func (c *UsersGetLoginProfileCall) IfNoneMatch(entityTag string) *UsersGetLoginProfileCall {
   405  	c.ifNoneMatch_ = entityTag
   406  	return c
   407  }
   408  
   409  // Context sets the context to be used in this call's Do method.
   410  func (c *UsersGetLoginProfileCall) Context(ctx context.Context) *UsersGetLoginProfileCall {
   411  	c.ctx_ = ctx
   412  	return c
   413  }
   414  
   415  // Header returns a http.Header that can be modified by the caller to add
   416  // headers to the request.
   417  func (c *UsersGetLoginProfileCall) Header() http.Header {
   418  	if c.header_ == nil {
   419  		c.header_ = make(http.Header)
   420  	}
   421  	return c.header_
   422  }
   423  
   424  func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) {
   425  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   426  	if c.ifNoneMatch_ != "" {
   427  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   428  	}
   429  	var body io.Reader = nil
   430  	c.urlParams_.Set("alt", alt)
   431  	c.urlParams_.Set("prettyPrint", "false")
   432  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/loginProfile")
   433  	urls += "?" + c.urlParams_.Encode()
   434  	req, err := http.NewRequest("GET", urls, body)
   435  	if err != nil {
   436  		return nil, err
   437  	}
   438  	req.Header = reqHeaders
   439  	googleapi.Expand(req.URL, map[string]string{
   440  		"name": c.name,
   441  	})
   442  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   443  }
   444  
   445  // Do executes the "oslogin.users.getLoginProfile" call.
   446  // Any non-2xx status code is an error. Response headers are in either
   447  // *LoginProfile.ServerResponse.Header or (if a response was returned at all)
   448  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   449  // whether the returned error was because http.StatusNotModified was returned.
   450  func (c *UsersGetLoginProfileCall) Do(opts ...googleapi.CallOption) (*LoginProfile, error) {
   451  	gensupport.SetOptions(c.urlParams_, opts...)
   452  	res, err := c.doRequest("json")
   453  	if res != nil && res.StatusCode == http.StatusNotModified {
   454  		if res.Body != nil {
   455  			res.Body.Close()
   456  		}
   457  		return nil, gensupport.WrapError(&googleapi.Error{
   458  			Code:   res.StatusCode,
   459  			Header: res.Header,
   460  		})
   461  	}
   462  	if err != nil {
   463  		return nil, err
   464  	}
   465  	defer googleapi.CloseBody(res)
   466  	if err := googleapi.CheckResponse(res); err != nil {
   467  		return nil, gensupport.WrapError(err)
   468  	}
   469  	ret := &LoginProfile{
   470  		ServerResponse: googleapi.ServerResponse{
   471  			Header:         res.Header,
   472  			HTTPStatusCode: res.StatusCode,
   473  		},
   474  	}
   475  	target := &ret
   476  	if err := gensupport.DecodeResponse(target, res); err != nil {
   477  		return nil, err
   478  	}
   479  	return ret, nil
   480  }
   481  
   482  type UsersImportSshPublicKeyCall struct {
   483  	s            *Service
   484  	parent       string
   485  	sshpublickey *SshPublicKey
   486  	urlParams_   gensupport.URLParams
   487  	ctx_         context.Context
   488  	header_      http.Header
   489  }
   490  
   491  // ImportSshPublicKey: Adds an SSH public key and returns the profile
   492  // information. Default POSIX account information is set when no username and
   493  // UID exist as part of the login profile.
   494  //
   495  // - parent: The unique ID for the user in format `users/{user}`.
   496  func (r *UsersService) ImportSshPublicKey(parent string, sshpublickey *SshPublicKey) *UsersImportSshPublicKeyCall {
   497  	c := &UsersImportSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   498  	c.parent = parent
   499  	c.sshpublickey = sshpublickey
   500  	return c
   501  }
   502  
   503  // ProjectId sets the optional parameter "projectId": The project ID of the
   504  // Google Cloud Platform project.
   505  func (c *UsersImportSshPublicKeyCall) ProjectId(projectId string) *UsersImportSshPublicKeyCall {
   506  	c.urlParams_.Set("projectId", projectId)
   507  	return c
   508  }
   509  
   510  // Regions sets the optional parameter "regions": The regions to which to
   511  // assert that the key was written. If unspecified, defaults to all regions.
   512  // Regions are listed at https://cloud.google.com/about/locations#region.
   513  func (c *UsersImportSshPublicKeyCall) Regions(regions ...string) *UsersImportSshPublicKeyCall {
   514  	c.urlParams_.SetMulti("regions", append([]string{}, regions...))
   515  	return c
   516  }
   517  
   518  // Fields allows partial responses to be retrieved. See
   519  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   520  // details.
   521  func (c *UsersImportSshPublicKeyCall) Fields(s ...googleapi.Field) *UsersImportSshPublicKeyCall {
   522  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   523  	return c
   524  }
   525  
   526  // Context sets the context to be used in this call's Do method.
   527  func (c *UsersImportSshPublicKeyCall) Context(ctx context.Context) *UsersImportSshPublicKeyCall {
   528  	c.ctx_ = ctx
   529  	return c
   530  }
   531  
   532  // Header returns a http.Header that can be modified by the caller to add
   533  // headers to the request.
   534  func (c *UsersImportSshPublicKeyCall) Header() http.Header {
   535  	if c.header_ == nil {
   536  		c.header_ = make(http.Header)
   537  	}
   538  	return c.header_
   539  }
   540  
   541  func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) {
   542  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   543  	var body io.Reader = nil
   544  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey)
   545  	if err != nil {
   546  		return nil, err
   547  	}
   548  	c.urlParams_.Set("alt", alt)
   549  	c.urlParams_.Set("prettyPrint", "false")
   550  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:importSshPublicKey")
   551  	urls += "?" + c.urlParams_.Encode()
   552  	req, err := http.NewRequest("POST", urls, body)
   553  	if err != nil {
   554  		return nil, err
   555  	}
   556  	req.Header = reqHeaders
   557  	googleapi.Expand(req.URL, map[string]string{
   558  		"parent": c.parent,
   559  	})
   560  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   561  }
   562  
   563  // Do executes the "oslogin.users.importSshPublicKey" call.
   564  // Any non-2xx status code is an error. Response headers are in either
   565  // *ImportSshPublicKeyResponse.ServerResponse.Header or (if a response was
   566  // returned at all) in error.(*googleapi.Error).Header. Use
   567  // googleapi.IsNotModified to check whether the returned error was because
   568  // http.StatusNotModified was returned.
   569  func (c *UsersImportSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*ImportSshPublicKeyResponse, error) {
   570  	gensupport.SetOptions(c.urlParams_, opts...)
   571  	res, err := c.doRequest("json")
   572  	if res != nil && res.StatusCode == http.StatusNotModified {
   573  		if res.Body != nil {
   574  			res.Body.Close()
   575  		}
   576  		return nil, gensupport.WrapError(&googleapi.Error{
   577  			Code:   res.StatusCode,
   578  			Header: res.Header,
   579  		})
   580  	}
   581  	if err != nil {
   582  		return nil, err
   583  	}
   584  	defer googleapi.CloseBody(res)
   585  	if err := googleapi.CheckResponse(res); err != nil {
   586  		return nil, gensupport.WrapError(err)
   587  	}
   588  	ret := &ImportSshPublicKeyResponse{
   589  		ServerResponse: googleapi.ServerResponse{
   590  			Header:         res.Header,
   591  			HTTPStatusCode: res.StatusCode,
   592  		},
   593  	}
   594  	target := &ret
   595  	if err := gensupport.DecodeResponse(target, res); err != nil {
   596  		return nil, err
   597  	}
   598  	return ret, nil
   599  }
   600  
   601  type UsersProjectsDeleteCall struct {
   602  	s          *Service
   603  	name       string
   604  	urlParams_ gensupport.URLParams
   605  	ctx_       context.Context
   606  	header_    http.Header
   607  }
   608  
   609  // Delete: Deletes a POSIX account.
   610  //
   611  //   - name: A reference to the POSIX account to update. POSIX accounts are
   612  //     identified by the project ID they are associated with. A reference to the
   613  //     POSIX account is in format `users/{user}/projects/{project}`.
   614  func (r *UsersProjectsService) Delete(name string) *UsersProjectsDeleteCall {
   615  	c := &UsersProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   616  	c.name = name
   617  	return c
   618  }
   619  
   620  // Fields allows partial responses to be retrieved. See
   621  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   622  // details.
   623  func (c *UsersProjectsDeleteCall) Fields(s ...googleapi.Field) *UsersProjectsDeleteCall {
   624  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   625  	return c
   626  }
   627  
   628  // Context sets the context to be used in this call's Do method.
   629  func (c *UsersProjectsDeleteCall) Context(ctx context.Context) *UsersProjectsDeleteCall {
   630  	c.ctx_ = ctx
   631  	return c
   632  }
   633  
   634  // Header returns a http.Header that can be modified by the caller to add
   635  // headers to the request.
   636  func (c *UsersProjectsDeleteCall) Header() http.Header {
   637  	if c.header_ == nil {
   638  		c.header_ = make(http.Header)
   639  	}
   640  	return c.header_
   641  }
   642  
   643  func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
   644  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   645  	var body io.Reader = nil
   646  	c.urlParams_.Set("alt", alt)
   647  	c.urlParams_.Set("prettyPrint", "false")
   648  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   649  	urls += "?" + c.urlParams_.Encode()
   650  	req, err := http.NewRequest("DELETE", urls, body)
   651  	if err != nil {
   652  		return nil, err
   653  	}
   654  	req.Header = reqHeaders
   655  	googleapi.Expand(req.URL, map[string]string{
   656  		"name": c.name,
   657  	})
   658  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   659  }
   660  
   661  // Do executes the "oslogin.users.projects.delete" call.
   662  // Any non-2xx status code is an error. Response headers are in either
   663  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   664  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   665  // whether the returned error was because http.StatusNotModified was returned.
   666  func (c *UsersProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   667  	gensupport.SetOptions(c.urlParams_, opts...)
   668  	res, err := c.doRequest("json")
   669  	if res != nil && res.StatusCode == http.StatusNotModified {
   670  		if res.Body != nil {
   671  			res.Body.Close()
   672  		}
   673  		return nil, gensupport.WrapError(&googleapi.Error{
   674  			Code:   res.StatusCode,
   675  			Header: res.Header,
   676  		})
   677  	}
   678  	if err != nil {
   679  		return nil, err
   680  	}
   681  	defer googleapi.CloseBody(res)
   682  	if err := googleapi.CheckResponse(res); err != nil {
   683  		return nil, gensupport.WrapError(err)
   684  	}
   685  	ret := &Empty{
   686  		ServerResponse: googleapi.ServerResponse{
   687  			Header:         res.Header,
   688  			HTTPStatusCode: res.StatusCode,
   689  		},
   690  	}
   691  	target := &ret
   692  	if err := gensupport.DecodeResponse(target, res); err != nil {
   693  		return nil, err
   694  	}
   695  	return ret, nil
   696  }
   697  
   698  type UsersSshPublicKeysCreateCall struct {
   699  	s            *Service
   700  	parent       string
   701  	sshpublickey *SshPublicKey
   702  	urlParams_   gensupport.URLParams
   703  	ctx_         context.Context
   704  	header_      http.Header
   705  }
   706  
   707  // Create: Create an SSH public key
   708  //
   709  // - parent: The unique ID for the user in format `users/{user}`.
   710  func (r *UsersSshPublicKeysService) Create(parent string, sshpublickey *SshPublicKey) *UsersSshPublicKeysCreateCall {
   711  	c := &UsersSshPublicKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   712  	c.parent = parent
   713  	c.sshpublickey = sshpublickey
   714  	return c
   715  }
   716  
   717  // Fields allows partial responses to be retrieved. See
   718  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   719  // details.
   720  func (c *UsersSshPublicKeysCreateCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysCreateCall {
   721  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   722  	return c
   723  }
   724  
   725  // Context sets the context to be used in this call's Do method.
   726  func (c *UsersSshPublicKeysCreateCall) Context(ctx context.Context) *UsersSshPublicKeysCreateCall {
   727  	c.ctx_ = ctx
   728  	return c
   729  }
   730  
   731  // Header returns a http.Header that can be modified by the caller to add
   732  // headers to the request.
   733  func (c *UsersSshPublicKeysCreateCall) Header() http.Header {
   734  	if c.header_ == nil {
   735  		c.header_ = make(http.Header)
   736  	}
   737  	return c.header_
   738  }
   739  
   740  func (c *UsersSshPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) {
   741  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   742  	var body io.Reader = nil
   743  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey)
   744  	if err != nil {
   745  		return nil, err
   746  	}
   747  	c.urlParams_.Set("alt", alt)
   748  	c.urlParams_.Set("prettyPrint", "false")
   749  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/sshPublicKeys")
   750  	urls += "?" + c.urlParams_.Encode()
   751  	req, err := http.NewRequest("POST", urls, body)
   752  	if err != nil {
   753  		return nil, err
   754  	}
   755  	req.Header = reqHeaders
   756  	googleapi.Expand(req.URL, map[string]string{
   757  		"parent": c.parent,
   758  	})
   759  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   760  }
   761  
   762  // Do executes the "oslogin.users.sshPublicKeys.create" call.
   763  // Any non-2xx status code is an error. Response headers are in either
   764  // *SshPublicKey.ServerResponse.Header or (if a response was returned at all)
   765  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   766  // whether the returned error was because http.StatusNotModified was returned.
   767  func (c *UsersSshPublicKeysCreateCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) {
   768  	gensupport.SetOptions(c.urlParams_, opts...)
   769  	res, err := c.doRequest("json")
   770  	if res != nil && res.StatusCode == http.StatusNotModified {
   771  		if res.Body != nil {
   772  			res.Body.Close()
   773  		}
   774  		return nil, gensupport.WrapError(&googleapi.Error{
   775  			Code:   res.StatusCode,
   776  			Header: res.Header,
   777  		})
   778  	}
   779  	if err != nil {
   780  		return nil, err
   781  	}
   782  	defer googleapi.CloseBody(res)
   783  	if err := googleapi.CheckResponse(res); err != nil {
   784  		return nil, gensupport.WrapError(err)
   785  	}
   786  	ret := &SshPublicKey{
   787  		ServerResponse: googleapi.ServerResponse{
   788  			Header:         res.Header,
   789  			HTTPStatusCode: res.StatusCode,
   790  		},
   791  	}
   792  	target := &ret
   793  	if err := gensupport.DecodeResponse(target, res); err != nil {
   794  		return nil, err
   795  	}
   796  	return ret, nil
   797  }
   798  
   799  type UsersSshPublicKeysDeleteCall struct {
   800  	s          *Service
   801  	name       string
   802  	urlParams_ gensupport.URLParams
   803  	ctx_       context.Context
   804  	header_    http.Header
   805  }
   806  
   807  // Delete: Deletes an SSH public key.
   808  //
   809  //   - name: The fingerprint of the public key to update. Public keys are
   810  //     identified by their SHA-256 fingerprint. The fingerprint of the public key
   811  //     is in format `users/{user}/sshPublicKeys/{fingerprint}`.
   812  func (r *UsersSshPublicKeysService) Delete(name string) *UsersSshPublicKeysDeleteCall {
   813  	c := &UsersSshPublicKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   814  	c.name = name
   815  	return c
   816  }
   817  
   818  // Fields allows partial responses to be retrieved. See
   819  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   820  // details.
   821  func (c *UsersSshPublicKeysDeleteCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysDeleteCall {
   822  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   823  	return c
   824  }
   825  
   826  // Context sets the context to be used in this call's Do method.
   827  func (c *UsersSshPublicKeysDeleteCall) Context(ctx context.Context) *UsersSshPublicKeysDeleteCall {
   828  	c.ctx_ = ctx
   829  	return c
   830  }
   831  
   832  // Header returns a http.Header that can be modified by the caller to add
   833  // headers to the request.
   834  func (c *UsersSshPublicKeysDeleteCall) Header() http.Header {
   835  	if c.header_ == nil {
   836  		c.header_ = make(http.Header)
   837  	}
   838  	return c.header_
   839  }
   840  
   841  func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
   842  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   843  	var body io.Reader = nil
   844  	c.urlParams_.Set("alt", alt)
   845  	c.urlParams_.Set("prettyPrint", "false")
   846  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   847  	urls += "?" + c.urlParams_.Encode()
   848  	req, err := http.NewRequest("DELETE", urls, body)
   849  	if err != nil {
   850  		return nil, err
   851  	}
   852  	req.Header = reqHeaders
   853  	googleapi.Expand(req.URL, map[string]string{
   854  		"name": c.name,
   855  	})
   856  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   857  }
   858  
   859  // Do executes the "oslogin.users.sshPublicKeys.delete" call.
   860  // Any non-2xx status code is an error. Response headers are in either
   861  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   862  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   863  // whether the returned error was because http.StatusNotModified was returned.
   864  func (c *UsersSshPublicKeysDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   865  	gensupport.SetOptions(c.urlParams_, opts...)
   866  	res, err := c.doRequest("json")
   867  	if res != nil && res.StatusCode == http.StatusNotModified {
   868  		if res.Body != nil {
   869  			res.Body.Close()
   870  		}
   871  		return nil, gensupport.WrapError(&googleapi.Error{
   872  			Code:   res.StatusCode,
   873  			Header: res.Header,
   874  		})
   875  	}
   876  	if err != nil {
   877  		return nil, err
   878  	}
   879  	defer googleapi.CloseBody(res)
   880  	if err := googleapi.CheckResponse(res); err != nil {
   881  		return nil, gensupport.WrapError(err)
   882  	}
   883  	ret := &Empty{
   884  		ServerResponse: googleapi.ServerResponse{
   885  			Header:         res.Header,
   886  			HTTPStatusCode: res.StatusCode,
   887  		},
   888  	}
   889  	target := &ret
   890  	if err := gensupport.DecodeResponse(target, res); err != nil {
   891  		return nil, err
   892  	}
   893  	return ret, nil
   894  }
   895  
   896  type UsersSshPublicKeysGetCall struct {
   897  	s            *Service
   898  	name         string
   899  	urlParams_   gensupport.URLParams
   900  	ifNoneMatch_ string
   901  	ctx_         context.Context
   902  	header_      http.Header
   903  }
   904  
   905  // Get: Retrieves an SSH public key.
   906  //
   907  //   - name: The fingerprint of the public key to retrieve. Public keys are
   908  //     identified by their SHA-256 fingerprint. The fingerprint of the public key
   909  //     is in format `users/{user}/sshPublicKeys/{fingerprint}`.
   910  func (r *UsersSshPublicKeysService) Get(name string) *UsersSshPublicKeysGetCall {
   911  	c := &UsersSshPublicKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   912  	c.name = name
   913  	return c
   914  }
   915  
   916  // Fields allows partial responses to be retrieved. See
   917  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   918  // details.
   919  func (c *UsersSshPublicKeysGetCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysGetCall {
   920  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   921  	return c
   922  }
   923  
   924  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   925  // object's ETag matches the given value. This is useful for getting updates
   926  // only after the object has changed since the last request.
   927  func (c *UsersSshPublicKeysGetCall) IfNoneMatch(entityTag string) *UsersSshPublicKeysGetCall {
   928  	c.ifNoneMatch_ = entityTag
   929  	return c
   930  }
   931  
   932  // Context sets the context to be used in this call's Do method.
   933  func (c *UsersSshPublicKeysGetCall) Context(ctx context.Context) *UsersSshPublicKeysGetCall {
   934  	c.ctx_ = ctx
   935  	return c
   936  }
   937  
   938  // Header returns a http.Header that can be modified by the caller to add
   939  // headers to the request.
   940  func (c *UsersSshPublicKeysGetCall) Header() http.Header {
   941  	if c.header_ == nil {
   942  		c.header_ = make(http.Header)
   943  	}
   944  	return c.header_
   945  }
   946  
   947  func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error) {
   948  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   949  	if c.ifNoneMatch_ != "" {
   950  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   951  	}
   952  	var body io.Reader = nil
   953  	c.urlParams_.Set("alt", alt)
   954  	c.urlParams_.Set("prettyPrint", "false")
   955  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   956  	urls += "?" + c.urlParams_.Encode()
   957  	req, err := http.NewRequest("GET", urls, body)
   958  	if err != nil {
   959  		return nil, err
   960  	}
   961  	req.Header = reqHeaders
   962  	googleapi.Expand(req.URL, map[string]string{
   963  		"name": c.name,
   964  	})
   965  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   966  }
   967  
   968  // Do executes the "oslogin.users.sshPublicKeys.get" call.
   969  // Any non-2xx status code is an error. Response headers are in either
   970  // *SshPublicKey.ServerResponse.Header or (if a response was returned at all)
   971  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   972  // whether the returned error was because http.StatusNotModified was returned.
   973  func (c *UsersSshPublicKeysGetCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) {
   974  	gensupport.SetOptions(c.urlParams_, opts...)
   975  	res, err := c.doRequest("json")
   976  	if res != nil && res.StatusCode == http.StatusNotModified {
   977  		if res.Body != nil {
   978  			res.Body.Close()
   979  		}
   980  		return nil, gensupport.WrapError(&googleapi.Error{
   981  			Code:   res.StatusCode,
   982  			Header: res.Header,
   983  		})
   984  	}
   985  	if err != nil {
   986  		return nil, err
   987  	}
   988  	defer googleapi.CloseBody(res)
   989  	if err := googleapi.CheckResponse(res); err != nil {
   990  		return nil, gensupport.WrapError(err)
   991  	}
   992  	ret := &SshPublicKey{
   993  		ServerResponse: googleapi.ServerResponse{
   994  			Header:         res.Header,
   995  			HTTPStatusCode: res.StatusCode,
   996  		},
   997  	}
   998  	target := &ret
   999  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1000  		return nil, err
  1001  	}
  1002  	return ret, nil
  1003  }
  1004  
  1005  type UsersSshPublicKeysPatchCall struct {
  1006  	s            *Service
  1007  	name         string
  1008  	sshpublickey *SshPublicKey
  1009  	urlParams_   gensupport.URLParams
  1010  	ctx_         context.Context
  1011  	header_      http.Header
  1012  }
  1013  
  1014  // Patch: Updates an SSH public key and returns the profile information. This
  1015  // method supports patch semantics.
  1016  //
  1017  //   - name: The fingerprint of the public key to update. Public keys are
  1018  //     identified by their SHA-256 fingerprint. The fingerprint of the public key
  1019  //     is in format `users/{user}/sshPublicKeys/{fingerprint}`.
  1020  func (r *UsersSshPublicKeysService) Patch(name string, sshpublickey *SshPublicKey) *UsersSshPublicKeysPatchCall {
  1021  	c := &UsersSshPublicKeysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1022  	c.name = name
  1023  	c.sshpublickey = sshpublickey
  1024  	return c
  1025  }
  1026  
  1027  // UpdateMask sets the optional parameter "updateMask": Mask to control which
  1028  // fields get updated. Updates all if not present.
  1029  func (c *UsersSshPublicKeysPatchCall) UpdateMask(updateMask string) *UsersSshPublicKeysPatchCall {
  1030  	c.urlParams_.Set("updateMask", updateMask)
  1031  	return c
  1032  }
  1033  
  1034  // Fields allows partial responses to be retrieved. See
  1035  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1036  // details.
  1037  func (c *UsersSshPublicKeysPatchCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysPatchCall {
  1038  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1039  	return c
  1040  }
  1041  
  1042  // Context sets the context to be used in this call's Do method.
  1043  func (c *UsersSshPublicKeysPatchCall) Context(ctx context.Context) *UsersSshPublicKeysPatchCall {
  1044  	c.ctx_ = ctx
  1045  	return c
  1046  }
  1047  
  1048  // Header returns a http.Header that can be modified by the caller to add
  1049  // headers to the request.
  1050  func (c *UsersSshPublicKeysPatchCall) Header() http.Header {
  1051  	if c.header_ == nil {
  1052  		c.header_ = make(http.Header)
  1053  	}
  1054  	return c.header_
  1055  }
  1056  
  1057  func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) {
  1058  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1059  	var body io.Reader = nil
  1060  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sshpublickey)
  1061  	if err != nil {
  1062  		return nil, err
  1063  	}
  1064  	c.urlParams_.Set("alt", alt)
  1065  	c.urlParams_.Set("prettyPrint", "false")
  1066  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1067  	urls += "?" + c.urlParams_.Encode()
  1068  	req, err := http.NewRequest("PATCH", urls, body)
  1069  	if err != nil {
  1070  		return nil, err
  1071  	}
  1072  	req.Header = reqHeaders
  1073  	googleapi.Expand(req.URL, map[string]string{
  1074  		"name": c.name,
  1075  	})
  1076  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1077  }
  1078  
  1079  // Do executes the "oslogin.users.sshPublicKeys.patch" call.
  1080  // Any non-2xx status code is an error. Response headers are in either
  1081  // *SshPublicKey.ServerResponse.Header or (if a response was returned at all)
  1082  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1083  // whether the returned error was because http.StatusNotModified was returned.
  1084  func (c *UsersSshPublicKeysPatchCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) {
  1085  	gensupport.SetOptions(c.urlParams_, opts...)
  1086  	res, err := c.doRequest("json")
  1087  	if res != nil && res.StatusCode == http.StatusNotModified {
  1088  		if res.Body != nil {
  1089  			res.Body.Close()
  1090  		}
  1091  		return nil, gensupport.WrapError(&googleapi.Error{
  1092  			Code:   res.StatusCode,
  1093  			Header: res.Header,
  1094  		})
  1095  	}
  1096  	if err != nil {
  1097  		return nil, err
  1098  	}
  1099  	defer googleapi.CloseBody(res)
  1100  	if err := googleapi.CheckResponse(res); err != nil {
  1101  		return nil, gensupport.WrapError(err)
  1102  	}
  1103  	ret := &SshPublicKey{
  1104  		ServerResponse: googleapi.ServerResponse{
  1105  			Header:         res.Header,
  1106  			HTTPStatusCode: res.StatusCode,
  1107  		},
  1108  	}
  1109  	target := &ret
  1110  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1111  		return nil, err
  1112  	}
  1113  	return ret, nil
  1114  }
  1115  

View as plain text