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