| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
package oslogin |
| 59 |
|
| 60 |
import ( |
| 61 |
"bytes" |
| 62 |
"context" |
| 63 |
"encoding/json" |
| 64 |
"errors" |
| 65 |
"fmt" |
| 66 |
"io" |
| 67 |
"log/slog" |
| 68 |
"net/http" |
| 69 |
"net/url" |
| 70 |
"strconv" |
| 71 |
"strings" |
| 72 |
|
| 73 |
"github.com/googleapis/gax-go/v2/internallog" |
| 74 |
googleapi "google.golang.org/api/googleapi" |
| 75 |
internal "google.golang.org/api/internal" |
| 76 |
gensupport "google.golang.org/api/internal/gensupport" |
| 77 |
option "google.golang.org/api/option" |
| 78 |
internaloption "google.golang.org/api/option/internaloption" |
| 79 |
htransport "google.golang.org/api/transport/http" |
| 80 |
) |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
var _ = bytes.NewBuffer |
| 85 |
var _ = strconv.Itoa |
| 86 |
var _ = fmt.Sprintf |
| 87 |
var _ = json.NewDecoder |
| 88 |
var _ = io.Copy |
| 89 |
var _ = url.Parse |
| 90 |
var _ = gensupport.MarshalJSON |
| 91 |
var _ = googleapi.Version |
| 92 |
var _ = errors.New |
| 93 |
var _ = strings.Replace |
| 94 |
var _ = context.Canceled |
| 95 |
var _ = internaloption.WithDefaultEndpoint |
| 96 |
var _ = internal.Version |
| 97 |
var _ = internallog.New |
| 98 |
|
| 99 |
const apiId = "oslogin:v1beta" |
| 100 |
const apiName = "oslogin" |
| 101 |
const apiVersion = "v1beta" |
| 102 |
const basePath = "https://oslogin.googleapis.com/" |
| 103 |
const basePathTemplate = "https://oslogin.UNIVERSE_DOMAIN/" |
| 104 |
const mtlsBasePath = "https://oslogin.mtls.googleapis.com/" |
| 105 |
|
| 106 |
|
| 107 |
const ( |
| 108 |
|
| 109 |
|
| 110 |
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" |
| 115 |
|
| 116 |
|
| 117 |
ComputeScope = "https://www.googleapis.com/auth/compute" |
| 118 |
|
| 119 |
|
| 120 |
ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly" |
| 121 |
) |
| 122 |
|
| 123 |
|
| 124 |
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| 125 |
scopesOption := internaloption.WithDefaultScopes( |
| 126 |
"https://www.googleapis.com/auth/cloud-platform", |
| 127 |
"https://www.googleapis.com/auth/cloud-platform.read-only", |
| 128 |
"https://www.googleapis.com/auth/compute", |
| 129 |
"https://www.googleapis.com/auth/compute.readonly", |
| 130 |
) |
| 131 |
|
| 132 |
opts = append([]option.ClientOption{scopesOption}, opts...) |
| 133 |
opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| 134 |
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) |
| 135 |
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) |
| 136 |
opts = append(opts, internaloption.EnableNewAuthLibrary()) |
| 137 |
client, endpoint, err := htransport.NewClient(ctx, opts...) |
| 138 |
if err != nil { |
| 139 |
return nil, err |
| 140 |
} |
| 141 |
s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} |
| 142 |
s.Projects = NewProjectsService(s) |
| 143 |
s.Users = NewUsersService(s) |
| 144 |
if endpoint != "" { |
| 145 |
s.BasePath = endpoint |
| 146 |
} |
| 147 |
return s, nil |
| 148 |
} |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
func New(client *http.Client) (*Service, error) { |
| 156 |
if client == nil { |
| 157 |
return nil, errors.New("client is nil") |
| 158 |
} |
| 159 |
return NewService(context.TODO(), option.WithHTTPClient(client)) |
| 160 |
} |
| 161 |
|
| 162 |
type Service struct { |
| 163 |
client *http.Client |
| 164 |
logger *slog.Logger |
| 165 |
BasePath string |
| 166 |
UserAgent string |
| 167 |
|
| 168 |
Projects *ProjectsService |
| 169 |
|
| 170 |
Users *UsersService |
| 171 |
} |
| 172 |
|
| 173 |
func (s *Service) userAgent() string { |
| 174 |
if s.UserAgent == "" { |
| 175 |
return googleapi.UserAgent |
| 176 |
} |
| 177 |
return googleapi.UserAgent + " " + s.UserAgent |
| 178 |
} |
| 179 |
|
| 180 |
func NewProjectsService(s *Service) *ProjectsService { |
| 181 |
rs := &ProjectsService{s: s} |
| 182 |
rs.Locations = NewProjectsLocationsService(s) |
| 183 |
return rs |
| 184 |
} |
| 185 |
|
| 186 |
type ProjectsService struct { |
| 187 |
s *Service |
| 188 |
|
| 189 |
Locations *ProjectsLocationsService |
| 190 |
} |
| 191 |
|
| 192 |
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { |
| 193 |
rs := &ProjectsLocationsService{s: s} |
| 194 |
return rs |
| 195 |
} |
| 196 |
|
| 197 |
type ProjectsLocationsService struct { |
| 198 |
s *Service |
| 199 |
} |
| 200 |
|
| 201 |
func NewUsersService(s *Service) *UsersService { |
| 202 |
rs := &UsersService{s: s} |
| 203 |
rs.Projects = NewUsersProjectsService(s) |
| 204 |
rs.SshPublicKeys = NewUsersSshPublicKeysService(s) |
| 205 |
return rs |
| 206 |
} |
| 207 |
|
| 208 |
type UsersService struct { |
| 209 |
s *Service |
| 210 |
|
| 211 |
Projects *UsersProjectsService |
| 212 |
|
| 213 |
SshPublicKeys *UsersSshPublicKeysService |
| 214 |
} |
| 215 |
|
| 216 |
func NewUsersProjectsService(s *Service) *UsersProjectsService { |
| 217 |
rs := &UsersProjectsService{s: s} |
| 218 |
rs.Locations = NewUsersProjectsLocationsService(s) |
| 219 |
rs.Zones = NewUsersProjectsZonesService(s) |
| 220 |
return rs |
| 221 |
} |
| 222 |
|
| 223 |
type UsersProjectsService struct { |
| 224 |
s *Service |
| 225 |
|
| 226 |
Locations *UsersProjectsLocationsService |
| 227 |
|
| 228 |
Zones *UsersProjectsZonesService |
| 229 |
} |
| 230 |
|
| 231 |
func NewUsersProjectsLocationsService(s *Service) *UsersProjectsLocationsService { |
| 232 |
rs := &UsersProjectsLocationsService{s: s} |
| 233 |
return rs |
| 234 |
} |
| 235 |
|
| 236 |
type UsersProjectsLocationsService struct { |
| 237 |
s *Service |
| 238 |
} |
| 239 |
|
| 240 |
func NewUsersProjectsZonesService(s *Service) *UsersProjectsZonesService { |
| 241 |
rs := &UsersProjectsZonesService{s: s} |
| 242 |
return rs |
| 243 |
} |
| 244 |
|
| 245 |
type UsersProjectsZonesService struct { |
| 246 |
s *Service |
| 247 |
} |
| 248 |
|
| 249 |
func NewUsersSshPublicKeysService(s *Service) *UsersSshPublicKeysService { |
| 250 |
rs := &UsersSshPublicKeysService{s: s} |
| 251 |
return rs |
| 252 |
} |
| 253 |
|
| 254 |
type UsersSshPublicKeysService struct { |
| 255 |
s *Service |
| 256 |
} |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
type Empty struct { |
| 263 |
|
| 264 |
googleapi.ServerResponse `json:"-"` |
| 265 |
} |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
type GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyRequest struct { |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
AppEngineInstance string `json:"appEngineInstance,omitempty"` |
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
ComputeInstance string `json:"computeInstance,omitempty"` |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
ServiceAccount string `json:"serviceAccount,omitempty"` |
| 283 |
|
| 284 |
SshPublicKey string `json:"sshPublicKey,omitempty"` |
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
ForceSendFields []string `json:"-"` |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
NullFields []string `json:"-"` |
| 296 |
} |
| 297 |
|
| 298 |
func (s GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyRequest) MarshalJSON() ([]byte, error) { |
| 299 |
type NoMethod GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyRequest |
| 300 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 301 |
} |
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
type GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyResponse struct { |
| 306 |
|
| 307 |
SignedSshPublicKey string `json:"signedSshPublicKey,omitempty"` |
| 308 |
|
| 309 |
|
| 310 |
googleapi.ServerResponse `json:"-"` |
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
ForceSendFields []string `json:"-"` |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
NullFields []string `json:"-"` |
| 322 |
} |
| 323 |
|
| 324 |
func (s GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyResponse) MarshalJSON() ([]byte, error) { |
| 325 |
type NoMethod GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyResponse |
| 326 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 327 |
} |
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
type ImportSshPublicKeyResponse struct { |
| 332 |
|
| 333 |
Details string `json:"details,omitempty"` |
| 334 |
|
| 335 |
LoginProfile *LoginProfile `json:"loginProfile,omitempty"` |
| 336 |
|
| 337 |
|
| 338 |
googleapi.ServerResponse `json:"-"` |
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
ForceSendFields []string `json:"-"` |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
NullFields []string `json:"-"` |
| 350 |
} |
| 351 |
|
| 352 |
func (s ImportSshPublicKeyResponse) MarshalJSON() ([]byte, error) { |
| 353 |
type NoMethod ImportSshPublicKeyResponse |
| 354 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 355 |
} |
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
type LoginProfile struct { |
| 360 |
|
| 361 |
Name string `json:"name,omitempty"` |
| 362 |
|
| 363 |
PosixAccounts []*PosixAccount `json:"posixAccounts,omitempty"` |
| 364 |
|
| 365 |
SecurityKeys []*SecurityKey `json:"securityKeys,omitempty"` |
| 366 |
|
| 367 |
|
| 368 |
SshPublicKeys map[string]SshPublicKey `json:"sshPublicKeys,omitempty"` |
| 369 |
|
| 370 |
|
| 371 |
googleapi.ServerResponse `json:"-"` |
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
ForceSendFields []string `json:"-"` |
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
NullFields []string `json:"-"` |
| 383 |
} |
| 384 |
|
| 385 |
func (s LoginProfile) MarshalJSON() ([]byte, error) { |
| 386 |
type NoMethod LoginProfile |
| 387 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 388 |
} |
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
type PosixAccount struct { |
| 393 |
|
| 394 |
AccountId string `json:"accountId,omitempty"` |
| 395 |
|
| 396 |
Gecos string `json:"gecos,omitempty"` |
| 397 |
|
| 398 |
Gid int64 `json:"gid,omitempty,string"` |
| 399 |
|
| 400 |
HomeDirectory string `json:"homeDirectory,omitempty"` |
| 401 |
|
| 402 |
Name string `json:"name,omitempty"` |
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
OperatingSystemType string `json:"operatingSystemType,omitempty"` |
| 411 |
|
| 412 |
Primary bool `json:"primary,omitempty"` |
| 413 |
|
| 414 |
Shell string `json:"shell,omitempty"` |
| 415 |
|
| 416 |
|
| 417 |
SystemId string `json:"systemId,omitempty"` |
| 418 |
|
| 419 |
Uid int64 `json:"uid,omitempty,string"` |
| 420 |
|
| 421 |
Username string `json:"username,omitempty"` |
| 422 |
|
| 423 |
|
| 424 |
googleapi.ServerResponse `json:"-"` |
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
ForceSendFields []string `json:"-"` |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
NullFields []string `json:"-"` |
| 436 |
} |
| 437 |
|
| 438 |
func (s PosixAccount) MarshalJSON() ([]byte, error) { |
| 439 |
type NoMethod PosixAccount |
| 440 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 441 |
} |
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
type ProvisionPosixAccountRequest struct { |
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
Regions []string `json:"regions,omitempty"` |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
ForceSendFields []string `json:"-"` |
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
NullFields []string `json:"-"` |
| 461 |
} |
| 462 |
|
| 463 |
func (s ProvisionPosixAccountRequest) MarshalJSON() ([]byte, error) { |
| 464 |
type NoMethod ProvisionPosixAccountRequest |
| 465 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 466 |
} |
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
type SecurityKey struct { |
| 471 |
|
| 472 |
DeviceNickname string `json:"deviceNickname,omitempty"` |
| 473 |
|
| 474 |
PrivateKey string `json:"privateKey,omitempty"` |
| 475 |
|
| 476 |
|
| 477 |
PublicKey string `json:"publicKey,omitempty"` |
| 478 |
|
| 479 |
UniversalTwoFactor *UniversalTwoFactor `json:"universalTwoFactor,omitempty"` |
| 480 |
|
| 481 |
WebAuthn *WebAuthn `json:"webAuthn,omitempty"` |
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
ForceSendFields []string `json:"-"` |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
NullFields []string `json:"-"` |
| 493 |
} |
| 494 |
|
| 495 |
func (s SecurityKey) MarshalJSON() ([]byte, error) { |
| 496 |
type NoMethod SecurityKey |
| 497 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 498 |
} |
| 499 |
|
| 500 |
type SignSshPublicKeyRequest struct { |
| 501 |
|
| 502 |
SshPublicKey string `json:"sshPublicKey,omitempty"` |
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
ForceSendFields []string `json:"-"` |
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
NullFields []string `json:"-"` |
| 514 |
} |
| 515 |
|
| 516 |
func (s SignSshPublicKeyRequest) MarshalJSON() ([]byte, error) { |
| 517 |
type NoMethod SignSshPublicKeyRequest |
| 518 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 519 |
} |
| 520 |
|
| 521 |
type SignSshPublicKeyResponse struct { |
| 522 |
|
| 523 |
SignedSshPublicKey string `json:"signedSshPublicKey,omitempty"` |
| 524 |
|
| 525 |
|
| 526 |
googleapi.ServerResponse `json:"-"` |
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
ForceSendFields []string `json:"-"` |
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
NullFields []string `json:"-"` |
| 538 |
} |
| 539 |
|
| 540 |
func (s SignSshPublicKeyResponse) MarshalJSON() ([]byte, error) { |
| 541 |
type NoMethod SignSshPublicKeyResponse |
| 542 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 543 |
} |
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
type SshPublicKey struct { |
| 548 |
|
| 549 |
ExpirationTimeUsec int64 `json:"expirationTimeUsec,omitempty,string"` |
| 550 |
|
| 551 |
Fingerprint string `json:"fingerprint,omitempty"` |
| 552 |
|
| 553 |
|
| 554 |
Key string `json:"key,omitempty"` |
| 555 |
|
| 556 |
Name string `json:"name,omitempty"` |
| 557 |
|
| 558 |
|
| 559 |
googleapi.ServerResponse `json:"-"` |
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
ForceSendFields []string `json:"-"` |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
NullFields []string `json:"-"` |
| 571 |
} |
| 572 |
|
| 573 |
func (s SshPublicKey) MarshalJSON() ([]byte, error) { |
| 574 |
type NoMethod SshPublicKey |
| 575 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 576 |
} |
| 577 |
|
| 578 |
|
| 579 |
type UniversalTwoFactor struct { |
| 580 |
|
| 581 |
AppId string `json:"appId,omitempty"` |
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
ForceSendFields []string `json:"-"` |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
NullFields []string `json:"-"` |
| 593 |
} |
| 594 |
|
| 595 |
func (s UniversalTwoFactor) MarshalJSON() ([]byte, error) { |
| 596 |
type NoMethod UniversalTwoFactor |
| 597 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 598 |
} |
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
type WebAuthn struct { |
| 603 |
|
| 604 |
RpId string `json:"rpId,omitempty"` |
| 605 |
|
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
ForceSendFields []string `json:"-"` |
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
|
| 615 |
NullFields []string `json:"-"` |
| 616 |
} |
| 617 |
|
| 618 |
func (s WebAuthn) MarshalJSON() ([]byte, error) { |
| 619 |
type NoMethod WebAuthn |
| 620 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 621 |
} |
| 622 |
|
| 623 |
type ProjectsLocationsSignSshPublicKeyCall struct { |
| 624 |
s *Service |
| 625 |
parent string |
| 626 |
googlecloudoslogincontrolplaneregionalv1betasignsshpublickeyrequest *GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyRequest |
| 627 |
urlParams_ gensupport.URLParams |
| 628 |
ctx_ context.Context |
| 629 |
header_ http.Header |
| 630 |
} |
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
func (r *ProjectsLocationsService) SignSshPublicKey(parent string, googlecloudoslogincontrolplaneregionalv1betasignsshpublickeyrequest *GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyRequest) *ProjectsLocationsSignSshPublicKeyCall { |
| 638 |
c := &ProjectsLocationsSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 639 |
c.parent = parent |
| 640 |
c.googlecloudoslogincontrolplaneregionalv1betasignsshpublickeyrequest = googlecloudoslogincontrolplaneregionalv1betasignsshpublickeyrequest |
| 641 |
return c |
| 642 |
} |
| 643 |
|
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
func (c *ProjectsLocationsSignSshPublicKeyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSignSshPublicKeyCall { |
| 648 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 649 |
return c |
| 650 |
} |
| 651 |
|
| 652 |
|
| 653 |
func (c *ProjectsLocationsSignSshPublicKeyCall) Context(ctx context.Context) *ProjectsLocationsSignSshPublicKeyCall { |
| 654 |
c.ctx_ = ctx |
| 655 |
return c |
| 656 |
} |
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
func (c *ProjectsLocationsSignSshPublicKeyCall) Header() http.Header { |
| 661 |
if c.header_ == nil { |
| 662 |
c.header_ = make(http.Header) |
| 663 |
} |
| 664 |
return c.header_ |
| 665 |
} |
| 666 |
|
| 667 |
func (c *ProjectsLocationsSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { |
| 668 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 669 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudoslogincontrolplaneregionalv1betasignsshpublickeyrequest) |
| 670 |
if err != nil { |
| 671 |
return nil, err |
| 672 |
} |
| 673 |
c.urlParams_.Set("alt", alt) |
| 674 |
c.urlParams_.Set("prettyPrint", "false") |
| 675 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:signSshPublicKey") |
| 676 |
urls += "?" + c.urlParams_.Encode() |
| 677 |
req, err := http.NewRequest("POST", urls, body) |
| 678 |
if err != nil { |
| 679 |
return nil, err |
| 680 |
} |
| 681 |
req.Header = reqHeaders |
| 682 |
googleapi.Expand(req.URL, map[string]string{ |
| 683 |
"parent": c.parent, |
| 684 |
}) |
| 685 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.projects.locations.signSshPublicKey", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 686 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 687 |
} |
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
func (c *ProjectsLocationsSignSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyResponse, error) { |
| 696 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 697 |
res, err := c.doRequest("json") |
| 698 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 699 |
if res.Body != nil { |
| 700 |
res.Body.Close() |
| 701 |
} |
| 702 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 703 |
Code: res.StatusCode, |
| 704 |
Header: res.Header, |
| 705 |
}) |
| 706 |
} |
| 707 |
if err != nil { |
| 708 |
return nil, err |
| 709 |
} |
| 710 |
defer googleapi.CloseBody(res) |
| 711 |
if err := googleapi.CheckResponse(res); err != nil { |
| 712 |
return nil, gensupport.WrapError(err) |
| 713 |
} |
| 714 |
ret := &GoogleCloudOsloginControlplaneRegionalV1betaSignSshPublicKeyResponse{ |
| 715 |
ServerResponse: googleapi.ServerResponse{ |
| 716 |
Header: res.Header, |
| 717 |
HTTPStatusCode: res.StatusCode, |
| 718 |
}, |
| 719 |
} |
| 720 |
target := &ret |
| 721 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 722 |
if err != nil { |
| 723 |
return nil, err |
| 724 |
} |
| 725 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.projects.locations.signSshPublicKey", "response", internallog.HTTPResponse(res, b)) |
| 726 |
return ret, nil |
| 727 |
} |
| 728 |
|
| 729 |
type UsersGetLoginProfileCall struct { |
| 730 |
s *Service |
| 731 |
name string |
| 732 |
urlParams_ gensupport.URLParams |
| 733 |
ifNoneMatch_ string |
| 734 |
ctx_ context.Context |
| 735 |
header_ http.Header |
| 736 |
} |
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
func (r *UsersService) GetLoginProfile(name string) *UsersGetLoginProfileCall { |
| 743 |
c := &UsersGetLoginProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 744 |
c.name = name |
| 745 |
return c |
| 746 |
} |
| 747 |
|
| 748 |
|
| 749 |
|
| 750 |
func (c *UsersGetLoginProfileCall) ProjectId(projectId string) *UsersGetLoginProfileCall { |
| 751 |
c.urlParams_.Set("projectId", projectId) |
| 752 |
return c |
| 753 |
} |
| 754 |
|
| 755 |
|
| 756 |
|
| 757 |
func (c *UsersGetLoginProfileCall) SystemId(systemId string) *UsersGetLoginProfileCall { |
| 758 |
c.urlParams_.Set("systemId", systemId) |
| 759 |
return c |
| 760 |
} |
| 761 |
|
| 762 |
|
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
|
| 771 |
|
| 772 |
|
| 773 |
func (c *UsersGetLoginProfileCall) View(view string) *UsersGetLoginProfileCall { |
| 774 |
c.urlParams_.Set("view", view) |
| 775 |
return c |
| 776 |
} |
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
|
| 781 |
func (c *UsersGetLoginProfileCall) Fields(s ...googleapi.Field) *UsersGetLoginProfileCall { |
| 782 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 783 |
return c |
| 784 |
} |
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
|
| 789 |
func (c *UsersGetLoginProfileCall) IfNoneMatch(entityTag string) *UsersGetLoginProfileCall { |
| 790 |
c.ifNoneMatch_ = entityTag |
| 791 |
return c |
| 792 |
} |
| 793 |
|
| 794 |
|
| 795 |
func (c *UsersGetLoginProfileCall) Context(ctx context.Context) *UsersGetLoginProfileCall { |
| 796 |
c.ctx_ = ctx |
| 797 |
return c |
| 798 |
} |
| 799 |
|
| 800 |
|
| 801 |
|
| 802 |
func (c *UsersGetLoginProfileCall) Header() http.Header { |
| 803 |
if c.header_ == nil { |
| 804 |
c.header_ = make(http.Header) |
| 805 |
} |
| 806 |
return c.header_ |
| 807 |
} |
| 808 |
|
| 809 |
func (c *UsersGetLoginProfileCall) doRequest(alt string) (*http.Response, error) { |
| 810 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 811 |
if c.ifNoneMatch_ != "" { |
| 812 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 813 |
} |
| 814 |
c.urlParams_.Set("alt", alt) |
| 815 |
c.urlParams_.Set("prettyPrint", "false") |
| 816 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/loginProfile") |
| 817 |
urls += "?" + c.urlParams_.Encode() |
| 818 |
req, err := http.NewRequest("GET", urls, nil) |
| 819 |
if err != nil { |
| 820 |
return nil, err |
| 821 |
} |
| 822 |
req.Header = reqHeaders |
| 823 |
googleapi.Expand(req.URL, map[string]string{ |
| 824 |
"name": c.name, |
| 825 |
}) |
| 826 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.getLoginProfile", "request", internallog.HTTPRequest(req, nil)) |
| 827 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 828 |
} |
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
|
| 835 |
func (c *UsersGetLoginProfileCall) Do(opts ...googleapi.CallOption) (*LoginProfile, error) { |
| 836 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 837 |
res, err := c.doRequest("json") |
| 838 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 839 |
if res.Body != nil { |
| 840 |
res.Body.Close() |
| 841 |
} |
| 842 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 843 |
Code: res.StatusCode, |
| 844 |
Header: res.Header, |
| 845 |
}) |
| 846 |
} |
| 847 |
if err != nil { |
| 848 |
return nil, err |
| 849 |
} |
| 850 |
defer googleapi.CloseBody(res) |
| 851 |
if err := googleapi.CheckResponse(res); err != nil { |
| 852 |
return nil, gensupport.WrapError(err) |
| 853 |
} |
| 854 |
ret := &LoginProfile{ |
| 855 |
ServerResponse: googleapi.ServerResponse{ |
| 856 |
Header: res.Header, |
| 857 |
HTTPStatusCode: res.StatusCode, |
| 858 |
}, |
| 859 |
} |
| 860 |
target := &ret |
| 861 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 862 |
if err != nil { |
| 863 |
return nil, err |
| 864 |
} |
| 865 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.getLoginProfile", "response", internallog.HTTPResponse(res, b)) |
| 866 |
return ret, nil |
| 867 |
} |
| 868 |
|
| 869 |
type UsersImportSshPublicKeyCall struct { |
| 870 |
s *Service |
| 871 |
parent string |
| 872 |
sshpublickey *SshPublicKey |
| 873 |
urlParams_ gensupport.URLParams |
| 874 |
ctx_ context.Context |
| 875 |
header_ http.Header |
| 876 |
} |
| 877 |
|
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
|
| 883 |
func (r *UsersService) ImportSshPublicKey(parent string, sshpublickey *SshPublicKey) *UsersImportSshPublicKeyCall { |
| 884 |
c := &UsersImportSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 885 |
c.parent = parent |
| 886 |
c.sshpublickey = sshpublickey |
| 887 |
return c |
| 888 |
} |
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
func (c *UsersImportSshPublicKeyCall) ProjectId(projectId string) *UsersImportSshPublicKeyCall { |
| 893 |
c.urlParams_.Set("projectId", projectId) |
| 894 |
return c |
| 895 |
} |
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
func (c *UsersImportSshPublicKeyCall) Regions(regions ...string) *UsersImportSshPublicKeyCall { |
| 901 |
c.urlParams_.SetMulti("regions", append([]string{}, regions...)) |
| 902 |
return c |
| 903 |
} |
| 904 |
|
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
|
| 909 |
|
| 910 |
|
| 911 |
|
| 912 |
|
| 913 |
|
| 914 |
|
| 915 |
|
| 916 |
func (c *UsersImportSshPublicKeyCall) View(view string) *UsersImportSshPublicKeyCall { |
| 917 |
c.urlParams_.Set("view", view) |
| 918 |
return c |
| 919 |
} |
| 920 |
|
| 921 |
|
| 922 |
|
| 923 |
|
| 924 |
func (c *UsersImportSshPublicKeyCall) Fields(s ...googleapi.Field) *UsersImportSshPublicKeyCall { |
| 925 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 926 |
return c |
| 927 |
} |
| 928 |
|
| 929 |
|
| 930 |
func (c *UsersImportSshPublicKeyCall) Context(ctx context.Context) *UsersImportSshPublicKeyCall { |
| 931 |
c.ctx_ = ctx |
| 932 |
return c |
| 933 |
} |
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
func (c *UsersImportSshPublicKeyCall) Header() http.Header { |
| 938 |
if c.header_ == nil { |
| 939 |
c.header_ = make(http.Header) |
| 940 |
} |
| 941 |
return c.header_ |
| 942 |
} |
| 943 |
|
| 944 |
func (c *UsersImportSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { |
| 945 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 946 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) |
| 947 |
if err != nil { |
| 948 |
return nil, err |
| 949 |
} |
| 950 |
c.urlParams_.Set("alt", alt) |
| 951 |
c.urlParams_.Set("prettyPrint", "false") |
| 952 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:importSshPublicKey") |
| 953 |
urls += "?" + c.urlParams_.Encode() |
| 954 |
req, err := http.NewRequest("POST", urls, body) |
| 955 |
if err != nil { |
| 956 |
return nil, err |
| 957 |
} |
| 958 |
req.Header = reqHeaders |
| 959 |
googleapi.Expand(req.URL, map[string]string{ |
| 960 |
"parent": c.parent, |
| 961 |
}) |
| 962 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.importSshPublicKey", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 963 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 964 |
} |
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
func (c *UsersImportSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*ImportSshPublicKeyResponse, error) { |
| 973 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 974 |
res, err := c.doRequest("json") |
| 975 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 976 |
if res.Body != nil { |
| 977 |
res.Body.Close() |
| 978 |
} |
| 979 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 980 |
Code: res.StatusCode, |
| 981 |
Header: res.Header, |
| 982 |
}) |
| 983 |
} |
| 984 |
if err != nil { |
| 985 |
return nil, err |
| 986 |
} |
| 987 |
defer googleapi.CloseBody(res) |
| 988 |
if err := googleapi.CheckResponse(res); err != nil { |
| 989 |
return nil, gensupport.WrapError(err) |
| 990 |
} |
| 991 |
ret := &ImportSshPublicKeyResponse{ |
| 992 |
ServerResponse: googleapi.ServerResponse{ |
| 993 |
Header: res.Header, |
| 994 |
HTTPStatusCode: res.StatusCode, |
| 995 |
}, |
| 996 |
} |
| 997 |
target := &ret |
| 998 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 999 |
if err != nil { |
| 1000 |
return nil, err |
| 1001 |
} |
| 1002 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.importSshPublicKey", "response", internallog.HTTPResponse(res, b)) |
| 1003 |
return ret, nil |
| 1004 |
} |
| 1005 |
|
| 1006 |
type UsersProjectsDeleteCall struct { |
| 1007 |
s *Service |
| 1008 |
name string |
| 1009 |
urlParams_ gensupport.URLParams |
| 1010 |
ctx_ context.Context |
| 1011 |
header_ http.Header |
| 1012 |
} |
| 1013 |
|
| 1014 |
|
| 1015 |
|
| 1016 |
|
| 1017 |
|
| 1018 |
|
| 1019 |
func (r *UsersProjectsService) Delete(name string) *UsersProjectsDeleteCall { |
| 1020 |
c := &UsersProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1021 |
c.name = name |
| 1022 |
return c |
| 1023 |
} |
| 1024 |
|
| 1025 |
|
| 1026 |
|
| 1027 |
|
| 1028 |
func (c *UsersProjectsDeleteCall) Fields(s ...googleapi.Field) *UsersProjectsDeleteCall { |
| 1029 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1030 |
return c |
| 1031 |
} |
| 1032 |
|
| 1033 |
|
| 1034 |
func (c *UsersProjectsDeleteCall) Context(ctx context.Context) *UsersProjectsDeleteCall { |
| 1035 |
c.ctx_ = ctx |
| 1036 |
return c |
| 1037 |
} |
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
func (c *UsersProjectsDeleteCall) Header() http.Header { |
| 1042 |
if c.header_ == nil { |
| 1043 |
c.header_ = make(http.Header) |
| 1044 |
} |
| 1045 |
return c.header_ |
| 1046 |
} |
| 1047 |
|
| 1048 |
func (c *UsersProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { |
| 1049 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1050 |
c.urlParams_.Set("alt", alt) |
| 1051 |
c.urlParams_.Set("prettyPrint", "false") |
| 1052 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1053 |
urls += "?" + c.urlParams_.Encode() |
| 1054 |
req, err := http.NewRequest("DELETE", urls, nil) |
| 1055 |
if err != nil { |
| 1056 |
return nil, err |
| 1057 |
} |
| 1058 |
req.Header = reqHeaders |
| 1059 |
googleapi.Expand(req.URL, map[string]string{ |
| 1060 |
"name": c.name, |
| 1061 |
}) |
| 1062 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.projects.delete", "request", internallog.HTTPRequest(req, nil)) |
| 1063 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1064 |
} |
| 1065 |
|
| 1066 |
|
| 1067 |
|
| 1068 |
|
| 1069 |
|
| 1070 |
|
| 1071 |
func (c *UsersProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { |
| 1072 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1073 |
res, err := c.doRequest("json") |
| 1074 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1075 |
if res.Body != nil { |
| 1076 |
res.Body.Close() |
| 1077 |
} |
| 1078 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1079 |
Code: res.StatusCode, |
| 1080 |
Header: res.Header, |
| 1081 |
}) |
| 1082 |
} |
| 1083 |
if err != nil { |
| 1084 |
return nil, err |
| 1085 |
} |
| 1086 |
defer googleapi.CloseBody(res) |
| 1087 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1088 |
return nil, gensupport.WrapError(err) |
| 1089 |
} |
| 1090 |
ret := &Empty{ |
| 1091 |
ServerResponse: googleapi.ServerResponse{ |
| 1092 |
Header: res.Header, |
| 1093 |
HTTPStatusCode: res.StatusCode, |
| 1094 |
}, |
| 1095 |
} |
| 1096 |
target := &ret |
| 1097 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1098 |
if err != nil { |
| 1099 |
return nil, err |
| 1100 |
} |
| 1101 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.projects.delete", "response", internallog.HTTPResponse(res, b)) |
| 1102 |
return ret, nil |
| 1103 |
} |
| 1104 |
|
| 1105 |
type UsersProjectsProvisionPosixAccountCall struct { |
| 1106 |
s *Service |
| 1107 |
name string |
| 1108 |
provisionposixaccountrequest *ProvisionPosixAccountRequest |
| 1109 |
urlParams_ gensupport.URLParams |
| 1110 |
ctx_ context.Context |
| 1111 |
header_ http.Header |
| 1112 |
} |
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
|
| 1117 |
|
| 1118 |
func (r *UsersProjectsService) ProvisionPosixAccount(name string, provisionposixaccountrequest *ProvisionPosixAccountRequest) *UsersProjectsProvisionPosixAccountCall { |
| 1119 |
c := &UsersProjectsProvisionPosixAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1120 |
c.name = name |
| 1121 |
c.provisionposixaccountrequest = provisionposixaccountrequest |
| 1122 |
return c |
| 1123 |
} |
| 1124 |
|
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
func (c *UsersProjectsProvisionPosixAccountCall) Fields(s ...googleapi.Field) *UsersProjectsProvisionPosixAccountCall { |
| 1129 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1130 |
return c |
| 1131 |
} |
| 1132 |
|
| 1133 |
|
| 1134 |
func (c *UsersProjectsProvisionPosixAccountCall) Context(ctx context.Context) *UsersProjectsProvisionPosixAccountCall { |
| 1135 |
c.ctx_ = ctx |
| 1136 |
return c |
| 1137 |
} |
| 1138 |
|
| 1139 |
|
| 1140 |
|
| 1141 |
func (c *UsersProjectsProvisionPosixAccountCall) Header() http.Header { |
| 1142 |
if c.header_ == nil { |
| 1143 |
c.header_ = make(http.Header) |
| 1144 |
} |
| 1145 |
return c.header_ |
| 1146 |
} |
| 1147 |
|
| 1148 |
func (c *UsersProjectsProvisionPosixAccountCall) doRequest(alt string) (*http.Response, error) { |
| 1149 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1150 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.provisionposixaccountrequest) |
| 1151 |
if err != nil { |
| 1152 |
return nil, err |
| 1153 |
} |
| 1154 |
c.urlParams_.Set("alt", alt) |
| 1155 |
c.urlParams_.Set("prettyPrint", "false") |
| 1156 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1157 |
urls += "?" + c.urlParams_.Encode() |
| 1158 |
req, err := http.NewRequest("POST", urls, body) |
| 1159 |
if err != nil { |
| 1160 |
return nil, err |
| 1161 |
} |
| 1162 |
req.Header = reqHeaders |
| 1163 |
googleapi.Expand(req.URL, map[string]string{ |
| 1164 |
"name": c.name, |
| 1165 |
}) |
| 1166 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.projects.provisionPosixAccount", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1167 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1168 |
} |
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
func (c *UsersProjectsProvisionPosixAccountCall) Do(opts ...googleapi.CallOption) (*PosixAccount, error) { |
| 1176 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1177 |
res, err := c.doRequest("json") |
| 1178 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1179 |
if res.Body != nil { |
| 1180 |
res.Body.Close() |
| 1181 |
} |
| 1182 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1183 |
Code: res.StatusCode, |
| 1184 |
Header: res.Header, |
| 1185 |
}) |
| 1186 |
} |
| 1187 |
if err != nil { |
| 1188 |
return nil, err |
| 1189 |
} |
| 1190 |
defer googleapi.CloseBody(res) |
| 1191 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1192 |
return nil, gensupport.WrapError(err) |
| 1193 |
} |
| 1194 |
ret := &PosixAccount{ |
| 1195 |
ServerResponse: googleapi.ServerResponse{ |
| 1196 |
Header: res.Header, |
| 1197 |
HTTPStatusCode: res.StatusCode, |
| 1198 |
}, |
| 1199 |
} |
| 1200 |
target := &ret |
| 1201 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1202 |
if err != nil { |
| 1203 |
return nil, err |
| 1204 |
} |
| 1205 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.projects.provisionPosixAccount", "response", internallog.HTTPResponse(res, b)) |
| 1206 |
return ret, nil |
| 1207 |
} |
| 1208 |
|
| 1209 |
type UsersProjectsLocationsSignSshPublicKeyCall struct { |
| 1210 |
s *Service |
| 1211 |
parent string |
| 1212 |
signsshpublickeyrequest *SignSshPublicKeyRequest |
| 1213 |
urlParams_ gensupport.URLParams |
| 1214 |
ctx_ context.Context |
| 1215 |
header_ http.Header |
| 1216 |
} |
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
|
| 1221 |
|
| 1222 |
func (r *UsersProjectsLocationsService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsLocationsSignSshPublicKeyCall { |
| 1223 |
c := &UsersProjectsLocationsSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1224 |
c.parent = parent |
| 1225 |
c.signsshpublickeyrequest = signsshpublickeyrequest |
| 1226 |
return c |
| 1227 |
} |
| 1228 |
|
| 1229 |
|
| 1230 |
|
| 1231 |
|
| 1232 |
func (c *UsersProjectsLocationsSignSshPublicKeyCall) Fields(s ...googleapi.Field) *UsersProjectsLocationsSignSshPublicKeyCall { |
| 1233 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1234 |
return c |
| 1235 |
} |
| 1236 |
|
| 1237 |
|
| 1238 |
func (c *UsersProjectsLocationsSignSshPublicKeyCall) Context(ctx context.Context) *UsersProjectsLocationsSignSshPublicKeyCall { |
| 1239 |
c.ctx_ = ctx |
| 1240 |
return c |
| 1241 |
} |
| 1242 |
|
| 1243 |
|
| 1244 |
|
| 1245 |
func (c *UsersProjectsLocationsSignSshPublicKeyCall) Header() http.Header { |
| 1246 |
if c.header_ == nil { |
| 1247 |
c.header_ = make(http.Header) |
| 1248 |
} |
| 1249 |
return c.header_ |
| 1250 |
} |
| 1251 |
|
| 1252 |
func (c *UsersProjectsLocationsSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { |
| 1253 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1254 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) |
| 1255 |
if err != nil { |
| 1256 |
return nil, err |
| 1257 |
} |
| 1258 |
c.urlParams_.Set("alt", alt) |
| 1259 |
c.urlParams_.Set("prettyPrint", "false") |
| 1260 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:signSshPublicKey") |
| 1261 |
urls += "?" + c.urlParams_.Encode() |
| 1262 |
req, err := http.NewRequest("POST", urls, body) |
| 1263 |
if err != nil { |
| 1264 |
return nil, err |
| 1265 |
} |
| 1266 |
req.Header = reqHeaders |
| 1267 |
googleapi.Expand(req.URL, map[string]string{ |
| 1268 |
"parent": c.parent, |
| 1269 |
}) |
| 1270 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.projects.locations.signSshPublicKey", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1271 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1272 |
} |
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 |
func (c *UsersProjectsLocationsSignSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*SignSshPublicKeyResponse, error) { |
| 1281 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1282 |
res, err := c.doRequest("json") |
| 1283 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1284 |
if res.Body != nil { |
| 1285 |
res.Body.Close() |
| 1286 |
} |
| 1287 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1288 |
Code: res.StatusCode, |
| 1289 |
Header: res.Header, |
| 1290 |
}) |
| 1291 |
} |
| 1292 |
if err != nil { |
| 1293 |
return nil, err |
| 1294 |
} |
| 1295 |
defer googleapi.CloseBody(res) |
| 1296 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1297 |
return nil, gensupport.WrapError(err) |
| 1298 |
} |
| 1299 |
ret := &SignSshPublicKeyResponse{ |
| 1300 |
ServerResponse: googleapi.ServerResponse{ |
| 1301 |
Header: res.Header, |
| 1302 |
HTTPStatusCode: res.StatusCode, |
| 1303 |
}, |
| 1304 |
} |
| 1305 |
target := &ret |
| 1306 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1307 |
if err != nil { |
| 1308 |
return nil, err |
| 1309 |
} |
| 1310 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.projects.locations.signSshPublicKey", "response", internallog.HTTPResponse(res, b)) |
| 1311 |
return ret, nil |
| 1312 |
} |
| 1313 |
|
| 1314 |
type UsersProjectsZonesSignSshPublicKeyCall struct { |
| 1315 |
s *Service |
| 1316 |
parent string |
| 1317 |
signsshpublickeyrequest *SignSshPublicKeyRequest |
| 1318 |
urlParams_ gensupport.URLParams |
| 1319 |
ctx_ context.Context |
| 1320 |
header_ http.Header |
| 1321 |
} |
| 1322 |
|
| 1323 |
|
| 1324 |
|
| 1325 |
|
| 1326 |
|
| 1327 |
func (r *UsersProjectsZonesService) SignSshPublicKey(parent string, signsshpublickeyrequest *SignSshPublicKeyRequest) *UsersProjectsZonesSignSshPublicKeyCall { |
| 1328 |
c := &UsersProjectsZonesSignSshPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1329 |
c.parent = parent |
| 1330 |
c.signsshpublickeyrequest = signsshpublickeyrequest |
| 1331 |
return c |
| 1332 |
} |
| 1333 |
|
| 1334 |
|
| 1335 |
|
| 1336 |
|
| 1337 |
func (c *UsersProjectsZonesSignSshPublicKeyCall) Fields(s ...googleapi.Field) *UsersProjectsZonesSignSshPublicKeyCall { |
| 1338 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1339 |
return c |
| 1340 |
} |
| 1341 |
|
| 1342 |
|
| 1343 |
func (c *UsersProjectsZonesSignSshPublicKeyCall) Context(ctx context.Context) *UsersProjectsZonesSignSshPublicKeyCall { |
| 1344 |
c.ctx_ = ctx |
| 1345 |
return c |
| 1346 |
} |
| 1347 |
|
| 1348 |
|
| 1349 |
|
| 1350 |
func (c *UsersProjectsZonesSignSshPublicKeyCall) Header() http.Header { |
| 1351 |
if c.header_ == nil { |
| 1352 |
c.header_ = make(http.Header) |
| 1353 |
} |
| 1354 |
return c.header_ |
| 1355 |
} |
| 1356 |
|
| 1357 |
func (c *UsersProjectsZonesSignSshPublicKeyCall) doRequest(alt string) (*http.Response, error) { |
| 1358 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1359 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.signsshpublickeyrequest) |
| 1360 |
if err != nil { |
| 1361 |
return nil, err |
| 1362 |
} |
| 1363 |
c.urlParams_.Set("alt", alt) |
| 1364 |
c.urlParams_.Set("prettyPrint", "false") |
| 1365 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}:signSshPublicKey") |
| 1366 |
urls += "?" + c.urlParams_.Encode() |
| 1367 |
req, err := http.NewRequest("POST", urls, body) |
| 1368 |
if err != nil { |
| 1369 |
return nil, err |
| 1370 |
} |
| 1371 |
req.Header = reqHeaders |
| 1372 |
googleapi.Expand(req.URL, map[string]string{ |
| 1373 |
"parent": c.parent, |
| 1374 |
}) |
| 1375 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.projects.zones.signSshPublicKey", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1376 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1377 |
} |
| 1378 |
|
| 1379 |
|
| 1380 |
|
| 1381 |
|
| 1382 |
|
| 1383 |
|
| 1384 |
|
| 1385 |
func (c *UsersProjectsZonesSignSshPublicKeyCall) Do(opts ...googleapi.CallOption) (*SignSshPublicKeyResponse, error) { |
| 1386 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1387 |
res, err := c.doRequest("json") |
| 1388 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1389 |
if res.Body != nil { |
| 1390 |
res.Body.Close() |
| 1391 |
} |
| 1392 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1393 |
Code: res.StatusCode, |
| 1394 |
Header: res.Header, |
| 1395 |
}) |
| 1396 |
} |
| 1397 |
if err != nil { |
| 1398 |
return nil, err |
| 1399 |
} |
| 1400 |
defer googleapi.CloseBody(res) |
| 1401 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1402 |
return nil, gensupport.WrapError(err) |
| 1403 |
} |
| 1404 |
ret := &SignSshPublicKeyResponse{ |
| 1405 |
ServerResponse: googleapi.ServerResponse{ |
| 1406 |
Header: res.Header, |
| 1407 |
HTTPStatusCode: res.StatusCode, |
| 1408 |
}, |
| 1409 |
} |
| 1410 |
target := &ret |
| 1411 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1412 |
if err != nil { |
| 1413 |
return nil, err |
| 1414 |
} |
| 1415 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.projects.zones.signSshPublicKey", "response", internallog.HTTPResponse(res, b)) |
| 1416 |
return ret, nil |
| 1417 |
} |
| 1418 |
|
| 1419 |
type UsersSshPublicKeysCreateCall struct { |
| 1420 |
s *Service |
| 1421 |
parent string |
| 1422 |
sshpublickey *SshPublicKey |
| 1423 |
urlParams_ gensupport.URLParams |
| 1424 |
ctx_ context.Context |
| 1425 |
header_ http.Header |
| 1426 |
} |
| 1427 |
|
| 1428 |
|
| 1429 |
|
| 1430 |
|
| 1431 |
func (r *UsersSshPublicKeysService) Create(parent string, sshpublickey *SshPublicKey) *UsersSshPublicKeysCreateCall { |
| 1432 |
c := &UsersSshPublicKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1433 |
c.parent = parent |
| 1434 |
c.sshpublickey = sshpublickey |
| 1435 |
return c |
| 1436 |
} |
| 1437 |
|
| 1438 |
|
| 1439 |
|
| 1440 |
|
| 1441 |
func (c *UsersSshPublicKeysCreateCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysCreateCall { |
| 1442 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1443 |
return c |
| 1444 |
} |
| 1445 |
|
| 1446 |
|
| 1447 |
func (c *UsersSshPublicKeysCreateCall) Context(ctx context.Context) *UsersSshPublicKeysCreateCall { |
| 1448 |
c.ctx_ = ctx |
| 1449 |
return c |
| 1450 |
} |
| 1451 |
|
| 1452 |
|
| 1453 |
|
| 1454 |
func (c *UsersSshPublicKeysCreateCall) Header() http.Header { |
| 1455 |
if c.header_ == nil { |
| 1456 |
c.header_ = make(http.Header) |
| 1457 |
} |
| 1458 |
return c.header_ |
| 1459 |
} |
| 1460 |
|
| 1461 |
func (c *UsersSshPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) { |
| 1462 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1463 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) |
| 1464 |
if err != nil { |
| 1465 |
return nil, err |
| 1466 |
} |
| 1467 |
c.urlParams_.Set("alt", alt) |
| 1468 |
c.urlParams_.Set("prettyPrint", "false") |
| 1469 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/sshPublicKeys") |
| 1470 |
urls += "?" + c.urlParams_.Encode() |
| 1471 |
req, err := http.NewRequest("POST", urls, body) |
| 1472 |
if err != nil { |
| 1473 |
return nil, err |
| 1474 |
} |
| 1475 |
req.Header = reqHeaders |
| 1476 |
googleapi.Expand(req.URL, map[string]string{ |
| 1477 |
"parent": c.parent, |
| 1478 |
}) |
| 1479 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.create", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1480 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1481 |
} |
| 1482 |
|
| 1483 |
|
| 1484 |
|
| 1485 |
|
| 1486 |
|
| 1487 |
|
| 1488 |
func (c *UsersSshPublicKeysCreateCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) { |
| 1489 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1490 |
res, err := c.doRequest("json") |
| 1491 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1492 |
if res.Body != nil { |
| 1493 |
res.Body.Close() |
| 1494 |
} |
| 1495 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1496 |
Code: res.StatusCode, |
| 1497 |
Header: res.Header, |
| 1498 |
}) |
| 1499 |
} |
| 1500 |
if err != nil { |
| 1501 |
return nil, err |
| 1502 |
} |
| 1503 |
defer googleapi.CloseBody(res) |
| 1504 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1505 |
return nil, gensupport.WrapError(err) |
| 1506 |
} |
| 1507 |
ret := &SshPublicKey{ |
| 1508 |
ServerResponse: googleapi.ServerResponse{ |
| 1509 |
Header: res.Header, |
| 1510 |
HTTPStatusCode: res.StatusCode, |
| 1511 |
}, |
| 1512 |
} |
| 1513 |
target := &ret |
| 1514 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1515 |
if err != nil { |
| 1516 |
return nil, err |
| 1517 |
} |
| 1518 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.create", "response", internallog.HTTPResponse(res, b)) |
| 1519 |
return ret, nil |
| 1520 |
} |
| 1521 |
|
| 1522 |
type UsersSshPublicKeysDeleteCall struct { |
| 1523 |
s *Service |
| 1524 |
name string |
| 1525 |
urlParams_ gensupport.URLParams |
| 1526 |
ctx_ context.Context |
| 1527 |
header_ http.Header |
| 1528 |
} |
| 1529 |
|
| 1530 |
|
| 1531 |
|
| 1532 |
|
| 1533 |
|
| 1534 |
|
| 1535 |
func (r *UsersSshPublicKeysService) Delete(name string) *UsersSshPublicKeysDeleteCall { |
| 1536 |
c := &UsersSshPublicKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1537 |
c.name = name |
| 1538 |
return c |
| 1539 |
} |
| 1540 |
|
| 1541 |
|
| 1542 |
|
| 1543 |
|
| 1544 |
func (c *UsersSshPublicKeysDeleteCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysDeleteCall { |
| 1545 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1546 |
return c |
| 1547 |
} |
| 1548 |
|
| 1549 |
|
| 1550 |
func (c *UsersSshPublicKeysDeleteCall) Context(ctx context.Context) *UsersSshPublicKeysDeleteCall { |
| 1551 |
c.ctx_ = ctx |
| 1552 |
return c |
| 1553 |
} |
| 1554 |
|
| 1555 |
|
| 1556 |
|
| 1557 |
func (c *UsersSshPublicKeysDeleteCall) Header() http.Header { |
| 1558 |
if c.header_ == nil { |
| 1559 |
c.header_ = make(http.Header) |
| 1560 |
} |
| 1561 |
return c.header_ |
| 1562 |
} |
| 1563 |
|
| 1564 |
func (c *UsersSshPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) { |
| 1565 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1566 |
c.urlParams_.Set("alt", alt) |
| 1567 |
c.urlParams_.Set("prettyPrint", "false") |
| 1568 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1569 |
urls += "?" + c.urlParams_.Encode() |
| 1570 |
req, err := http.NewRequest("DELETE", urls, nil) |
| 1571 |
if err != nil { |
| 1572 |
return nil, err |
| 1573 |
} |
| 1574 |
req.Header = reqHeaders |
| 1575 |
googleapi.Expand(req.URL, map[string]string{ |
| 1576 |
"name": c.name, |
| 1577 |
}) |
| 1578 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.delete", "request", internallog.HTTPRequest(req, nil)) |
| 1579 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1580 |
} |
| 1581 |
|
| 1582 |
|
| 1583 |
|
| 1584 |
|
| 1585 |
|
| 1586 |
|
| 1587 |
func (c *UsersSshPublicKeysDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { |
| 1588 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1589 |
res, err := c.doRequest("json") |
| 1590 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1591 |
if res.Body != nil { |
| 1592 |
res.Body.Close() |
| 1593 |
} |
| 1594 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1595 |
Code: res.StatusCode, |
| 1596 |
Header: res.Header, |
| 1597 |
}) |
| 1598 |
} |
| 1599 |
if err != nil { |
| 1600 |
return nil, err |
| 1601 |
} |
| 1602 |
defer googleapi.CloseBody(res) |
| 1603 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1604 |
return nil, gensupport.WrapError(err) |
| 1605 |
} |
| 1606 |
ret := &Empty{ |
| 1607 |
ServerResponse: googleapi.ServerResponse{ |
| 1608 |
Header: res.Header, |
| 1609 |
HTTPStatusCode: res.StatusCode, |
| 1610 |
}, |
| 1611 |
} |
| 1612 |
target := &ret |
| 1613 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1614 |
if err != nil { |
| 1615 |
return nil, err |
| 1616 |
} |
| 1617 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.delete", "response", internallog.HTTPResponse(res, b)) |
| 1618 |
return ret, nil |
| 1619 |
} |
| 1620 |
|
| 1621 |
type UsersSshPublicKeysGetCall struct { |
| 1622 |
s *Service |
| 1623 |
name string |
| 1624 |
urlParams_ gensupport.URLParams |
| 1625 |
ifNoneMatch_ string |
| 1626 |
ctx_ context.Context |
| 1627 |
header_ http.Header |
| 1628 |
} |
| 1629 |
|
| 1630 |
|
| 1631 |
|
| 1632 |
|
| 1633 |
|
| 1634 |
|
| 1635 |
func (r *UsersSshPublicKeysService) Get(name string) *UsersSshPublicKeysGetCall { |
| 1636 |
c := &UsersSshPublicKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1637 |
c.name = name |
| 1638 |
return c |
| 1639 |
} |
| 1640 |
|
| 1641 |
|
| 1642 |
|
| 1643 |
|
| 1644 |
func (c *UsersSshPublicKeysGetCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysGetCall { |
| 1645 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1646 |
return c |
| 1647 |
} |
| 1648 |
|
| 1649 |
|
| 1650 |
|
| 1651 |
|
| 1652 |
func (c *UsersSshPublicKeysGetCall) IfNoneMatch(entityTag string) *UsersSshPublicKeysGetCall { |
| 1653 |
c.ifNoneMatch_ = entityTag |
| 1654 |
return c |
| 1655 |
} |
| 1656 |
|
| 1657 |
|
| 1658 |
func (c *UsersSshPublicKeysGetCall) Context(ctx context.Context) *UsersSshPublicKeysGetCall { |
| 1659 |
c.ctx_ = ctx |
| 1660 |
return c |
| 1661 |
} |
| 1662 |
|
| 1663 |
|
| 1664 |
|
| 1665 |
func (c *UsersSshPublicKeysGetCall) Header() http.Header { |
| 1666 |
if c.header_ == nil { |
| 1667 |
c.header_ = make(http.Header) |
| 1668 |
} |
| 1669 |
return c.header_ |
| 1670 |
} |
| 1671 |
|
| 1672 |
func (c *UsersSshPublicKeysGetCall) doRequest(alt string) (*http.Response, error) { |
| 1673 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1674 |
if c.ifNoneMatch_ != "" { |
| 1675 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1676 |
} |
| 1677 |
c.urlParams_.Set("alt", alt) |
| 1678 |
c.urlParams_.Set("prettyPrint", "false") |
| 1679 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1680 |
urls += "?" + c.urlParams_.Encode() |
| 1681 |
req, err := http.NewRequest("GET", urls, nil) |
| 1682 |
if err != nil { |
| 1683 |
return nil, err |
| 1684 |
} |
| 1685 |
req.Header = reqHeaders |
| 1686 |
googleapi.Expand(req.URL, map[string]string{ |
| 1687 |
"name": c.name, |
| 1688 |
}) |
| 1689 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.get", "request", internallog.HTTPRequest(req, nil)) |
| 1690 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1691 |
} |
| 1692 |
|
| 1693 |
|
| 1694 |
|
| 1695 |
|
| 1696 |
|
| 1697 |
|
| 1698 |
func (c *UsersSshPublicKeysGetCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) { |
| 1699 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1700 |
res, err := c.doRequest("json") |
| 1701 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1702 |
if res.Body != nil { |
| 1703 |
res.Body.Close() |
| 1704 |
} |
| 1705 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1706 |
Code: res.StatusCode, |
| 1707 |
Header: res.Header, |
| 1708 |
}) |
| 1709 |
} |
| 1710 |
if err != nil { |
| 1711 |
return nil, err |
| 1712 |
} |
| 1713 |
defer googleapi.CloseBody(res) |
| 1714 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1715 |
return nil, gensupport.WrapError(err) |
| 1716 |
} |
| 1717 |
ret := &SshPublicKey{ |
| 1718 |
ServerResponse: googleapi.ServerResponse{ |
| 1719 |
Header: res.Header, |
| 1720 |
HTTPStatusCode: res.StatusCode, |
| 1721 |
}, |
| 1722 |
} |
| 1723 |
target := &ret |
| 1724 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1725 |
if err != nil { |
| 1726 |
return nil, err |
| 1727 |
} |
| 1728 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.get", "response", internallog.HTTPResponse(res, b)) |
| 1729 |
return ret, nil |
| 1730 |
} |
| 1731 |
|
| 1732 |
type UsersSshPublicKeysPatchCall struct { |
| 1733 |
s *Service |
| 1734 |
name string |
| 1735 |
sshpublickey *SshPublicKey |
| 1736 |
urlParams_ gensupport.URLParams |
| 1737 |
ctx_ context.Context |
| 1738 |
header_ http.Header |
| 1739 |
} |
| 1740 |
|
| 1741 |
|
| 1742 |
|
| 1743 |
|
| 1744 |
|
| 1745 |
|
| 1746 |
|
| 1747 |
func (r *UsersSshPublicKeysService) Patch(name string, sshpublickey *SshPublicKey) *UsersSshPublicKeysPatchCall { |
| 1748 |
c := &UsersSshPublicKeysPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1749 |
c.name = name |
| 1750 |
c.sshpublickey = sshpublickey |
| 1751 |
return c |
| 1752 |
} |
| 1753 |
|
| 1754 |
|
| 1755 |
|
| 1756 |
func (c *UsersSshPublicKeysPatchCall) UpdateMask(updateMask string) *UsersSshPublicKeysPatchCall { |
| 1757 |
c.urlParams_.Set("updateMask", updateMask) |
| 1758 |
return c |
| 1759 |
} |
| 1760 |
|
| 1761 |
|
| 1762 |
|
| 1763 |
|
| 1764 |
func (c *UsersSshPublicKeysPatchCall) Fields(s ...googleapi.Field) *UsersSshPublicKeysPatchCall { |
| 1765 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1766 |
return c |
| 1767 |
} |
| 1768 |
|
| 1769 |
|
| 1770 |
func (c *UsersSshPublicKeysPatchCall) Context(ctx context.Context) *UsersSshPublicKeysPatchCall { |
| 1771 |
c.ctx_ = ctx |
| 1772 |
return c |
| 1773 |
} |
| 1774 |
|
| 1775 |
|
| 1776 |
|
| 1777 |
func (c *UsersSshPublicKeysPatchCall) Header() http.Header { |
| 1778 |
if c.header_ == nil { |
| 1779 |
c.header_ = make(http.Header) |
| 1780 |
} |
| 1781 |
return c.header_ |
| 1782 |
} |
| 1783 |
|
| 1784 |
func (c *UsersSshPublicKeysPatchCall) doRequest(alt string) (*http.Response, error) { |
| 1785 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1786 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sshpublickey) |
| 1787 |
if err != nil { |
| 1788 |
return nil, err |
| 1789 |
} |
| 1790 |
c.urlParams_.Set("alt", alt) |
| 1791 |
c.urlParams_.Set("prettyPrint", "false") |
| 1792 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1793 |
urls += "?" + c.urlParams_.Encode() |
| 1794 |
req, err := http.NewRequest("PATCH", urls, body) |
| 1795 |
if err != nil { |
| 1796 |
return nil, err |
| 1797 |
} |
| 1798 |
req.Header = reqHeaders |
| 1799 |
googleapi.Expand(req.URL, map[string]string{ |
| 1800 |
"name": c.name, |
| 1801 |
}) |
| 1802 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.patch", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1803 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1804 |
} |
| 1805 |
|
| 1806 |
|
| 1807 |
|
| 1808 |
|
| 1809 |
|
| 1810 |
|
| 1811 |
func (c *UsersSshPublicKeysPatchCall) Do(opts ...googleapi.CallOption) (*SshPublicKey, error) { |
| 1812 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1813 |
res, err := c.doRequest("json") |
| 1814 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1815 |
if res.Body != nil { |
| 1816 |
res.Body.Close() |
| 1817 |
} |
| 1818 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1819 |
Code: res.StatusCode, |
| 1820 |
Header: res.Header, |
| 1821 |
}) |
| 1822 |
} |
| 1823 |
if err != nil { |
| 1824 |
return nil, err |
| 1825 |
} |
| 1826 |
defer googleapi.CloseBody(res) |
| 1827 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1828 |
return nil, gensupport.WrapError(err) |
| 1829 |
} |
| 1830 |
ret := &SshPublicKey{ |
| 1831 |
ServerResponse: googleapi.ServerResponse{ |
| 1832 |
Header: res.Header, |
| 1833 |
HTTPStatusCode: res.StatusCode, |
| 1834 |
}, |
| 1835 |
} |
| 1836 |
target := &ret |
| 1837 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1838 |
if err != nil { |
| 1839 |
return nil, err |
| 1840 |
} |
| 1841 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "oslogin.users.sshPublicKeys.patch", "response", internallog.HTTPResponse(res, b)) |
| 1842 |
return ret, nil |
| 1843 |
} |