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 admin provides access to the Admin SDK API. 8// 9// For product documentation, see: http://developers.google.com/admin-sdk/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/admin/directory/v1" 16// ... 17// ctx := context.Background() 18// adminService, err := admin.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// adminService, err := admin.NewService(ctx, option.WithScopes(admin.CloudPlatformScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// adminService, err := admin.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// adminService, err := admin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package admin // import "google.golang.org/api/admin/directory/v1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "admin:directory_v1" 79const apiName = "admin" 80const apiVersion = "directory_v1" 81const basePath = "https://admin.googleapis.com/" 82const mtlsBasePath = "https://admin.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // View and manage customer related information 87 AdminDirectoryCustomerScope = "https://www.googleapis.com/auth/admin.directory.customer" 88 89 // View customer related information 90 AdminDirectoryCustomerReadonlyScope = "https://www.googleapis.com/auth/admin.directory.customer.readonly" 91 92 // View and manage your Chrome OS devices' metadata 93 AdminDirectoryDeviceChromeosScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos" 94 95 // View your Chrome OS devices' metadata 96 AdminDirectoryDeviceChromeosReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 97 98 // View and manage your mobile devices' metadata 99 AdminDirectoryDeviceMobileScope = "https://www.googleapis.com/auth/admin.directory.device.mobile" 100 101 // Manage your mobile devices by performing administrative tasks 102 AdminDirectoryDeviceMobileActionScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.action" 103 104 // View your mobile devices' metadata 105 AdminDirectoryDeviceMobileReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 106 107 // View and manage the provisioning of domains for your customers 108 AdminDirectoryDomainScope = "https://www.googleapis.com/auth/admin.directory.domain" 109 110 // View domains related to your customers 111 AdminDirectoryDomainReadonlyScope = "https://www.googleapis.com/auth/admin.directory.domain.readonly" 112 113 // View and manage the provisioning of groups on your domain 114 AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group" 115 116 // View and manage group subscriptions on your domain 117 AdminDirectoryGroupMemberScope = "https://www.googleapis.com/auth/admin.directory.group.member" 118 119 // View group subscriptions on your domain 120 AdminDirectoryGroupMemberReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.member.readonly" 121 122 // View groups on your domain 123 AdminDirectoryGroupReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.readonly" 124 125 // View and manage organization units on your domain 126 AdminDirectoryOrgunitScope = "https://www.googleapis.com/auth/admin.directory.orgunit" 127 128 // View organization units on your domain 129 AdminDirectoryOrgunitReadonlyScope = "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 130 131 // View and manage the provisioning of calendar resources on your domain 132 AdminDirectoryResourceCalendarScope = "https://www.googleapis.com/auth/admin.directory.resource.calendar" 133 134 // View calendar resources on your domain 135 AdminDirectoryResourceCalendarReadonlyScope = "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 136 137 // Manage delegated admin roles for your domain 138 AdminDirectoryRolemanagementScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement" 139 140 // View delegated admin roles for your domain 141 AdminDirectoryRolemanagementReadonlyScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 142 143 // View and manage the provisioning of users on your domain 144 AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user" 145 146 // View and manage user aliases on your domain 147 AdminDirectoryUserAliasScope = "https://www.googleapis.com/auth/admin.directory.user.alias" 148 149 // View user aliases on your domain 150 AdminDirectoryUserAliasReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.alias.readonly" 151 152 // View users on your domain 153 AdminDirectoryUserReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.readonly" 154 155 // Manage data access permissions for users on your domain 156 AdminDirectoryUserSecurityScope = "https://www.googleapis.com/auth/admin.directory.user.security" 157 158 // View and manage the provisioning of user schemas on your domain 159 AdminDirectoryUserschemaScope = "https://www.googleapis.com/auth/admin.directory.userschema" 160 161 // View user schemas on your domain 162 AdminDirectoryUserschemaReadonlyScope = "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 163 164 // View and manage your data across Google Cloud Platform services 165 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 166) 167 168// NewService creates a new Service. 169func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 170 scopesOption := option.WithScopes( 171 "https://www.googleapis.com/auth/admin.directory.customer", 172 "https://www.googleapis.com/auth/admin.directory.customer.readonly", 173 "https://www.googleapis.com/auth/admin.directory.device.chromeos", 174 "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly", 175 "https://www.googleapis.com/auth/admin.directory.device.mobile", 176 "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 177 "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly", 178 "https://www.googleapis.com/auth/admin.directory.domain", 179 "https://www.googleapis.com/auth/admin.directory.domain.readonly", 180 "https://www.googleapis.com/auth/admin.directory.group", 181 "https://www.googleapis.com/auth/admin.directory.group.member", 182 "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 183 "https://www.googleapis.com/auth/admin.directory.group.readonly", 184 "https://www.googleapis.com/auth/admin.directory.orgunit", 185 "https://www.googleapis.com/auth/admin.directory.orgunit.readonly", 186 "https://www.googleapis.com/auth/admin.directory.resource.calendar", 187 "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly", 188 "https://www.googleapis.com/auth/admin.directory.rolemanagement", 189 "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly", 190 "https://www.googleapis.com/auth/admin.directory.user", 191 "https://www.googleapis.com/auth/admin.directory.user.alias", 192 "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 193 "https://www.googleapis.com/auth/admin.directory.user.readonly", 194 "https://www.googleapis.com/auth/admin.directory.user.security", 195 "https://www.googleapis.com/auth/admin.directory.userschema", 196 "https://www.googleapis.com/auth/admin.directory.userschema.readonly", 197 "https://www.googleapis.com/auth/cloud-platform", 198 ) 199 // NOTE: prepend, so we don't override user-specified scopes. 200 opts = append([]option.ClientOption{scopesOption}, opts...) 201 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 202 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 203 client, endpoint, err := htransport.NewClient(ctx, opts...) 204 if err != nil { 205 return nil, err 206 } 207 s, err := New(client) 208 if err != nil { 209 return nil, err 210 } 211 if endpoint != "" { 212 s.BasePath = endpoint 213 } 214 return s, nil 215} 216 217// New creates a new Service. It uses the provided http.Client for requests. 218// 219// Deprecated: please use NewService instead. 220// To provide a custom HTTP client, use option.WithHTTPClient. 221// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 222func New(client *http.Client) (*Service, error) { 223 if client == nil { 224 return nil, errors.New("client is nil") 225 } 226 s := &Service{client: client, BasePath: basePath} 227 s.Asps = NewAspsService(s) 228 s.Channels = NewChannelsService(s) 229 s.Chromeosdevices = NewChromeosdevicesService(s) 230 s.Customer = NewCustomerService(s) 231 s.Customers = NewCustomersService(s) 232 s.DomainAliases = NewDomainAliasesService(s) 233 s.Domains = NewDomainsService(s) 234 s.Groups = NewGroupsService(s) 235 s.Members = NewMembersService(s) 236 s.Mobiledevices = NewMobiledevicesService(s) 237 s.Orgunits = NewOrgunitsService(s) 238 s.Privileges = NewPrivilegesService(s) 239 s.Resources = NewResourcesService(s) 240 s.RoleAssignments = NewRoleAssignmentsService(s) 241 s.Roles = NewRolesService(s) 242 s.Schemas = NewSchemasService(s) 243 s.Tokens = NewTokensService(s) 244 s.TwoStepVerification = NewTwoStepVerificationService(s) 245 s.Users = NewUsersService(s) 246 s.VerificationCodes = NewVerificationCodesService(s) 247 return s, nil 248} 249 250type Service struct { 251 client *http.Client 252 BasePath string // API endpoint base URL 253 UserAgent string // optional additional User-Agent fragment 254 255 Asps *AspsService 256 257 Channels *ChannelsService 258 259 Chromeosdevices *ChromeosdevicesService 260 261 Customer *CustomerService 262 263 Customers *CustomersService 264 265 DomainAliases *DomainAliasesService 266 267 Domains *DomainsService 268 269 Groups *GroupsService 270 271 Members *MembersService 272 273 Mobiledevices *MobiledevicesService 274 275 Orgunits *OrgunitsService 276 277 Privileges *PrivilegesService 278 279 Resources *ResourcesService 280 281 RoleAssignments *RoleAssignmentsService 282 283 Roles *RolesService 284 285 Schemas *SchemasService 286 287 Tokens *TokensService 288 289 TwoStepVerification *TwoStepVerificationService 290 291 Users *UsersService 292 293 VerificationCodes *VerificationCodesService 294} 295 296func (s *Service) userAgent() string { 297 if s.UserAgent == "" { 298 return googleapi.UserAgent 299 } 300 return googleapi.UserAgent + " " + s.UserAgent 301} 302 303func NewAspsService(s *Service) *AspsService { 304 rs := &AspsService{s: s} 305 return rs 306} 307 308type AspsService struct { 309 s *Service 310} 311 312func NewChannelsService(s *Service) *ChannelsService { 313 rs := &ChannelsService{s: s} 314 return rs 315} 316 317type ChannelsService struct { 318 s *Service 319} 320 321func NewChromeosdevicesService(s *Service) *ChromeosdevicesService { 322 rs := &ChromeosdevicesService{s: s} 323 return rs 324} 325 326type ChromeosdevicesService struct { 327 s *Service 328} 329 330func NewCustomerService(s *Service) *CustomerService { 331 rs := &CustomerService{s: s} 332 rs.Devices = NewCustomerDevicesService(s) 333 return rs 334} 335 336type CustomerService struct { 337 s *Service 338 339 Devices *CustomerDevicesService 340} 341 342func NewCustomerDevicesService(s *Service) *CustomerDevicesService { 343 rs := &CustomerDevicesService{s: s} 344 rs.Chromeos = NewCustomerDevicesChromeosService(s) 345 return rs 346} 347 348type CustomerDevicesService struct { 349 s *Service 350 351 Chromeos *CustomerDevicesChromeosService 352} 353 354func NewCustomerDevicesChromeosService(s *Service) *CustomerDevicesChromeosService { 355 rs := &CustomerDevicesChromeosService{s: s} 356 rs.Commands = NewCustomerDevicesChromeosCommandsService(s) 357 return rs 358} 359 360type CustomerDevicesChromeosService struct { 361 s *Service 362 363 Commands *CustomerDevicesChromeosCommandsService 364} 365 366func NewCustomerDevicesChromeosCommandsService(s *Service) *CustomerDevicesChromeosCommandsService { 367 rs := &CustomerDevicesChromeosCommandsService{s: s} 368 return rs 369} 370 371type CustomerDevicesChromeosCommandsService struct { 372 s *Service 373} 374 375func NewCustomersService(s *Service) *CustomersService { 376 rs := &CustomersService{s: s} 377 return rs 378} 379 380type CustomersService struct { 381 s *Service 382} 383 384func NewDomainAliasesService(s *Service) *DomainAliasesService { 385 rs := &DomainAliasesService{s: s} 386 return rs 387} 388 389type DomainAliasesService struct { 390 s *Service 391} 392 393func NewDomainsService(s *Service) *DomainsService { 394 rs := &DomainsService{s: s} 395 return rs 396} 397 398type DomainsService struct { 399 s *Service 400} 401 402func NewGroupsService(s *Service) *GroupsService { 403 rs := &GroupsService{s: s} 404 rs.Aliases = NewGroupsAliasesService(s) 405 return rs 406} 407 408type GroupsService struct { 409 s *Service 410 411 Aliases *GroupsAliasesService 412} 413 414func NewGroupsAliasesService(s *Service) *GroupsAliasesService { 415 rs := &GroupsAliasesService{s: s} 416 return rs 417} 418 419type GroupsAliasesService struct { 420 s *Service 421} 422 423func NewMembersService(s *Service) *MembersService { 424 rs := &MembersService{s: s} 425 return rs 426} 427 428type MembersService struct { 429 s *Service 430} 431 432func NewMobiledevicesService(s *Service) *MobiledevicesService { 433 rs := &MobiledevicesService{s: s} 434 return rs 435} 436 437type MobiledevicesService struct { 438 s *Service 439} 440 441func NewOrgunitsService(s *Service) *OrgunitsService { 442 rs := &OrgunitsService{s: s} 443 return rs 444} 445 446type OrgunitsService struct { 447 s *Service 448} 449 450func NewPrivilegesService(s *Service) *PrivilegesService { 451 rs := &PrivilegesService{s: s} 452 return rs 453} 454 455type PrivilegesService struct { 456 s *Service 457} 458 459func NewResourcesService(s *Service) *ResourcesService { 460 rs := &ResourcesService{s: s} 461 rs.Buildings = NewResourcesBuildingsService(s) 462 rs.Calendars = NewResourcesCalendarsService(s) 463 rs.Features = NewResourcesFeaturesService(s) 464 return rs 465} 466 467type ResourcesService struct { 468 s *Service 469 470 Buildings *ResourcesBuildingsService 471 472 Calendars *ResourcesCalendarsService 473 474 Features *ResourcesFeaturesService 475} 476 477func NewResourcesBuildingsService(s *Service) *ResourcesBuildingsService { 478 rs := &ResourcesBuildingsService{s: s} 479 return rs 480} 481 482type ResourcesBuildingsService struct { 483 s *Service 484} 485 486func NewResourcesCalendarsService(s *Service) *ResourcesCalendarsService { 487 rs := &ResourcesCalendarsService{s: s} 488 return rs 489} 490 491type ResourcesCalendarsService struct { 492 s *Service 493} 494 495func NewResourcesFeaturesService(s *Service) *ResourcesFeaturesService { 496 rs := &ResourcesFeaturesService{s: s} 497 return rs 498} 499 500type ResourcesFeaturesService struct { 501 s *Service 502} 503 504func NewRoleAssignmentsService(s *Service) *RoleAssignmentsService { 505 rs := &RoleAssignmentsService{s: s} 506 return rs 507} 508 509type RoleAssignmentsService struct { 510 s *Service 511} 512 513func NewRolesService(s *Service) *RolesService { 514 rs := &RolesService{s: s} 515 return rs 516} 517 518type RolesService struct { 519 s *Service 520} 521 522func NewSchemasService(s *Service) *SchemasService { 523 rs := &SchemasService{s: s} 524 return rs 525} 526 527type SchemasService struct { 528 s *Service 529} 530 531func NewTokensService(s *Service) *TokensService { 532 rs := &TokensService{s: s} 533 return rs 534} 535 536type TokensService struct { 537 s *Service 538} 539 540func NewTwoStepVerificationService(s *Service) *TwoStepVerificationService { 541 rs := &TwoStepVerificationService{s: s} 542 return rs 543} 544 545type TwoStepVerificationService struct { 546 s *Service 547} 548 549func NewUsersService(s *Service) *UsersService { 550 rs := &UsersService{s: s} 551 rs.Aliases = NewUsersAliasesService(s) 552 rs.Photos = NewUsersPhotosService(s) 553 return rs 554} 555 556type UsersService struct { 557 s *Service 558 559 Aliases *UsersAliasesService 560 561 Photos *UsersPhotosService 562} 563 564func NewUsersAliasesService(s *Service) *UsersAliasesService { 565 rs := &UsersAliasesService{s: s} 566 return rs 567} 568 569type UsersAliasesService struct { 570 s *Service 571} 572 573func NewUsersPhotosService(s *Service) *UsersPhotosService { 574 rs := &UsersPhotosService{s: s} 575 return rs 576} 577 578type UsersPhotosService struct { 579 s *Service 580} 581 582func NewVerificationCodesService(s *Service) *VerificationCodesService { 583 rs := &VerificationCodesService{s: s} 584 return rs 585} 586 587type VerificationCodesService struct { 588 s *Service 589} 590 591// Alias: JSON template for Alias object in Directory API. 592type Alias struct { 593 Alias string `json:"alias,omitempty"` 594 595 Etag string `json:"etag,omitempty"` 596 597 Id string `json:"id,omitempty"` 598 599 Kind string `json:"kind,omitempty"` 600 601 PrimaryEmail string `json:"primaryEmail,omitempty"` 602 603 // ServerResponse contains the HTTP response code and headers from the 604 // server. 605 googleapi.ServerResponse `json:"-"` 606 607 // ForceSendFields is a list of field names (e.g. "Alias") to 608 // unconditionally include in API requests. By default, fields with 609 // empty values are omitted from API requests. However, any non-pointer, 610 // non-interface field appearing in ForceSendFields will be sent to the 611 // server regardless of whether the field is empty or not. This may be 612 // used to include empty fields in Patch requests. 613 ForceSendFields []string `json:"-"` 614 615 // NullFields is a list of field names (e.g. "Alias") to include in API 616 // requests with the JSON null value. By default, fields with empty 617 // values are omitted from API requests. However, any field with an 618 // empty value appearing in NullFields will be sent to the server as 619 // null. It is an error if a field in this list has a non-empty value. 620 // This may be used to include null fields in Patch requests. 621 NullFields []string `json:"-"` 622} 623 624func (s *Alias) MarshalJSON() ([]byte, error) { 625 type NoMethod Alias 626 raw := NoMethod(*s) 627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 628} 629 630// Aliases: JSON response template to list aliases in Directory API. 631type Aliases struct { 632 Aliases []interface{} `json:"aliases,omitempty"` 633 634 Etag string `json:"etag,omitempty"` 635 636 Kind string `json:"kind,omitempty"` 637 638 // ServerResponse contains the HTTP response code and headers from the 639 // server. 640 googleapi.ServerResponse `json:"-"` 641 642 // ForceSendFields is a list of field names (e.g. "Aliases") to 643 // unconditionally include in API requests. By default, fields with 644 // empty values are omitted from API requests. However, any non-pointer, 645 // non-interface field appearing in ForceSendFields will be sent to the 646 // server regardless of whether the field is empty or not. This may be 647 // used to include empty fields in Patch requests. 648 ForceSendFields []string `json:"-"` 649 650 // NullFields is a list of field names (e.g. "Aliases") to include in 651 // API requests with the JSON null value. By default, fields with empty 652 // values are omitted from API requests. However, any field with an 653 // empty value appearing in NullFields will be sent to the server as 654 // null. It is an error if a field in this list has a non-empty value. 655 // This may be used to include null fields in Patch requests. 656 NullFields []string `json:"-"` 657} 658 659func (s *Aliases) MarshalJSON() ([]byte, error) { 660 type NoMethod Aliases 661 raw := NoMethod(*s) 662 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 663} 664 665// Asp: An application-specific password (ASP) is used with applications 666// that do not accept a verification code when logging into the 667// application on certain devices. The ASP access code is used instead 668// of the login and password you commonly use when accessing an 669// application through a browser. For more information about ASPs and 670// how to create one, see the [help 671// center](//http://support.google.com/a/bin/answer.py?amp;answer=1032419 672// ). 673type Asp struct { 674 // CodeId: The unique ID of the ASP. 675 CodeId int64 `json:"codeId,omitempty"` 676 677 // CreationTime: The time when the ASP was created. Expressed in [Unix 678 // time](http://en.wikipedia.org/wiki/Epoch_time) format. 679 CreationTime int64 `json:"creationTime,omitempty,string"` 680 681 // Etag: ETag of the ASP. 682 Etag string `json:"etag,omitempty"` 683 684 // Kind: The type of the API resource. This is always 685 // `admin#directory#asp`. 686 Kind string `json:"kind,omitempty"` 687 688 // LastTimeUsed: The time when the ASP was last used. Expressed in [Unix 689 // time](http://en.wikipedia.org/wiki/Epoch_time) format. 690 LastTimeUsed int64 `json:"lastTimeUsed,omitempty,string"` 691 692 // Name: The name of the application that the user, represented by their 693 // `userId`, entered when the ASP was created. 694 Name string `json:"name,omitempty"` 695 696 // UserKey: The unique ID of the user who issued the ASP. 697 UserKey string `json:"userKey,omitempty"` 698 699 // ServerResponse contains the HTTP response code and headers from the 700 // server. 701 googleapi.ServerResponse `json:"-"` 702 703 // ForceSendFields is a list of field names (e.g. "CodeId") to 704 // unconditionally include in API requests. By default, fields with 705 // empty values are omitted from API requests. However, any non-pointer, 706 // non-interface field appearing in ForceSendFields will be sent to the 707 // server regardless of whether the field is empty or not. This may be 708 // used to include empty fields in Patch requests. 709 ForceSendFields []string `json:"-"` 710 711 // NullFields is a list of field names (e.g. "CodeId") to include in API 712 // requests with the JSON null value. By default, fields with empty 713 // values are omitted from API requests. However, any field with an 714 // empty value appearing in NullFields will be sent to the server as 715 // null. It is an error if a field in this list has a non-empty value. 716 // This may be used to include null fields in Patch requests. 717 NullFields []string `json:"-"` 718} 719 720func (s *Asp) MarshalJSON() ([]byte, error) { 721 type NoMethod Asp 722 raw := NoMethod(*s) 723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 724} 725 726type Asps struct { 727 // Etag: ETag of the resource. 728 Etag string `json:"etag,omitempty"` 729 730 // Items: A list of ASP resources. 731 Items []*Asp `json:"items,omitempty"` 732 733 // Kind: The type of the API resource. This is always 734 // `admin#directory#aspList`. 735 Kind string `json:"kind,omitempty"` 736 737 // ServerResponse contains the HTTP response code and headers from the 738 // server. 739 googleapi.ServerResponse `json:"-"` 740 741 // ForceSendFields is a list of field names (e.g. "Etag") to 742 // unconditionally include in API requests. By default, fields with 743 // empty values are omitted from API requests. However, any non-pointer, 744 // non-interface field appearing in ForceSendFields will be sent to the 745 // server regardless of whether the field is empty or not. This may be 746 // used to include empty fields in Patch requests. 747 ForceSendFields []string `json:"-"` 748 749 // NullFields is a list of field names (e.g. "Etag") to include in API 750 // requests with the JSON null value. By default, fields with empty 751 // values are omitted from API requests. However, any field with an 752 // empty value appearing in NullFields will be sent to the server as 753 // null. It is an error if a field in this list has a non-empty value. 754 // This may be used to include null fields in Patch requests. 755 NullFields []string `json:"-"` 756} 757 758func (s *Asps) MarshalJSON() ([]byte, error) { 759 type NoMethod Asps 760 raw := NoMethod(*s) 761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 762} 763 764// Building: Public API: Resources.buildings 765type Building struct { 766 // Address: The postal address of the building. See 767 // [`PostalAddress`](/my-business/reference/rest/v4/PostalAddress) for 768 // details. Note that only a single address line and region code are 769 // required. 770 Address *BuildingAddress `json:"address,omitempty"` 771 772 // BuildingId: Unique identifier for the building. The maximum length is 773 // 100 characters. 774 BuildingId string `json:"buildingId,omitempty"` 775 776 // BuildingName: The building name as seen by users in Calendar. Must be 777 // unique for the customer. For example, "NYC-CHEL". The maximum length 778 // is 100 characters. 779 BuildingName string `json:"buildingName,omitempty"` 780 781 // Coordinates: The geographic coordinates of the center of the 782 // building, expressed as latitude and longitude in decimal degrees. 783 Coordinates *BuildingCoordinates `json:"coordinates,omitempty"` 784 785 // Description: A brief description of the building. For example, 786 // "Chelsea Market". 787 Description string `json:"description,omitempty"` 788 789 // Etags: ETag of the resource. 790 Etags string `json:"etags,omitempty"` 791 792 // FloorNames: The display names for all floors in this building. The 793 // floors are expected to be sorted in ascending order, from lowest 794 // floor to highest floor. For example, ["B2", "B1", "L", "1", "2", 795 // "2M", "3", "PH"] Must contain at least one entry. 796 FloorNames []string `json:"floorNames,omitempty"` 797 798 // Kind: Kind of resource this is. 799 Kind string `json:"kind,omitempty"` 800 801 // ServerResponse contains the HTTP response code and headers from the 802 // server. 803 googleapi.ServerResponse `json:"-"` 804 805 // ForceSendFields is a list of field names (e.g. "Address") to 806 // unconditionally include in API requests. By default, fields with 807 // empty values are omitted from API requests. However, any non-pointer, 808 // non-interface field appearing in ForceSendFields will be sent to the 809 // server regardless of whether the field is empty or not. This may be 810 // used to include empty fields in Patch requests. 811 ForceSendFields []string `json:"-"` 812 813 // NullFields is a list of field names (e.g. "Address") to include in 814 // API requests with the JSON null value. By default, fields with empty 815 // values are omitted from API requests. However, any field with an 816 // empty value appearing in NullFields will be sent to the server as 817 // null. It is an error if a field in this list has a non-empty value. 818 // This may be used to include null fields in Patch requests. 819 NullFields []string `json:"-"` 820} 821 822func (s *Building) MarshalJSON() ([]byte, error) { 823 type NoMethod Building 824 raw := NoMethod(*s) 825 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 826} 827 828// BuildingAddress: Public API: Resources.buildings 829type BuildingAddress struct { 830 // AddressLines: Unstructured address lines describing the lower levels 831 // of an address. 832 AddressLines []string `json:"addressLines,omitempty"` 833 834 // AdministrativeArea: Optional. Highest administrative subdivision 835 // which is used for postal addresses of a country or region. 836 AdministrativeArea string `json:"administrativeArea,omitempty"` 837 838 // LanguageCode: Optional. BCP-47 language code of the contents of this 839 // address (if known). 840 LanguageCode string `json:"languageCode,omitempty"` 841 842 // Locality: Optional. Generally refers to the city/town portion of the 843 // address. Examples: US city, IT comune, UK post town. In regions of 844 // the world where localities are not well defined or do not fit into 845 // this structure well, leave locality empty and use addressLines. 846 Locality string `json:"locality,omitempty"` 847 848 // PostalCode: Optional. Postal code of the address. 849 PostalCode string `json:"postalCode,omitempty"` 850 851 // RegionCode: Required. CLDR region code of the country/region of the 852 // address. 853 RegionCode string `json:"regionCode,omitempty"` 854 855 // Sublocality: Optional. Sublocality of the address. 856 Sublocality string `json:"sublocality,omitempty"` 857 858 // ForceSendFields is a list of field names (e.g. "AddressLines") to 859 // unconditionally include in API requests. By default, fields with 860 // empty values are omitted from API requests. However, any non-pointer, 861 // non-interface field appearing in ForceSendFields will be sent to the 862 // server regardless of whether the field is empty or not. This may be 863 // used to include empty fields in Patch requests. 864 ForceSendFields []string `json:"-"` 865 866 // NullFields is a list of field names (e.g. "AddressLines") to include 867 // in API requests with the JSON null value. By default, fields with 868 // empty values are omitted from API requests. However, any field with 869 // an empty value appearing in NullFields will be sent to the server as 870 // null. It is an error if a field in this list has a non-empty value. 871 // This may be used to include null fields in Patch requests. 872 NullFields []string `json:"-"` 873} 874 875func (s *BuildingAddress) MarshalJSON() ([]byte, error) { 876 type NoMethod BuildingAddress 877 raw := NoMethod(*s) 878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 879} 880 881// BuildingCoordinates: Public API: Resources.buildings 882type BuildingCoordinates struct { 883 // Latitude: Latitude in decimal degrees. 884 Latitude float64 `json:"latitude,omitempty"` 885 886 // Longitude: Longitude in decimal degrees. 887 Longitude float64 `json:"longitude,omitempty"` 888 889 // ForceSendFields is a list of field names (e.g. "Latitude") to 890 // unconditionally include in API requests. By default, fields with 891 // empty values are omitted from API requests. However, any non-pointer, 892 // non-interface field appearing in ForceSendFields will be sent to the 893 // server regardless of whether the field is empty or not. This may be 894 // used to include empty fields in Patch requests. 895 ForceSendFields []string `json:"-"` 896 897 // NullFields is a list of field names (e.g. "Latitude") to include in 898 // API requests with the JSON null value. By default, fields with empty 899 // values are omitted from API requests. However, any field with an 900 // empty value appearing in NullFields will be sent to the server as 901 // null. It is an error if a field in this list has a non-empty value. 902 // This may be used to include null fields in Patch requests. 903 NullFields []string `json:"-"` 904} 905 906func (s *BuildingCoordinates) MarshalJSON() ([]byte, error) { 907 type NoMethod BuildingCoordinates 908 raw := NoMethod(*s) 909 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 910} 911 912func (s *BuildingCoordinates) UnmarshalJSON(data []byte) error { 913 type NoMethod BuildingCoordinates 914 var s1 struct { 915 Latitude gensupport.JSONFloat64 `json:"latitude"` 916 Longitude gensupport.JSONFloat64 `json:"longitude"` 917 *NoMethod 918 } 919 s1.NoMethod = (*NoMethod)(s) 920 if err := json.Unmarshal(data, &s1); err != nil { 921 return err 922 } 923 s.Latitude = float64(s1.Latitude) 924 s.Longitude = float64(s1.Longitude) 925 return nil 926} 927 928// Buildings: Public API: Resources.buildings 929type Buildings struct { 930 // Buildings: The Buildings in this page of results. 931 Buildings []*Building `json:"buildings,omitempty"` 932 933 // Etag: ETag of the resource. 934 Etag string `json:"etag,omitempty"` 935 936 // Kind: Kind of resource this is. 937 Kind string `json:"kind,omitempty"` 938 939 // NextPageToken: The continuation token, used to page through large 940 // result sets. Provide this value in a subsequent request to return the 941 // next page of results. 942 NextPageToken string `json:"nextPageToken,omitempty"` 943 944 // ServerResponse contains the HTTP response code and headers from the 945 // server. 946 googleapi.ServerResponse `json:"-"` 947 948 // ForceSendFields is a list of field names (e.g. "Buildings") to 949 // unconditionally include in API requests. By default, fields with 950 // empty values are omitted from API requests. However, any non-pointer, 951 // non-interface field appearing in ForceSendFields will be sent to the 952 // server regardless of whether the field is empty or not. This may be 953 // used to include empty fields in Patch requests. 954 ForceSendFields []string `json:"-"` 955 956 // NullFields is a list of field names (e.g. "Buildings") to include in 957 // API requests with the JSON null value. By default, fields with empty 958 // values are omitted from API requests. However, any field with an 959 // empty value appearing in NullFields will be sent to the server as 960 // null. It is an error if a field in this list has a non-empty value. 961 // This may be used to include null fields in Patch requests. 962 NullFields []string `json:"-"` 963} 964 965func (s *Buildings) MarshalJSON() ([]byte, error) { 966 type NoMethod Buildings 967 raw := NoMethod(*s) 968 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 969} 970 971// CalendarResource: Public API: Resources.calendars 972type CalendarResource struct { 973 // BuildingId: Unique ID for the building a resource is located in. 974 BuildingId string `json:"buildingId,omitempty"` 975 976 // Capacity: Capacity of a resource, number of seats in a room. 977 Capacity int64 `json:"capacity,omitempty"` 978 979 // Etags: ETag of the resource. 980 Etags string `json:"etags,omitempty"` 981 982 // FeatureInstances: Instances of features for the calendar resource. 983 FeatureInstances interface{} `json:"featureInstances,omitempty"` 984 985 // FloorName: Name of the floor a resource is located on. 986 FloorName string `json:"floorName,omitempty"` 987 988 // FloorSection: Name of the section within a floor a resource is 989 // located in. 990 FloorSection string `json:"floorSection,omitempty"` 991 992 // GeneratedResourceName: The read-only auto-generated name of the 993 // calendar resource which includes metadata about the resource such as 994 // building name, floor, capacity, etc. For example, "NYC-2-Training 995 // Room 1A (16)". 996 GeneratedResourceName string `json:"generatedResourceName,omitempty"` 997 998 // Kind: The type of the resource. For calendar resources, the value is 999 // `admin#directory#resources#calendars#CalendarResource`. 1000 Kind string `json:"kind,omitempty"` 1001 1002 // ResourceCategory: The category of the calendar resource. Either 1003 // CONFERENCE_ROOM or OTHER. Legacy data is set to CATEGORY_UNKNOWN. 1004 ResourceCategory string `json:"resourceCategory,omitempty"` 1005 1006 // ResourceDescription: Description of the resource, visible only to 1007 // admins. 1008 ResourceDescription string `json:"resourceDescription,omitempty"` 1009 1010 // ResourceEmail: The read-only email for the calendar resource. 1011 // Generated as part of creating a new calendar resource. 1012 ResourceEmail string `json:"resourceEmail,omitempty"` 1013 1014 // ResourceId: The unique ID for the calendar resource. 1015 ResourceId string `json:"resourceId,omitempty"` 1016 1017 // ResourceName: The name of the calendar resource. For example, 1018 // "Training Room 1A". 1019 ResourceName string `json:"resourceName,omitempty"` 1020 1021 // ResourceType: The type of the calendar resource, intended for 1022 // non-room resources. 1023 ResourceType string `json:"resourceType,omitempty"` 1024 1025 // UserVisibleDescription: Description of the resource, visible to users 1026 // and admins. 1027 UserVisibleDescription string `json:"userVisibleDescription,omitempty"` 1028 1029 // ServerResponse contains the HTTP response code and headers from the 1030 // server. 1031 googleapi.ServerResponse `json:"-"` 1032 1033 // ForceSendFields is a list of field names (e.g. "BuildingId") to 1034 // unconditionally include in API requests. By default, fields with 1035 // empty values are omitted from API requests. However, any non-pointer, 1036 // non-interface field appearing in ForceSendFields will be sent to the 1037 // server regardless of whether the field is empty or not. This may be 1038 // used to include empty fields in Patch requests. 1039 ForceSendFields []string `json:"-"` 1040 1041 // NullFields is a list of field names (e.g. "BuildingId") to include in 1042 // API requests with the JSON null value. By default, fields with empty 1043 // values are omitted from API requests. However, any field with an 1044 // empty value appearing in NullFields will be sent to the server as 1045 // null. It is an error if a field in this list has a non-empty value. 1046 // This may be used to include null fields in Patch requests. 1047 NullFields []string `json:"-"` 1048} 1049 1050func (s *CalendarResource) MarshalJSON() ([]byte, error) { 1051 type NoMethod CalendarResource 1052 raw := NoMethod(*s) 1053 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1054} 1055 1056// CalendarResources: Public API: Resources.calendars 1057type CalendarResources struct { 1058 // Etag: ETag of the resource. 1059 Etag string `json:"etag,omitempty"` 1060 1061 // Items: The CalendarResources in this page of results. 1062 Items []*CalendarResource `json:"items,omitempty"` 1063 1064 // Kind: Identifies this as a collection of CalendarResources. This is 1065 // always `admin#directory#resources#calendars#calendarResourcesList`. 1066 Kind string `json:"kind,omitempty"` 1067 1068 // NextPageToken: The continuation token, used to page through large 1069 // result sets. Provide this value in a subsequent request to return the 1070 // next page of results. 1071 NextPageToken string `json:"nextPageToken,omitempty"` 1072 1073 // ServerResponse contains the HTTP response code and headers from the 1074 // server. 1075 googleapi.ServerResponse `json:"-"` 1076 1077 // ForceSendFields is a list of field names (e.g. "Etag") to 1078 // unconditionally include in API requests. By default, fields with 1079 // empty values are omitted from API requests. However, any non-pointer, 1080 // non-interface field appearing in ForceSendFields will be sent to the 1081 // server regardless of whether the field is empty or not. This may be 1082 // used to include empty fields in Patch requests. 1083 ForceSendFields []string `json:"-"` 1084 1085 // NullFields is a list of field names (e.g. "Etag") to include in API 1086 // requests with the JSON null value. By default, fields with empty 1087 // values are omitted from API requests. However, any field with an 1088 // empty value appearing in NullFields will be sent to the server as 1089 // null. It is an error if a field in this list has a non-empty value. 1090 // This may be used to include null fields in Patch requests. 1091 NullFields []string `json:"-"` 1092} 1093 1094func (s *CalendarResources) MarshalJSON() ([]byte, error) { 1095 type NoMethod CalendarResources 1096 raw := NoMethod(*s) 1097 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1098} 1099 1100// Channel: An notification channel used to watch for resource changes. 1101type Channel struct { 1102 // Address: The address where notifications are delivered for this 1103 // channel. 1104 Address string `json:"address,omitempty"` 1105 1106 // Expiration: Date and time of notification channel expiration, 1107 // expressed as a Unix timestamp, in milliseconds. Optional. 1108 Expiration int64 `json:"expiration,omitempty,string"` 1109 1110 // Id: A UUID or similar unique string that identifies this channel. 1111 Id string `json:"id,omitempty"` 1112 1113 // Kind: Identifies this as a notification channel used to watch for 1114 // changes to a resource, which is `api#channel`. 1115 Kind string `json:"kind,omitempty"` 1116 1117 // Params: Additional parameters controlling delivery channel behavior. 1118 // Optional. 1119 Params map[string]string `json:"params,omitempty"` 1120 1121 // Payload: A Boolean value to indicate whether payload is wanted. 1122 // Optional. 1123 Payload bool `json:"payload,omitempty"` 1124 1125 // ResourceId: An opaque ID that identifies the resource being watched 1126 // on this channel. Stable across different API versions. 1127 ResourceId string `json:"resourceId,omitempty"` 1128 1129 // ResourceUri: A version-specific identifier for the watched resource. 1130 ResourceUri string `json:"resourceUri,omitempty"` 1131 1132 // Token: An arbitrary string delivered to the target address with each 1133 // notification delivered over this channel. Optional. 1134 Token string `json:"token,omitempty"` 1135 1136 // Type: The type of delivery mechanism used for this channel. 1137 Type string `json:"type,omitempty"` 1138 1139 // ServerResponse contains the HTTP response code and headers from the 1140 // server. 1141 googleapi.ServerResponse `json:"-"` 1142 1143 // ForceSendFields is a list of field names (e.g. "Address") to 1144 // unconditionally include in API requests. By default, fields with 1145 // empty values are omitted from API requests. However, any non-pointer, 1146 // non-interface field appearing in ForceSendFields will be sent to the 1147 // server regardless of whether the field is empty or not. This may be 1148 // used to include empty fields in Patch requests. 1149 ForceSendFields []string `json:"-"` 1150 1151 // NullFields is a list of field names (e.g. "Address") to include in 1152 // API requests with the JSON null value. By default, fields with empty 1153 // values are omitted from API requests. However, any field with an 1154 // empty value appearing in NullFields will be sent to the server as 1155 // null. It is an error if a field in this list has a non-empty value. 1156 // This may be used to include null fields in Patch requests. 1157 NullFields []string `json:"-"` 1158} 1159 1160func (s *Channel) MarshalJSON() ([]byte, error) { 1161 type NoMethod Channel 1162 raw := NoMethod(*s) 1163 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1164} 1165 1166// ChromeOsDevice: Google Chrome devices run on the [Chrome 1167// OS](http://support.google.com/chromeos). For more information about 1168// common API tasks, see the [Developer's 1169// Guide](/admin-sdk/directory/v1/guides/manage-chrome-devices). 1170type ChromeOsDevice struct { 1171 // ActiveTimeRanges: List of active time ranges (Read-only). 1172 ActiveTimeRanges []*ChromeOsDeviceActiveTimeRanges `json:"activeTimeRanges,omitempty"` 1173 1174 // AnnotatedAssetId: The asset identifier as noted by an administrator 1175 // or specified during enrollment. 1176 AnnotatedAssetId string `json:"annotatedAssetId,omitempty"` 1177 1178 // AnnotatedLocation: The address or location of the device as noted by 1179 // the administrator. Maximum length is `200` characters. Empty values 1180 // are allowed. 1181 AnnotatedLocation string `json:"annotatedLocation,omitempty"` 1182 1183 // AnnotatedUser: The user of the device as noted by the administrator. 1184 // Maximum length is 100 characters. Empty values are allowed. 1185 AnnotatedUser string `json:"annotatedUser,omitempty"` 1186 1187 // AutoUpdateExpiration: (Read-only) The timestamp after which the 1188 // device will stop receiving Chrome updates or support 1189 AutoUpdateExpiration int64 `json:"autoUpdateExpiration,omitempty,string"` 1190 1191 // BootMode: The boot mode for the device. The possible values are: * 1192 // `Verified`: The device is running a valid version of the Chrome OS. * 1193 // `Dev`: The devices's developer hardware switch is enabled. When 1194 // booted, the device has a command line shell. For an example of a 1195 // developer switch, see the [Chromebook developer 1196 // information](http://www.chromium.org/chromium-os/developer-information 1197 // -for-chrome-os-devices/samsung-series-5-chromebook#TOC-Developer-switc 1198 // h). 1199 BootMode string `json:"bootMode,omitempty"` 1200 1201 // CpuStatusReports: Reports of CPU utilization and temperature 1202 // (Read-only) 1203 CpuStatusReports []*ChromeOsDeviceCpuStatusReports `json:"cpuStatusReports,omitempty"` 1204 1205 // DeviceFiles: List of device files to download (Read-only) 1206 DeviceFiles []*ChromeOsDeviceDeviceFiles `json:"deviceFiles,omitempty"` 1207 1208 // DeviceId: The unique ID of the Chrome device. 1209 DeviceId string `json:"deviceId,omitempty"` 1210 1211 // DiskVolumeReports: Reports of disk space and other info about 1212 // mounted/connected volumes. 1213 DiskVolumeReports []*ChromeOsDeviceDiskVolumeReports `json:"diskVolumeReports,omitempty"` 1214 1215 // DockMacAddress: (Read-only) Built-in MAC address for the docking 1216 // station that the device connected to. Factory sets Media access 1217 // control address (MAC address) assigned for use by a dock. It is 1218 // reserved specifically for MAC pass through device policy. The format 1219 // is twelve (12) hexadecimal digits without any delimiter (uppercase 1220 // letters). This is only relevant for some devices. 1221 DockMacAddress string `json:"dockMacAddress,omitempty"` 1222 1223 // Etag: ETag of the resource. 1224 Etag string `json:"etag,omitempty"` 1225 1226 // EthernetMacAddress: The device's MAC address on the ethernet network 1227 // interface. 1228 EthernetMacAddress string `json:"ethernetMacAddress,omitempty"` 1229 1230 // EthernetMacAddress0: (Read-only) MAC address used by the 1231 // Chromebook’s internal ethernet port, and for onboard network 1232 // (ethernet) interface. The format is twelve (12) hexadecimal digits 1233 // without any delimiter (uppercase letters). This is only relevant for 1234 // some devices. 1235 EthernetMacAddress0 string `json:"ethernetMacAddress0,omitempty"` 1236 1237 // FirmwareVersion: The Chrome device's firmware version. 1238 FirmwareVersion string `json:"firmwareVersion,omitempty"` 1239 1240 // Kind: The type of resource. For the Chromeosdevices resource, the 1241 // value is `admin#directory#chromeosdevice`. 1242 Kind string `json:"kind,omitempty"` 1243 1244 // LastEnrollmentTime: Date and time the device was last enrolled 1245 // (Read-only) 1246 LastEnrollmentTime string `json:"lastEnrollmentTime,omitempty"` 1247 1248 // LastKnownNetwork: Contains last known network (Read-only) 1249 LastKnownNetwork []*ChromeOsDeviceLastKnownNetwork `json:"lastKnownNetwork,omitempty"` 1250 1251 // LastSync: Date and time the device was last synchronized with the 1252 // policy settings in the G Suite administrator control panel 1253 // (Read-only) 1254 LastSync string `json:"lastSync,omitempty"` 1255 1256 // MacAddress: The device's wireless MAC address. If the device does not 1257 // have this information, it is not included in the response. 1258 MacAddress string `json:"macAddress,omitempty"` 1259 1260 // ManufactureDate: (Read-only) The date the device was manufactured in 1261 // yyyy-mm-dd format. 1262 ManufactureDate string `json:"manufactureDate,omitempty"` 1263 1264 // Meid: The Mobile Equipment Identifier (MEID) or the International 1265 // Mobile Equipment Identity (IMEI) for the 3G mobile card in a mobile 1266 // device. A MEID/IMEI is typically used when adding a device to a 1267 // wireless carrier's post-pay service plan. If the device does not have 1268 // this information, this property is not included in the response. For 1269 // more information on how to export a MEID/IMEI list, see the 1270 // [Developer's 1271 // Guide](/admin-sdk/directory/v1/guides/manage-chrome-devices.html#expor 1272 // t_meid). 1273 Meid string `json:"meid,omitempty"` 1274 1275 // Model: The device's model information. If the device does not have 1276 // this information, this property is not included in the response. 1277 Model string `json:"model,omitempty"` 1278 1279 // Notes: Notes about this device added by the administrator. This 1280 // property can be 1281 // [searched](http://support.google.com/chromeos/a/bin/answer.py?answer=1 1282 // 698333) with the 1283 // [list](/admin-sdk/directory/v1/reference/chromeosdevices/list) 1284 // method's `query` parameter. Maximum length is 500 characters. Empty 1285 // values are allowed. 1286 Notes string `json:"notes,omitempty"` 1287 1288 // OrderNumber: The device's order number. Only devices directly 1289 // purchased from Google have an order number. 1290 OrderNumber string `json:"orderNumber,omitempty"` 1291 1292 // OrgUnitPath: The full parent path with the organizational unit's name 1293 // associated with the device. Path names are case insensitive. If the 1294 // parent organizational unit is the top-level organization, it is 1295 // represented as a forward slash, `/`. This property can be 1296 // [updated](/admin-sdk/directory/v1/guides/manage-chrome-devices#update_ 1297 // chrome_device) using the API. For more information about how to 1298 // create an organizational structure for your device, see the 1299 // [administration help 1300 // center](http://support.google.com/a/bin/answer.py?answer=182433). 1301 OrgUnitPath string `json:"orgUnitPath,omitempty"` 1302 1303 // OsVersion: The Chrome device's operating system version. 1304 OsVersion string `json:"osVersion,omitempty"` 1305 1306 // PlatformVersion: The Chrome device's platform version. 1307 PlatformVersion string `json:"platformVersion,omitempty"` 1308 1309 // RecentUsers: List of recent device users, in descending order, by 1310 // last login time. 1311 RecentUsers []*RecentUsers `json:"recentUsers,omitempty"` 1312 1313 // SerialNumber: The Chrome device serial number entered when the device 1314 // was enabled. This value is the same as the Admin console's *Serial 1315 // Number* in the *Chrome OS Devices* tab. 1316 SerialNumber string `json:"serialNumber,omitempty"` 1317 1318 // Status: The status of the device. 1319 Status string `json:"status,omitempty"` 1320 1321 // SupportEndDate: Final date the device will be supported (Read-only) 1322 SupportEndDate string `json:"supportEndDate,omitempty"` 1323 1324 // SystemRamFreeReports: Reports of amounts of available RAM memory 1325 // (Read-only) 1326 SystemRamFreeReports []*ChromeOsDeviceSystemRamFreeReports `json:"systemRamFreeReports,omitempty"` 1327 1328 // SystemRamTotal: Total RAM on the device [in bytes] (Read-only) 1329 SystemRamTotal int64 `json:"systemRamTotal,omitempty,string"` 1330 1331 // TpmVersionInfo: Trusted Platform Module (TPM) (Read-only) 1332 TpmVersionInfo *ChromeOsDeviceTpmVersionInfo `json:"tpmVersionInfo,omitempty"` 1333 1334 // WillAutoRenew: Determines if the device will auto renew its support 1335 // after the support end date. This is a read-only property. 1336 WillAutoRenew bool `json:"willAutoRenew,omitempty"` 1337 1338 // ServerResponse contains the HTTP response code and headers from the 1339 // server. 1340 googleapi.ServerResponse `json:"-"` 1341 1342 // ForceSendFields is a list of field names (e.g. "ActiveTimeRanges") to 1343 // unconditionally include in API requests. By default, fields with 1344 // empty values are omitted from API requests. However, any non-pointer, 1345 // non-interface field appearing in ForceSendFields will be sent to the 1346 // server regardless of whether the field is empty or not. This may be 1347 // used to include empty fields in Patch requests. 1348 ForceSendFields []string `json:"-"` 1349 1350 // NullFields is a list of field names (e.g. "ActiveTimeRanges") to 1351 // include in API requests with the JSON null value. By default, fields 1352 // with empty values are omitted from API requests. However, any field 1353 // with an empty value appearing in NullFields will be sent to the 1354 // server as null. It is an error if a field in this list has a 1355 // non-empty value. This may be used to include null fields in Patch 1356 // requests. 1357 NullFields []string `json:"-"` 1358} 1359 1360func (s *ChromeOsDevice) MarshalJSON() ([]byte, error) { 1361 type NoMethod ChromeOsDevice 1362 raw := NoMethod(*s) 1363 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1364} 1365 1366type ChromeOsDeviceActiveTimeRanges struct { 1367 // ActiveTime: Duration of usage in milliseconds. 1368 ActiveTime int64 `json:"activeTime,omitempty"` 1369 1370 // Date: Date of usage 1371 Date string `json:"date,omitempty"` 1372 1373 // ForceSendFields is a list of field names (e.g. "ActiveTime") to 1374 // unconditionally include in API requests. By default, fields with 1375 // empty values are omitted from API requests. However, any non-pointer, 1376 // non-interface field appearing in ForceSendFields will be sent to the 1377 // server regardless of whether the field is empty or not. This may be 1378 // used to include empty fields in Patch requests. 1379 ForceSendFields []string `json:"-"` 1380 1381 // NullFields is a list of field names (e.g. "ActiveTime") to include in 1382 // API requests with the JSON null value. By default, fields with empty 1383 // values are omitted from API requests. However, any field with an 1384 // empty value appearing in NullFields will be sent to the server as 1385 // null. It is an error if a field in this list has a non-empty value. 1386 // This may be used to include null fields in Patch requests. 1387 NullFields []string `json:"-"` 1388} 1389 1390func (s *ChromeOsDeviceActiveTimeRanges) MarshalJSON() ([]byte, error) { 1391 type NoMethod ChromeOsDeviceActiveTimeRanges 1392 raw := NoMethod(*s) 1393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1394} 1395 1396type ChromeOsDeviceCpuStatusReports struct { 1397 // CpuTemperatureInfo: List of CPU temperature samples. 1398 CpuTemperatureInfo []*ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo `json:"cpuTemperatureInfo,omitempty"` 1399 1400 CpuUtilizationPercentageInfo []int64 `json:"cpuUtilizationPercentageInfo,omitempty"` 1401 1402 // ReportTime: Date and time the report was received. 1403 ReportTime string `json:"reportTime,omitempty"` 1404 1405 // ForceSendFields is a list of field names (e.g. "CpuTemperatureInfo") 1406 // to unconditionally include in API requests. By default, fields with 1407 // empty values are omitted from API requests. However, any non-pointer, 1408 // non-interface field appearing in ForceSendFields will be sent to the 1409 // server regardless of whether the field is empty or not. This may be 1410 // used to include empty fields in Patch requests. 1411 ForceSendFields []string `json:"-"` 1412 1413 // NullFields is a list of field names (e.g. "CpuTemperatureInfo") to 1414 // include in API requests with the JSON null value. By default, fields 1415 // with empty values are omitted from API requests. However, any field 1416 // with an empty value appearing in NullFields will be sent to the 1417 // server as null. It is an error if a field in this list has a 1418 // non-empty value. This may be used to include null fields in Patch 1419 // requests. 1420 NullFields []string `json:"-"` 1421} 1422 1423func (s *ChromeOsDeviceCpuStatusReports) MarshalJSON() ([]byte, error) { 1424 type NoMethod ChromeOsDeviceCpuStatusReports 1425 raw := NoMethod(*s) 1426 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1427} 1428 1429type ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo struct { 1430 // Label: CPU label 1431 Label string `json:"label,omitempty"` 1432 1433 // Temperature: Temperature in Celsius degrees. 1434 Temperature int64 `json:"temperature,omitempty"` 1435 1436 // ForceSendFields is a list of field names (e.g. "Label") to 1437 // unconditionally include in API requests. By default, fields with 1438 // empty values are omitted from API requests. However, any non-pointer, 1439 // non-interface field appearing in ForceSendFields will be sent to the 1440 // server regardless of whether the field is empty or not. This may be 1441 // used to include empty fields in Patch requests. 1442 ForceSendFields []string `json:"-"` 1443 1444 // NullFields is a list of field names (e.g. "Label") to include in API 1445 // requests with the JSON null value. By default, fields with empty 1446 // values are omitted from API requests. However, any field with an 1447 // empty value appearing in NullFields will be sent to the server as 1448 // null. It is an error if a field in this list has a non-empty value. 1449 // This may be used to include null fields in Patch requests. 1450 NullFields []string `json:"-"` 1451} 1452 1453func (s *ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo) MarshalJSON() ([]byte, error) { 1454 type NoMethod ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo 1455 raw := NoMethod(*s) 1456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1457} 1458 1459type ChromeOsDeviceDeviceFiles struct { 1460 // CreateTime: Date and time the file was created 1461 CreateTime string `json:"createTime,omitempty"` 1462 1463 // DownloadUrl: File download URL 1464 DownloadUrl string `json:"downloadUrl,omitempty"` 1465 1466 // Name: File name 1467 Name string `json:"name,omitempty"` 1468 1469 // Type: File type 1470 Type string `json:"type,omitempty"` 1471 1472 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1473 // unconditionally include in API requests. By default, fields with 1474 // empty values are omitted from API requests. However, any non-pointer, 1475 // non-interface field appearing in ForceSendFields will be sent to the 1476 // server regardless of whether the field is empty or not. This may be 1477 // used to include empty fields in Patch requests. 1478 ForceSendFields []string `json:"-"` 1479 1480 // NullFields is a list of field names (e.g. "CreateTime") to include in 1481 // API requests with the JSON null value. By default, fields with empty 1482 // values are omitted from API requests. However, any field with an 1483 // empty value appearing in NullFields will be sent to the server as 1484 // null. It is an error if a field in this list has a non-empty value. 1485 // This may be used to include null fields in Patch requests. 1486 NullFields []string `json:"-"` 1487} 1488 1489func (s *ChromeOsDeviceDeviceFiles) MarshalJSON() ([]byte, error) { 1490 type NoMethod ChromeOsDeviceDeviceFiles 1491 raw := NoMethod(*s) 1492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1493} 1494 1495type ChromeOsDeviceDiskVolumeReports struct { 1496 // VolumeInfo: Disk volumes 1497 VolumeInfo []*ChromeOsDeviceDiskVolumeReportsVolumeInfo `json:"volumeInfo,omitempty"` 1498 1499 // ForceSendFields is a list of field names (e.g. "VolumeInfo") to 1500 // unconditionally include in API requests. By default, fields with 1501 // empty values are omitted from API requests. However, any non-pointer, 1502 // non-interface field appearing in ForceSendFields will be sent to the 1503 // server regardless of whether the field is empty or not. This may be 1504 // used to include empty fields in Patch requests. 1505 ForceSendFields []string `json:"-"` 1506 1507 // NullFields is a list of field names (e.g. "VolumeInfo") to include in 1508 // API requests with the JSON null value. By default, fields with empty 1509 // values are omitted from API requests. However, any field with an 1510 // empty value appearing in NullFields will be sent to the server as 1511 // null. It is an error if a field in this list has a non-empty value. 1512 // This may be used to include null fields in Patch requests. 1513 NullFields []string `json:"-"` 1514} 1515 1516func (s *ChromeOsDeviceDiskVolumeReports) MarshalJSON() ([]byte, error) { 1517 type NoMethod ChromeOsDeviceDiskVolumeReports 1518 raw := NoMethod(*s) 1519 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1520} 1521 1522type ChromeOsDeviceDiskVolumeReportsVolumeInfo struct { 1523 // StorageFree: Free disk space [in bytes] 1524 StorageFree int64 `json:"storageFree,omitempty,string"` 1525 1526 // StorageTotal: Total disk space [in bytes] 1527 StorageTotal int64 `json:"storageTotal,omitempty,string"` 1528 1529 // VolumeId: Volume id 1530 VolumeId string `json:"volumeId,omitempty"` 1531 1532 // ForceSendFields is a list of field names (e.g. "StorageFree") to 1533 // unconditionally include in API requests. By default, fields with 1534 // empty values are omitted from API requests. However, any non-pointer, 1535 // non-interface field appearing in ForceSendFields will be sent to the 1536 // server regardless of whether the field is empty or not. This may be 1537 // used to include empty fields in Patch requests. 1538 ForceSendFields []string `json:"-"` 1539 1540 // NullFields is a list of field names (e.g. "StorageFree") to include 1541 // in API requests with the JSON null value. By default, fields with 1542 // empty values are omitted from API requests. However, any field with 1543 // an empty value appearing in NullFields will be sent to the server as 1544 // null. It is an error if a field in this list has a non-empty value. 1545 // This may be used to include null fields in Patch requests. 1546 NullFields []string `json:"-"` 1547} 1548 1549func (s *ChromeOsDeviceDiskVolumeReportsVolumeInfo) MarshalJSON() ([]byte, error) { 1550 type NoMethod ChromeOsDeviceDiskVolumeReportsVolumeInfo 1551 raw := NoMethod(*s) 1552 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1553} 1554 1555// ChromeOsDeviceLastKnownNetwork: Information for an ip address. 1556type ChromeOsDeviceLastKnownNetwork struct { 1557 // IpAddress: The IP address. 1558 IpAddress string `json:"ipAddress,omitempty"` 1559 1560 // WanIpAddress: The WAN IP address. 1561 WanIpAddress string `json:"wanIpAddress,omitempty"` 1562 1563 // ForceSendFields is a list of field names (e.g. "IpAddress") to 1564 // unconditionally include in API requests. By default, fields with 1565 // empty values are omitted from API requests. However, any non-pointer, 1566 // non-interface field appearing in ForceSendFields will be sent to the 1567 // server regardless of whether the field is empty or not. This may be 1568 // used to include empty fields in Patch requests. 1569 ForceSendFields []string `json:"-"` 1570 1571 // NullFields is a list of field names (e.g. "IpAddress") to include in 1572 // API requests with the JSON null value. By default, fields with empty 1573 // values are omitted from API requests. However, any field with an 1574 // empty value appearing in NullFields will be sent to the server as 1575 // null. It is an error if a field in this list has a non-empty value. 1576 // This may be used to include null fields in Patch requests. 1577 NullFields []string `json:"-"` 1578} 1579 1580func (s *ChromeOsDeviceLastKnownNetwork) MarshalJSON() ([]byte, error) { 1581 type NoMethod ChromeOsDeviceLastKnownNetwork 1582 raw := NoMethod(*s) 1583 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1584} 1585 1586type ChromeOsDeviceSystemRamFreeReports struct { 1587 // ReportTime: Date and time the report was received. 1588 ReportTime string `json:"reportTime,omitempty"` 1589 1590 SystemRamFreeInfo googleapi.Int64s `json:"systemRamFreeInfo,omitempty"` 1591 1592 // ForceSendFields is a list of field names (e.g. "ReportTime") to 1593 // unconditionally include in API requests. By default, fields with 1594 // empty values are omitted from API requests. However, any non-pointer, 1595 // non-interface field appearing in ForceSendFields will be sent to the 1596 // server regardless of whether the field is empty or not. This may be 1597 // used to include empty fields in Patch requests. 1598 ForceSendFields []string `json:"-"` 1599 1600 // NullFields is a list of field names (e.g. "ReportTime") to include in 1601 // API requests with the JSON null value. By default, fields with empty 1602 // values are omitted from API requests. However, any field with an 1603 // empty value appearing in NullFields will be sent to the server as 1604 // null. It is an error if a field in this list has a non-empty value. 1605 // This may be used to include null fields in Patch requests. 1606 NullFields []string `json:"-"` 1607} 1608 1609func (s *ChromeOsDeviceSystemRamFreeReports) MarshalJSON() ([]byte, error) { 1610 type NoMethod ChromeOsDeviceSystemRamFreeReports 1611 raw := NoMethod(*s) 1612 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1613} 1614 1615// ChromeOsDeviceTpmVersionInfo: Trusted Platform Module (TPM) 1616// (Read-only) 1617type ChromeOsDeviceTpmVersionInfo struct { 1618 // Family: TPM family. We use the TPM 2.0 style encoding, e.g.: TPM 1.2: 1619 // "1.2" -> 312e3200 TPM 2.0: "2.0" -> 322e3000 1620 Family string `json:"family,omitempty"` 1621 1622 // FirmwareVersion: TPM firmware version. 1623 FirmwareVersion string `json:"firmwareVersion,omitempty"` 1624 1625 // Manufacturer: TPM manufacturer code. 1626 Manufacturer string `json:"manufacturer,omitempty"` 1627 1628 // SpecLevel: TPM specification level. See Library Specification for TPM 1629 // 2.0 and Main Specification for TPM 1.2. 1630 SpecLevel string `json:"specLevel,omitempty"` 1631 1632 // TpmModel: TPM model number. 1633 TpmModel string `json:"tpmModel,omitempty"` 1634 1635 // VendorSpecific: Vendor-specific information such as Vendor ID. 1636 VendorSpecific string `json:"vendorSpecific,omitempty"` 1637 1638 // ForceSendFields is a list of field names (e.g. "Family") to 1639 // unconditionally include in API requests. By default, fields with 1640 // empty values are omitted from API requests. However, any non-pointer, 1641 // non-interface field appearing in ForceSendFields will be sent to the 1642 // server regardless of whether the field is empty or not. This may be 1643 // used to include empty fields in Patch requests. 1644 ForceSendFields []string `json:"-"` 1645 1646 // NullFields is a list of field names (e.g. "Family") to include in API 1647 // requests with the JSON null value. By default, fields with empty 1648 // values are omitted from API requests. However, any field with an 1649 // empty value appearing in NullFields will be sent to the server as 1650 // null. It is an error if a field in this list has a non-empty value. 1651 // This may be used to include null fields in Patch requests. 1652 NullFields []string `json:"-"` 1653} 1654 1655func (s *ChromeOsDeviceTpmVersionInfo) MarshalJSON() ([]byte, error) { 1656 type NoMethod ChromeOsDeviceTpmVersionInfo 1657 raw := NoMethod(*s) 1658 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1659} 1660 1661type ChromeOsDeviceAction struct { 1662 // Action: Action to be taken on the Chrome OS device. 1663 Action string `json:"action,omitempty"` 1664 1665 // DeprovisionReason: Only used when the action is `deprovision`. With 1666 // the `deprovision` action, this field is required. *Note*: The 1667 // deprovision reason is audited because it might have implications on 1668 // licenses for perpetual subscription customers. 1669 DeprovisionReason string `json:"deprovisionReason,omitempty"` 1670 1671 // ForceSendFields is a list of field names (e.g. "Action") to 1672 // unconditionally include in API requests. By default, fields with 1673 // empty values are omitted from API requests. However, any non-pointer, 1674 // non-interface field appearing in ForceSendFields will be sent to the 1675 // server regardless of whether the field is empty or not. This may be 1676 // used to include empty fields in Patch requests. 1677 ForceSendFields []string `json:"-"` 1678 1679 // NullFields is a list of field names (e.g. "Action") to include in API 1680 // requests with the JSON null value. By default, fields with empty 1681 // values are omitted from API requests. However, any field with an 1682 // empty value appearing in NullFields will be sent to the server as 1683 // null. It is an error if a field in this list has a non-empty value. 1684 // This may be used to include null fields in Patch requests. 1685 NullFields []string `json:"-"` 1686} 1687 1688func (s *ChromeOsDeviceAction) MarshalJSON() ([]byte, error) { 1689 type NoMethod ChromeOsDeviceAction 1690 raw := NoMethod(*s) 1691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1692} 1693 1694type ChromeOsDevices struct { 1695 // Chromeosdevices: List of Chrome OS Device objects. 1696 Chromeosdevices []*ChromeOsDevice `json:"chromeosdevices,omitempty"` 1697 1698 // Etag: ETag of the resource. 1699 Etag string `json:"etag,omitempty"` 1700 1701 // Kind: Kind of resource this is. 1702 Kind string `json:"kind,omitempty"` 1703 1704 // NextPageToken: Token used to access the next page of this result. To 1705 // access the next page, use this token's value in the `pageToken` query 1706 // string of this request. 1707 NextPageToken string `json:"nextPageToken,omitempty"` 1708 1709 // ServerResponse contains the HTTP response code and headers from the 1710 // server. 1711 googleapi.ServerResponse `json:"-"` 1712 1713 // ForceSendFields is a list of field names (e.g. "Chromeosdevices") to 1714 // unconditionally include in API requests. By default, fields with 1715 // empty values are omitted from API requests. However, any non-pointer, 1716 // non-interface field appearing in ForceSendFields will be sent to the 1717 // server regardless of whether the field is empty or not. This may be 1718 // used to include empty fields in Patch requests. 1719 ForceSendFields []string `json:"-"` 1720 1721 // NullFields is a list of field names (e.g. "Chromeosdevices") to 1722 // include in API requests with the JSON null value. By default, fields 1723 // with empty values are omitted from API requests. However, any field 1724 // with an empty value appearing in NullFields will be sent to the 1725 // server as null. It is an error if a field in this list has a 1726 // non-empty value. This may be used to include null fields in Patch 1727 // requests. 1728 NullFields []string `json:"-"` 1729} 1730 1731func (s *ChromeOsDevices) MarshalJSON() ([]byte, error) { 1732 type NoMethod ChromeOsDevices 1733 raw := NoMethod(*s) 1734 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1735} 1736 1737type ChromeOsMoveDevicesToOu struct { 1738 // DeviceIds: Chrome OS devices to be moved to OU 1739 DeviceIds []string `json:"deviceIds,omitempty"` 1740 1741 // ForceSendFields is a list of field names (e.g. "DeviceIds") to 1742 // unconditionally include in API requests. By default, fields with 1743 // empty values are omitted from API requests. However, any non-pointer, 1744 // non-interface field appearing in ForceSendFields will be sent to the 1745 // server regardless of whether the field is empty or not. This may be 1746 // used to include empty fields in Patch requests. 1747 ForceSendFields []string `json:"-"` 1748 1749 // NullFields is a list of field names (e.g. "DeviceIds") to include in 1750 // API requests with the JSON null value. By default, fields with empty 1751 // values are omitted from API requests. However, any field with an 1752 // empty value appearing in NullFields will be sent to the server as 1753 // null. It is an error if a field in this list has a non-empty value. 1754 // This may be used to include null fields in Patch requests. 1755 NullFields []string `json:"-"` 1756} 1757 1758func (s *ChromeOsMoveDevicesToOu) MarshalJSON() ([]byte, error) { 1759 type NoMethod ChromeOsMoveDevicesToOu 1760 raw := NoMethod(*s) 1761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1762} 1763 1764type Customer struct { 1765 // AlternateEmail: The customer's secondary contact email address. This 1766 // email address cannot be on the same domain as the `customerDomain` 1767 AlternateEmail string `json:"alternateEmail,omitempty"` 1768 1769 // CustomerCreationTime: The customer's creation time (Readonly) 1770 CustomerCreationTime string `json:"customerCreationTime,omitempty"` 1771 1772 // CustomerDomain: The customer's primary domain name string. Do not 1773 // include the `www` prefix when creating a new customer. 1774 CustomerDomain string `json:"customerDomain,omitempty"` 1775 1776 // Etag: ETag of the resource. 1777 Etag string `json:"etag,omitempty"` 1778 1779 // Id: The unique ID for the customer's G Suite account. (Readonly) 1780 Id string `json:"id,omitempty"` 1781 1782 // Kind: Identifies the resource as a customer. Value: 1783 // `admin#directory#customer` 1784 Kind string `json:"kind,omitempty"` 1785 1786 // Language: The customer's ISO 639-2 language code. See the [Language 1787 // Codes](/admin-sdk/directory/v1/languages) page for the list of 1788 // supported codes. Valid language codes outside the supported set will 1789 // be accepted by the API but may lead to unexpected behavior. The 1790 // default value is `en`. 1791 Language string `json:"language,omitempty"` 1792 1793 // PhoneNumber: The customer's contact phone number in 1794 // [E.164](http://en.wikipedia.org/wiki/E.164) format. 1795 PhoneNumber string `json:"phoneNumber,omitempty"` 1796 1797 // PostalAddress: The customer's postal address information. 1798 PostalAddress *CustomerPostalAddress `json:"postalAddress,omitempty"` 1799 1800 // ServerResponse contains the HTTP response code and headers from the 1801 // server. 1802 googleapi.ServerResponse `json:"-"` 1803 1804 // ForceSendFields is a list of field names (e.g. "AlternateEmail") to 1805 // unconditionally include in API requests. By default, fields with 1806 // empty values are omitted from API requests. However, any non-pointer, 1807 // non-interface field appearing in ForceSendFields will be sent to the 1808 // server regardless of whether the field is empty or not. This may be 1809 // used to include empty fields in Patch requests. 1810 ForceSendFields []string `json:"-"` 1811 1812 // NullFields is a list of field names (e.g. "AlternateEmail") to 1813 // include in API requests with the JSON null value. By default, fields 1814 // with empty values are omitted from API requests. However, any field 1815 // with an empty value appearing in NullFields will be sent to the 1816 // server as null. It is an error if a field in this list has a 1817 // non-empty value. This may be used to include null fields in Patch 1818 // requests. 1819 NullFields []string `json:"-"` 1820} 1821 1822func (s *Customer) MarshalJSON() ([]byte, error) { 1823 type NoMethod Customer 1824 raw := NoMethod(*s) 1825 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1826} 1827 1828type CustomerPostalAddress struct { 1829 // AddressLine1: A customer's physical address. The address can be 1830 // composed of one to three lines. 1831 AddressLine1 string `json:"addressLine1,omitempty"` 1832 1833 // AddressLine2: Address line 2 of the address. 1834 AddressLine2 string `json:"addressLine2,omitempty"` 1835 1836 // AddressLine3: Address line 3 of the address. 1837 AddressLine3 string `json:"addressLine3,omitempty"` 1838 1839 // ContactName: The customer contact's name. 1840 ContactName string `json:"contactName,omitempty"` 1841 1842 // CountryCode: This is a required property. For `countryCode` 1843 // information see the [ISO 3166 country code 1844 // elements](http://www.iso.org/iso/country_codes.htm). 1845 CountryCode string `json:"countryCode,omitempty"` 1846 1847 // Locality: Name of the locality. An example of a locality value is the 1848 // city of `San Francisco`. 1849 Locality string `json:"locality,omitempty"` 1850 1851 // OrganizationName: The company or company division name. 1852 OrganizationName string `json:"organizationName,omitempty"` 1853 1854 // PostalCode: The postal code. A postalCode example is a postal zip 1855 // code such as `10009`. This is in accordance with - http: 1856 // //portablecontacts.net/draft-spec.html#address_element. 1857 PostalCode string `json:"postalCode,omitempty"` 1858 1859 // Region: Name of the region. An example of a region value is `NY` for 1860 // the state of New York. 1861 Region string `json:"region,omitempty"` 1862 1863 // ForceSendFields is a list of field names (e.g. "AddressLine1") to 1864 // unconditionally include in API requests. By default, fields with 1865 // empty values are omitted from API requests. However, any non-pointer, 1866 // non-interface field appearing in ForceSendFields will be sent to the 1867 // server regardless of whether the field is empty or not. This may be 1868 // used to include empty fields in Patch requests. 1869 ForceSendFields []string `json:"-"` 1870 1871 // NullFields is a list of field names (e.g. "AddressLine1") to include 1872 // in API requests with the JSON null value. By default, fields with 1873 // empty values are omitted from API requests. However, any field with 1874 // an empty value appearing in NullFields will be sent to the server as 1875 // null. It is an error if a field in this list has a non-empty value. 1876 // This may be used to include null fields in Patch requests. 1877 NullFields []string `json:"-"` 1878} 1879 1880func (s *CustomerPostalAddress) MarshalJSON() ([]byte, error) { 1881 type NoMethod CustomerPostalAddress 1882 raw := NoMethod(*s) 1883 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1884} 1885 1886// DirectoryChromeosdevicesCommand: Information regarding a command that 1887// was issued to a device. 1888type DirectoryChromeosdevicesCommand struct { 1889 // CommandExpireTime: The time at which the command will expire. If the 1890 // device doesn't execute the command within this time the command will 1891 // become expired. 1892 CommandExpireTime string `json:"commandExpireTime,omitempty"` 1893 1894 // CommandId: Unique ID of a device command. 1895 CommandId int64 `json:"commandId,omitempty,string"` 1896 1897 // CommandResult: The result of the command execution. 1898 CommandResult *DirectoryChromeosdevicesCommandResult `json:"commandResult,omitempty"` 1899 1900 // IssueTime: The timestamp when the command was issued by the admin. 1901 IssueTime string `json:"issueTime,omitempty"` 1902 1903 // Payload: The payload that the command specified, if any. 1904 Payload string `json:"payload,omitempty"` 1905 1906 // State: Indicates the command state. 1907 // 1908 // Possible values: 1909 // "STATE_UNSPECIFIED" - The command status was unspecified. 1910 // "PENDING" - An unexpired command not yet sent to the client. 1911 // "EXPIRED" - The command didn't get executed by the client within 1912 // the expected time. 1913 // "CANCELLED" - The command is cancelled by admin while in PENDING. 1914 // "SENT_TO_CLIENT" - The command has been sent to the client. 1915 // "ACKED_BY_CLIENT" - The client has responded that it received the 1916 // command. 1917 // "EXECUTED_BY_CLIENT" - The client has (un)successfully executed the 1918 // command. 1919 State string `json:"state,omitempty"` 1920 1921 // Type: The type of the command. 1922 // 1923 // Possible values: 1924 // "COMMAND_TYPE_UNSPECIFIED" - The command type was unspecified. 1925 // "REBOOT" - Reboot the device. Can only be issued to Kiosk and 1926 // managed guest session devices. 1927 // "TAKE_A_SCREENSHOT" - Take a screenshot of the device. Only 1928 // available if the device is in Kiosk Mode. 1929 // "SET_VOLUME" - Set the volume of the device. Can only be issued to 1930 // Kiosk and managed guest session devices. 1931 // "WIPE_USERS" - Wipe all the users off of the device. Executing this 1932 // command in the device will remove all user profile data, but it will 1933 // keep device policy and enrollment. 1934 // "REMOTE_POWERWASH" - Wipes the device by performing a power wash. 1935 // Executing this command in the device will remove all data including 1936 // user policies, device policies and enrollment policies. Warning: This 1937 // will revert the device back to a factory state with no enrollment 1938 // unless the device is subject to forced or auto enrollment. Use with 1939 // caution, as this is an irreversible action! 1940 Type string `json:"type,omitempty"` 1941 1942 // ServerResponse contains the HTTP response code and headers from the 1943 // server. 1944 googleapi.ServerResponse `json:"-"` 1945 1946 // ForceSendFields is a list of field names (e.g. "CommandExpireTime") 1947 // to unconditionally include in API requests. By default, fields with 1948 // empty values are omitted from API requests. However, any non-pointer, 1949 // non-interface field appearing in ForceSendFields will be sent to the 1950 // server regardless of whether the field is empty or not. This may be 1951 // used to include empty fields in Patch requests. 1952 ForceSendFields []string `json:"-"` 1953 1954 // NullFields is a list of field names (e.g. "CommandExpireTime") to 1955 // include in API requests with the JSON null value. By default, fields 1956 // with empty values are omitted from API requests. However, any field 1957 // with an empty value appearing in NullFields will be sent to the 1958 // server as null. It is an error if a field in this list has a 1959 // non-empty value. This may be used to include null fields in Patch 1960 // requests. 1961 NullFields []string `json:"-"` 1962} 1963 1964func (s *DirectoryChromeosdevicesCommand) MarshalJSON() ([]byte, error) { 1965 type NoMethod DirectoryChromeosdevicesCommand 1966 raw := NoMethod(*s) 1967 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1968} 1969 1970// DirectoryChromeosdevicesCommandResult: The result of executing a 1971// command. 1972type DirectoryChromeosdevicesCommandResult struct { 1973 // ErrorMessage: The error message with a short explanation as to why 1974 // the command failed. Only present if the command failed. 1975 ErrorMessage string `json:"errorMessage,omitempty"` 1976 1977 // ExecuteTime: The time at which the command was executed or failed to 1978 // execute. 1979 ExecuteTime string `json:"executeTime,omitempty"` 1980 1981 // Result: The result of the command. 1982 // 1983 // Possible values: 1984 // "COMMAND_RESULT_TYPE_UNSPECIFIED" - The command result was 1985 // unspecified. 1986 // "IGNORED" - The command was ignored as obsolete. 1987 // "FAILURE" - The command could not be executed successfully. 1988 // "SUCCESS" - The command was successfully executed. 1989 Result string `json:"result,omitempty"` 1990 1991 // ForceSendFields is a list of field names (e.g. "ErrorMessage") to 1992 // unconditionally include in API requests. By default, fields with 1993 // empty values are omitted from API requests. However, any non-pointer, 1994 // non-interface field appearing in ForceSendFields will be sent to the 1995 // server regardless of whether the field is empty or not. This may be 1996 // used to include empty fields in Patch requests. 1997 ForceSendFields []string `json:"-"` 1998 1999 // NullFields is a list of field names (e.g. "ErrorMessage") to include 2000 // in API requests with the JSON null value. By default, fields with 2001 // empty values are omitted from API requests. However, any field with 2002 // an empty value appearing in NullFields will be sent to the server as 2003 // null. It is an error if a field in this list has a non-empty value. 2004 // This may be used to include null fields in Patch requests. 2005 NullFields []string `json:"-"` 2006} 2007 2008func (s *DirectoryChromeosdevicesCommandResult) MarshalJSON() ([]byte, error) { 2009 type NoMethod DirectoryChromeosdevicesCommandResult 2010 raw := NoMethod(*s) 2011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2012} 2013 2014// DirectoryChromeosdevicesIssueCommandRequest: A request for issuing a 2015// command. 2016type DirectoryChromeosdevicesIssueCommandRequest struct { 2017 // CommandType: The type of command. 2018 // 2019 // Possible values: 2020 // "COMMAND_TYPE_UNSPECIFIED" - The command type was unspecified. 2021 // "REBOOT" - Reboot the device. Can only be issued to Kiosk and 2022 // managed guest session devices. 2023 // "TAKE_A_SCREENSHOT" - Take a screenshot of the device. Only 2024 // available if the device is in Kiosk Mode. 2025 // "SET_VOLUME" - Set the volume of the device. Can only be issued to 2026 // Kiosk and managed guest session devices. 2027 // "WIPE_USERS" - Wipe all the users off of the device. Executing this 2028 // command in the device will remove all user profile data, but it will 2029 // keep device policy and enrollment. 2030 // "REMOTE_POWERWASH" - Wipes the device by performing a power wash. 2031 // Executing this command in the device will remove all data including 2032 // user policies, device policies and enrollment policies. Warning: This 2033 // will revert the device back to a factory state with no enrollment 2034 // unless the device is subject to forced or auto enrollment. Use with 2035 // caution, as this is an irreversible action! 2036 CommandType string `json:"commandType,omitempty"` 2037 2038 // Payload: The payload for the command, provide it only if command 2039 // supports it. The following commands support adding payload: - 2040 // SET_VOLUME: Payload is a stringified JSON object in the form: { 2041 // "volume": 50 }. The volume has to be an integer in the range [0,100]. 2042 Payload string `json:"payload,omitempty"` 2043 2044 // ForceSendFields is a list of field names (e.g. "CommandType") to 2045 // unconditionally include in API requests. By default, fields with 2046 // empty values are omitted from API requests. However, any non-pointer, 2047 // non-interface field appearing in ForceSendFields will be sent to the 2048 // server regardless of whether the field is empty or not. This may be 2049 // used to include empty fields in Patch requests. 2050 ForceSendFields []string `json:"-"` 2051 2052 // NullFields is a list of field names (e.g. "CommandType") to include 2053 // in API requests with the JSON null value. By default, fields with 2054 // empty values are omitted from API requests. However, any field with 2055 // an empty value appearing in NullFields will be sent to the server as 2056 // null. It is an error if a field in this list has a non-empty value. 2057 // This may be used to include null fields in Patch requests. 2058 NullFields []string `json:"-"` 2059} 2060 2061func (s *DirectoryChromeosdevicesIssueCommandRequest) MarshalJSON() ([]byte, error) { 2062 type NoMethod DirectoryChromeosdevicesIssueCommandRequest 2063 raw := NoMethod(*s) 2064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2065} 2066 2067// DirectoryChromeosdevicesIssueCommandResponse: A response for issuing 2068// a command. 2069type DirectoryChromeosdevicesIssueCommandResponse struct { 2070 // CommandId: The unique ID of the issued command, used to retrieve the 2071 // command status. 2072 CommandId int64 `json:"commandId,omitempty,string"` 2073 2074 // ServerResponse contains the HTTP response code and headers from the 2075 // server. 2076 googleapi.ServerResponse `json:"-"` 2077 2078 // ForceSendFields is a list of field names (e.g. "CommandId") to 2079 // unconditionally include in API requests. By default, fields with 2080 // empty values are omitted from API requests. However, any non-pointer, 2081 // non-interface field appearing in ForceSendFields will be sent to the 2082 // server regardless of whether the field is empty or not. This may be 2083 // used to include empty fields in Patch requests. 2084 ForceSendFields []string `json:"-"` 2085 2086 // NullFields is a list of field names (e.g. "CommandId") to include in 2087 // API requests with the JSON null value. By default, fields with empty 2088 // values are omitted from API requests. However, any field with an 2089 // empty value appearing in NullFields will be sent to the server as 2090 // null. It is an error if a field in this list has a non-empty value. 2091 // This may be used to include null fields in Patch requests. 2092 NullFields []string `json:"-"` 2093} 2094 2095func (s *DirectoryChromeosdevicesIssueCommandResponse) MarshalJSON() ([]byte, error) { 2096 type NoMethod DirectoryChromeosdevicesIssueCommandResponse 2097 raw := NoMethod(*s) 2098 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2099} 2100 2101type DomainAlias struct { 2102 // CreationTime: The creation time of the domain alias. (Read-only). 2103 CreationTime int64 `json:"creationTime,omitempty,string"` 2104 2105 // DomainAliasName: The domain alias name. 2106 DomainAliasName string `json:"domainAliasName,omitempty"` 2107 2108 // Etag: ETag of the resource. 2109 Etag string `json:"etag,omitempty"` 2110 2111 // Kind: Kind of resource this is. 2112 Kind string `json:"kind,omitempty"` 2113 2114 // ParentDomainName: The parent domain name that the domain alias is 2115 // associated with. This can either be a primary or secondary domain 2116 // name within a customer. 2117 ParentDomainName string `json:"parentDomainName,omitempty"` 2118 2119 // Verified: Indicates the verification state of a domain alias. 2120 // (Read-only) 2121 Verified bool `json:"verified,omitempty"` 2122 2123 // ServerResponse contains the HTTP response code and headers from the 2124 // server. 2125 googleapi.ServerResponse `json:"-"` 2126 2127 // ForceSendFields is a list of field names (e.g. "CreationTime") to 2128 // unconditionally include in API requests. By default, fields with 2129 // empty values are omitted from API requests. However, any non-pointer, 2130 // non-interface field appearing in ForceSendFields will be sent to the 2131 // server regardless of whether the field is empty or not. This may be 2132 // used to include empty fields in Patch requests. 2133 ForceSendFields []string `json:"-"` 2134 2135 // NullFields is a list of field names (e.g. "CreationTime") to include 2136 // in API requests with the JSON null value. By default, fields with 2137 // empty values are omitted from API requests. However, any field with 2138 // an empty value appearing in NullFields will be sent to the server as 2139 // null. It is an error if a field in this list has a non-empty value. 2140 // This may be used to include null fields in Patch requests. 2141 NullFields []string `json:"-"` 2142} 2143 2144func (s *DomainAlias) MarshalJSON() ([]byte, error) { 2145 type NoMethod DomainAlias 2146 raw := NoMethod(*s) 2147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2148} 2149 2150type DomainAliases struct { 2151 // DomainAliases: List of domain alias objects. 2152 DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` 2153 2154 // Etag: ETag of the resource. 2155 Etag string `json:"etag,omitempty"` 2156 2157 // Kind: Kind of resource this is. 2158 Kind string `json:"kind,omitempty"` 2159 2160 // ServerResponse contains the HTTP response code and headers from the 2161 // server. 2162 googleapi.ServerResponse `json:"-"` 2163 2164 // ForceSendFields is a list of field names (e.g. "DomainAliases") to 2165 // unconditionally include in API requests. By default, fields with 2166 // empty values are omitted from API requests. However, any non-pointer, 2167 // non-interface field appearing in ForceSendFields will be sent to the 2168 // server regardless of whether the field is empty or not. This may be 2169 // used to include empty fields in Patch requests. 2170 ForceSendFields []string `json:"-"` 2171 2172 // NullFields is a list of field names (e.g. "DomainAliases") to include 2173 // in API requests with the JSON null value. By default, fields with 2174 // empty values are omitted from API requests. However, any field with 2175 // an empty value appearing in NullFields will be sent to the server as 2176 // null. It is an error if a field in this list has a non-empty value. 2177 // This may be used to include null fields in Patch requests. 2178 NullFields []string `json:"-"` 2179} 2180 2181func (s *DomainAliases) MarshalJSON() ([]byte, error) { 2182 type NoMethod DomainAliases 2183 raw := NoMethod(*s) 2184 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2185} 2186 2187type Domains struct { 2188 // CreationTime: Creation time of the domain. Expressed in [Unix 2189 // time](http://en.wikipedia.org/wiki/Epoch_time) format. (Read-only). 2190 CreationTime int64 `json:"creationTime,omitempty,string"` 2191 2192 // DomainAliases: List of domain alias objects. (Read-only) 2193 DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` 2194 2195 // DomainName: The domain name of the customer. 2196 DomainName string `json:"domainName,omitempty"` 2197 2198 // Etag: ETag of the resource. 2199 Etag string `json:"etag,omitempty"` 2200 2201 // IsPrimary: Indicates if the domain is a primary domain (Read-only). 2202 IsPrimary bool `json:"isPrimary,omitempty"` 2203 2204 // Kind: Kind of resource this is. 2205 Kind string `json:"kind,omitempty"` 2206 2207 // Verified: Indicates the verification state of a domain. (Read-only). 2208 Verified bool `json:"verified,omitempty"` 2209 2210 // ServerResponse contains the HTTP response code and headers from the 2211 // server. 2212 googleapi.ServerResponse `json:"-"` 2213 2214 // ForceSendFields is a list of field names (e.g. "CreationTime") to 2215 // unconditionally include in API requests. By default, fields with 2216 // empty values are omitted from API requests. However, any non-pointer, 2217 // non-interface field appearing in ForceSendFields will be sent to the 2218 // server regardless of whether the field is empty or not. This may be 2219 // used to include empty fields in Patch requests. 2220 ForceSendFields []string `json:"-"` 2221 2222 // NullFields is a list of field names (e.g. "CreationTime") to include 2223 // in API requests with the JSON null value. By default, fields with 2224 // empty values are omitted from API requests. However, any field with 2225 // an empty value appearing in NullFields will be sent to the server as 2226 // null. It is an error if a field in this list has a non-empty value. 2227 // This may be used to include null fields in Patch requests. 2228 NullFields []string `json:"-"` 2229} 2230 2231func (s *Domains) MarshalJSON() ([]byte, error) { 2232 type NoMethod Domains 2233 raw := NoMethod(*s) 2234 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2235} 2236 2237type Domains2 struct { 2238 // Domains: List of domain objects. 2239 Domains []*Domains `json:"domains,omitempty"` 2240 2241 // Etag: ETag of the resource. 2242 Etag string `json:"etag,omitempty"` 2243 2244 // Kind: Kind of resource this is. 2245 Kind string `json:"kind,omitempty"` 2246 2247 // ServerResponse contains the HTTP response code and headers from the 2248 // server. 2249 googleapi.ServerResponse `json:"-"` 2250 2251 // ForceSendFields is a list of field names (e.g. "Domains") to 2252 // unconditionally include in API requests. By default, fields with 2253 // empty values are omitted from API requests. However, any non-pointer, 2254 // non-interface field appearing in ForceSendFields will be sent to the 2255 // server regardless of whether the field is empty or not. This may be 2256 // used to include empty fields in Patch requests. 2257 ForceSendFields []string `json:"-"` 2258 2259 // NullFields is a list of field names (e.g. "Domains") to include in 2260 // API requests with the JSON null value. By default, fields with empty 2261 // values are omitted from API requests. However, any field with an 2262 // empty value appearing in NullFields will be sent to the server as 2263 // null. It is an error if a field in this list has a non-empty value. 2264 // This may be used to include null fields in Patch requests. 2265 NullFields []string `json:"-"` 2266} 2267 2268func (s *Domains2) MarshalJSON() ([]byte, error) { 2269 type NoMethod Domains2 2270 raw := NoMethod(*s) 2271 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2272} 2273 2274// Feature: JSON template for Feature object in Directory API. 2275type Feature struct { 2276 // Etags: ETag of the resource. 2277 Etags string `json:"etags,omitempty"` 2278 2279 // Kind: Kind of resource this is. 2280 Kind string `json:"kind,omitempty"` 2281 2282 // Name: The name of the feature. 2283 Name string `json:"name,omitempty"` 2284 2285 // ServerResponse contains the HTTP response code and headers from the 2286 // server. 2287 googleapi.ServerResponse `json:"-"` 2288 2289 // ForceSendFields is a list of field names (e.g. "Etags") to 2290 // unconditionally include in API requests. By default, fields with 2291 // empty values are omitted from API requests. However, any non-pointer, 2292 // non-interface field appearing in ForceSendFields will be sent to the 2293 // server regardless of whether the field is empty or not. This may be 2294 // used to include empty fields in Patch requests. 2295 ForceSendFields []string `json:"-"` 2296 2297 // NullFields is a list of field names (e.g. "Etags") to include in API 2298 // requests with the JSON null value. By default, fields with empty 2299 // values are omitted from API requests. However, any field with an 2300 // empty value appearing in NullFields will be sent to the server as 2301 // null. It is an error if a field in this list has a non-empty value. 2302 // This may be used to include null fields in Patch requests. 2303 NullFields []string `json:"-"` 2304} 2305 2306func (s *Feature) MarshalJSON() ([]byte, error) { 2307 type NoMethod Feature 2308 raw := NoMethod(*s) 2309 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2310} 2311 2312// FeatureInstance: JSON template for a feature instance. 2313type FeatureInstance struct { 2314 // Feature: The feature that this is an instance of. A calendar resource 2315 // may have multiple instances of a feature. 2316 Feature *Feature `json:"feature,omitempty"` 2317 2318 // ForceSendFields is a list of field names (e.g. "Feature") to 2319 // unconditionally include in API requests. By default, fields with 2320 // empty values are omitted from API requests. However, any non-pointer, 2321 // non-interface field appearing in ForceSendFields will be sent to the 2322 // server regardless of whether the field is empty or not. This may be 2323 // used to include empty fields in Patch requests. 2324 ForceSendFields []string `json:"-"` 2325 2326 // NullFields is a list of field names (e.g. "Feature") to include in 2327 // API requests with the JSON null value. By default, fields with empty 2328 // values are omitted from API requests. However, any field with an 2329 // empty value appearing in NullFields will be sent to the server as 2330 // null. It is an error if a field in this list has a non-empty value. 2331 // This may be used to include null fields in Patch requests. 2332 NullFields []string `json:"-"` 2333} 2334 2335func (s *FeatureInstance) MarshalJSON() ([]byte, error) { 2336 type NoMethod FeatureInstance 2337 raw := NoMethod(*s) 2338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2339} 2340 2341type FeatureRename struct { 2342 // NewName: New name of the feature. 2343 NewName string `json:"newName,omitempty"` 2344 2345 // ForceSendFields is a list of field names (e.g. "NewName") to 2346 // unconditionally include in API requests. By default, fields with 2347 // empty values are omitted from API requests. However, any non-pointer, 2348 // non-interface field appearing in ForceSendFields will be sent to the 2349 // server regardless of whether the field is empty or not. This may be 2350 // used to include empty fields in Patch requests. 2351 ForceSendFields []string `json:"-"` 2352 2353 // NullFields is a list of field names (e.g. "NewName") to include in 2354 // API requests with the JSON null value. By default, fields with empty 2355 // values are omitted from API requests. However, any field with an 2356 // empty value appearing in NullFields will be sent to the server as 2357 // null. It is an error if a field in this list has a non-empty value. 2358 // This may be used to include null fields in Patch requests. 2359 NullFields []string `json:"-"` 2360} 2361 2362func (s *FeatureRename) MarshalJSON() ([]byte, error) { 2363 type NoMethod FeatureRename 2364 raw := NoMethod(*s) 2365 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2366} 2367 2368// Features: Public API: Resources.features 2369type Features struct { 2370 // Etag: ETag of the resource. 2371 Etag string `json:"etag,omitempty"` 2372 2373 // Features: The Features in this page of results. 2374 Features []*Feature `json:"features,omitempty"` 2375 2376 // Kind: Kind of resource this is. 2377 Kind string `json:"kind,omitempty"` 2378 2379 // NextPageToken: The continuation token, used to page through large 2380 // result sets. Provide this value in a subsequent request to return the 2381 // next page of results. 2382 NextPageToken string `json:"nextPageToken,omitempty"` 2383 2384 // ServerResponse contains the HTTP response code and headers from the 2385 // server. 2386 googleapi.ServerResponse `json:"-"` 2387 2388 // ForceSendFields is a list of field names (e.g. "Etag") to 2389 // unconditionally include in API requests. By default, fields with 2390 // empty values are omitted from API requests. However, any non-pointer, 2391 // non-interface field appearing in ForceSendFields will be sent to the 2392 // server regardless of whether the field is empty or not. This may be 2393 // used to include empty fields in Patch requests. 2394 ForceSendFields []string `json:"-"` 2395 2396 // NullFields is a list of field names (e.g. "Etag") to include in API 2397 // requests with the JSON null value. By default, fields with empty 2398 // values are omitted from API requests. However, any field with an 2399 // empty value appearing in NullFields will be sent to the server as 2400 // null. It is an error if a field in this list has a non-empty value. 2401 // This may be used to include null fields in Patch requests. 2402 NullFields []string `json:"-"` 2403} 2404 2405func (s *Features) MarshalJSON() ([]byte, error) { 2406 type NoMethod Features 2407 raw := NoMethod(*s) 2408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2409} 2410 2411// Group: Google Groups provide your users the ability to send messages 2412// to groups of people using the group's email address. For more 2413// information about common tasks, see the [Developer's 2414// Guide](/admin-sdk/directory/v1/guides/manage-groups). 2415type Group struct { 2416 // AdminCreated: Value is `true` if this group was created by an 2417 // administrator rather than a user. 2418 AdminCreated bool `json:"adminCreated,omitempty"` 2419 2420 // Aliases: List of a group's alias email addresses. 2421 Aliases []string `json:"aliases,omitempty"` 2422 2423 // Description: An extended description to help users determine the 2424 // purpose of a group. For example, you can include information about 2425 // who should join the group, the types of messages to send to the 2426 // group, links to FAQs about the group, or related groups. Maximum 2427 // length is `4,096` characters. 2428 Description string `json:"description,omitempty"` 2429 2430 // DirectMembersCount: The number of users that are direct members of 2431 // the group. If a group is a member (child) of this group (the parent), 2432 // members of the child group are not counted in the 2433 // `directMembersCount` property of the parent group. 2434 DirectMembersCount int64 `json:"directMembersCount,omitempty,string"` 2435 2436 // Email: The group's email address. If your account has multiple 2437 // domains, select the appropriate domain for the email address. The 2438 // `email` must be unique. This property is required when creating a 2439 // group. Group email addresses are subject to the same character usage 2440 // rules as usernames, see the [administration help 2441 // center](http://support.google.com/a/bin/answer.py?answer=33386) for 2442 // the details. 2443 Email string `json:"email,omitempty"` 2444 2445 // Etag: ETag of the resource. 2446 Etag string `json:"etag,omitempty"` 2447 2448 // Id: The unique ID of a group. A group `id` can be used as a group 2449 // request URI's `groupKey`. 2450 Id string `json:"id,omitempty"` 2451 2452 // Kind: The type of the API resource. For Groups resources, the value 2453 // is `admin#directory#group`. 2454 Kind string `json:"kind,omitempty"` 2455 2456 // Name: The group's display name. 2457 Name string `json:"name,omitempty"` 2458 2459 // NonEditableAliases: List of the group's non-editable alias email 2460 // addresses that are outside of the account's primary domain or 2461 // subdomains. These are functioning email addresses used by the group. 2462 // This is a read-only property returned in the API's response for a 2463 // group. If edited in a group's POST or PUT request, the edit is 2464 // ignored by the API service. 2465 NonEditableAliases []string `json:"nonEditableAliases,omitempty"` 2466 2467 // ServerResponse contains the HTTP response code and headers from the 2468 // server. 2469 googleapi.ServerResponse `json:"-"` 2470 2471 // ForceSendFields is a list of field names (e.g. "AdminCreated") to 2472 // unconditionally include in API requests. By default, fields with 2473 // empty values are omitted from API requests. However, any non-pointer, 2474 // non-interface field appearing in ForceSendFields will be sent to the 2475 // server regardless of whether the field is empty or not. This may be 2476 // used to include empty fields in Patch requests. 2477 ForceSendFields []string `json:"-"` 2478 2479 // NullFields is a list of field names (e.g. "AdminCreated") to include 2480 // in API requests with the JSON null value. By default, fields with 2481 // empty values are omitted from API requests. However, any field with 2482 // an empty value appearing in NullFields will be sent to the server as 2483 // null. It is an error if a field in this list has a non-empty value. 2484 // This may be used to include null fields in Patch requests. 2485 NullFields []string `json:"-"` 2486} 2487 2488func (s *Group) MarshalJSON() ([]byte, error) { 2489 type NoMethod Group 2490 raw := NoMethod(*s) 2491 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2492} 2493 2494type Groups struct { 2495 // Etag: ETag of the resource. 2496 Etag string `json:"etag,omitempty"` 2497 2498 // Groups: List of group objects. 2499 Groups []*Group `json:"groups,omitempty"` 2500 2501 // Kind: Kind of resource this is. 2502 Kind string `json:"kind,omitempty"` 2503 2504 // NextPageToken: Token used to access next page of this result. 2505 NextPageToken string `json:"nextPageToken,omitempty"` 2506 2507 // ServerResponse contains the HTTP response code and headers from the 2508 // server. 2509 googleapi.ServerResponse `json:"-"` 2510 2511 // ForceSendFields is a list of field names (e.g. "Etag") to 2512 // unconditionally include in API requests. By default, fields with 2513 // empty values are omitted from API requests. However, any non-pointer, 2514 // non-interface field appearing in ForceSendFields will be sent to the 2515 // server regardless of whether the field is empty or not. This may be 2516 // used to include empty fields in Patch requests. 2517 ForceSendFields []string `json:"-"` 2518 2519 // NullFields is a list of field names (e.g. "Etag") to include in API 2520 // requests with the JSON null value. By default, fields with empty 2521 // values are omitted from API requests. However, any field with an 2522 // empty value appearing in NullFields will be sent to the server as 2523 // null. It is an error if a field in this list has a non-empty value. 2524 // This may be used to include null fields in Patch requests. 2525 NullFields []string `json:"-"` 2526} 2527 2528func (s *Groups) MarshalJSON() ([]byte, error) { 2529 type NoMethod Groups 2530 raw := NoMethod(*s) 2531 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2532} 2533 2534// Member: A Google Groups member can be a user or another group. This 2535// member can be inside or outside of your account's domains. For more 2536// information about common group member tasks, see the [Developer's 2537// Guide](/admin-sdk/directory/v1/guides/manage-group-members). 2538type Member struct { 2539 // DeliverySettings: Defines mail delivery preferences of member. This 2540 // is only supported by create/update/get. 2541 DeliverySettings string `json:"delivery_settings,omitempty"` 2542 2543 // Email: The member's email address. A member can be a user or another 2544 // group. This property is required when adding a member to a group. The 2545 // `email` must be unique and cannot be an alias of another group. If 2546 // the email address is changed, the API automatically reflects the 2547 // email address changes. 2548 Email string `json:"email,omitempty"` 2549 2550 // Etag: ETag of the resource. 2551 Etag string `json:"etag,omitempty"` 2552 2553 // Id: The unique ID of the group member. A member `id` can be used as a 2554 // member request URI's `memberKey`. 2555 Id string `json:"id,omitempty"` 2556 2557 // Kind: The type of the API resource. For Members resources, the value 2558 // is `admin#directory#member`. 2559 Kind string `json:"kind,omitempty"` 2560 2561 // Role: The member's role in a group. The API returns an error for 2562 // cycles in group memberships. For example, if `group1` is a member of 2563 // `group2`, `group2` cannot be a member of `group1`. For more 2564 // information about a member's role, see the [administration help 2565 // center](http://support.google.com/a/bin/answer.py?answer=167094). 2566 Role string `json:"role,omitempty"` 2567 2568 // Status: Status of member (Immutable) 2569 Status string `json:"status,omitempty"` 2570 2571 // Type: The type of group member. 2572 Type string `json:"type,omitempty"` 2573 2574 // ServerResponse contains the HTTP response code and headers from the 2575 // server. 2576 googleapi.ServerResponse `json:"-"` 2577 2578 // ForceSendFields is a list of field names (e.g. "DeliverySettings") to 2579 // unconditionally include in API requests. By default, fields with 2580 // empty values are omitted from API requests. However, any non-pointer, 2581 // non-interface field appearing in ForceSendFields will be sent to the 2582 // server regardless of whether the field is empty or not. This may be 2583 // used to include empty fields in Patch requests. 2584 ForceSendFields []string `json:"-"` 2585 2586 // NullFields is a list of field names (e.g. "DeliverySettings") to 2587 // include in API requests with the JSON null value. By default, fields 2588 // with empty values are omitted from API requests. However, any field 2589 // with an empty value appearing in NullFields will be sent to the 2590 // server as null. It is an error if a field in this list has a 2591 // non-empty value. This may be used to include null fields in Patch 2592 // requests. 2593 NullFields []string `json:"-"` 2594} 2595 2596func (s *Member) MarshalJSON() ([]byte, error) { 2597 type NoMethod Member 2598 raw := NoMethod(*s) 2599 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2600} 2601 2602type Members struct { 2603 // Etag: ETag of the resource. 2604 Etag string `json:"etag,omitempty"` 2605 2606 // Kind: Kind of resource this is. 2607 Kind string `json:"kind,omitempty"` 2608 2609 // Members: List of member objects. 2610 Members []*Member `json:"members,omitempty"` 2611 2612 // NextPageToken: Token used to access next page of this result. 2613 NextPageToken string `json:"nextPageToken,omitempty"` 2614 2615 // ServerResponse contains the HTTP response code and headers from the 2616 // server. 2617 googleapi.ServerResponse `json:"-"` 2618 2619 // ForceSendFields is a list of field names (e.g. "Etag") to 2620 // unconditionally include in API requests. By default, fields with 2621 // empty values are omitted from API requests. However, any non-pointer, 2622 // non-interface field appearing in ForceSendFields will be sent to the 2623 // server regardless of whether the field is empty or not. This may be 2624 // used to include empty fields in Patch requests. 2625 ForceSendFields []string `json:"-"` 2626 2627 // NullFields is a list of field names (e.g. "Etag") to include in API 2628 // requests with the JSON null value. By default, fields with empty 2629 // values are omitted from API requests. However, any field with an 2630 // empty value appearing in NullFields will be sent to the server as 2631 // null. It is an error if a field in this list has a non-empty value. 2632 // This may be used to include null fields in Patch requests. 2633 NullFields []string `json:"-"` 2634} 2635 2636func (s *Members) MarshalJSON() ([]byte, error) { 2637 type NoMethod Members 2638 raw := NoMethod(*s) 2639 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2640} 2641 2642// MembersHasMember: JSON template for Has Member response in Directory 2643// API. 2644type MembersHasMember struct { 2645 // IsMember: Output only. Identifies whether the given user is a member 2646 // of the group. Membership can be direct or nested. 2647 IsMember bool `json:"isMember,omitempty"` 2648 2649 // ServerResponse contains the HTTP response code and headers from the 2650 // server. 2651 googleapi.ServerResponse `json:"-"` 2652 2653 // ForceSendFields is a list of field names (e.g. "IsMember") to 2654 // unconditionally include in API requests. By default, fields with 2655 // empty values are omitted from API requests. However, any non-pointer, 2656 // non-interface field appearing in ForceSendFields will be sent to the 2657 // server regardless of whether the field is empty or not. This may be 2658 // used to include empty fields in Patch requests. 2659 ForceSendFields []string `json:"-"` 2660 2661 // NullFields is a list of field names (e.g. "IsMember") to include in 2662 // API requests with the JSON null value. By default, fields with empty 2663 // values are omitted from API requests. However, any field with an 2664 // empty value appearing in NullFields will be sent to the server as 2665 // null. It is an error if a field in this list has a non-empty value. 2666 // This may be used to include null fields in Patch requests. 2667 NullFields []string `json:"-"` 2668} 2669 2670func (s *MembersHasMember) MarshalJSON() ([]byte, error) { 2671 type NoMethod MembersHasMember 2672 raw := NoMethod(*s) 2673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2674} 2675 2676// MobileDevice: G Suite Mobile Management includes Android, [Google 2677// Sync](http://support.google.com/a/bin/answer.py?answer=135937), and 2678// iOS devices. For more information about common group mobile device 2679// API tasks, see the [Developer's 2680// Guide](/admin-sdk/directory/v1/guides/manage-mobile-devices.html). 2681type MobileDevice struct { 2682 // AdbStatus: Adb (USB debugging) enabled or disabled on device 2683 // (Read-only) 2684 AdbStatus bool `json:"adbStatus,omitempty"` 2685 2686 // Applications: The list of applications installed on an Android mobile 2687 // device. It is not applicable to Google Sync and iOS devices. The list 2688 // includes any Android applications that access G Suite data. When 2689 // updating an applications list, it is important to note that updates 2690 // replace the existing list. If the Android device has two existing 2691 // applications and the API updates the list with five applications, the 2692 // is now the updated list of five applications. 2693 Applications []*MobileDeviceApplications `json:"applications,omitempty"` 2694 2695 // BasebandVersion: The device's baseband version. 2696 BasebandVersion string `json:"basebandVersion,omitempty"` 2697 2698 // BootloaderVersion: Mobile Device Bootloader version (Read-only) 2699 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 2700 2701 // Brand: Mobile Device Brand (Read-only) 2702 Brand string `json:"brand,omitempty"` 2703 2704 // BuildNumber: The device's operating system build number. 2705 BuildNumber string `json:"buildNumber,omitempty"` 2706 2707 // DefaultLanguage: The default locale used on the device. 2708 DefaultLanguage string `json:"defaultLanguage,omitempty"` 2709 2710 // DeveloperOptionsStatus: Developer options enabled or disabled on 2711 // device (Read-only) 2712 DeveloperOptionsStatus bool `json:"developerOptionsStatus,omitempty"` 2713 2714 // DeviceCompromisedStatus: The compromised device status. 2715 DeviceCompromisedStatus string `json:"deviceCompromisedStatus,omitempty"` 2716 2717 // DeviceId: The serial number for a Google Sync mobile device. For 2718 // Android and iOS devices, this is a software generated unique 2719 // identifier. 2720 DeviceId string `json:"deviceId,omitempty"` 2721 2722 // DevicePasswordStatus: DevicePasswordStatus (Read-only) 2723 DevicePasswordStatus string `json:"devicePasswordStatus,omitempty"` 2724 2725 // Email: List of owner's email addresses. If your application needs the 2726 // current list of user emails, use the 2727 // [get](/admin-sdk/directory/v1/reference/mobiledevices/get.html) 2728 // method. For additional information, see the [retrieve a 2729 // user](/admin-sdk/directory/v1/guides/manage-users#get_user) method. 2730 Email []string `json:"email,omitempty"` 2731 2732 // EncryptionStatus: Mobile Device Encryption Status (Read-only) 2733 EncryptionStatus string `json:"encryptionStatus,omitempty"` 2734 2735 // Etag: ETag of the resource. 2736 Etag string `json:"etag,omitempty"` 2737 2738 // FirstSync: Date and time the device was first synchronized with the 2739 // policy settings in the G Suite administrator control panel 2740 // (Read-only) 2741 FirstSync string `json:"firstSync,omitempty"` 2742 2743 // Hardware: Mobile Device Hardware (Read-only) 2744 Hardware string `json:"hardware,omitempty"` 2745 2746 // HardwareId: The IMEI/MEID unique identifier for Android hardware. It 2747 // is not applicable to Google Sync devices. When adding an Android 2748 // mobile device, this is an optional property. When updating one of 2749 // these devices, this is a read-only property. 2750 HardwareId string `json:"hardwareId,omitempty"` 2751 2752 // Imei: The device's IMEI number. 2753 Imei string `json:"imei,omitempty"` 2754 2755 // KernelVersion: The device's kernel version. 2756 KernelVersion string `json:"kernelVersion,omitempty"` 2757 2758 // Kind: The type of the API resource. For Mobiledevices resources, the 2759 // value is `admin#directory#mobiledevice`. 2760 Kind string `json:"kind,omitempty"` 2761 2762 // LastSync: Date and time the device was last synchronized with the 2763 // policy settings in the G Suite administrator control panel 2764 // (Read-only) 2765 LastSync string `json:"lastSync,omitempty"` 2766 2767 // ManagedAccountIsOnOwnerProfile: Boolean indicating if this account is 2768 // on owner/primary profile or not. 2769 ManagedAccountIsOnOwnerProfile bool `json:"managedAccountIsOnOwnerProfile,omitempty"` 2770 2771 // Manufacturer: Mobile Device manufacturer (Read-only) 2772 Manufacturer string `json:"manufacturer,omitempty"` 2773 2774 // Meid: The device's MEID number. 2775 Meid string `json:"meid,omitempty"` 2776 2777 // Model: The mobile device's model name, for example Nexus S. This 2778 // property can be 2779 // [updated](/admin-sdk/directory/v1/reference/mobiledevices/update.html) 2780 // . For more information, see the [Developer's 2781 // Guide](/admin-sdk/directory/v1/guides/manage-mobile=devices#update_mob 2782 // ile_device). 2783 Model string `json:"model,omitempty"` 2784 2785 // Name: List of the owner's user names. If your application needs the 2786 // current list of device owner names, use the 2787 // [get](/admin-sdk/directory/v1/reference/mobiledevices/get.html) 2788 // method. For more information about retrieving mobile device user 2789 // information, see the [Developer's 2790 // Guide](/admin-sdk/directory/v1/guides/manage-users#get_user). 2791 Name []string `json:"name,omitempty"` 2792 2793 // NetworkOperator: Mobile Device mobile or network operator (if 2794 // available) (Read-only) 2795 NetworkOperator string `json:"networkOperator,omitempty"` 2796 2797 // Os: The mobile device's operating system, for example IOS 4.3 or 2798 // Android 2.3.5. This property can be 2799 // [updated](/admin-sdk/directory/v1/reference/mobiledevices/update.html) 2800 // . For more information, see the [Developer's 2801 // Guide](/admin-sdk/directory/v1/guides/manage-mobile-devices#update_mob 2802 // ile_device). 2803 Os string `json:"os,omitempty"` 2804 2805 // OtherAccountsInfo: List of accounts added on device (Read-only) 2806 OtherAccountsInfo []string `json:"otherAccountsInfo,omitempty"` 2807 2808 // Privilege: DMAgentPermission (Read-only) 2809 Privilege string `json:"privilege,omitempty"` 2810 2811 // ReleaseVersion: Mobile Device release version version (Read-only) 2812 ReleaseVersion string `json:"releaseVersion,omitempty"` 2813 2814 // ResourceId: The unique ID the API service uses to identify the mobile 2815 // device. 2816 ResourceId string `json:"resourceId,omitempty"` 2817 2818 // SecurityPatchLevel: Mobile Device Security patch level (Read-only) 2819 SecurityPatchLevel int64 `json:"securityPatchLevel,omitempty,string"` 2820 2821 // SerialNumber: The device's serial number. 2822 SerialNumber string `json:"serialNumber,omitempty"` 2823 2824 // Status: The device's status. 2825 Status string `json:"status,omitempty"` 2826 2827 // SupportsWorkProfile: Work profile supported on device (Read-only) 2828 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 2829 2830 // Type: The type of mobile device. 2831 Type string `json:"type,omitempty"` 2832 2833 // UnknownSourcesStatus: Unknown sources enabled or disabled on device 2834 // (Read-only) 2835 UnknownSourcesStatus bool `json:"unknownSourcesStatus,omitempty"` 2836 2837 // UserAgent: Gives information about the device such as `os` version. 2838 // This property can be 2839 // [updated](/admin-sdk/directory/v1/reference/mobiledevices/update.html) 2840 // . For more information, see the [Developer's 2841 // Guide](/admin-sdk/directory/v1/guides/manage-mobile-devices#update_mob 2842 // ile_device). 2843 UserAgent string `json:"userAgent,omitempty"` 2844 2845 // WifiMacAddress: The device's MAC address on Wi-Fi networks. 2846 WifiMacAddress string `json:"wifiMacAddress,omitempty"` 2847 2848 // ServerResponse contains the HTTP response code and headers from the 2849 // server. 2850 googleapi.ServerResponse `json:"-"` 2851 2852 // ForceSendFields is a list of field names (e.g. "AdbStatus") to 2853 // unconditionally include in API requests. By default, fields with 2854 // empty values are omitted from API requests. However, any non-pointer, 2855 // non-interface field appearing in ForceSendFields will be sent to the 2856 // server regardless of whether the field is empty or not. This may be 2857 // used to include empty fields in Patch requests. 2858 ForceSendFields []string `json:"-"` 2859 2860 // NullFields is a list of field names (e.g. "AdbStatus") to include in 2861 // API requests with the JSON null value. By default, fields with empty 2862 // values are omitted from API requests. However, any field with an 2863 // empty value appearing in NullFields will be sent to the server as 2864 // null. It is an error if a field in this list has a non-empty value. 2865 // This may be used to include null fields in Patch requests. 2866 NullFields []string `json:"-"` 2867} 2868 2869func (s *MobileDevice) MarshalJSON() ([]byte, error) { 2870 type NoMethod MobileDevice 2871 raw := NoMethod(*s) 2872 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2873} 2874 2875type MobileDeviceApplications struct { 2876 // DisplayName: The application's display name. An example is `Browser`. 2877 DisplayName string `json:"displayName,omitempty"` 2878 2879 // PackageName: The application's package name. An example is 2880 // `com.android.browser`. 2881 PackageName string `json:"packageName,omitempty"` 2882 2883 // Permission: The list of permissions of this application. These can be 2884 // either a standard Android permission or one defined by the 2885 // application, and are found in an application's [Android 2886 // manifest](http://developer.android.com/guide/topics/manifest/uses-perm 2887 // ission-element.html). Examples of a Calendar application's 2888 // permissions are `READ_CALENDAR`, or `MANAGE_ACCOUNTS`. 2889 Permission []string `json:"permission,omitempty"` 2890 2891 // VersionCode: The application's version code. An example is `13`. 2892 VersionCode int64 `json:"versionCode,omitempty"` 2893 2894 // VersionName: The application's version name. An example is 2895 // `3.2-140714`. 2896 VersionName string `json:"versionName,omitempty"` 2897 2898 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2899 // unconditionally include in API requests. By default, fields with 2900 // empty values are omitted from API requests. However, any non-pointer, 2901 // non-interface field appearing in ForceSendFields will be sent to the 2902 // server regardless of whether the field is empty or not. This may be 2903 // used to include empty fields in Patch requests. 2904 ForceSendFields []string `json:"-"` 2905 2906 // NullFields is a list of field names (e.g. "DisplayName") to include 2907 // in API requests with the JSON null value. By default, fields with 2908 // empty values are omitted from API requests. However, any field with 2909 // an empty value appearing in NullFields will be sent to the server as 2910 // null. It is an error if a field in this list has a non-empty value. 2911 // This may be used to include null fields in Patch requests. 2912 NullFields []string `json:"-"` 2913} 2914 2915func (s *MobileDeviceApplications) MarshalJSON() ([]byte, error) { 2916 type NoMethod MobileDeviceApplications 2917 raw := NoMethod(*s) 2918 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2919} 2920 2921type MobileDeviceAction struct { 2922 // Action: The action to be performed on the device. 2923 Action string `json:"action,omitempty"` 2924 2925 // ForceSendFields is a list of field names (e.g. "Action") to 2926 // unconditionally include in API requests. By default, fields with 2927 // empty values are omitted from API requests. However, any non-pointer, 2928 // non-interface field appearing in ForceSendFields will be sent to the 2929 // server regardless of whether the field is empty or not. This may be 2930 // used to include empty fields in Patch requests. 2931 ForceSendFields []string `json:"-"` 2932 2933 // NullFields is a list of field names (e.g. "Action") to include in API 2934 // requests with the JSON null value. By default, fields with empty 2935 // values are omitted from API requests. However, any field with an 2936 // empty value appearing in NullFields will be sent to the server as 2937 // null. It is an error if a field in this list has a non-empty value. 2938 // This may be used to include null fields in Patch requests. 2939 NullFields []string `json:"-"` 2940} 2941 2942func (s *MobileDeviceAction) MarshalJSON() ([]byte, error) { 2943 type NoMethod MobileDeviceAction 2944 raw := NoMethod(*s) 2945 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2946} 2947 2948type MobileDevices struct { 2949 // Etag: ETag of the resource. 2950 Etag string `json:"etag,omitempty"` 2951 2952 // Kind: Kind of resource this is. 2953 Kind string `json:"kind,omitempty"` 2954 2955 // Mobiledevices: List of Mobile Device objects. 2956 Mobiledevices []*MobileDevice `json:"mobiledevices,omitempty"` 2957 2958 // NextPageToken: Token used to access next page of this result. 2959 NextPageToken string `json:"nextPageToken,omitempty"` 2960 2961 // ServerResponse contains the HTTP response code and headers from the 2962 // server. 2963 googleapi.ServerResponse `json:"-"` 2964 2965 // ForceSendFields is a list of field names (e.g. "Etag") to 2966 // unconditionally include in API requests. By default, fields with 2967 // empty values are omitted from API requests. However, any non-pointer, 2968 // non-interface field appearing in ForceSendFields will be sent to the 2969 // server regardless of whether the field is empty or not. This may be 2970 // used to include empty fields in Patch requests. 2971 ForceSendFields []string `json:"-"` 2972 2973 // NullFields is a list of field names (e.g. "Etag") to include in API 2974 // requests with the JSON null value. By default, fields with empty 2975 // values are omitted from API requests. However, any field with an 2976 // empty value appearing in NullFields will be sent to the server as 2977 // null. It is an error if a field in this list has a non-empty value. 2978 // This may be used to include null fields in Patch requests. 2979 NullFields []string `json:"-"` 2980} 2981 2982func (s *MobileDevices) MarshalJSON() ([]byte, error) { 2983 type NoMethod MobileDevices 2984 raw := NoMethod(*s) 2985 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2986} 2987 2988// OrgUnit: Managing your account's organizational units allows you to 2989// configure your users' access to services and custom settings. For 2990// more information about common organizational unit tasks, see the 2991// [Developer's 2992// Guide](/admin-sdk/directory/v1/guides/manage-org-units.html). 2993type OrgUnit struct { 2994 // BlockInheritance: Determines if a sub-organizational unit can inherit 2995 // the settings of the parent organization. The default value is 2996 // `false`, meaning a sub-organizational unit inherits the settings of 2997 // the nearest parent organizational unit. For more information on 2998 // inheritance and users in an organization structure, see the 2999 // [administration help 3000 // center](http://support.google.com/a/bin/answer.py?answer=182442&topic= 3001 // 1227584&ctx=topic). 3002 BlockInheritance bool `json:"blockInheritance,omitempty"` 3003 3004 // Description: Description of the organizational unit. 3005 Description string `json:"description,omitempty"` 3006 3007 // Etag: ETag of the resource. 3008 Etag string `json:"etag,omitempty"` 3009 3010 // Kind: The type of the API resource. For Orgunits resources, the value 3011 // is `admin#directory#orgUnit`. 3012 Kind string `json:"kind,omitempty"` 3013 3014 // Name: The organizational unit's path name. For example, an 3015 // organizational unit's name within the /corp/support/sales_support 3016 // parent path is sales_support. Required. 3017 Name string `json:"name,omitempty"` 3018 3019 // OrgUnitId: The unique ID of the organizational unit. 3020 OrgUnitId string `json:"orgUnitId,omitempty"` 3021 3022 // OrgUnitPath: The full path to the organizational unit. The 3023 // `orgUnitPath` is a derived property. When listed, it is derived from 3024 // `parentOrgunitPath` and organizational unit's `name`. For example, 3025 // for an organizational unit named 'apps' under parent organization 3026 // '/engineering', the orgUnitPath is '/engineering/apps'. In order to 3027 // edit an `orgUnitPath`, either update the name of the organization or 3028 // the `parentOrgunitPath`. A user's organizational unit determines 3029 // which G Suite services the user has access to. If the user is moved 3030 // to a new organization, the user's access changes. For more 3031 // information about organization structures, see the [administration 3032 // help 3033 // center](http://support.google.com/a/bin/answer.py?answer=182433&topic= 3034 // 1227584&ctx=topic). For more information about moving a user to a 3035 // different organization, see [Update a 3036 // user](/admin-sdk/directory/v1/guides/manage-users.html#update_user). 3037 OrgUnitPath string `json:"orgUnitPath,omitempty"` 3038 3039 // ParentOrgUnitId: The unique ID of the parent organizational unit. 3040 // Required, unless `parentOrgUnitPath` is set. 3041 ParentOrgUnitId string `json:"parentOrgUnitId,omitempty"` 3042 3043 // ParentOrgUnitPath: The organizational unit's parent path. For 3044 // example, /corp/sales is the parent path for /corp/sales/sales_support 3045 // organizational unit. Required, unless `parentOrgUnitId` is set. 3046 ParentOrgUnitPath string `json:"parentOrgUnitPath,omitempty"` 3047 3048 // ServerResponse contains the HTTP response code and headers from the 3049 // server. 3050 googleapi.ServerResponse `json:"-"` 3051 3052 // ForceSendFields is a list of field names (e.g. "BlockInheritance") to 3053 // unconditionally include in API requests. By default, fields with 3054 // empty values are omitted from API requests. However, any non-pointer, 3055 // non-interface field appearing in ForceSendFields will be sent to the 3056 // server regardless of whether the field is empty or not. This may be 3057 // used to include empty fields in Patch requests. 3058 ForceSendFields []string `json:"-"` 3059 3060 // NullFields is a list of field names (e.g. "BlockInheritance") to 3061 // include in API requests with the JSON null value. By default, fields 3062 // with empty values are omitted from API requests. However, any field 3063 // with an empty value appearing in NullFields will be sent to the 3064 // server as null. It is an error if a field in this list has a 3065 // non-empty value. This may be used to include null fields in Patch 3066 // requests. 3067 NullFields []string `json:"-"` 3068} 3069 3070func (s *OrgUnit) MarshalJSON() ([]byte, error) { 3071 type NoMethod OrgUnit 3072 raw := NoMethod(*s) 3073 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3074} 3075 3076type OrgUnits struct { 3077 // Etag: ETag of the resource. 3078 Etag string `json:"etag,omitempty"` 3079 3080 // Kind: The type of the API resource. For Org Unit resources, the type 3081 // is `admin#directory#orgUnits`. 3082 Kind string `json:"kind,omitempty"` 3083 3084 // OrganizationUnits: List of organizational unit objects. 3085 OrganizationUnits []*OrgUnit `json:"organizationUnits,omitempty"` 3086 3087 // ServerResponse contains the HTTP response code and headers from the 3088 // server. 3089 googleapi.ServerResponse `json:"-"` 3090 3091 // ForceSendFields is a list of field names (e.g. "Etag") to 3092 // unconditionally include in API requests. By default, fields with 3093 // empty values are omitted from API requests. However, any non-pointer, 3094 // non-interface field appearing in ForceSendFields will be sent to the 3095 // server regardless of whether the field is empty or not. This may be 3096 // used to include empty fields in Patch requests. 3097 ForceSendFields []string `json:"-"` 3098 3099 // NullFields is a list of field names (e.g. "Etag") to include in API 3100 // requests with the JSON null value. By default, fields with empty 3101 // values are omitted from API requests. However, any field with an 3102 // empty value appearing in NullFields will be sent to the server as 3103 // null. It is an error if a field in this list has a non-empty value. 3104 // This may be used to include null fields in Patch requests. 3105 NullFields []string `json:"-"` 3106} 3107 3108func (s *OrgUnits) MarshalJSON() ([]byte, error) { 3109 type NoMethod OrgUnits 3110 raw := NoMethod(*s) 3111 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3112} 3113 3114type Privilege struct { 3115 // ChildPrivileges: A list of child privileges. Privileges for a service 3116 // form a tree. Each privilege can have a list of child privileges; this 3117 // list is empty for a leaf privilege. 3118 ChildPrivileges []*Privilege `json:"childPrivileges,omitempty"` 3119 3120 // Etag: ETag of the resource. 3121 Etag string `json:"etag,omitempty"` 3122 3123 // IsOuScopable: If the privilege can be restricted to an organization 3124 // unit. 3125 IsOuScopable bool `json:"isOuScopable,omitempty"` 3126 3127 // Kind: The type of the API resource. This is always 3128 // `admin#directory#privilege`. 3129 Kind string `json:"kind,omitempty"` 3130 3131 // PrivilegeName: The name of the privilege. 3132 PrivilegeName string `json:"privilegeName,omitempty"` 3133 3134 // ServiceId: The obfuscated ID of the service this privilege is for. 3135 // This value is returned with 3136 // [`Privileges.list()`](/admin-sdk/directory/v1/reference/privileges/lis 3137 // t). 3138 ServiceId string `json:"serviceId,omitempty"` 3139 3140 // ServiceName: The name of the service this privilege is for. 3141 ServiceName string `json:"serviceName,omitempty"` 3142 3143 // ForceSendFields is a list of field names (e.g. "ChildPrivileges") to 3144 // unconditionally include in API requests. By default, fields with 3145 // empty values are omitted from API requests. However, any non-pointer, 3146 // non-interface field appearing in ForceSendFields will be sent to the 3147 // server regardless of whether the field is empty or not. This may be 3148 // used to include empty fields in Patch requests. 3149 ForceSendFields []string `json:"-"` 3150 3151 // NullFields is a list of field names (e.g. "ChildPrivileges") to 3152 // include in API requests with the JSON null value. By default, fields 3153 // with empty values are omitted from API requests. However, any field 3154 // with an empty value appearing in NullFields will be sent to the 3155 // server as null. It is an error if a field in this list has a 3156 // non-empty value. This may be used to include null fields in Patch 3157 // requests. 3158 NullFields []string `json:"-"` 3159} 3160 3161func (s *Privilege) MarshalJSON() ([]byte, error) { 3162 type NoMethod Privilege 3163 raw := NoMethod(*s) 3164 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3165} 3166 3167type Privileges struct { 3168 // Etag: ETag of the resource. 3169 Etag string `json:"etag,omitempty"` 3170 3171 // Items: A list of Privilege resources. 3172 Items []*Privilege `json:"items,omitempty"` 3173 3174 // Kind: The type of the API resource. This is always 3175 // `admin#directory#privileges`. 3176 Kind string `json:"kind,omitempty"` 3177 3178 // ServerResponse contains the HTTP response code and headers from the 3179 // server. 3180 googleapi.ServerResponse `json:"-"` 3181 3182 // ForceSendFields is a list of field names (e.g. "Etag") to 3183 // unconditionally include in API requests. By default, fields with 3184 // empty values are omitted from API requests. However, any non-pointer, 3185 // non-interface field appearing in ForceSendFields will be sent to the 3186 // server regardless of whether the field is empty or not. This may be 3187 // used to include empty fields in Patch requests. 3188 ForceSendFields []string `json:"-"` 3189 3190 // NullFields is a list of field names (e.g. "Etag") to include in API 3191 // requests with the JSON null value. By default, fields with empty 3192 // values are omitted from API requests. However, any field with an 3193 // empty value appearing in NullFields will be sent to the server as 3194 // null. It is an error if a field in this list has a non-empty value. 3195 // This may be used to include null fields in Patch requests. 3196 NullFields []string `json:"-"` 3197} 3198 3199func (s *Privileges) MarshalJSON() ([]byte, error) { 3200 type NoMethod Privileges 3201 raw := NoMethod(*s) 3202 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3203} 3204 3205// RecentUsers: List of recent device users, in descending order, by 3206// last login time. 3207type RecentUsers struct { 3208 // Email: The user's email address. This is only present if the user 3209 // type is `USER_TYPE_MANAGED`. 3210 Email string `json:"email,omitempty"` 3211 3212 // Type: The type of the user. 3213 Type string `json:"type,omitempty"` 3214 3215 // ForceSendFields is a list of field names (e.g. "Email") to 3216 // unconditionally include in API requests. By default, fields with 3217 // empty values are omitted from API requests. However, any non-pointer, 3218 // non-interface field appearing in ForceSendFields will be sent to the 3219 // server regardless of whether the field is empty or not. This may be 3220 // used to include empty fields in Patch requests. 3221 ForceSendFields []string `json:"-"` 3222 3223 // NullFields is a list of field names (e.g. "Email") to include in API 3224 // requests with the JSON null value. By default, fields with empty 3225 // values are omitted from API requests. However, any field with an 3226 // empty value appearing in NullFields will be sent to the server as 3227 // null. It is an error if a field in this list has a non-empty value. 3228 // This may be used to include null fields in Patch requests. 3229 NullFields []string `json:"-"` 3230} 3231 3232func (s *RecentUsers) MarshalJSON() ([]byte, error) { 3233 type NoMethod RecentUsers 3234 raw := NoMethod(*s) 3235 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3236} 3237 3238type Role struct { 3239 // Etag: ETag of the resource. 3240 Etag string `json:"etag,omitempty"` 3241 3242 // IsSuperAdminRole: Returns `true` if the role is a super admin role. 3243 IsSuperAdminRole bool `json:"isSuperAdminRole,omitempty"` 3244 3245 // IsSystemRole: Returns `true` if this is a pre-defined system role. 3246 IsSystemRole bool `json:"isSystemRole,omitempty"` 3247 3248 // Kind: The type of the API resource. This is always 3249 // `admin#directory#role`. 3250 Kind string `json:"kind,omitempty"` 3251 3252 // RoleDescription: A short description of the role. 3253 RoleDescription string `json:"roleDescription,omitempty"` 3254 3255 // RoleId: ID of the role. 3256 RoleId int64 `json:"roleId,omitempty,string"` 3257 3258 // RoleName: Name of the role. 3259 RoleName string `json:"roleName,omitempty"` 3260 3261 // RolePrivileges: The set of privileges that are granted to this role. 3262 RolePrivileges []*RoleRolePrivileges `json:"rolePrivileges,omitempty"` 3263 3264 // ServerResponse contains the HTTP response code and headers from the 3265 // server. 3266 googleapi.ServerResponse `json:"-"` 3267 3268 // ForceSendFields is a list of field names (e.g. "Etag") to 3269 // unconditionally include in API requests. By default, fields with 3270 // empty values are omitted from API requests. However, any non-pointer, 3271 // non-interface field appearing in ForceSendFields will be sent to the 3272 // server regardless of whether the field is empty or not. This may be 3273 // used to include empty fields in Patch requests. 3274 ForceSendFields []string `json:"-"` 3275 3276 // NullFields is a list of field names (e.g. "Etag") to include in API 3277 // requests with the JSON null value. By default, fields with empty 3278 // values are omitted from API requests. However, any field with an 3279 // empty value appearing in NullFields will be sent to the server as 3280 // null. It is an error if a field in this list has a non-empty value. 3281 // This may be used to include null fields in Patch requests. 3282 NullFields []string `json:"-"` 3283} 3284 3285func (s *Role) MarshalJSON() ([]byte, error) { 3286 type NoMethod Role 3287 raw := NoMethod(*s) 3288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3289} 3290 3291type RoleRolePrivileges struct { 3292 // PrivilegeName: The name of the privilege. 3293 PrivilegeName string `json:"privilegeName,omitempty"` 3294 3295 // ServiceId: The obfuscated ID of the service this privilege is for. 3296 // This value is returned with 3297 // [`Privileges.list()`](/admin-sdk/directory/v1/reference/privileges/lis 3298 // t). 3299 ServiceId string `json:"serviceId,omitempty"` 3300 3301 // ForceSendFields is a list of field names (e.g. "PrivilegeName") to 3302 // unconditionally include in API requests. By default, fields with 3303 // empty values are omitted from API requests. However, any non-pointer, 3304 // non-interface field appearing in ForceSendFields will be sent to the 3305 // server regardless of whether the field is empty or not. This may be 3306 // used to include empty fields in Patch requests. 3307 ForceSendFields []string `json:"-"` 3308 3309 // NullFields is a list of field names (e.g. "PrivilegeName") to include 3310 // in API requests with the JSON null value. By default, fields with 3311 // empty values are omitted from API requests. However, any field with 3312 // an empty value appearing in NullFields will be sent to the server as 3313 // null. It is an error if a field in this list has a non-empty value. 3314 // This may be used to include null fields in Patch requests. 3315 NullFields []string `json:"-"` 3316} 3317 3318func (s *RoleRolePrivileges) MarshalJSON() ([]byte, error) { 3319 type NoMethod RoleRolePrivileges 3320 raw := NoMethod(*s) 3321 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3322} 3323 3324type RoleAssignment struct { 3325 // AssignedTo: The unique ID of the user this role is assigned to. 3326 AssignedTo string `json:"assignedTo,omitempty"` 3327 3328 // Etag: ETag of the resource. 3329 Etag string `json:"etag,omitempty"` 3330 3331 // Kind: The type of the API resource. This is always 3332 // `admin#directory#roleAssignment`. 3333 Kind string `json:"kind,omitempty"` 3334 3335 // OrgUnitId: If the role is restricted to an organization unit, this 3336 // contains the ID for the organization unit the exercise of this role 3337 // is restricted to. 3338 OrgUnitId string `json:"orgUnitId,omitempty"` 3339 3340 // RoleAssignmentId: ID of this roleAssignment. 3341 RoleAssignmentId int64 `json:"roleAssignmentId,omitempty,string"` 3342 3343 // RoleId: The ID of the role that is assigned. 3344 RoleId int64 `json:"roleId,omitempty,string"` 3345 3346 // ScopeType: The scope in which this role is assigned. 3347 ScopeType string `json:"scopeType,omitempty"` 3348 3349 // ServerResponse contains the HTTP response code and headers from the 3350 // server. 3351 googleapi.ServerResponse `json:"-"` 3352 3353 // ForceSendFields is a list of field names (e.g. "AssignedTo") to 3354 // unconditionally include in API requests. By default, fields with 3355 // empty values are omitted from API requests. However, any non-pointer, 3356 // non-interface field appearing in ForceSendFields will be sent to the 3357 // server regardless of whether the field is empty or not. This may be 3358 // used to include empty fields in Patch requests. 3359 ForceSendFields []string `json:"-"` 3360 3361 // NullFields is a list of field names (e.g. "AssignedTo") to include in 3362 // API requests with the JSON null value. By default, fields with empty 3363 // values are omitted from API requests. However, any field with an 3364 // empty value appearing in NullFields will be sent to the server as 3365 // null. It is an error if a field in this list has a non-empty value. 3366 // This may be used to include null fields in Patch requests. 3367 NullFields []string `json:"-"` 3368} 3369 3370func (s *RoleAssignment) MarshalJSON() ([]byte, error) { 3371 type NoMethod RoleAssignment 3372 raw := NoMethod(*s) 3373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3374} 3375 3376type RoleAssignments struct { 3377 // Etag: ETag of the resource. 3378 Etag string `json:"etag,omitempty"` 3379 3380 // Items: A list of RoleAssignment resources. 3381 Items []*RoleAssignment `json:"items,omitempty"` 3382 3383 // Kind: The type of the API resource. This is always 3384 // `admin#directory#roleAssignments`. 3385 Kind string `json:"kind,omitempty"` 3386 3387 NextPageToken string `json:"nextPageToken,omitempty"` 3388 3389 // ServerResponse contains the HTTP response code and headers from the 3390 // server. 3391 googleapi.ServerResponse `json:"-"` 3392 3393 // ForceSendFields is a list of field names (e.g. "Etag") to 3394 // unconditionally include in API requests. By default, fields with 3395 // empty values are omitted from API requests. However, any non-pointer, 3396 // non-interface field appearing in ForceSendFields will be sent to the 3397 // server regardless of whether the field is empty or not. This may be 3398 // used to include empty fields in Patch requests. 3399 ForceSendFields []string `json:"-"` 3400 3401 // NullFields is a list of field names (e.g. "Etag") to include in API 3402 // requests with the JSON null value. By default, fields with empty 3403 // values are omitted from API requests. However, any field with an 3404 // empty value appearing in NullFields will be sent to the server as 3405 // null. It is an error if a field in this list has a non-empty value. 3406 // This may be used to include null fields in Patch requests. 3407 NullFields []string `json:"-"` 3408} 3409 3410func (s *RoleAssignments) MarshalJSON() ([]byte, error) { 3411 type NoMethod RoleAssignments 3412 raw := NoMethod(*s) 3413 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3414} 3415 3416type Roles struct { 3417 // Etag: ETag of the resource. 3418 Etag string `json:"etag,omitempty"` 3419 3420 // Items: A list of Role resources. 3421 Items []*Role `json:"items,omitempty"` 3422 3423 // Kind: The type of the API resource. This is always 3424 // `admin#directory#roles`. 3425 Kind string `json:"kind,omitempty"` 3426 3427 NextPageToken string `json:"nextPageToken,omitempty"` 3428 3429 // ServerResponse contains the HTTP response code and headers from the 3430 // server. 3431 googleapi.ServerResponse `json:"-"` 3432 3433 // ForceSendFields is a list of field names (e.g. "Etag") to 3434 // unconditionally include in API requests. By default, fields with 3435 // empty values are omitted from API requests. However, any non-pointer, 3436 // non-interface field appearing in ForceSendFields will be sent to the 3437 // server regardless of whether the field is empty or not. This may be 3438 // used to include empty fields in Patch requests. 3439 ForceSendFields []string `json:"-"` 3440 3441 // NullFields is a list of field names (e.g. "Etag") to include in API 3442 // requests with the JSON null value. By default, fields with empty 3443 // values are omitted from API requests. However, any field with an 3444 // empty value appearing in NullFields will be sent to the server as 3445 // null. It is an error if a field in this list has a non-empty value. 3446 // This may be used to include null fields in Patch requests. 3447 NullFields []string `json:"-"` 3448} 3449 3450func (s *Roles) MarshalJSON() ([]byte, error) { 3451 type NoMethod Roles 3452 raw := NoMethod(*s) 3453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3454} 3455 3456// Schema: The type of API resource. For Schema resources, this is 3457// always `admin#directory#schema`. 3458type Schema struct { 3459 // DisplayName: Display name for the schema. 3460 DisplayName string `json:"displayName,omitempty"` 3461 3462 // Etag: The ETag of the resource. 3463 Etag string `json:"etag,omitempty"` 3464 3465 // Fields: A list of fields in the schema. 3466 Fields []*SchemaFieldSpec `json:"fields,omitempty"` 3467 3468 // Kind: Kind of resource this is. 3469 Kind string `json:"kind,omitempty"` 3470 3471 // SchemaId: The unique identifier of the schema (Read-only) 3472 SchemaId string `json:"schemaId,omitempty"` 3473 3474 // SchemaName: The schema's name. 3475 SchemaName string `json:"schemaName,omitempty"` 3476 3477 // ServerResponse contains the HTTP response code and headers from the 3478 // server. 3479 googleapi.ServerResponse `json:"-"` 3480 3481 // ForceSendFields is a list of field names (e.g. "DisplayName") to 3482 // unconditionally include in API requests. By default, fields with 3483 // empty values are omitted from API requests. However, any non-pointer, 3484 // non-interface field appearing in ForceSendFields will be sent to the 3485 // server regardless of whether the field is empty or not. This may be 3486 // used to include empty fields in Patch requests. 3487 ForceSendFields []string `json:"-"` 3488 3489 // NullFields is a list of field names (e.g. "DisplayName") to include 3490 // in API requests with the JSON null value. By default, fields with 3491 // empty values are omitted from API requests. However, any field with 3492 // an empty value appearing in NullFields will be sent to the server as 3493 // null. It is an error if a field in this list has a non-empty value. 3494 // This may be used to include null fields in Patch requests. 3495 NullFields []string `json:"-"` 3496} 3497 3498func (s *Schema) MarshalJSON() ([]byte, error) { 3499 type NoMethod Schema 3500 raw := NoMethod(*s) 3501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3502} 3503 3504// SchemaFieldSpec: You can use schemas to add custom fields to user 3505// profiles. You can use these fields to store information such as the 3506// projects your users work on, their physical locations, their hire 3507// dates, or whatever else fits your business needs. For more 3508// information, see [Custom User 3509// Fields](/admin-sdk/directory/v1/guides/manage-schemas). 3510type SchemaFieldSpec struct { 3511 // DisplayName: Display Name of the field. 3512 DisplayName string `json:"displayName,omitempty"` 3513 3514 // Etag: The ETag of the field. 3515 Etag string `json:"etag,omitempty"` 3516 3517 // FieldId: The unique identifier of the field (Read-only) 3518 FieldId string `json:"fieldId,omitempty"` 3519 3520 // FieldName: The name of the field. 3521 FieldName string `json:"fieldName,omitempty"` 3522 3523 // FieldType: The type of the field. 3524 FieldType string `json:"fieldType,omitempty"` 3525 3526 // Indexed: Boolean specifying whether the field is indexed or not. 3527 // Default: `true`. 3528 // 3529 // Default: true 3530 Indexed *bool `json:"indexed,omitempty"` 3531 3532 // Kind: The kind of resource this is. For schema fields this is always 3533 // `admin#directory#schema#fieldspec`. 3534 Kind string `json:"kind,omitempty"` 3535 3536 // MultiValued: A boolean specifying whether this is a multi-valued 3537 // field or not. Default: `false`. 3538 MultiValued bool `json:"multiValued,omitempty"` 3539 3540 // NumericIndexingSpec: Indexing spec for a numeric field. By default, 3541 // only exact match queries will be supported for numeric fields. 3542 // Setting the `numericIndexingSpec` allows range queries to be 3543 // supported. 3544 NumericIndexingSpec *SchemaFieldSpecNumericIndexingSpec `json:"numericIndexingSpec,omitempty"` 3545 3546 // ReadAccessType: Specifies who can view values of this field. See 3547 // [Retrieve users as a 3548 // non-administrator](/admin-sdk/directory/v1/guides/manage-users#retriev 3549 // e_users_non_admin) for more information. Note: It may take up to 24 3550 // hours for changes to this field to be reflected. 3551 ReadAccessType string `json:"readAccessType,omitempty"` 3552 3553 // ForceSendFields is a list of field names (e.g. "DisplayName") to 3554 // unconditionally include in API requests. By default, fields with 3555 // empty values are omitted from API requests. However, any non-pointer, 3556 // non-interface field appearing in ForceSendFields will be sent to the 3557 // server regardless of whether the field is empty or not. This may be 3558 // used to include empty fields in Patch requests. 3559 ForceSendFields []string `json:"-"` 3560 3561 // NullFields is a list of field names (e.g. "DisplayName") to include 3562 // in API requests with the JSON null value. By default, fields with 3563 // empty values are omitted from API requests. However, any field with 3564 // an empty value appearing in NullFields will be sent to the server as 3565 // null. It is an error if a field in this list has a non-empty value. 3566 // This may be used to include null fields in Patch requests. 3567 NullFields []string `json:"-"` 3568} 3569 3570func (s *SchemaFieldSpec) MarshalJSON() ([]byte, error) { 3571 type NoMethod SchemaFieldSpec 3572 raw := NoMethod(*s) 3573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3574} 3575 3576// SchemaFieldSpecNumericIndexingSpec: Indexing spec for a numeric 3577// field. By default, only exact match queries will be supported for 3578// numeric fields. Setting the `numericIndexingSpec` allows range 3579// queries to be supported. 3580type SchemaFieldSpecNumericIndexingSpec struct { 3581 // MaxValue: Maximum value of this field. This is meant to be indicative 3582 // rather than enforced. Values outside this range will still be 3583 // indexed, but search may not be as performant. 3584 MaxValue float64 `json:"maxValue,omitempty"` 3585 3586 // MinValue: Minimum value of this field. This is meant to be indicative 3587 // rather than enforced. Values outside this range will still be 3588 // indexed, but search may not be as performant. 3589 MinValue float64 `json:"minValue,omitempty"` 3590 3591 // ForceSendFields is a list of field names (e.g. "MaxValue") to 3592 // unconditionally include in API requests. By default, fields with 3593 // empty values are omitted from API requests. However, any non-pointer, 3594 // non-interface field appearing in ForceSendFields will be sent to the 3595 // server regardless of whether the field is empty or not. This may be 3596 // used to include empty fields in Patch requests. 3597 ForceSendFields []string `json:"-"` 3598 3599 // NullFields is a list of field names (e.g. "MaxValue") to include in 3600 // API requests with the JSON null value. By default, fields with empty 3601 // values are omitted from API requests. However, any field with an 3602 // empty value appearing in NullFields will be sent to the server as 3603 // null. It is an error if a field in this list has a non-empty value. 3604 // This may be used to include null fields in Patch requests. 3605 NullFields []string `json:"-"` 3606} 3607 3608func (s *SchemaFieldSpecNumericIndexingSpec) MarshalJSON() ([]byte, error) { 3609 type NoMethod SchemaFieldSpecNumericIndexingSpec 3610 raw := NoMethod(*s) 3611 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3612} 3613 3614func (s *SchemaFieldSpecNumericIndexingSpec) UnmarshalJSON(data []byte) error { 3615 type NoMethod SchemaFieldSpecNumericIndexingSpec 3616 var s1 struct { 3617 MaxValue gensupport.JSONFloat64 `json:"maxValue"` 3618 MinValue gensupport.JSONFloat64 `json:"minValue"` 3619 *NoMethod 3620 } 3621 s1.NoMethod = (*NoMethod)(s) 3622 if err := json.Unmarshal(data, &s1); err != nil { 3623 return err 3624 } 3625 s.MaxValue = float64(s1.MaxValue) 3626 s.MinValue = float64(s1.MinValue) 3627 return nil 3628} 3629 3630// Schemas: JSON response template for List Schema operation in 3631// Directory API. 3632type Schemas struct { 3633 // Etag: ETag of the resource. 3634 Etag string `json:"etag,omitempty"` 3635 3636 // Kind: Kind of resource this is. 3637 Kind string `json:"kind,omitempty"` 3638 3639 // Schemas: List of UserSchema objects. 3640 Schemas []*Schema `json:"schemas,omitempty"` 3641 3642 // ServerResponse contains the HTTP response code and headers from the 3643 // server. 3644 googleapi.ServerResponse `json:"-"` 3645 3646 // ForceSendFields is a list of field names (e.g. "Etag") to 3647 // unconditionally include in API requests. By default, fields with 3648 // empty values are omitted from API requests. However, any non-pointer, 3649 // non-interface field appearing in ForceSendFields will be sent to the 3650 // server regardless of whether the field is empty or not. This may be 3651 // used to include empty fields in Patch requests. 3652 ForceSendFields []string `json:"-"` 3653 3654 // NullFields is a list of field names (e.g. "Etag") to include in API 3655 // requests with the JSON null value. By default, fields with empty 3656 // values are omitted from API requests. However, any field with an 3657 // empty value appearing in NullFields will be sent to the server as 3658 // null. It is an error if a field in this list has a non-empty value. 3659 // This may be used to include null fields in Patch requests. 3660 NullFields []string `json:"-"` 3661} 3662 3663func (s *Schemas) MarshalJSON() ([]byte, error) { 3664 type NoMethod Schemas 3665 raw := NoMethod(*s) 3666 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3667} 3668 3669// Token: JSON template for token resource in Directory API. 3670type Token struct { 3671 // Anonymous: Whether the application is registered with Google. The 3672 // value is `true` if the application has an anonymous Client ID. 3673 Anonymous bool `json:"anonymous,omitempty"` 3674 3675 // ClientId: The Client ID of the application the token is issued to. 3676 ClientId string `json:"clientId,omitempty"` 3677 3678 // DisplayText: The displayable name of the application the token is 3679 // issued to. 3680 DisplayText string `json:"displayText,omitempty"` 3681 3682 // Etag: ETag of the resource. 3683 Etag string `json:"etag,omitempty"` 3684 3685 // Kind: The type of the API resource. This is always 3686 // `admin#directory#token`. 3687 Kind string `json:"kind,omitempty"` 3688 3689 // NativeApp: Whether the token is issued to an installed application. 3690 // The value is `true` if the application is installed to a desktop or 3691 // mobile device. 3692 NativeApp bool `json:"nativeApp,omitempty"` 3693 3694 // Scopes: A list of authorization scopes the application is granted. 3695 Scopes []string `json:"scopes,omitempty"` 3696 3697 // UserKey: The unique ID of the user that issued the token. 3698 UserKey string `json:"userKey,omitempty"` 3699 3700 // ServerResponse contains the HTTP response code and headers from the 3701 // server. 3702 googleapi.ServerResponse `json:"-"` 3703 3704 // ForceSendFields is a list of field names (e.g. "Anonymous") to 3705 // unconditionally include in API requests. By default, fields with 3706 // empty values are omitted from API requests. However, any non-pointer, 3707 // non-interface field appearing in ForceSendFields will be sent to the 3708 // server regardless of whether the field is empty or not. This may be 3709 // used to include empty fields in Patch requests. 3710 ForceSendFields []string `json:"-"` 3711 3712 // NullFields is a list of field names (e.g. "Anonymous") to include in 3713 // API requests with the JSON null value. By default, fields with empty 3714 // values are omitted from API requests. However, any field with an 3715 // empty value appearing in NullFields will be sent to the server as 3716 // null. It is an error if a field in this list has a non-empty value. 3717 // This may be used to include null fields in Patch requests. 3718 NullFields []string `json:"-"` 3719} 3720 3721func (s *Token) MarshalJSON() ([]byte, error) { 3722 type NoMethod Token 3723 raw := NoMethod(*s) 3724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3725} 3726 3727// Tokens: JSON response template for List tokens operation in Directory 3728// API. 3729type Tokens struct { 3730 // Etag: ETag of the resource. 3731 Etag string `json:"etag,omitempty"` 3732 3733 // Items: A list of Token resources. 3734 Items []*Token `json:"items,omitempty"` 3735 3736 // Kind: The type of the API resource. This is always 3737 // `admin#directory#tokenList`. 3738 Kind string `json:"kind,omitempty"` 3739 3740 // ServerResponse contains the HTTP response code and headers from the 3741 // server. 3742 googleapi.ServerResponse `json:"-"` 3743 3744 // ForceSendFields is a list of field names (e.g. "Etag") to 3745 // unconditionally include in API requests. By default, fields with 3746 // empty values are omitted from API requests. However, any non-pointer, 3747 // non-interface field appearing in ForceSendFields will be sent to the 3748 // server regardless of whether the field is empty or not. This may be 3749 // used to include empty fields in Patch requests. 3750 ForceSendFields []string `json:"-"` 3751 3752 // NullFields is a list of field names (e.g. "Etag") to include in API 3753 // requests with the JSON null value. By default, fields with empty 3754 // values are omitted from API requests. However, any field with an 3755 // empty value appearing in NullFields will be sent to the server as 3756 // null. It is an error if a field in this list has a non-empty value. 3757 // This may be used to include null fields in Patch requests. 3758 NullFields []string `json:"-"` 3759} 3760 3761func (s *Tokens) MarshalJSON() ([]byte, error) { 3762 type NoMethod Tokens 3763 raw := NoMethod(*s) 3764 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3765} 3766 3767// User: The Directory API allows you to create and manage your 3768// account's users, user aliases, and user Gmail chat profile photos. 3769// For more information about common tasks, see the [User Accounts 3770// Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) 3771// and the [User Aliases Developer's 3772// Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html). 3773type User struct { 3774 // Addresses: A list of the user's addresses. The maximum allowed data 3775 // size for this field is 10Kb. 3776 Addresses interface{} `json:"addresses,omitempty"` 3777 3778 // AgreedToTerms: Output only. This property is `true` if the user has 3779 // completed an initial login and accepted the Terms of Service 3780 // agreement. 3781 AgreedToTerms bool `json:"agreedToTerms,omitempty"` 3782 3783 // Aliases: Output only. List of the user's alias email addresses. 3784 Aliases []string `json:"aliases,omitempty"` 3785 3786 // Archived: Indicates if user is archived. 3787 Archived bool `json:"archived,omitempty"` 3788 3789 // ChangePasswordAtNextLogin: Indicates if the user is forced to change 3790 // their password at next login. This setting doesn't apply when [the 3791 // user signs in via a third-party identity 3792 // provider](https://support.google.com/a/answer/60224). 3793 ChangePasswordAtNextLogin bool `json:"changePasswordAtNextLogin,omitempty"` 3794 3795 // CreationTime: User's G Suite account creation time. (Read-only) 3796 CreationTime string `json:"creationTime,omitempty"` 3797 3798 // CustomSchemas: Custom fields of the user. 3799 CustomSchemas map[string]googleapi.RawMessage `json:"customSchemas,omitempty"` 3800 3801 // CustomerId: Output only. The customer ID to [retrieve all account 3802 // users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users) 3803 // . You can use the alias `my_customer` to represent your account's 3804 // `customerId`. As a reseller administrator, you can use the resold 3805 // customer account's `customerId`. To get a `customerId`, use the 3806 // account's primary domain in the `domain` parameter of a 3807 // [users.list](/admin-sdk/directory/v1/reference/users/list) request. 3808 CustomerId string `json:"customerId,omitempty"` 3809 3810 DeletionTime string `json:"deletionTime,omitempty"` 3811 3812 // Emails: A list of the user's email addresses. The maximum allowed 3813 // data size for this field is 10Kb. 3814 Emails interface{} `json:"emails,omitempty"` 3815 3816 // Etag: Output only. ETag of the resource. 3817 Etag string `json:"etag,omitempty"` 3818 3819 // ExternalIds: A list of external IDs for the user, such as an employee 3820 // or network ID. The maximum allowed data size for this field is 2Kb. 3821 ExternalIds interface{} `json:"externalIds,omitempty"` 3822 3823 // Gender: The user's gender. The maximum allowed data size for this 3824 // field is 1Kb. 3825 Gender interface{} `json:"gender,omitempty"` 3826 3827 // HashFunction: Stores the hash format of the password property. We 3828 // recommend sending the `password` property value as a base 16 bit 3829 // hexadecimal-encoded hash value. Set the `hashFunction` values as 3830 // either the [SHA-1](http://wikipedia.org/wiki/SHA-1), 3831 // [MD5](http://wikipedia.org/wiki/MD5), or 3832 // [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format. 3833 HashFunction string `json:"hashFunction,omitempty"` 3834 3835 // Id: The unique ID for the user. A user `id` can be used as a user 3836 // request URI's `userKey`. 3837 Id string `json:"id,omitempty"` 3838 3839 // Ims: The user's Instant Messenger (IM) accounts. A user account can 3840 // have multiple ims properties. But, only one of these ims properties 3841 // can be the primary IM contact. The maximum allowed data size for this 3842 // field is 2Kb. 3843 Ims interface{} `json:"ims,omitempty"` 3844 3845 // IncludeInGlobalAddressList: Indicates if the user's profile is 3846 // visible in the G Suite global address list when the contact sharing 3847 // feature is enabled for the domain. For more information about 3848 // excluding user profiles, see the [administration help 3849 // center](http://support.google.com/a/bin/answer.py?answer=1285988). 3850 IncludeInGlobalAddressList bool `json:"includeInGlobalAddressList,omitempty"` 3851 3852 // IpWhitelisted: If `true`, the user's IP address is [white 3853 // listed](http://support.google.com/a/bin/answer.py?answer=60752). 3854 IpWhitelisted bool `json:"ipWhitelisted,omitempty"` 3855 3856 // IsAdmin: Output only. Indicates a user with super admininistrator 3857 // privileges. The `isAdmin` property can only be edited in the [Make a 3858 // user an 3859 // administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_a 3860 // dmin) operation ( 3861 // [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) 3862 // method). If edited in the user 3863 // [insert](/admin-sdk/directory/v1/reference/users/insert.html) or 3864 // [update](/admin-sdk/directory/v1/reference/users/update.html) 3865 // methods, the edit is ignored by the API service. 3866 IsAdmin bool `json:"isAdmin,omitempty"` 3867 3868 // IsDelegatedAdmin: Output only. Indicates if the user is a delegated 3869 // administrator. Delegated administrators are supported by the API but 3870 // cannot create or undelete users, or make users administrators. These 3871 // requests are ignored by the API service. Roles and privileges for 3872 // administrators are assigned using the [Admin 3873 // console](http://support.google.com/a/bin/answer.py?answer=33325). 3874 IsDelegatedAdmin bool `json:"isDelegatedAdmin,omitempty"` 3875 3876 // IsEnforcedIn2Sv: Output only. Is 2-step verification enforced 3877 // (Read-only) 3878 IsEnforcedIn2Sv bool `json:"isEnforcedIn2Sv,omitempty"` 3879 3880 // IsEnrolledIn2Sv: Output only. Is enrolled in 2-step verification 3881 // (Read-only) 3882 IsEnrolledIn2Sv bool `json:"isEnrolledIn2Sv,omitempty"` 3883 3884 // IsMailboxSetup: Output only. Indicates if the user's Google mailbox 3885 // is created. This property is only applicable if the user has been 3886 // assigned a Gmail license. 3887 IsMailboxSetup bool `json:"isMailboxSetup,omitempty"` 3888 3889 // Keywords: The user's keywords. The maximum allowed data size for this 3890 // field is 1Kb. 3891 Keywords interface{} `json:"keywords,omitempty"` 3892 3893 // Kind: Output only. The type of the API resource. For Users resources, 3894 // the value is `admin#directory#user`. 3895 Kind string `json:"kind,omitempty"` 3896 3897 // Languages: The user's languages. The maximum allowed data size for 3898 // this field is 1Kb. 3899 Languages interface{} `json:"languages,omitempty"` 3900 3901 // LastLoginTime: User's last login time. (Read-only) 3902 LastLoginTime string `json:"lastLoginTime,omitempty"` 3903 3904 // Locations: The user's locations. The maximum allowed data size for 3905 // this field is 10Kb. 3906 Locations interface{} `json:"locations,omitempty"` 3907 3908 // Name: Holds the given and family names of the user, and the read-only 3909 // `fullName` value. The maximum number of characters in the `givenName` 3910 // and in the `familyName` values is 60. In addition, name values 3911 // support unicode/UTF-8 characters, and can contain spaces, letters 3912 // (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods 3913 // (.). For more information about character usage rules, see the 3914 // [administration help 3915 // center](http://support.google.com/a/bin/answer.py?answer=33386). 3916 // Maximum allowed data size for this field is 1Kb. 3917 Name *UserName `json:"name,omitempty"` 3918 3919 // NonEditableAliases: Output only. List of the user's non-editable 3920 // alias email addresses. These are typically outside the account's 3921 // primary domain or sub-domain. 3922 NonEditableAliases []string `json:"nonEditableAliases,omitempty"` 3923 3924 // Notes: Notes for the user. 3925 Notes interface{} `json:"notes,omitempty"` 3926 3927 // OrgUnitPath: The full path of the parent organization associated with 3928 // the user. If the parent organization is the top-level, it is 3929 // represented as a forward slash (`/`). 3930 OrgUnitPath string `json:"orgUnitPath,omitempty"` 3931 3932 // Organizations: A list of organizations the user belongs to. The 3933 // maximum allowed data size for this field is 10Kb. 3934 Organizations interface{} `json:"organizations,omitempty"` 3935 3936 // Password: User's password 3937 Password string `json:"password,omitempty"` 3938 3939 // Phones: A list of the user's phone numbers. The maximum allowed data 3940 // size for this field is 1Kb. 3941 Phones interface{} `json:"phones,omitempty"` 3942 3943 // PosixAccounts: A list of 3944 // [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) 3945 // account information for the user. 3946 PosixAccounts interface{} `json:"posixAccounts,omitempty"` 3947 3948 // PrimaryEmail: The user's primary email address. This property is 3949 // required in a request to create a user account. The `primaryEmail` 3950 // must be unique and cannot be an alias of another user. 3951 PrimaryEmail string `json:"primaryEmail,omitempty"` 3952 3953 // RecoveryEmail: Recovery email of the user. 3954 RecoveryEmail string `json:"recoveryEmail,omitempty"` 3955 3956 // RecoveryPhone: Recovery phone of the user. The phone number must be 3957 // in the E.164 format, starting with the plus sign (+). Example: 3958 // *+16506661212*. 3959 RecoveryPhone string `json:"recoveryPhone,omitempty"` 3960 3961 // Relations: A list of the user's relationships to other users. The 3962 // maximum allowed data size for this field is 2Kb. 3963 Relations interface{} `json:"relations,omitempty"` 3964 3965 // SshPublicKeys: A list of SSH public keys. 3966 SshPublicKeys interface{} `json:"sshPublicKeys,omitempty"` 3967 3968 // Suspended: Indicates if user is suspended. 3969 Suspended bool `json:"suspended,omitempty"` 3970 3971 // SuspensionReason: Output only. Has the reason a user account is 3972 // suspended either by the administrator or by Google at the time of 3973 // suspension. The property is returned only if the `suspended` property 3974 // is `true`. 3975 SuspensionReason string `json:"suspensionReason,omitempty"` 3976 3977 // ThumbnailPhotoEtag: Output only. ETag of the user's photo (Read-only) 3978 ThumbnailPhotoEtag string `json:"thumbnailPhotoEtag,omitempty"` 3979 3980 // ThumbnailPhotoUrl: Output only. Photo Url of the user (Read-only) 3981 ThumbnailPhotoUrl string `json:"thumbnailPhotoUrl,omitempty"` 3982 3983 // Websites: The user's websites. The maximum allowed data size for this 3984 // field is 2Kb. 3985 Websites interface{} `json:"websites,omitempty"` 3986 3987 // ServerResponse contains the HTTP response code and headers from the 3988 // server. 3989 googleapi.ServerResponse `json:"-"` 3990 3991 // ForceSendFields is a list of field names (e.g. "Addresses") to 3992 // unconditionally include in API requests. By default, fields with 3993 // empty values are omitted from API requests. However, any non-pointer, 3994 // non-interface field appearing in ForceSendFields will be sent to the 3995 // server regardless of whether the field is empty or not. This may be 3996 // used to include empty fields in Patch requests. 3997 ForceSendFields []string `json:"-"` 3998 3999 // NullFields is a list of field names (e.g. "Addresses") to include in 4000 // API requests with the JSON null value. By default, fields with empty 4001 // values are omitted from API requests. However, any field with an 4002 // empty value appearing in NullFields will be sent to the server as 4003 // null. It is an error if a field in this list has a non-empty value. 4004 // This may be used to include null fields in Patch requests. 4005 NullFields []string `json:"-"` 4006} 4007 4008func (s *User) MarshalJSON() ([]byte, error) { 4009 type NoMethod User 4010 raw := NoMethod(*s) 4011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4012} 4013 4014// UserAbout: JSON template for About (notes) of a user in Directory 4015// API. 4016type UserAbout struct { 4017 // ContentType: About entry can have a type which indicates the content 4018 // type. It can either be plain or html. By default, notes contents are 4019 // assumed to contain plain text. 4020 ContentType string `json:"contentType,omitempty"` 4021 4022 // Value: Actual value of notes. 4023 Value string `json:"value,omitempty"` 4024 4025 // ForceSendFields is a list of field names (e.g. "ContentType") to 4026 // unconditionally include in API requests. By default, fields with 4027 // empty values are omitted from API requests. However, any non-pointer, 4028 // non-interface field appearing in ForceSendFields will be sent to the 4029 // server regardless of whether the field is empty or not. This may be 4030 // used to include empty fields in Patch requests. 4031 ForceSendFields []string `json:"-"` 4032 4033 // NullFields is a list of field names (e.g. "ContentType") to include 4034 // in API requests with the JSON null value. By default, fields with 4035 // empty values are omitted from API requests. However, any field with 4036 // an empty value appearing in NullFields will be sent to the server as 4037 // null. It is an error if a field in this list has a non-empty value. 4038 // This may be used to include null fields in Patch requests. 4039 NullFields []string `json:"-"` 4040} 4041 4042func (s *UserAbout) MarshalJSON() ([]byte, error) { 4043 type NoMethod UserAbout 4044 raw := NoMethod(*s) 4045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4046} 4047 4048// UserAddress: JSON template for address. 4049type UserAddress struct { 4050 // Country: Country. 4051 Country string `json:"country,omitempty"` 4052 4053 // CountryCode: Country code. 4054 CountryCode string `json:"countryCode,omitempty"` 4055 4056 // CustomType: Custom type. 4057 CustomType string `json:"customType,omitempty"` 4058 4059 // ExtendedAddress: Extended Address. 4060 ExtendedAddress string `json:"extendedAddress,omitempty"` 4061 4062 // Formatted: Formatted address. 4063 Formatted string `json:"formatted,omitempty"` 4064 4065 // Locality: Locality. 4066 Locality string `json:"locality,omitempty"` 4067 4068 // PoBox: Other parts of address. 4069 PoBox string `json:"poBox,omitempty"` 4070 4071 // PostalCode: Postal code. 4072 PostalCode string `json:"postalCode,omitempty"` 4073 4074 // Primary: If this is user's primary address. Only one entry could be 4075 // marked as primary. 4076 Primary bool `json:"primary,omitempty"` 4077 4078 // Region: Region. 4079 Region string `json:"region,omitempty"` 4080 4081 // SourceIsStructured: User supplied address was structured. Structured 4082 // addresses are NOT supported at this time. You might be able to write 4083 // structured addresses but any values will eventually be clobbered. 4084 SourceIsStructured bool `json:"sourceIsStructured,omitempty"` 4085 4086 // StreetAddress: Street. 4087 StreetAddress string `json:"streetAddress,omitempty"` 4088 4089 // Type: Each entry can have a type which indicates standard values of 4090 // that entry. For example address could be of home work etc. In 4091 // addition to the standard type an entry can have a custom type and can 4092 // take any value. Such type should have the CUSTOM value as type and 4093 // also have a customType value. 4094 Type string `json:"type,omitempty"` 4095 4096 // ForceSendFields is a list of field names (e.g. "Country") to 4097 // unconditionally include in API requests. By default, fields with 4098 // empty values are omitted from API requests. However, any non-pointer, 4099 // non-interface field appearing in ForceSendFields will be sent to the 4100 // server regardless of whether the field is empty or not. This may be 4101 // used to include empty fields in Patch requests. 4102 ForceSendFields []string `json:"-"` 4103 4104 // NullFields is a list of field names (e.g. "Country") to include in 4105 // API requests with the JSON null value. By default, fields with empty 4106 // values are omitted from API requests. However, any field with an 4107 // empty value appearing in NullFields will be sent to the server as 4108 // null. It is an error if a field in this list has a non-empty value. 4109 // This may be used to include null fields in Patch requests. 4110 NullFields []string `json:"-"` 4111} 4112 4113func (s *UserAddress) MarshalJSON() ([]byte, error) { 4114 type NoMethod UserAddress 4115 raw := NoMethod(*s) 4116 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4117} 4118 4119// UserEmail: JSON template for an email. 4120type UserEmail struct { 4121 // Address: Email id of the user. 4122 Address string `json:"address,omitempty"` 4123 4124 // CustomType: Custom Type. 4125 CustomType string `json:"customType,omitempty"` 4126 4127 // Primary: If this is user's primary email. Only one entry could be 4128 // marked as primary. 4129 Primary bool `json:"primary,omitempty"` 4130 4131 // Type: Each entry can have a type which indicates standard types of 4132 // that entry. For example email could be of home, work etc. In addition 4133 // to the standard type, an entry can have a custom type and can take 4134 // any value Such types should have the CUSTOM value as type and also 4135 // have a customType value. 4136 Type string `json:"type,omitempty"` 4137 4138 // ForceSendFields is a list of field names (e.g. "Address") to 4139 // unconditionally include in API requests. By default, fields with 4140 // empty values are omitted from API requests. However, any non-pointer, 4141 // non-interface field appearing in ForceSendFields will be sent to the 4142 // server regardless of whether the field is empty or not. This may be 4143 // used to include empty fields in Patch requests. 4144 ForceSendFields []string `json:"-"` 4145 4146 // NullFields is a list of field names (e.g. "Address") to include in 4147 // API requests with the JSON null value. By default, fields with empty 4148 // values are omitted from API requests. However, any field with an 4149 // empty value appearing in NullFields will be sent to the server as 4150 // null. It is an error if a field in this list has a non-empty value. 4151 // This may be used to include null fields in Patch requests. 4152 NullFields []string `json:"-"` 4153} 4154 4155func (s *UserEmail) MarshalJSON() ([]byte, error) { 4156 type NoMethod UserEmail 4157 raw := NoMethod(*s) 4158 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4159} 4160 4161// UserExternalId: JSON template for an externalId entry. 4162type UserExternalId struct { 4163 // CustomType: Custom type. 4164 CustomType string `json:"customType,omitempty"` 4165 4166 // Type: The type of the Id. 4167 Type string `json:"type,omitempty"` 4168 4169 // Value: The value of the id. 4170 Value string `json:"value,omitempty"` 4171 4172 // ForceSendFields is a list of field names (e.g. "CustomType") to 4173 // unconditionally include in API requests. By default, fields with 4174 // empty values are omitted from API requests. However, any non-pointer, 4175 // non-interface field appearing in ForceSendFields will be sent to the 4176 // server regardless of whether the field is empty or not. This may be 4177 // used to include empty fields in Patch requests. 4178 ForceSendFields []string `json:"-"` 4179 4180 // NullFields is a list of field names (e.g. "CustomType") to include in 4181 // API requests with the JSON null value. By default, fields with empty 4182 // values are omitted from API requests. However, any field with an 4183 // empty value appearing in NullFields will be sent to the server as 4184 // null. It is an error if a field in this list has a non-empty value. 4185 // This may be used to include null fields in Patch requests. 4186 NullFields []string `json:"-"` 4187} 4188 4189func (s *UserExternalId) MarshalJSON() ([]byte, error) { 4190 type NoMethod UserExternalId 4191 raw := NoMethod(*s) 4192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4193} 4194 4195type UserGender struct { 4196 // AddressMeAs: AddressMeAs. A human-readable string containing the 4197 // proper way to refer to the profile owner by humans for example 4198 // he/him/his or they/them/their. 4199 AddressMeAs string `json:"addressMeAs,omitempty"` 4200 4201 // CustomGender: Custom gender. 4202 CustomGender string `json:"customGender,omitempty"` 4203 4204 // Type: Gender. 4205 Type string `json:"type,omitempty"` 4206 4207 // ForceSendFields is a list of field names (e.g. "AddressMeAs") to 4208 // unconditionally include in API requests. By default, fields with 4209 // empty values are omitted from API requests. However, any non-pointer, 4210 // non-interface field appearing in ForceSendFields will be sent to the 4211 // server regardless of whether the field is empty or not. This may be 4212 // used to include empty fields in Patch requests. 4213 ForceSendFields []string `json:"-"` 4214 4215 // NullFields is a list of field names (e.g. "AddressMeAs") to include 4216 // in API requests with the JSON null value. By default, fields with 4217 // empty values are omitted from API requests. However, any field with 4218 // an empty value appearing in NullFields will be sent to the server as 4219 // null. It is an error if a field in this list has a non-empty value. 4220 // This may be used to include null fields in Patch requests. 4221 NullFields []string `json:"-"` 4222} 4223 4224func (s *UserGender) MarshalJSON() ([]byte, error) { 4225 type NoMethod UserGender 4226 raw := NoMethod(*s) 4227 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4228} 4229 4230// UserIm: JSON template for instant messenger of an user. 4231type UserIm struct { 4232 // CustomProtocol: Custom protocol. 4233 CustomProtocol string `json:"customProtocol,omitempty"` 4234 4235 // CustomType: Custom type. 4236 CustomType string `json:"customType,omitempty"` 4237 4238 // Im: Instant messenger id. 4239 Im string `json:"im,omitempty"` 4240 4241 // Primary: If this is user's primary im. Only one entry could be marked 4242 // as primary. 4243 Primary bool `json:"primary,omitempty"` 4244 4245 // Protocol: Protocol used in the instant messenger. It should be one of 4246 // the values from ImProtocolTypes map. Similar to type it can take a 4247 // CUSTOM value and specify the custom name in customProtocol field. 4248 Protocol string `json:"protocol,omitempty"` 4249 4250 // Type: Each entry can have a type which indicates standard types of 4251 // that entry. For example instant messengers could be of home work etc. 4252 // In addition to the standard type an entry can have a custom type and 4253 // can take any value. Such types should have the CUSTOM value as type 4254 // and also have a customType value. 4255 Type string `json:"type,omitempty"` 4256 4257 // ForceSendFields is a list of field names (e.g. "CustomProtocol") to 4258 // unconditionally include in API requests. By default, fields with 4259 // empty values are omitted from API requests. However, any non-pointer, 4260 // non-interface field appearing in ForceSendFields will be sent to the 4261 // server regardless of whether the field is empty or not. This may be 4262 // used to include empty fields in Patch requests. 4263 ForceSendFields []string `json:"-"` 4264 4265 // NullFields is a list of field names (e.g. "CustomProtocol") to 4266 // include in API requests with the JSON null value. By default, fields 4267 // with empty values are omitted from API requests. However, any field 4268 // with an empty value appearing in NullFields will be sent to the 4269 // server as null. It is an error if a field in this list has a 4270 // non-empty value. This may be used to include null fields in Patch 4271 // requests. 4272 NullFields []string `json:"-"` 4273} 4274 4275func (s *UserIm) MarshalJSON() ([]byte, error) { 4276 type NoMethod UserIm 4277 raw := NoMethod(*s) 4278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4279} 4280 4281// UserKeyword: JSON template for a keyword entry. 4282type UserKeyword struct { 4283 // CustomType: Custom Type. 4284 CustomType string `json:"customType,omitempty"` 4285 4286 // Type: Each entry can have a type which indicates standard type of 4287 // that entry. For example keyword could be of type occupation or 4288 // outlook. In addition to the standard type an entry can have a custom 4289 // type and can give it any name. Such types should have the CUSTOM 4290 // value as type and also have a customType value. 4291 Type string `json:"type,omitempty"` 4292 4293 // Value: Keyword. 4294 Value string `json:"value,omitempty"` 4295 4296 // ForceSendFields is a list of field names (e.g. "CustomType") to 4297 // unconditionally include in API requests. By default, fields with 4298 // empty values are omitted from API requests. However, any non-pointer, 4299 // non-interface field appearing in ForceSendFields will be sent to the 4300 // server regardless of whether the field is empty or not. This may be 4301 // used to include empty fields in Patch requests. 4302 ForceSendFields []string `json:"-"` 4303 4304 // NullFields is a list of field names (e.g. "CustomType") to include in 4305 // API requests with the JSON null value. By default, fields with empty 4306 // values are omitted from API requests. However, any field with an 4307 // empty value appearing in NullFields will be sent to the server as 4308 // null. It is an error if a field in this list has a non-empty value. 4309 // This may be used to include null fields in Patch requests. 4310 NullFields []string `json:"-"` 4311} 4312 4313func (s *UserKeyword) MarshalJSON() ([]byte, error) { 4314 type NoMethod UserKeyword 4315 raw := NoMethod(*s) 4316 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4317} 4318 4319// UserLanguage: JSON template for a language entry. 4320type UserLanguage struct { 4321 // CustomLanguage: Other language. User can provide own language name if 4322 // there is no corresponding Google III language code. If this is set 4323 // LanguageCode can't be set 4324 CustomLanguage string `json:"customLanguage,omitempty"` 4325 4326 // LanguageCode: Language Code. Should be used for storing Google III 4327 // LanguageCode string representation for language. Illegal values cause 4328 // SchemaException. 4329 LanguageCode string `json:"languageCode,omitempty"` 4330 4331 // ForceSendFields is a list of field names (e.g. "CustomLanguage") to 4332 // unconditionally include in API requests. By default, fields with 4333 // empty values are omitted from API requests. However, any non-pointer, 4334 // non-interface field appearing in ForceSendFields will be sent to the 4335 // server regardless of whether the field is empty or not. This may be 4336 // used to include empty fields in Patch requests. 4337 ForceSendFields []string `json:"-"` 4338 4339 // NullFields is a list of field names (e.g. "CustomLanguage") to 4340 // include in API requests with the JSON null value. By default, fields 4341 // with empty values are omitted from API requests. However, any field 4342 // with an empty value appearing in NullFields will be sent to the 4343 // server as null. It is an error if a field in this list has a 4344 // non-empty value. This may be used to include null fields in Patch 4345 // requests. 4346 NullFields []string `json:"-"` 4347} 4348 4349func (s *UserLanguage) MarshalJSON() ([]byte, error) { 4350 type NoMethod UserLanguage 4351 raw := NoMethod(*s) 4352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4353} 4354 4355// UserLocation: JSON template for a location entry. 4356type UserLocation struct { 4357 // Area: Textual location. This is most useful for display purposes to 4358 // concisely describe the location. For example 'Mountain View, CA', 4359 // 'Near Seattle', 'US-NYC-9TH 9A209A.'' 4360 Area string `json:"area,omitempty"` 4361 4362 // BuildingId: Building Identifier. 4363 BuildingId string `json:"buildingId,omitempty"` 4364 4365 // CustomType: Custom Type. 4366 CustomType string `json:"customType,omitempty"` 4367 4368 // DeskCode: Most specific textual code of individual desk location. 4369 DeskCode string `json:"deskCode,omitempty"` 4370 4371 // FloorName: Floor name/number. 4372 FloorName string `json:"floorName,omitempty"` 4373 4374 // FloorSection: Floor section. More specific location within the floor. 4375 // For example if a floor is divided into sections 'A', 'B' and 'C' this 4376 // field would identify one of those values. 4377 FloorSection string `json:"floorSection,omitempty"` 4378 4379 // Type: Each entry can have a type which indicates standard types of 4380 // that entry. For example location could be of types default and desk. 4381 // In addition to standard type an entry can have a custom type and can 4382 // give it any name. Such types should have 'custom' as type and also 4383 // have a customType value. 4384 Type string `json:"type,omitempty"` 4385 4386 // ForceSendFields is a list of field names (e.g. "Area") to 4387 // unconditionally include in API requests. By default, fields with 4388 // empty values are omitted from API requests. However, any non-pointer, 4389 // non-interface field appearing in ForceSendFields will be sent to the 4390 // server regardless of whether the field is empty or not. This may be 4391 // used to include empty fields in Patch requests. 4392 ForceSendFields []string `json:"-"` 4393 4394 // NullFields is a list of field names (e.g. "Area") to include in API 4395 // requests with the JSON null value. By default, fields with empty 4396 // values are omitted from API requests. However, any field with an 4397 // empty value appearing in NullFields will be sent to the server as 4398 // null. It is an error if a field in this list has a non-empty value. 4399 // This may be used to include null fields in Patch requests. 4400 NullFields []string `json:"-"` 4401} 4402 4403func (s *UserLocation) MarshalJSON() ([]byte, error) { 4404 type NoMethod UserLocation 4405 raw := NoMethod(*s) 4406 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4407} 4408 4409type UserMakeAdmin struct { 4410 // Status: Indicates the administrator status of the user. 4411 Status bool `json:"status,omitempty"` 4412 4413 // ForceSendFields is a list of field names (e.g. "Status") to 4414 // unconditionally include in API requests. By default, fields with 4415 // empty values are omitted from API requests. However, any non-pointer, 4416 // non-interface field appearing in ForceSendFields will be sent to the 4417 // server regardless of whether the field is empty or not. This may be 4418 // used to include empty fields in Patch requests. 4419 ForceSendFields []string `json:"-"` 4420 4421 // NullFields is a list of field names (e.g. "Status") to include in API 4422 // requests with the JSON null value. By default, fields with empty 4423 // values are omitted from API requests. However, any field with an 4424 // empty value appearing in NullFields will be sent to the server as 4425 // null. It is an error if a field in this list has a non-empty value. 4426 // This may be used to include null fields in Patch requests. 4427 NullFields []string `json:"-"` 4428} 4429 4430func (s *UserMakeAdmin) MarshalJSON() ([]byte, error) { 4431 type NoMethod UserMakeAdmin 4432 raw := NoMethod(*s) 4433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4434} 4435 4436type UserName struct { 4437 // FamilyName: The user's last name. Required when creating a user 4438 // account. 4439 FamilyName string `json:"familyName,omitempty"` 4440 4441 // FullName: The user's full name formed by concatenating the first and 4442 // last name values. 4443 FullName string `json:"fullName,omitempty"` 4444 4445 // GivenName: The user's first name. Required when creating a user 4446 // account. 4447 GivenName string `json:"givenName,omitempty"` 4448 4449 // ForceSendFields is a list of field names (e.g. "FamilyName") to 4450 // unconditionally include in API requests. By default, fields with 4451 // empty values are omitted from API requests. However, any non-pointer, 4452 // non-interface field appearing in ForceSendFields will be sent to the 4453 // server regardless of whether the field is empty or not. This may be 4454 // used to include empty fields in Patch requests. 4455 ForceSendFields []string `json:"-"` 4456 4457 // NullFields is a list of field names (e.g. "FamilyName") to include in 4458 // API requests with the JSON null value. By default, fields with empty 4459 // values are omitted from API requests. However, any field with an 4460 // empty value appearing in NullFields will be sent to the server as 4461 // null. It is an error if a field in this list has a non-empty value. 4462 // This may be used to include null fields in Patch requests. 4463 NullFields []string `json:"-"` 4464} 4465 4466func (s *UserName) MarshalJSON() ([]byte, error) { 4467 type NoMethod UserName 4468 raw := NoMethod(*s) 4469 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4470} 4471 4472// UserOrganization: JSON template for an organization entry. 4473type UserOrganization struct { 4474 // CostCenter: The cost center of the users department. 4475 CostCenter string `json:"costCenter,omitempty"` 4476 4477 // CustomType: Custom type. 4478 CustomType string `json:"customType,omitempty"` 4479 4480 // Department: Department within the organization. 4481 Department string `json:"department,omitempty"` 4482 4483 // Description: Description of the organization. 4484 Description string `json:"description,omitempty"` 4485 4486 // Domain: The domain to which the organization belongs to. 4487 Domain string `json:"domain,omitempty"` 4488 4489 // FullTimeEquivalent: The full-time equivalent millipercent within the 4490 // organization (100000 = 100%). 4491 FullTimeEquivalent int64 `json:"fullTimeEquivalent,omitempty"` 4492 4493 // Location: Location of the organization. This need not be fully 4494 // qualified address. 4495 Location string `json:"location,omitempty"` 4496 4497 // Name: Name of the organization 4498 Name string `json:"name,omitempty"` 4499 4500 // Primary: If it user's primary organization. 4501 Primary bool `json:"primary,omitempty"` 4502 4503 // Symbol: Symbol of the organization. 4504 Symbol string `json:"symbol,omitempty"` 4505 4506 // Title: Title (designation) of the user in the organization. 4507 Title string `json:"title,omitempty"` 4508 4509 // Type: Each entry can have a type which indicates standard types of 4510 // that entry. For example organization could be of school work etc. In 4511 // addition to the standard type an entry can have a custom type and can 4512 // give it any name. Such types should have the CUSTOM value as type and 4513 // also have a CustomType value. 4514 Type string `json:"type,omitempty"` 4515 4516 // ForceSendFields is a list of field names (e.g. "CostCenter") to 4517 // unconditionally include in API requests. By default, fields with 4518 // empty values are omitted from API requests. However, any non-pointer, 4519 // non-interface field appearing in ForceSendFields will be sent to the 4520 // server regardless of whether the field is empty or not. This may be 4521 // used to include empty fields in Patch requests. 4522 ForceSendFields []string `json:"-"` 4523 4524 // NullFields is a list of field names (e.g. "CostCenter") to include in 4525 // API requests with the JSON null value. By default, fields with empty 4526 // values are omitted from API requests. However, any field with an 4527 // empty value appearing in NullFields will be sent to the server as 4528 // null. It is an error if a field in this list has a non-empty value. 4529 // This may be used to include null fields in Patch requests. 4530 NullFields []string `json:"-"` 4531} 4532 4533func (s *UserOrganization) MarshalJSON() ([]byte, error) { 4534 type NoMethod UserOrganization 4535 raw := NoMethod(*s) 4536 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4537} 4538 4539// UserPhone: JSON template for a phone entry. 4540type UserPhone struct { 4541 // CustomType: Custom Type. 4542 CustomType string `json:"customType,omitempty"` 4543 4544 // Primary: If this is user's primary phone or not. 4545 Primary bool `json:"primary,omitempty"` 4546 4547 // Type: Each entry can have a type which indicates standard types of 4548 // that entry. For example phone could be of home_fax work mobile etc. 4549 // In addition to the standard type an entry can have a custom type and 4550 // can give it any name. Such types should have the CUSTOM value as type 4551 // and also have a customType value. 4552 Type string `json:"type,omitempty"` 4553 4554 // Value: Phone number. 4555 Value string `json:"value,omitempty"` 4556 4557 // ForceSendFields is a list of field names (e.g. "CustomType") to 4558 // unconditionally include in API requests. By default, fields with 4559 // empty values are omitted from API requests. However, any non-pointer, 4560 // non-interface field appearing in ForceSendFields will be sent to the 4561 // server regardless of whether the field is empty or not. This may be 4562 // used to include empty fields in Patch requests. 4563 ForceSendFields []string `json:"-"` 4564 4565 // NullFields is a list of field names (e.g. "CustomType") to include in 4566 // API requests with the JSON null value. By default, fields with empty 4567 // values are omitted from API requests. However, any field with an 4568 // empty value appearing in NullFields will be sent to the server as 4569 // null. It is an error if a field in this list has a non-empty value. 4570 // This may be used to include null fields in Patch requests. 4571 NullFields []string `json:"-"` 4572} 4573 4574func (s *UserPhone) MarshalJSON() ([]byte, error) { 4575 type NoMethod UserPhone 4576 raw := NoMethod(*s) 4577 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4578} 4579 4580type UserPhoto struct { 4581 // Etag: ETag of the resource. 4582 Etag string `json:"etag,omitempty"` 4583 4584 // Height: Height of the photo in pixels. 4585 Height int64 `json:"height,omitempty"` 4586 4587 // Id: The ID the API uses to uniquely identify the user. 4588 Id string `json:"id,omitempty"` 4589 4590 // Kind: The type of the API resource. For Photo resources, this is 4591 // `admin#directory#user#photo`. 4592 Kind string `json:"kind,omitempty"` 4593 4594 // MimeType: The MIME type of the photo. Allowed values are `JPEG`, 4595 // `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding. 4596 MimeType string `json:"mimeType,omitempty"` 4597 4598 // PhotoData: The user photo's upload data in [web-safe 4599 // Base64](https://code.google.com/p/stringencoders/wiki/WebSafeBase64) 4600 // format in bytes. This means: * The slash (/) character is replaced 4601 // with the underscore (_) character. * The plus sign (+) character is 4602 // replaced with the hyphen (-) character. * The equals sign (=) 4603 // character is replaced with the asterisk (*). * For padding, the 4604 // period (.) character is used instead of the RFC-4648 baseURL 4605 // definition which uses the equals sign (=) for padding. This is done 4606 // to simplify URL-parsing. * Whatever the size of the photo being 4607 // uploaded, the API downsizes it to 96x96 pixels. 4608 PhotoData string `json:"photoData,omitempty"` 4609 4610 // PrimaryEmail: The user's primary email address. 4611 PrimaryEmail string `json:"primaryEmail,omitempty"` 4612 4613 // Width: Width of the photo in pixels. 4614 Width int64 `json:"width,omitempty"` 4615 4616 // ServerResponse contains the HTTP response code and headers from the 4617 // server. 4618 googleapi.ServerResponse `json:"-"` 4619 4620 // ForceSendFields is a list of field names (e.g. "Etag") to 4621 // unconditionally include in API requests. By default, fields with 4622 // empty values are omitted from API requests. However, any non-pointer, 4623 // non-interface field appearing in ForceSendFields will be sent to the 4624 // server regardless of whether the field is empty or not. This may be 4625 // used to include empty fields in Patch requests. 4626 ForceSendFields []string `json:"-"` 4627 4628 // NullFields is a list of field names (e.g. "Etag") to include in API 4629 // requests with the JSON null value. By default, fields with empty 4630 // values are omitted from API requests. However, any field with an 4631 // empty value appearing in NullFields will be sent to the server as 4632 // null. It is an error if a field in this list has a non-empty value. 4633 // This may be used to include null fields in Patch requests. 4634 NullFields []string `json:"-"` 4635} 4636 4637func (s *UserPhoto) MarshalJSON() ([]byte, error) { 4638 type NoMethod UserPhoto 4639 raw := NoMethod(*s) 4640 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4641} 4642 4643// UserPosixAccount: JSON template for a POSIX account entry. 4644type UserPosixAccount struct { 4645 // AccountId: A POSIX account field identifier. 4646 AccountId string `json:"accountId,omitempty"` 4647 4648 // Gecos: The GECOS (user information) for this account. 4649 Gecos string `json:"gecos,omitempty"` 4650 4651 // Gid: The default group ID. 4652 Gid uint64 `json:"gid,omitempty,string"` 4653 4654 // HomeDirectory: The path to the home directory for this account. 4655 HomeDirectory string `json:"homeDirectory,omitempty"` 4656 4657 // OperatingSystemType: The operating system type for this account. 4658 OperatingSystemType string `json:"operatingSystemType,omitempty"` 4659 4660 // Primary: If this is user's primary account within the SystemId. 4661 Primary bool `json:"primary,omitempty"` 4662 4663 // Shell: The path to the login shell for this account. 4664 Shell string `json:"shell,omitempty"` 4665 4666 // SystemId: System identifier for which account Username or Uid apply 4667 // to. 4668 SystemId string `json:"systemId,omitempty"` 4669 4670 // Uid: The POSIX compliant user ID. 4671 Uid uint64 `json:"uid,omitempty,string"` 4672 4673 // Username: The username of the account. 4674 Username string `json:"username,omitempty"` 4675 4676 // ForceSendFields is a list of field names (e.g. "AccountId") to 4677 // unconditionally include in API requests. By default, fields with 4678 // empty values are omitted from API requests. However, any non-pointer, 4679 // non-interface field appearing in ForceSendFields will be sent to the 4680 // server regardless of whether the field is empty or not. This may be 4681 // used to include empty fields in Patch requests. 4682 ForceSendFields []string `json:"-"` 4683 4684 // NullFields is a list of field names (e.g. "AccountId") to include in 4685 // API requests with the JSON null value. By default, fields with empty 4686 // values are omitted from API requests. However, any field with an 4687 // empty value appearing in NullFields will be sent to the server as 4688 // null. It is an error if a field in this list has a non-empty value. 4689 // This may be used to include null fields in Patch requests. 4690 NullFields []string `json:"-"` 4691} 4692 4693func (s *UserPosixAccount) MarshalJSON() ([]byte, error) { 4694 type NoMethod UserPosixAccount 4695 raw := NoMethod(*s) 4696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4697} 4698 4699// UserRelation: JSON template for a relation entry. 4700type UserRelation struct { 4701 // CustomType: Custom Type. 4702 CustomType string `json:"customType,omitempty"` 4703 4704 // Type: The relation of the user. Some of the possible values are 4705 // mother father sister brother manager assistant partner. 4706 Type string `json:"type,omitempty"` 4707 4708 // Value: The name of the relation. 4709 Value string `json:"value,omitempty"` 4710 4711 // ForceSendFields is a list of field names (e.g. "CustomType") to 4712 // unconditionally include in API requests. By default, fields with 4713 // empty values are omitted from API requests. However, any non-pointer, 4714 // non-interface field appearing in ForceSendFields will be sent to the 4715 // server regardless of whether the field is empty or not. This may be 4716 // used to include empty fields in Patch requests. 4717 ForceSendFields []string `json:"-"` 4718 4719 // NullFields is a list of field names (e.g. "CustomType") to include in 4720 // API requests with the JSON null value. By default, fields with empty 4721 // values are omitted from API requests. However, any field with an 4722 // empty value appearing in NullFields will be sent to the server as 4723 // null. It is an error if a field in this list has a non-empty value. 4724 // This may be used to include null fields in Patch requests. 4725 NullFields []string `json:"-"` 4726} 4727 4728func (s *UserRelation) MarshalJSON() ([]byte, error) { 4729 type NoMethod UserRelation 4730 raw := NoMethod(*s) 4731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4732} 4733 4734// UserSshPublicKey: JSON template for a POSIX account entry. 4735type UserSshPublicKey struct { 4736 // ExpirationTimeUsec: An expiration time in microseconds since epoch. 4737 ExpirationTimeUsec int64 `json:"expirationTimeUsec,omitempty,string"` 4738 4739 // Fingerprint: A SHA-256 fingerprint of the SSH public key. (Read-only) 4740 Fingerprint string `json:"fingerprint,omitempty"` 4741 4742 // Key: An SSH public key. 4743 Key string `json:"key,omitempty"` 4744 4745 // ForceSendFields is a list of field names (e.g. "ExpirationTimeUsec") 4746 // to unconditionally include in API requests. By default, fields with 4747 // empty values are omitted from API requests. However, any non-pointer, 4748 // non-interface field appearing in ForceSendFields will be sent to the 4749 // server regardless of whether the field is empty or not. This may be 4750 // used to include empty fields in Patch requests. 4751 ForceSendFields []string `json:"-"` 4752 4753 // NullFields is a list of field names (e.g. "ExpirationTimeUsec") to 4754 // include in API requests with the JSON null value. By default, fields 4755 // with empty values are omitted from API requests. However, any field 4756 // with an empty value appearing in NullFields will be sent to the 4757 // server as null. It is an error if a field in this list has a 4758 // non-empty value. This may be used to include null fields in Patch 4759 // requests. 4760 NullFields []string `json:"-"` 4761} 4762 4763func (s *UserSshPublicKey) MarshalJSON() ([]byte, error) { 4764 type NoMethod UserSshPublicKey 4765 raw := NoMethod(*s) 4766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4767} 4768 4769type UserUndelete struct { 4770 // OrgUnitPath: OrgUnit of User 4771 OrgUnitPath string `json:"orgUnitPath,omitempty"` 4772 4773 // ForceSendFields is a list of field names (e.g. "OrgUnitPath") to 4774 // unconditionally include in API requests. By default, fields with 4775 // empty values are omitted from API requests. However, any non-pointer, 4776 // non-interface field appearing in ForceSendFields will be sent to the 4777 // server regardless of whether the field is empty or not. This may be 4778 // used to include empty fields in Patch requests. 4779 ForceSendFields []string `json:"-"` 4780 4781 // NullFields is a list of field names (e.g. "OrgUnitPath") to include 4782 // in API requests with the JSON null value. By default, fields with 4783 // empty values are omitted from API requests. However, any field with 4784 // an empty value appearing in NullFields will be sent to the server as 4785 // null. It is an error if a field in this list has a non-empty value. 4786 // This may be used to include null fields in Patch requests. 4787 NullFields []string `json:"-"` 4788} 4789 4790func (s *UserUndelete) MarshalJSON() ([]byte, error) { 4791 type NoMethod UserUndelete 4792 raw := NoMethod(*s) 4793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4794} 4795 4796// UserWebsite: JSON template for a website entry. 4797type UserWebsite struct { 4798 // CustomType: Custom Type. 4799 CustomType string `json:"customType,omitempty"` 4800 4801 // Primary: If this is user's primary website or not. 4802 Primary bool `json:"primary,omitempty"` 4803 4804 // Type: Each entry can have a type which indicates standard types of 4805 // that entry. For example website could be of home work blog etc. In 4806 // addition to the standard type an entry can have a custom type and can 4807 // give it any name. Such types should have the CUSTOM value as type and 4808 // also have a customType value. 4809 Type string `json:"type,omitempty"` 4810 4811 // Value: Website. 4812 Value string `json:"value,omitempty"` 4813 4814 // ForceSendFields is a list of field names (e.g. "CustomType") to 4815 // unconditionally include in API requests. By default, fields with 4816 // empty values are omitted from API requests. However, any non-pointer, 4817 // non-interface field appearing in ForceSendFields will be sent to the 4818 // server regardless of whether the field is empty or not. This may be 4819 // used to include empty fields in Patch requests. 4820 ForceSendFields []string `json:"-"` 4821 4822 // NullFields is a list of field names (e.g. "CustomType") to include in 4823 // API requests with the JSON null value. By default, fields with empty 4824 // values are omitted from API requests. However, any field with an 4825 // empty value appearing in NullFields will be sent to the server as 4826 // null. It is an error if a field in this list has a non-empty value. 4827 // This may be used to include null fields in Patch requests. 4828 NullFields []string `json:"-"` 4829} 4830 4831func (s *UserWebsite) MarshalJSON() ([]byte, error) { 4832 type NoMethod UserWebsite 4833 raw := NoMethod(*s) 4834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4835} 4836 4837type Users struct { 4838 // Etag: ETag of the resource. 4839 Etag string `json:"etag,omitempty"` 4840 4841 // Kind: Kind of resource this is. 4842 Kind string `json:"kind,omitempty"` 4843 4844 // NextPageToken: Token used to access next page of this result. 4845 NextPageToken string `json:"nextPageToken,omitempty"` 4846 4847 // TriggerEvent: Event that triggered this response (only used in case 4848 // of Push Response) 4849 TriggerEvent string `json:"trigger_event,omitempty"` 4850 4851 // Users: List of user objects. 4852 Users []*User `json:"users,omitempty"` 4853 4854 // ServerResponse contains the HTTP response code and headers from the 4855 // server. 4856 googleapi.ServerResponse `json:"-"` 4857 4858 // ForceSendFields is a list of field names (e.g. "Etag") to 4859 // unconditionally include in API requests. By default, fields with 4860 // empty values are omitted from API requests. However, any non-pointer, 4861 // non-interface field appearing in ForceSendFields will be sent to the 4862 // server regardless of whether the field is empty or not. This may be 4863 // used to include empty fields in Patch requests. 4864 ForceSendFields []string `json:"-"` 4865 4866 // NullFields is a list of field names (e.g. "Etag") to include in API 4867 // requests with the JSON null value. By default, fields with empty 4868 // values are omitted from API requests. However, any field with an 4869 // empty value appearing in NullFields will be sent to the server as 4870 // null. It is an error if a field in this list has a non-empty value. 4871 // This may be used to include null fields in Patch requests. 4872 NullFields []string `json:"-"` 4873} 4874 4875func (s *Users) MarshalJSON() ([]byte, error) { 4876 type NoMethod Users 4877 raw := NoMethod(*s) 4878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4879} 4880 4881// VerificationCode: The Directory API allows you to view, generate, and 4882// invalidate backup verification codes for a user. 4883type VerificationCode struct { 4884 // Etag: ETag of the resource. 4885 Etag string `json:"etag,omitempty"` 4886 4887 // Kind: The type of the resource. This is always 4888 // `admin#directory#verificationCode`. 4889 Kind string `json:"kind,omitempty"` 4890 4891 // UserId: The obfuscated unique ID of the user. 4892 UserId string `json:"userId,omitempty"` 4893 4894 // VerificationCode: A current verification code for the user. 4895 // Invalidated or used verification codes are not returned as part of 4896 // the result. 4897 VerificationCode string `json:"verificationCode,omitempty"` 4898 4899 // ForceSendFields is a list of field names (e.g. "Etag") to 4900 // unconditionally include in API requests. By default, fields with 4901 // empty values are omitted from API requests. However, any non-pointer, 4902 // non-interface field appearing in ForceSendFields will be sent to the 4903 // server regardless of whether the field is empty or not. This may be 4904 // used to include empty fields in Patch requests. 4905 ForceSendFields []string `json:"-"` 4906 4907 // NullFields is a list of field names (e.g. "Etag") to include in API 4908 // requests with the JSON null value. By default, fields with empty 4909 // values are omitted from API requests. However, any field with an 4910 // empty value appearing in NullFields will be sent to the server as 4911 // null. It is an error if a field in this list has a non-empty value. 4912 // This may be used to include null fields in Patch requests. 4913 NullFields []string `json:"-"` 4914} 4915 4916func (s *VerificationCode) MarshalJSON() ([]byte, error) { 4917 type NoMethod VerificationCode 4918 raw := NoMethod(*s) 4919 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4920} 4921 4922// VerificationCodes: JSON response template for List verification codes 4923// operation in Directory API. 4924type VerificationCodes struct { 4925 // Etag: ETag of the resource. 4926 Etag string `json:"etag,omitempty"` 4927 4928 // Items: A list of verification code resources. 4929 Items []*VerificationCode `json:"items,omitempty"` 4930 4931 // Kind: The type of the resource. This is always 4932 // `admin#directory#verificationCodesList`. 4933 Kind string `json:"kind,omitempty"` 4934 4935 // ServerResponse contains the HTTP response code and headers from the 4936 // server. 4937 googleapi.ServerResponse `json:"-"` 4938 4939 // ForceSendFields is a list of field names (e.g. "Etag") to 4940 // unconditionally include in API requests. By default, fields with 4941 // empty values are omitted from API requests. However, any non-pointer, 4942 // non-interface field appearing in ForceSendFields will be sent to the 4943 // server regardless of whether the field is empty or not. This may be 4944 // used to include empty fields in Patch requests. 4945 ForceSendFields []string `json:"-"` 4946 4947 // NullFields is a list of field names (e.g. "Etag") to include in API 4948 // requests with the JSON null value. By default, fields with empty 4949 // values are omitted from API requests. However, any field with an 4950 // empty value appearing in NullFields will be sent to the server as 4951 // null. It is an error if a field in this list has a non-empty value. 4952 // This may be used to include null fields in Patch requests. 4953 NullFields []string `json:"-"` 4954} 4955 4956func (s *VerificationCodes) MarshalJSON() ([]byte, error) { 4957 type NoMethod VerificationCodes 4958 raw := NoMethod(*s) 4959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4960} 4961 4962// method id "directory.asps.delete": 4963 4964type AspsDeleteCall struct { 4965 s *Service 4966 userKey string 4967 codeId int64 4968 urlParams_ gensupport.URLParams 4969 ctx_ context.Context 4970 header_ http.Header 4971} 4972 4973// Delete: Delete an ASP issued by a user. 4974func (r *AspsService) Delete(userKey string, codeId int64) *AspsDeleteCall { 4975 c := &AspsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4976 c.userKey = userKey 4977 c.codeId = codeId 4978 return c 4979} 4980 4981// Fields allows partial responses to be retrieved. See 4982// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4983// for more information. 4984func (c *AspsDeleteCall) Fields(s ...googleapi.Field) *AspsDeleteCall { 4985 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4986 return c 4987} 4988 4989// Context sets the context to be used in this call's Do method. Any 4990// pending HTTP request will be aborted if the provided context is 4991// canceled. 4992func (c *AspsDeleteCall) Context(ctx context.Context) *AspsDeleteCall { 4993 c.ctx_ = ctx 4994 return c 4995} 4996 4997// Header returns an http.Header that can be modified by the caller to 4998// add HTTP headers to the request. 4999func (c *AspsDeleteCall) Header() http.Header { 5000 if c.header_ == nil { 5001 c.header_ = make(http.Header) 5002 } 5003 return c.header_ 5004} 5005 5006func (c *AspsDeleteCall) doRequest(alt string) (*http.Response, error) { 5007 reqHeaders := make(http.Header) 5008 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5009 for k, v := range c.header_ { 5010 reqHeaders[k] = v 5011 } 5012 reqHeaders.Set("User-Agent", c.s.userAgent()) 5013 var body io.Reader = nil 5014 c.urlParams_.Set("alt", alt) 5015 c.urlParams_.Set("prettyPrint", "false") 5016 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") 5017 urls += "?" + c.urlParams_.Encode() 5018 req, err := http.NewRequest("DELETE", urls, body) 5019 if err != nil { 5020 return nil, err 5021 } 5022 req.Header = reqHeaders 5023 googleapi.Expand(req.URL, map[string]string{ 5024 "userKey": c.userKey, 5025 "codeId": strconv.FormatInt(c.codeId, 10), 5026 }) 5027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5028} 5029 5030// Do executes the "directory.asps.delete" call. 5031func (c *AspsDeleteCall) Do(opts ...googleapi.CallOption) error { 5032 gensupport.SetOptions(c.urlParams_, opts...) 5033 res, err := c.doRequest("json") 5034 if err != nil { 5035 return err 5036 } 5037 defer googleapi.CloseBody(res) 5038 if err := googleapi.CheckResponse(res); err != nil { 5039 return err 5040 } 5041 return nil 5042 // { 5043 // "description": "Delete an ASP issued by a user.", 5044 // "flatPath": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5045 // "httpMethod": "DELETE", 5046 // "id": "directory.asps.delete", 5047 // "parameterOrder": [ 5048 // "userKey", 5049 // "codeId" 5050 // ], 5051 // "parameters": { 5052 // "codeId": { 5053 // "description": "The unique ID of the ASP to be deleted.", 5054 // "format": "int32", 5055 // "location": "path", 5056 // "required": true, 5057 // "type": "integer" 5058 // }, 5059 // "userKey": { 5060 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 5061 // "location": "path", 5062 // "required": true, 5063 // "type": "string" 5064 // } 5065 // }, 5066 // "path": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5067 // "scopes": [ 5068 // "https://www.googleapis.com/auth/admin.directory.user.security" 5069 // ] 5070 // } 5071 5072} 5073 5074// method id "directory.asps.get": 5075 5076type AspsGetCall struct { 5077 s *Service 5078 userKey string 5079 codeId int64 5080 urlParams_ gensupport.URLParams 5081 ifNoneMatch_ string 5082 ctx_ context.Context 5083 header_ http.Header 5084} 5085 5086// Get: Get information about an ASP issued by a user. 5087func (r *AspsService) Get(userKey string, codeId int64) *AspsGetCall { 5088 c := &AspsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5089 c.userKey = userKey 5090 c.codeId = codeId 5091 return c 5092} 5093 5094// Fields allows partial responses to be retrieved. See 5095// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5096// for more information. 5097func (c *AspsGetCall) Fields(s ...googleapi.Field) *AspsGetCall { 5098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5099 return c 5100} 5101 5102// IfNoneMatch sets the optional parameter which makes the operation 5103// fail if the object's ETag matches the given value. This is useful for 5104// getting updates only after the object has changed since the last 5105// request. Use googleapi.IsNotModified to check whether the response 5106// error from Do is the result of In-None-Match. 5107func (c *AspsGetCall) IfNoneMatch(entityTag string) *AspsGetCall { 5108 c.ifNoneMatch_ = entityTag 5109 return c 5110} 5111 5112// Context sets the context to be used in this call's Do method. Any 5113// pending HTTP request will be aborted if the provided context is 5114// canceled. 5115func (c *AspsGetCall) Context(ctx context.Context) *AspsGetCall { 5116 c.ctx_ = ctx 5117 return c 5118} 5119 5120// Header returns an http.Header that can be modified by the caller to 5121// add HTTP headers to the request. 5122func (c *AspsGetCall) Header() http.Header { 5123 if c.header_ == nil { 5124 c.header_ = make(http.Header) 5125 } 5126 return c.header_ 5127} 5128 5129func (c *AspsGetCall) doRequest(alt string) (*http.Response, error) { 5130 reqHeaders := make(http.Header) 5131 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5132 for k, v := range c.header_ { 5133 reqHeaders[k] = v 5134 } 5135 reqHeaders.Set("User-Agent", c.s.userAgent()) 5136 if c.ifNoneMatch_ != "" { 5137 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5138 } 5139 var body io.Reader = nil 5140 c.urlParams_.Set("alt", alt) 5141 c.urlParams_.Set("prettyPrint", "false") 5142 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") 5143 urls += "?" + c.urlParams_.Encode() 5144 req, err := http.NewRequest("GET", urls, body) 5145 if err != nil { 5146 return nil, err 5147 } 5148 req.Header = reqHeaders 5149 googleapi.Expand(req.URL, map[string]string{ 5150 "userKey": c.userKey, 5151 "codeId": strconv.FormatInt(c.codeId, 10), 5152 }) 5153 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5154} 5155 5156// Do executes the "directory.asps.get" call. 5157// Exactly one of *Asp or error will be non-nil. Any non-2xx status code 5158// is an error. Response headers are in either 5159// *Asp.ServerResponse.Header or (if a response was returned at all) in 5160// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5161// whether the returned error was because http.StatusNotModified was 5162// returned. 5163func (c *AspsGetCall) Do(opts ...googleapi.CallOption) (*Asp, error) { 5164 gensupport.SetOptions(c.urlParams_, opts...) 5165 res, err := c.doRequest("json") 5166 if res != nil && res.StatusCode == http.StatusNotModified { 5167 if res.Body != nil { 5168 res.Body.Close() 5169 } 5170 return nil, &googleapi.Error{ 5171 Code: res.StatusCode, 5172 Header: res.Header, 5173 } 5174 } 5175 if err != nil { 5176 return nil, err 5177 } 5178 defer googleapi.CloseBody(res) 5179 if err := googleapi.CheckResponse(res); err != nil { 5180 return nil, err 5181 } 5182 ret := &Asp{ 5183 ServerResponse: googleapi.ServerResponse{ 5184 Header: res.Header, 5185 HTTPStatusCode: res.StatusCode, 5186 }, 5187 } 5188 target := &ret 5189 if err := gensupport.DecodeResponse(target, res); err != nil { 5190 return nil, err 5191 } 5192 return ret, nil 5193 // { 5194 // "description": "Get information about an ASP issued by a user.", 5195 // "flatPath": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5196 // "httpMethod": "GET", 5197 // "id": "directory.asps.get", 5198 // "parameterOrder": [ 5199 // "userKey", 5200 // "codeId" 5201 // ], 5202 // "parameters": { 5203 // "codeId": { 5204 // "description": "The unique ID of the ASP.", 5205 // "format": "int32", 5206 // "location": "path", 5207 // "required": true, 5208 // "type": "integer" 5209 // }, 5210 // "userKey": { 5211 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 5212 // "location": "path", 5213 // "required": true, 5214 // "type": "string" 5215 // } 5216 // }, 5217 // "path": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5218 // "response": { 5219 // "$ref": "Asp" 5220 // }, 5221 // "scopes": [ 5222 // "https://www.googleapis.com/auth/admin.directory.user.security" 5223 // ] 5224 // } 5225 5226} 5227 5228// method id "directory.asps.list": 5229 5230type AspsListCall struct { 5231 s *Service 5232 userKey string 5233 urlParams_ gensupport.URLParams 5234 ifNoneMatch_ string 5235 ctx_ context.Context 5236 header_ http.Header 5237} 5238 5239// List: List the ASPs issued by a user. 5240func (r *AspsService) List(userKey string) *AspsListCall { 5241 c := &AspsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5242 c.userKey = userKey 5243 return c 5244} 5245 5246// Fields allows partial responses to be retrieved. See 5247// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5248// for more information. 5249func (c *AspsListCall) Fields(s ...googleapi.Field) *AspsListCall { 5250 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5251 return c 5252} 5253 5254// IfNoneMatch sets the optional parameter which makes the operation 5255// fail if the object's ETag matches the given value. This is useful for 5256// getting updates only after the object has changed since the last 5257// request. Use googleapi.IsNotModified to check whether the response 5258// error from Do is the result of In-None-Match. 5259func (c *AspsListCall) IfNoneMatch(entityTag string) *AspsListCall { 5260 c.ifNoneMatch_ = entityTag 5261 return c 5262} 5263 5264// Context sets the context to be used in this call's Do method. Any 5265// pending HTTP request will be aborted if the provided context is 5266// canceled. 5267func (c *AspsListCall) Context(ctx context.Context) *AspsListCall { 5268 c.ctx_ = ctx 5269 return c 5270} 5271 5272// Header returns an http.Header that can be modified by the caller to 5273// add HTTP headers to the request. 5274func (c *AspsListCall) Header() http.Header { 5275 if c.header_ == nil { 5276 c.header_ = make(http.Header) 5277 } 5278 return c.header_ 5279} 5280 5281func (c *AspsListCall) doRequest(alt string) (*http.Response, error) { 5282 reqHeaders := make(http.Header) 5283 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5284 for k, v := range c.header_ { 5285 reqHeaders[k] = v 5286 } 5287 reqHeaders.Set("User-Agent", c.s.userAgent()) 5288 if c.ifNoneMatch_ != "" { 5289 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5290 } 5291 var body io.Reader = nil 5292 c.urlParams_.Set("alt", alt) 5293 c.urlParams_.Set("prettyPrint", "false") 5294 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps") 5295 urls += "?" + c.urlParams_.Encode() 5296 req, err := http.NewRequest("GET", urls, body) 5297 if err != nil { 5298 return nil, err 5299 } 5300 req.Header = reqHeaders 5301 googleapi.Expand(req.URL, map[string]string{ 5302 "userKey": c.userKey, 5303 }) 5304 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5305} 5306 5307// Do executes the "directory.asps.list" call. 5308// Exactly one of *Asps or error will be non-nil. Any non-2xx status 5309// code is an error. Response headers are in either 5310// *Asps.ServerResponse.Header or (if a response was returned at all) in 5311// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5312// whether the returned error was because http.StatusNotModified was 5313// returned. 5314func (c *AspsListCall) Do(opts ...googleapi.CallOption) (*Asps, error) { 5315 gensupport.SetOptions(c.urlParams_, opts...) 5316 res, err := c.doRequest("json") 5317 if res != nil && res.StatusCode == http.StatusNotModified { 5318 if res.Body != nil { 5319 res.Body.Close() 5320 } 5321 return nil, &googleapi.Error{ 5322 Code: res.StatusCode, 5323 Header: res.Header, 5324 } 5325 } 5326 if err != nil { 5327 return nil, err 5328 } 5329 defer googleapi.CloseBody(res) 5330 if err := googleapi.CheckResponse(res); err != nil { 5331 return nil, err 5332 } 5333 ret := &Asps{ 5334 ServerResponse: googleapi.ServerResponse{ 5335 Header: res.Header, 5336 HTTPStatusCode: res.StatusCode, 5337 }, 5338 } 5339 target := &ret 5340 if err := gensupport.DecodeResponse(target, res); err != nil { 5341 return nil, err 5342 } 5343 return ret, nil 5344 // { 5345 // "description": "List the ASPs issued by a user.", 5346 // "flatPath": "admin/directory/v1/users/{userKey}/asps", 5347 // "httpMethod": "GET", 5348 // "id": "directory.asps.list", 5349 // "parameterOrder": [ 5350 // "userKey" 5351 // ], 5352 // "parameters": { 5353 // "userKey": { 5354 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 5355 // "location": "path", 5356 // "required": true, 5357 // "type": "string" 5358 // } 5359 // }, 5360 // "path": "admin/directory/v1/users/{userKey}/asps", 5361 // "response": { 5362 // "$ref": "Asps" 5363 // }, 5364 // "scopes": [ 5365 // "https://www.googleapis.com/auth/admin.directory.user.security" 5366 // ] 5367 // } 5368 5369} 5370 5371// method id "admin.channels.stop": 5372 5373type ChannelsStopCall struct { 5374 s *Service 5375 channel *Channel 5376 urlParams_ gensupport.URLParams 5377 ctx_ context.Context 5378 header_ http.Header 5379} 5380 5381// Stop: Stop watching resources through this channel. 5382func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 5383 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5384 c.channel = channel 5385 return c 5386} 5387 5388// Fields allows partial responses to be retrieved. See 5389// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5390// for more information. 5391func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 5392 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5393 return c 5394} 5395 5396// Context sets the context to be used in this call's Do method. Any 5397// pending HTTP request will be aborted if the provided context is 5398// canceled. 5399func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 5400 c.ctx_ = ctx 5401 return c 5402} 5403 5404// Header returns an http.Header that can be modified by the caller to 5405// add HTTP headers to the request. 5406func (c *ChannelsStopCall) Header() http.Header { 5407 if c.header_ == nil { 5408 c.header_ = make(http.Header) 5409 } 5410 return c.header_ 5411} 5412 5413func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 5414 reqHeaders := make(http.Header) 5415 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5416 for k, v := range c.header_ { 5417 reqHeaders[k] = v 5418 } 5419 reqHeaders.Set("User-Agent", c.s.userAgent()) 5420 var body io.Reader = nil 5421 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 5422 if err != nil { 5423 return nil, err 5424 } 5425 reqHeaders.Set("Content-Type", "application/json") 5426 c.urlParams_.Set("alt", alt) 5427 c.urlParams_.Set("prettyPrint", "false") 5428 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory_v1/channels/stop") 5429 urls += "?" + c.urlParams_.Encode() 5430 req, err := http.NewRequest("POST", urls, body) 5431 if err != nil { 5432 return nil, err 5433 } 5434 req.Header = reqHeaders 5435 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5436} 5437 5438// Do executes the "admin.channels.stop" call. 5439func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 5440 gensupport.SetOptions(c.urlParams_, opts...) 5441 res, err := c.doRequest("json") 5442 if err != nil { 5443 return err 5444 } 5445 defer googleapi.CloseBody(res) 5446 if err := googleapi.CheckResponse(res); err != nil { 5447 return err 5448 } 5449 return nil 5450 // { 5451 // "description": "Stop watching resources through this channel.", 5452 // "flatPath": "admin/directory_v1/channels/stop", 5453 // "httpMethod": "POST", 5454 // "id": "admin.channels.stop", 5455 // "parameterOrder": [], 5456 // "parameters": {}, 5457 // "path": "admin/directory_v1/channels/stop", 5458 // "request": { 5459 // "$ref": "Channel" 5460 // }, 5461 // "scopes": [ 5462 // "https://www.googleapis.com/auth/admin.directory.user", 5463 // "https://www.googleapis.com/auth/admin.directory.user.alias", 5464 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 5465 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 5466 // "https://www.googleapis.com/auth/cloud-platform" 5467 // ] 5468 // } 5469 5470} 5471 5472// method id "directory.chromeosdevices.action": 5473 5474type ChromeosdevicesActionCall struct { 5475 s *Service 5476 customerId string 5477 resourceId string 5478 chromeosdeviceaction *ChromeOsDeviceAction 5479 urlParams_ gensupport.URLParams 5480 ctx_ context.Context 5481 header_ http.Header 5482} 5483 5484// Action: Takes an action that affects a Chrome OS Device. This 5485// includes deprovisioning, disabling, and re-enabling devices. 5486// *Warning:* * Deprovisioning a device will stop device policy syncing 5487// and remove device-level printers. After a device is deprovisioned, it 5488// must be wiped before it can be re-enrolled. * Lost or stolen devices 5489// should use the disable action. * Re-enabling a disabled device will 5490// consume a device license. If you do not have sufficient licenses 5491// available when completing the re-enable action, you will receive an 5492// error. For more information about deprovisioning and disabling 5493// devices, visit the [help 5494// center](https://support.google.com/chrome/a/answer/3523633). 5495func (r *ChromeosdevicesService) Action(customerId string, resourceId string, chromeosdeviceaction *ChromeOsDeviceAction) *ChromeosdevicesActionCall { 5496 c := &ChromeosdevicesActionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5497 c.customerId = customerId 5498 c.resourceId = resourceId 5499 c.chromeosdeviceaction = chromeosdeviceaction 5500 return c 5501} 5502 5503// Fields allows partial responses to be retrieved. See 5504// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5505// for more information. 5506func (c *ChromeosdevicesActionCall) Fields(s ...googleapi.Field) *ChromeosdevicesActionCall { 5507 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5508 return c 5509} 5510 5511// Context sets the context to be used in this call's Do method. Any 5512// pending HTTP request will be aborted if the provided context is 5513// canceled. 5514func (c *ChromeosdevicesActionCall) Context(ctx context.Context) *ChromeosdevicesActionCall { 5515 c.ctx_ = ctx 5516 return c 5517} 5518 5519// Header returns an http.Header that can be modified by the caller to 5520// add HTTP headers to the request. 5521func (c *ChromeosdevicesActionCall) Header() http.Header { 5522 if c.header_ == nil { 5523 c.header_ = make(http.Header) 5524 } 5525 return c.header_ 5526} 5527 5528func (c *ChromeosdevicesActionCall) doRequest(alt string) (*http.Response, error) { 5529 reqHeaders := make(http.Header) 5530 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5531 for k, v := range c.header_ { 5532 reqHeaders[k] = v 5533 } 5534 reqHeaders.Set("User-Agent", c.s.userAgent()) 5535 var body io.Reader = nil 5536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdeviceaction) 5537 if err != nil { 5538 return nil, err 5539 } 5540 reqHeaders.Set("Content-Type", "application/json") 5541 c.urlParams_.Set("alt", alt) 5542 c.urlParams_.Set("prettyPrint", "false") 5543 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action") 5544 urls += "?" + c.urlParams_.Encode() 5545 req, err := http.NewRequest("POST", urls, body) 5546 if err != nil { 5547 return nil, err 5548 } 5549 req.Header = reqHeaders 5550 googleapi.Expand(req.URL, map[string]string{ 5551 "customerId": c.customerId, 5552 "resourceId": c.resourceId, 5553 }) 5554 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5555} 5556 5557// Do executes the "directory.chromeosdevices.action" call. 5558func (c *ChromeosdevicesActionCall) Do(opts ...googleapi.CallOption) error { 5559 gensupport.SetOptions(c.urlParams_, opts...) 5560 res, err := c.doRequest("json") 5561 if err != nil { 5562 return err 5563 } 5564 defer googleapi.CloseBody(res) 5565 if err := googleapi.CheckResponse(res); err != nil { 5566 return err 5567 } 5568 return nil 5569 // { 5570 // "description": "Takes an action that affects a Chrome OS Device. This includes deprovisioning, disabling, and re-enabling devices. *Warning:* * Deprovisioning a device will stop device policy syncing and remove device-level printers. After a device is deprovisioned, it must be wiped before it can be re-enrolled. * Lost or stolen devices should use the disable action. * Re-enabling a disabled device will consume a device license. If you do not have sufficient licenses available when completing the re-enable action, you will receive an error. For more information about deprovisioning and disabling devices, visit the [help center](https://support.google.com/chrome/a/answer/3523633).", 5571 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action", 5572 // "httpMethod": "POST", 5573 // "id": "directory.chromeosdevices.action", 5574 // "parameterOrder": [ 5575 // "customerId", 5576 // "resourceId" 5577 // ], 5578 // "parameters": { 5579 // "customerId": { 5580 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 5581 // "location": "path", 5582 // "required": true, 5583 // "type": "string" 5584 // }, 5585 // "resourceId": { 5586 // "description": "The unique ID of the device. The `resourceId`s are returned in the response from the [chromeosdevices.list](/admin-sdk/directory/v1/reference/chromeosdevices/list) method.", 5587 // "location": "path", 5588 // "required": true, 5589 // "type": "string" 5590 // } 5591 // }, 5592 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action", 5593 // "request": { 5594 // "$ref": "ChromeOsDeviceAction" 5595 // }, 5596 // "scopes": [ 5597 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 5598 // ] 5599 // } 5600 5601} 5602 5603// method id "directory.chromeosdevices.get": 5604 5605type ChromeosdevicesGetCall struct { 5606 s *Service 5607 customerId string 5608 deviceId string 5609 urlParams_ gensupport.URLParams 5610 ifNoneMatch_ string 5611 ctx_ context.Context 5612 header_ http.Header 5613} 5614 5615// Get: Retrieves a Chrome OS device's properties. 5616func (r *ChromeosdevicesService) Get(customerId string, deviceId string) *ChromeosdevicesGetCall { 5617 c := &ChromeosdevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5618 c.customerId = customerId 5619 c.deviceId = deviceId 5620 return c 5621} 5622 5623// Projection sets the optional parameter "projection": Determines 5624// whether the response contains the full list of properties or only a 5625// subset. 5626// 5627// Possible values: 5628// "PROJECTION_UNDEFINED" 5629// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 5630// serialNumber, status, and user) 5631// "FULL" - Includes all metadata fields 5632func (c *ChromeosdevicesGetCall) Projection(projection string) *ChromeosdevicesGetCall { 5633 c.urlParams_.Set("projection", projection) 5634 return c 5635} 5636 5637// Fields allows partial responses to be retrieved. See 5638// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5639// for more information. 5640func (c *ChromeosdevicesGetCall) Fields(s ...googleapi.Field) *ChromeosdevicesGetCall { 5641 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5642 return c 5643} 5644 5645// IfNoneMatch sets the optional parameter which makes the operation 5646// fail if the object's ETag matches the given value. This is useful for 5647// getting updates only after the object has changed since the last 5648// request. Use googleapi.IsNotModified to check whether the response 5649// error from Do is the result of In-None-Match. 5650func (c *ChromeosdevicesGetCall) IfNoneMatch(entityTag string) *ChromeosdevicesGetCall { 5651 c.ifNoneMatch_ = entityTag 5652 return c 5653} 5654 5655// Context sets the context to be used in this call's Do method. Any 5656// pending HTTP request will be aborted if the provided context is 5657// canceled. 5658func (c *ChromeosdevicesGetCall) Context(ctx context.Context) *ChromeosdevicesGetCall { 5659 c.ctx_ = ctx 5660 return c 5661} 5662 5663// Header returns an http.Header that can be modified by the caller to 5664// add HTTP headers to the request. 5665func (c *ChromeosdevicesGetCall) Header() http.Header { 5666 if c.header_ == nil { 5667 c.header_ = make(http.Header) 5668 } 5669 return c.header_ 5670} 5671 5672func (c *ChromeosdevicesGetCall) doRequest(alt string) (*http.Response, error) { 5673 reqHeaders := make(http.Header) 5674 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5675 for k, v := range c.header_ { 5676 reqHeaders[k] = v 5677 } 5678 reqHeaders.Set("User-Agent", c.s.userAgent()) 5679 if c.ifNoneMatch_ != "" { 5680 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5681 } 5682 var body io.Reader = nil 5683 c.urlParams_.Set("alt", alt) 5684 c.urlParams_.Set("prettyPrint", "false") 5685 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 5686 urls += "?" + c.urlParams_.Encode() 5687 req, err := http.NewRequest("GET", urls, body) 5688 if err != nil { 5689 return nil, err 5690 } 5691 req.Header = reqHeaders 5692 googleapi.Expand(req.URL, map[string]string{ 5693 "customerId": c.customerId, 5694 "deviceId": c.deviceId, 5695 }) 5696 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5697} 5698 5699// Do executes the "directory.chromeosdevices.get" call. 5700// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 5701// status code is an error. Response headers are in either 5702// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 5703// at all) in error.(*googleapi.Error).Header. Use 5704// googleapi.IsNotModified to check whether the returned error was 5705// because http.StatusNotModified was returned. 5706func (c *ChromeosdevicesGetCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 5707 gensupport.SetOptions(c.urlParams_, opts...) 5708 res, err := c.doRequest("json") 5709 if res != nil && res.StatusCode == http.StatusNotModified { 5710 if res.Body != nil { 5711 res.Body.Close() 5712 } 5713 return nil, &googleapi.Error{ 5714 Code: res.StatusCode, 5715 Header: res.Header, 5716 } 5717 } 5718 if err != nil { 5719 return nil, err 5720 } 5721 defer googleapi.CloseBody(res) 5722 if err := googleapi.CheckResponse(res); err != nil { 5723 return nil, err 5724 } 5725 ret := &ChromeOsDevice{ 5726 ServerResponse: googleapi.ServerResponse{ 5727 Header: res.Header, 5728 HTTPStatusCode: res.StatusCode, 5729 }, 5730 } 5731 target := &ret 5732 if err := gensupport.DecodeResponse(target, res); err != nil { 5733 return nil, err 5734 } 5735 return ret, nil 5736 // { 5737 // "description": "Retrieves a Chrome OS device's properties.", 5738 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 5739 // "httpMethod": "GET", 5740 // "id": "directory.chromeosdevices.get", 5741 // "parameterOrder": [ 5742 // "customerId", 5743 // "deviceId" 5744 // ], 5745 // "parameters": { 5746 // "customerId": { 5747 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 5748 // "location": "path", 5749 // "required": true, 5750 // "type": "string" 5751 // }, 5752 // "deviceId": { 5753 // "description": "The unique ID of the device. The `deviceId`s are returned in the response from the [chromeosdevices.list](/admin-sdk/directory/v1/reference/chromeosdevices/list) method.", 5754 // "location": "path", 5755 // "required": true, 5756 // "type": "string" 5757 // }, 5758 // "projection": { 5759 // "description": "Determines whether the response contains the full list of properties or only a subset.", 5760 // "enum": [ 5761 // "PROJECTION_UNDEFINED", 5762 // "BASIC", 5763 // "FULL" 5764 // ], 5765 // "enumDescriptions": [ 5766 // "", 5767 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 5768 // "Includes all metadata fields" 5769 // ], 5770 // "location": "query", 5771 // "type": "string" 5772 // } 5773 // }, 5774 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 5775 // "response": { 5776 // "$ref": "ChromeOsDevice" 5777 // }, 5778 // "scopes": [ 5779 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 5780 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 5781 // ] 5782 // } 5783 5784} 5785 5786// method id "directory.chromeosdevices.list": 5787 5788type ChromeosdevicesListCall struct { 5789 s *Service 5790 customerId string 5791 urlParams_ gensupport.URLParams 5792 ifNoneMatch_ string 5793 ctx_ context.Context 5794 header_ http.Header 5795} 5796 5797// List: Retrieves a paginated list of Chrome OS devices within an 5798// account. 5799func (r *ChromeosdevicesService) List(customerId string) *ChromeosdevicesListCall { 5800 c := &ChromeosdevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5801 c.customerId = customerId 5802 return c 5803} 5804 5805// MaxResults sets the optional parameter "maxResults": Maximum number 5806// of results to return. 5807func (c *ChromeosdevicesListCall) MaxResults(maxResults int64) *ChromeosdevicesListCall { 5808 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5809 return c 5810} 5811 5812// OrderBy sets the optional parameter "orderBy": Device property to use 5813// for sorting results. 5814// 5815// Possible values: 5816// "orderByUndefined" 5817// "annotatedLocation" - Chrome device location as annotated by the 5818// administrator. 5819// "annotatedUser" - Chromebook user as annotated by administrator. 5820// "lastSync" - The date and time the Chrome device was last 5821// synchronized with the policy settings in the Admin console. 5822// "notes" - Chrome device notes as annotated by the administrator. 5823// "serialNumber" - The Chrome device serial number entered when the 5824// device was enabled. 5825// "status" - Chrome device status. For more information, see the <a 5826// [chromeosdevices](/admin-sdk/directory/v1/reference/chromeosdevices.ht 5827// ml). 5828// "supportEndDate" - Chrome device support end date. This is 5829// applicable only for devices purchased directly from Google. 5830func (c *ChromeosdevicesListCall) OrderBy(orderBy string) *ChromeosdevicesListCall { 5831 c.urlParams_.Set("orderBy", orderBy) 5832 return c 5833} 5834 5835// OrgUnitPath sets the optional parameter "orgUnitPath": The full path 5836// of the organizational unit or its unique ID. 5837func (c *ChromeosdevicesListCall) OrgUnitPath(orgUnitPath string) *ChromeosdevicesListCall { 5838 c.urlParams_.Set("orgUnitPath", orgUnitPath) 5839 return c 5840} 5841 5842// PageToken sets the optional parameter "pageToken": The `pageToken` 5843// query parameter is used to request the next page of query results. 5844// The follow-on request's `pageToken` query parameter is the 5845// `nextPageToken` from your previous response. 5846func (c *ChromeosdevicesListCall) PageToken(pageToken string) *ChromeosdevicesListCall { 5847 c.urlParams_.Set("pageToken", pageToken) 5848 return c 5849} 5850 5851// Projection sets the optional parameter "projection": Restrict 5852// information returned to a set of selected fields. 5853// 5854// Possible values: 5855// "PROJECTION_UNDEFINED" 5856// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 5857// serialNumber, status, and user) 5858// "FULL" - Includes all metadata fields 5859func (c *ChromeosdevicesListCall) Projection(projection string) *ChromeosdevicesListCall { 5860 c.urlParams_.Set("projection", projection) 5861 return c 5862} 5863 5864// Query sets the optional parameter "query": Search string in the 5865// format given at 5866// http://support.google.com/chromeos/a/bin/answer.py?answer=1698333 5867func (c *ChromeosdevicesListCall) Query(query string) *ChromeosdevicesListCall { 5868 c.urlParams_.Set("query", query) 5869 return c 5870} 5871 5872// SortOrder sets the optional parameter "sortOrder": Whether to return 5873// results in ascending or descending order. Must be used with the 5874// `orderBy` parameter. 5875// 5876// Possible values: 5877// "SORT_ORDER_UNDEFINED" 5878// "ASCENDING" - Ascending order. 5879// "DESCENDING" - Descending order. 5880func (c *ChromeosdevicesListCall) SortOrder(sortOrder string) *ChromeosdevicesListCall { 5881 c.urlParams_.Set("sortOrder", sortOrder) 5882 return c 5883} 5884 5885// Fields allows partial responses to be retrieved. See 5886// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5887// for more information. 5888func (c *ChromeosdevicesListCall) Fields(s ...googleapi.Field) *ChromeosdevicesListCall { 5889 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5890 return c 5891} 5892 5893// IfNoneMatch sets the optional parameter which makes the operation 5894// fail if the object's ETag matches the given value. This is useful for 5895// getting updates only after the object has changed since the last 5896// request. Use googleapi.IsNotModified to check whether the response 5897// error from Do is the result of In-None-Match. 5898func (c *ChromeosdevicesListCall) IfNoneMatch(entityTag string) *ChromeosdevicesListCall { 5899 c.ifNoneMatch_ = entityTag 5900 return c 5901} 5902 5903// Context sets the context to be used in this call's Do method. Any 5904// pending HTTP request will be aborted if the provided context is 5905// canceled. 5906func (c *ChromeosdevicesListCall) Context(ctx context.Context) *ChromeosdevicesListCall { 5907 c.ctx_ = ctx 5908 return c 5909} 5910 5911// Header returns an http.Header that can be modified by the caller to 5912// add HTTP headers to the request. 5913func (c *ChromeosdevicesListCall) Header() http.Header { 5914 if c.header_ == nil { 5915 c.header_ = make(http.Header) 5916 } 5917 return c.header_ 5918} 5919 5920func (c *ChromeosdevicesListCall) doRequest(alt string) (*http.Response, error) { 5921 reqHeaders := make(http.Header) 5922 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5923 for k, v := range c.header_ { 5924 reqHeaders[k] = v 5925 } 5926 reqHeaders.Set("User-Agent", c.s.userAgent()) 5927 if c.ifNoneMatch_ != "" { 5928 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5929 } 5930 var body io.Reader = nil 5931 c.urlParams_.Set("alt", alt) 5932 c.urlParams_.Set("prettyPrint", "false") 5933 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos") 5934 urls += "?" + c.urlParams_.Encode() 5935 req, err := http.NewRequest("GET", urls, body) 5936 if err != nil { 5937 return nil, err 5938 } 5939 req.Header = reqHeaders 5940 googleapi.Expand(req.URL, map[string]string{ 5941 "customerId": c.customerId, 5942 }) 5943 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5944} 5945 5946// Do executes the "directory.chromeosdevices.list" call. 5947// Exactly one of *ChromeOsDevices or error will be non-nil. Any non-2xx 5948// status code is an error. Response headers are in either 5949// *ChromeOsDevices.ServerResponse.Header or (if a response was returned 5950// at all) in error.(*googleapi.Error).Header. Use 5951// googleapi.IsNotModified to check whether the returned error was 5952// because http.StatusNotModified was returned. 5953func (c *ChromeosdevicesListCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevices, error) { 5954 gensupport.SetOptions(c.urlParams_, opts...) 5955 res, err := c.doRequest("json") 5956 if res != nil && res.StatusCode == http.StatusNotModified { 5957 if res.Body != nil { 5958 res.Body.Close() 5959 } 5960 return nil, &googleapi.Error{ 5961 Code: res.StatusCode, 5962 Header: res.Header, 5963 } 5964 } 5965 if err != nil { 5966 return nil, err 5967 } 5968 defer googleapi.CloseBody(res) 5969 if err := googleapi.CheckResponse(res); err != nil { 5970 return nil, err 5971 } 5972 ret := &ChromeOsDevices{ 5973 ServerResponse: googleapi.ServerResponse{ 5974 Header: res.Header, 5975 HTTPStatusCode: res.StatusCode, 5976 }, 5977 } 5978 target := &ret 5979 if err := gensupport.DecodeResponse(target, res); err != nil { 5980 return nil, err 5981 } 5982 return ret, nil 5983 // { 5984 // "description": "Retrieves a paginated list of Chrome OS devices within an account.", 5985 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos", 5986 // "httpMethod": "GET", 5987 // "id": "directory.chromeosdevices.list", 5988 // "parameterOrder": [ 5989 // "customerId" 5990 // ], 5991 // "parameters": { 5992 // "customerId": { 5993 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 5994 // "location": "path", 5995 // "required": true, 5996 // "type": "string" 5997 // }, 5998 // "maxResults": { 5999 // "default": "100", 6000 // "description": "Maximum number of results to return.", 6001 // "format": "int32", 6002 // "location": "query", 6003 // "minimum": "1", 6004 // "type": "integer" 6005 // }, 6006 // "orderBy": { 6007 // "description": "Device property to use for sorting results.", 6008 // "enum": [ 6009 // "orderByUndefined", 6010 // "annotatedLocation", 6011 // "annotatedUser", 6012 // "lastSync", 6013 // "notes", 6014 // "serialNumber", 6015 // "status", 6016 // "supportEndDate" 6017 // ], 6018 // "enumDescriptions": [ 6019 // "", 6020 // "Chrome device location as annotated by the administrator.", 6021 // "Chromebook user as annotated by administrator.", 6022 // "The date and time the Chrome device was last synchronized with the policy settings in the Admin console.", 6023 // "Chrome device notes as annotated by the administrator.", 6024 // "The Chrome device serial number entered when the device was enabled.", 6025 // "Chrome device status. For more information, see the \u003ca [chromeosdevices](/admin-sdk/directory/v1/reference/chromeosdevices.html).", 6026 // "Chrome device support end date. This is applicable only for devices purchased directly from Google." 6027 // ], 6028 // "location": "query", 6029 // "type": "string" 6030 // }, 6031 // "orgUnitPath": { 6032 // "description": "The full path of the organizational unit or its unique ID.", 6033 // "location": "query", 6034 // "type": "string" 6035 // }, 6036 // "pageToken": { 6037 // "description": "The `pageToken` query parameter is used to request the next page of query results. The follow-on request's `pageToken` query parameter is the `nextPageToken` from your previous response.", 6038 // "location": "query", 6039 // "type": "string" 6040 // }, 6041 // "projection": { 6042 // "description": "Restrict information returned to a set of selected fields.", 6043 // "enum": [ 6044 // "PROJECTION_UNDEFINED", 6045 // "BASIC", 6046 // "FULL" 6047 // ], 6048 // "enumDescriptions": [ 6049 // "", 6050 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 6051 // "Includes all metadata fields" 6052 // ], 6053 // "location": "query", 6054 // "type": "string" 6055 // }, 6056 // "query": { 6057 // "description": "Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?answer=1698333", 6058 // "location": "query", 6059 // "type": "string" 6060 // }, 6061 // "sortOrder": { 6062 // "description": "Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter.", 6063 // "enum": [ 6064 // "SORT_ORDER_UNDEFINED", 6065 // "ASCENDING", 6066 // "DESCENDING" 6067 // ], 6068 // "enumDescriptions": [ 6069 // "", 6070 // "Ascending order.", 6071 // "Descending order." 6072 // ], 6073 // "location": "query", 6074 // "type": "string" 6075 // } 6076 // }, 6077 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos", 6078 // "response": { 6079 // "$ref": "ChromeOsDevices" 6080 // }, 6081 // "scopes": [ 6082 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 6083 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 6084 // ] 6085 // } 6086 6087} 6088 6089// Pages invokes f for each page of results. 6090// A non-nil error returned from f will halt the iteration. 6091// The provided context supersedes any context provided to the Context method. 6092func (c *ChromeosdevicesListCall) Pages(ctx context.Context, f func(*ChromeOsDevices) error) error { 6093 c.ctx_ = ctx 6094 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6095 for { 6096 x, err := c.Do() 6097 if err != nil { 6098 return err 6099 } 6100 if err := f(x); err != nil { 6101 return err 6102 } 6103 if x.NextPageToken == "" { 6104 return nil 6105 } 6106 c.PageToken(x.NextPageToken) 6107 } 6108} 6109 6110// method id "directory.chromeosdevices.moveDevicesToOu": 6111 6112type ChromeosdevicesMoveDevicesToOuCall struct { 6113 s *Service 6114 customerId string 6115 chromeosmovedevicestoou *ChromeOsMoveDevicesToOu 6116 urlParams_ gensupport.URLParams 6117 ctx_ context.Context 6118 header_ http.Header 6119} 6120 6121// MoveDevicesToOu: Move or insert multiple Chrome OS devices to an 6122// organizational unit. You can move up to 50 devices at once. 6123func (r *ChromeosdevicesService) MoveDevicesToOu(customerId string, orgUnitPath string, chromeosmovedevicestoou *ChromeOsMoveDevicesToOu) *ChromeosdevicesMoveDevicesToOuCall { 6124 c := &ChromeosdevicesMoveDevicesToOuCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6125 c.customerId = customerId 6126 c.urlParams_.Set("orgUnitPath", orgUnitPath) 6127 c.chromeosmovedevicestoou = chromeosmovedevicestoou 6128 return c 6129} 6130 6131// Fields allows partial responses to be retrieved. See 6132// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6133// for more information. 6134func (c *ChromeosdevicesMoveDevicesToOuCall) Fields(s ...googleapi.Field) *ChromeosdevicesMoveDevicesToOuCall { 6135 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6136 return c 6137} 6138 6139// Context sets the context to be used in this call's Do method. Any 6140// pending HTTP request will be aborted if the provided context is 6141// canceled. 6142func (c *ChromeosdevicesMoveDevicesToOuCall) Context(ctx context.Context) *ChromeosdevicesMoveDevicesToOuCall { 6143 c.ctx_ = ctx 6144 return c 6145} 6146 6147// Header returns an http.Header that can be modified by the caller to 6148// add HTTP headers to the request. 6149func (c *ChromeosdevicesMoveDevicesToOuCall) Header() http.Header { 6150 if c.header_ == nil { 6151 c.header_ = make(http.Header) 6152 } 6153 return c.header_ 6154} 6155 6156func (c *ChromeosdevicesMoveDevicesToOuCall) doRequest(alt string) (*http.Response, error) { 6157 reqHeaders := make(http.Header) 6158 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6159 for k, v := range c.header_ { 6160 reqHeaders[k] = v 6161 } 6162 reqHeaders.Set("User-Agent", c.s.userAgent()) 6163 var body io.Reader = nil 6164 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosmovedevicestoou) 6165 if err != nil { 6166 return nil, err 6167 } 6168 reqHeaders.Set("Content-Type", "application/json") 6169 c.urlParams_.Set("alt", alt) 6170 c.urlParams_.Set("prettyPrint", "false") 6171 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu") 6172 urls += "?" + c.urlParams_.Encode() 6173 req, err := http.NewRequest("POST", urls, body) 6174 if err != nil { 6175 return nil, err 6176 } 6177 req.Header = reqHeaders 6178 googleapi.Expand(req.URL, map[string]string{ 6179 "customerId": c.customerId, 6180 }) 6181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6182} 6183 6184// Do executes the "directory.chromeosdevices.moveDevicesToOu" call. 6185func (c *ChromeosdevicesMoveDevicesToOuCall) Do(opts ...googleapi.CallOption) error { 6186 gensupport.SetOptions(c.urlParams_, opts...) 6187 res, err := c.doRequest("json") 6188 if err != nil { 6189 return err 6190 } 6191 defer googleapi.CloseBody(res) 6192 if err := googleapi.CheckResponse(res); err != nil { 6193 return err 6194 } 6195 return nil 6196 // { 6197 // "description": "Move or insert multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.", 6198 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu", 6199 // "httpMethod": "POST", 6200 // "id": "directory.chromeosdevices.moveDevicesToOu", 6201 // "parameterOrder": [ 6202 // "customerId", 6203 // "orgUnitPath" 6204 // ], 6205 // "parameters": { 6206 // "customerId": { 6207 // "description": "Immutable ID of the G Suite account", 6208 // "location": "path", 6209 // "required": true, 6210 // "type": "string" 6211 // }, 6212 // "orgUnitPath": { 6213 // "description": "Full path of the target organizational unit or its ID", 6214 // "location": "query", 6215 // "required": true, 6216 // "type": "string" 6217 // } 6218 // }, 6219 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu", 6220 // "request": { 6221 // "$ref": "ChromeOsMoveDevicesToOu" 6222 // }, 6223 // "scopes": [ 6224 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6225 // ] 6226 // } 6227 6228} 6229 6230// method id "directory.chromeosdevices.patch": 6231 6232type ChromeosdevicesPatchCall struct { 6233 s *Service 6234 customerId string 6235 deviceId string 6236 chromeosdevice *ChromeOsDevice 6237 urlParams_ gensupport.URLParams 6238 ctx_ context.Context 6239 header_ http.Header 6240} 6241 6242// Patch: Updates a device's updatable properties, such as 6243// `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or 6244// `annotatedAssetId`. This method supports [patch 6245// semantics](/admin-sdk/directory/v1/guides/performance#patch). 6246func (r *ChromeosdevicesService) Patch(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesPatchCall { 6247 c := &ChromeosdevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6248 c.customerId = customerId 6249 c.deviceId = deviceId 6250 c.chromeosdevice = chromeosdevice 6251 return c 6252} 6253 6254// Projection sets the optional parameter "projection": Restrict 6255// information returned to a set of selected fields. 6256// 6257// Possible values: 6258// "PROJECTION_UNDEFINED" 6259// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 6260// serialNumber, status, and user) 6261// "FULL" - Includes all metadata fields 6262func (c *ChromeosdevicesPatchCall) Projection(projection string) *ChromeosdevicesPatchCall { 6263 c.urlParams_.Set("projection", projection) 6264 return c 6265} 6266 6267// Fields allows partial responses to be retrieved. See 6268// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6269// for more information. 6270func (c *ChromeosdevicesPatchCall) Fields(s ...googleapi.Field) *ChromeosdevicesPatchCall { 6271 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6272 return c 6273} 6274 6275// Context sets the context to be used in this call's Do method. Any 6276// pending HTTP request will be aborted if the provided context is 6277// canceled. 6278func (c *ChromeosdevicesPatchCall) Context(ctx context.Context) *ChromeosdevicesPatchCall { 6279 c.ctx_ = ctx 6280 return c 6281} 6282 6283// Header returns an http.Header that can be modified by the caller to 6284// add HTTP headers to the request. 6285func (c *ChromeosdevicesPatchCall) Header() http.Header { 6286 if c.header_ == nil { 6287 c.header_ = make(http.Header) 6288 } 6289 return c.header_ 6290} 6291 6292func (c *ChromeosdevicesPatchCall) doRequest(alt string) (*http.Response, error) { 6293 reqHeaders := make(http.Header) 6294 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6295 for k, v := range c.header_ { 6296 reqHeaders[k] = v 6297 } 6298 reqHeaders.Set("User-Agent", c.s.userAgent()) 6299 var body io.Reader = nil 6300 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) 6301 if err != nil { 6302 return nil, err 6303 } 6304 reqHeaders.Set("Content-Type", "application/json") 6305 c.urlParams_.Set("alt", alt) 6306 c.urlParams_.Set("prettyPrint", "false") 6307 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 6308 urls += "?" + c.urlParams_.Encode() 6309 req, err := http.NewRequest("PATCH", urls, body) 6310 if err != nil { 6311 return nil, err 6312 } 6313 req.Header = reqHeaders 6314 googleapi.Expand(req.URL, map[string]string{ 6315 "customerId": c.customerId, 6316 "deviceId": c.deviceId, 6317 }) 6318 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6319} 6320 6321// Do executes the "directory.chromeosdevices.patch" call. 6322// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 6323// status code is an error. Response headers are in either 6324// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 6325// at all) in error.(*googleapi.Error).Header. Use 6326// googleapi.IsNotModified to check whether the returned error was 6327// because http.StatusNotModified was returned. 6328func (c *ChromeosdevicesPatchCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 6329 gensupport.SetOptions(c.urlParams_, opts...) 6330 res, err := c.doRequest("json") 6331 if res != nil && res.StatusCode == http.StatusNotModified { 6332 if res.Body != nil { 6333 res.Body.Close() 6334 } 6335 return nil, &googleapi.Error{ 6336 Code: res.StatusCode, 6337 Header: res.Header, 6338 } 6339 } 6340 if err != nil { 6341 return nil, err 6342 } 6343 defer googleapi.CloseBody(res) 6344 if err := googleapi.CheckResponse(res); err != nil { 6345 return nil, err 6346 } 6347 ret := &ChromeOsDevice{ 6348 ServerResponse: googleapi.ServerResponse{ 6349 Header: res.Header, 6350 HTTPStatusCode: res.StatusCode, 6351 }, 6352 } 6353 target := &ret 6354 if err := gensupport.DecodeResponse(target, res); err != nil { 6355 return nil, err 6356 } 6357 return ret, nil 6358 // { 6359 // "description": "Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 6360 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6361 // "httpMethod": "PATCH", 6362 // "id": "directory.chromeosdevices.patch", 6363 // "parameterOrder": [ 6364 // "customerId", 6365 // "deviceId" 6366 // ], 6367 // "parameters": { 6368 // "customerId": { 6369 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 6370 // "location": "path", 6371 // "required": true, 6372 // "type": "string" 6373 // }, 6374 // "deviceId": { 6375 // "description": "The unique ID of the device. The `deviceId`s are returned in the response from the [chromeosdevices.list](/admin-sdk/v1/reference/chromeosdevices/list) method.", 6376 // "location": "path", 6377 // "required": true, 6378 // "type": "string" 6379 // }, 6380 // "projection": { 6381 // "description": "Restrict information returned to a set of selected fields.", 6382 // "enum": [ 6383 // "PROJECTION_UNDEFINED", 6384 // "BASIC", 6385 // "FULL" 6386 // ], 6387 // "enumDescriptions": [ 6388 // "", 6389 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 6390 // "Includes all metadata fields" 6391 // ], 6392 // "location": "query", 6393 // "type": "string" 6394 // } 6395 // }, 6396 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6397 // "request": { 6398 // "$ref": "ChromeOsDevice" 6399 // }, 6400 // "response": { 6401 // "$ref": "ChromeOsDevice" 6402 // }, 6403 // "scopes": [ 6404 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6405 // ] 6406 // } 6407 6408} 6409 6410// method id "directory.chromeosdevices.update": 6411 6412type ChromeosdevicesUpdateCall struct { 6413 s *Service 6414 customerId string 6415 deviceId string 6416 chromeosdevice *ChromeOsDevice 6417 urlParams_ gensupport.URLParams 6418 ctx_ context.Context 6419 header_ http.Header 6420} 6421 6422// Update: Updates a device's updatable properties, such as 6423// `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or 6424// `annotatedAssetId`. 6425func (r *ChromeosdevicesService) Update(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesUpdateCall { 6426 c := &ChromeosdevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6427 c.customerId = customerId 6428 c.deviceId = deviceId 6429 c.chromeosdevice = chromeosdevice 6430 return c 6431} 6432 6433// Projection sets the optional parameter "projection": Restrict 6434// information returned to a set of selected fields. 6435// 6436// Possible values: 6437// "PROJECTION_UNDEFINED" 6438// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 6439// serialNumber, status, and user) 6440// "FULL" - Includes all metadata fields 6441func (c *ChromeosdevicesUpdateCall) Projection(projection string) *ChromeosdevicesUpdateCall { 6442 c.urlParams_.Set("projection", projection) 6443 return c 6444} 6445 6446// Fields allows partial responses to be retrieved. See 6447// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6448// for more information. 6449func (c *ChromeosdevicesUpdateCall) Fields(s ...googleapi.Field) *ChromeosdevicesUpdateCall { 6450 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6451 return c 6452} 6453 6454// Context sets the context to be used in this call's Do method. Any 6455// pending HTTP request will be aborted if the provided context is 6456// canceled. 6457func (c *ChromeosdevicesUpdateCall) Context(ctx context.Context) *ChromeosdevicesUpdateCall { 6458 c.ctx_ = ctx 6459 return c 6460} 6461 6462// Header returns an http.Header that can be modified by the caller to 6463// add HTTP headers to the request. 6464func (c *ChromeosdevicesUpdateCall) Header() http.Header { 6465 if c.header_ == nil { 6466 c.header_ = make(http.Header) 6467 } 6468 return c.header_ 6469} 6470 6471func (c *ChromeosdevicesUpdateCall) doRequest(alt string) (*http.Response, error) { 6472 reqHeaders := make(http.Header) 6473 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6474 for k, v := range c.header_ { 6475 reqHeaders[k] = v 6476 } 6477 reqHeaders.Set("User-Agent", c.s.userAgent()) 6478 var body io.Reader = nil 6479 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) 6480 if err != nil { 6481 return nil, err 6482 } 6483 reqHeaders.Set("Content-Type", "application/json") 6484 c.urlParams_.Set("alt", alt) 6485 c.urlParams_.Set("prettyPrint", "false") 6486 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 6487 urls += "?" + c.urlParams_.Encode() 6488 req, err := http.NewRequest("PUT", urls, body) 6489 if err != nil { 6490 return nil, err 6491 } 6492 req.Header = reqHeaders 6493 googleapi.Expand(req.URL, map[string]string{ 6494 "customerId": c.customerId, 6495 "deviceId": c.deviceId, 6496 }) 6497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6498} 6499 6500// Do executes the "directory.chromeosdevices.update" call. 6501// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 6502// status code is an error. Response headers are in either 6503// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 6504// at all) in error.(*googleapi.Error).Header. Use 6505// googleapi.IsNotModified to check whether the returned error was 6506// because http.StatusNotModified was returned. 6507func (c *ChromeosdevicesUpdateCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 6508 gensupport.SetOptions(c.urlParams_, opts...) 6509 res, err := c.doRequest("json") 6510 if res != nil && res.StatusCode == http.StatusNotModified { 6511 if res.Body != nil { 6512 res.Body.Close() 6513 } 6514 return nil, &googleapi.Error{ 6515 Code: res.StatusCode, 6516 Header: res.Header, 6517 } 6518 } 6519 if err != nil { 6520 return nil, err 6521 } 6522 defer googleapi.CloseBody(res) 6523 if err := googleapi.CheckResponse(res); err != nil { 6524 return nil, err 6525 } 6526 ret := &ChromeOsDevice{ 6527 ServerResponse: googleapi.ServerResponse{ 6528 Header: res.Header, 6529 HTTPStatusCode: res.StatusCode, 6530 }, 6531 } 6532 target := &ret 6533 if err := gensupport.DecodeResponse(target, res); err != nil { 6534 return nil, err 6535 } 6536 return ret, nil 6537 // { 6538 // "description": "Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.", 6539 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6540 // "httpMethod": "PUT", 6541 // "id": "directory.chromeosdevices.update", 6542 // "parameterOrder": [ 6543 // "customerId", 6544 // "deviceId" 6545 // ], 6546 // "parameters": { 6547 // "customerId": { 6548 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 6549 // "location": "path", 6550 // "required": true, 6551 // "type": "string" 6552 // }, 6553 // "deviceId": { 6554 // "description": "The unique ID of the device. The `deviceId`s are returned in the response from the [chromeosdevices.list](/admin-sdk/v1/reference/chromeosdevices/list) method.", 6555 // "location": "path", 6556 // "required": true, 6557 // "type": "string" 6558 // }, 6559 // "projection": { 6560 // "description": "Restrict information returned to a set of selected fields.", 6561 // "enum": [ 6562 // "PROJECTION_UNDEFINED", 6563 // "BASIC", 6564 // "FULL" 6565 // ], 6566 // "enumDescriptions": [ 6567 // "", 6568 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 6569 // "Includes all metadata fields" 6570 // ], 6571 // "location": "query", 6572 // "type": "string" 6573 // } 6574 // }, 6575 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6576 // "request": { 6577 // "$ref": "ChromeOsDevice" 6578 // }, 6579 // "response": { 6580 // "$ref": "ChromeOsDevice" 6581 // }, 6582 // "scopes": [ 6583 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6584 // ] 6585 // } 6586 6587} 6588 6589// method id "admin.customer.devices.chromeos.issueCommand": 6590 6591type CustomerDevicesChromeosIssueCommandCall struct { 6592 s *Service 6593 customerId string 6594 deviceId string 6595 directorychromeosdevicesissuecommandrequest *DirectoryChromeosdevicesIssueCommandRequest 6596 urlParams_ gensupport.URLParams 6597 ctx_ context.Context 6598 header_ http.Header 6599} 6600 6601// IssueCommand: Issues a command for the device to execute. 6602func (r *CustomerDevicesChromeosService) IssueCommand(customerId string, deviceId string, directorychromeosdevicesissuecommandrequest *DirectoryChromeosdevicesIssueCommandRequest) *CustomerDevicesChromeosIssueCommandCall { 6603 c := &CustomerDevicesChromeosIssueCommandCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6604 c.customerId = customerId 6605 c.deviceId = deviceId 6606 c.directorychromeosdevicesissuecommandrequest = directorychromeosdevicesissuecommandrequest 6607 return c 6608} 6609 6610// Fields allows partial responses to be retrieved. See 6611// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6612// for more information. 6613func (c *CustomerDevicesChromeosIssueCommandCall) Fields(s ...googleapi.Field) *CustomerDevicesChromeosIssueCommandCall { 6614 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6615 return c 6616} 6617 6618// Context sets the context to be used in this call's Do method. Any 6619// pending HTTP request will be aborted if the provided context is 6620// canceled. 6621func (c *CustomerDevicesChromeosIssueCommandCall) Context(ctx context.Context) *CustomerDevicesChromeosIssueCommandCall { 6622 c.ctx_ = ctx 6623 return c 6624} 6625 6626// Header returns an http.Header that can be modified by the caller to 6627// add HTTP headers to the request. 6628func (c *CustomerDevicesChromeosIssueCommandCall) Header() http.Header { 6629 if c.header_ == nil { 6630 c.header_ = make(http.Header) 6631 } 6632 return c.header_ 6633} 6634 6635func (c *CustomerDevicesChromeosIssueCommandCall) doRequest(alt string) (*http.Response, error) { 6636 reqHeaders := make(http.Header) 6637 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6638 for k, v := range c.header_ { 6639 reqHeaders[k] = v 6640 } 6641 reqHeaders.Set("User-Agent", c.s.userAgent()) 6642 var body io.Reader = nil 6643 body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorychromeosdevicesissuecommandrequest) 6644 if err != nil { 6645 return nil, err 6646 } 6647 reqHeaders.Set("Content-Type", "application/json") 6648 c.urlParams_.Set("alt", alt) 6649 c.urlParams_.Set("prettyPrint", "false") 6650 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand") 6651 urls += "?" + c.urlParams_.Encode() 6652 req, err := http.NewRequest("POST", urls, body) 6653 if err != nil { 6654 return nil, err 6655 } 6656 req.Header = reqHeaders 6657 googleapi.Expand(req.URL, map[string]string{ 6658 "customerId": c.customerId, 6659 "deviceId": c.deviceId, 6660 }) 6661 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6662} 6663 6664// Do executes the "admin.customer.devices.chromeos.issueCommand" call. 6665// Exactly one of *DirectoryChromeosdevicesIssueCommandResponse or error 6666// will be non-nil. Any non-2xx status code is an error. Response 6667// headers are in either 6668// *DirectoryChromeosdevicesIssueCommandResponse.ServerResponse.Header 6669// or (if a response was returned at all) in 6670// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6671// whether the returned error was because http.StatusNotModified was 6672// returned. 6673func (c *CustomerDevicesChromeosIssueCommandCall) Do(opts ...googleapi.CallOption) (*DirectoryChromeosdevicesIssueCommandResponse, error) { 6674 gensupport.SetOptions(c.urlParams_, opts...) 6675 res, err := c.doRequest("json") 6676 if res != nil && res.StatusCode == http.StatusNotModified { 6677 if res.Body != nil { 6678 res.Body.Close() 6679 } 6680 return nil, &googleapi.Error{ 6681 Code: res.StatusCode, 6682 Header: res.Header, 6683 } 6684 } 6685 if err != nil { 6686 return nil, err 6687 } 6688 defer googleapi.CloseBody(res) 6689 if err := googleapi.CheckResponse(res); err != nil { 6690 return nil, err 6691 } 6692 ret := &DirectoryChromeosdevicesIssueCommandResponse{ 6693 ServerResponse: googleapi.ServerResponse{ 6694 Header: res.Header, 6695 HTTPStatusCode: res.StatusCode, 6696 }, 6697 } 6698 target := &ret 6699 if err := gensupport.DecodeResponse(target, res); err != nil { 6700 return nil, err 6701 } 6702 return ret, nil 6703 // { 6704 // "description": "Issues a command for the device to execute.", 6705 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand", 6706 // "httpMethod": "POST", 6707 // "id": "admin.customer.devices.chromeos.issueCommand", 6708 // "parameterOrder": [ 6709 // "customerId", 6710 // "deviceId" 6711 // ], 6712 // "parameters": { 6713 // "customerId": { 6714 // "description": "Immutable. Immutable ID of the G Suite account.", 6715 // "location": "path", 6716 // "required": true, 6717 // "type": "string" 6718 // }, 6719 // "deviceId": { 6720 // "description": "Immutable. Immutable ID of Chrome OS Device.", 6721 // "location": "path", 6722 // "required": true, 6723 // "type": "string" 6724 // } 6725 // }, 6726 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand", 6727 // "request": { 6728 // "$ref": "DirectoryChromeosdevicesIssueCommandRequest" 6729 // }, 6730 // "response": { 6731 // "$ref": "DirectoryChromeosdevicesIssueCommandResponse" 6732 // }, 6733 // "scopes": [ 6734 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6735 // ] 6736 // } 6737 6738} 6739 6740// method id "admin.customer.devices.chromeos.commands.get": 6741 6742type CustomerDevicesChromeosCommandsGetCall struct { 6743 s *Service 6744 customerId string 6745 deviceId string 6746 commandId int64 6747 urlParams_ gensupport.URLParams 6748 ifNoneMatch_ string 6749 ctx_ context.Context 6750 header_ http.Header 6751} 6752 6753// Get: Gets command data a specific command issued to the device. 6754func (r *CustomerDevicesChromeosCommandsService) Get(customerId string, deviceId string, commandId int64) *CustomerDevicesChromeosCommandsGetCall { 6755 c := &CustomerDevicesChromeosCommandsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6756 c.customerId = customerId 6757 c.deviceId = deviceId 6758 c.commandId = commandId 6759 return c 6760} 6761 6762// Fields allows partial responses to be retrieved. See 6763// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6764// for more information. 6765func (c *CustomerDevicesChromeosCommandsGetCall) Fields(s ...googleapi.Field) *CustomerDevicesChromeosCommandsGetCall { 6766 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6767 return c 6768} 6769 6770// IfNoneMatch sets the optional parameter which makes the operation 6771// fail if the object's ETag matches the given value. This is useful for 6772// getting updates only after the object has changed since the last 6773// request. Use googleapi.IsNotModified to check whether the response 6774// error from Do is the result of In-None-Match. 6775func (c *CustomerDevicesChromeosCommandsGetCall) IfNoneMatch(entityTag string) *CustomerDevicesChromeosCommandsGetCall { 6776 c.ifNoneMatch_ = entityTag 6777 return c 6778} 6779 6780// Context sets the context to be used in this call's Do method. Any 6781// pending HTTP request will be aborted if the provided context is 6782// canceled. 6783func (c *CustomerDevicesChromeosCommandsGetCall) Context(ctx context.Context) *CustomerDevicesChromeosCommandsGetCall { 6784 c.ctx_ = ctx 6785 return c 6786} 6787 6788// Header returns an http.Header that can be modified by the caller to 6789// add HTTP headers to the request. 6790func (c *CustomerDevicesChromeosCommandsGetCall) Header() http.Header { 6791 if c.header_ == nil { 6792 c.header_ = make(http.Header) 6793 } 6794 return c.header_ 6795} 6796 6797func (c *CustomerDevicesChromeosCommandsGetCall) doRequest(alt string) (*http.Response, error) { 6798 reqHeaders := make(http.Header) 6799 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6800 for k, v := range c.header_ { 6801 reqHeaders[k] = v 6802 } 6803 reqHeaders.Set("User-Agent", c.s.userAgent()) 6804 if c.ifNoneMatch_ != "" { 6805 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6806 } 6807 var body io.Reader = nil 6808 c.urlParams_.Set("alt", alt) 6809 c.urlParams_.Set("prettyPrint", "false") 6810 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}") 6811 urls += "?" + c.urlParams_.Encode() 6812 req, err := http.NewRequest("GET", urls, body) 6813 if err != nil { 6814 return nil, err 6815 } 6816 req.Header = reqHeaders 6817 googleapi.Expand(req.URL, map[string]string{ 6818 "customerId": c.customerId, 6819 "deviceId": c.deviceId, 6820 "commandId": strconv.FormatInt(c.commandId, 10), 6821 }) 6822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6823} 6824 6825// Do executes the "admin.customer.devices.chromeos.commands.get" call. 6826// Exactly one of *DirectoryChromeosdevicesCommand or error will be 6827// non-nil. Any non-2xx status code is an error. Response headers are in 6828// either *DirectoryChromeosdevicesCommand.ServerResponse.Header or (if 6829// a response was returned at all) in error.(*googleapi.Error).Header. 6830// Use googleapi.IsNotModified to check whether the returned error was 6831// because http.StatusNotModified was returned. 6832func (c *CustomerDevicesChromeosCommandsGetCall) Do(opts ...googleapi.CallOption) (*DirectoryChromeosdevicesCommand, error) { 6833 gensupport.SetOptions(c.urlParams_, opts...) 6834 res, err := c.doRequest("json") 6835 if res != nil && res.StatusCode == http.StatusNotModified { 6836 if res.Body != nil { 6837 res.Body.Close() 6838 } 6839 return nil, &googleapi.Error{ 6840 Code: res.StatusCode, 6841 Header: res.Header, 6842 } 6843 } 6844 if err != nil { 6845 return nil, err 6846 } 6847 defer googleapi.CloseBody(res) 6848 if err := googleapi.CheckResponse(res); err != nil { 6849 return nil, err 6850 } 6851 ret := &DirectoryChromeosdevicesCommand{ 6852 ServerResponse: googleapi.ServerResponse{ 6853 Header: res.Header, 6854 HTTPStatusCode: res.StatusCode, 6855 }, 6856 } 6857 target := &ret 6858 if err := gensupport.DecodeResponse(target, res); err != nil { 6859 return nil, err 6860 } 6861 return ret, nil 6862 // { 6863 // "description": "Gets command data a specific command issued to the device.", 6864 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}", 6865 // "httpMethod": "GET", 6866 // "id": "admin.customer.devices.chromeos.commands.get", 6867 // "parameterOrder": [ 6868 // "customerId", 6869 // "deviceId", 6870 // "commandId" 6871 // ], 6872 // "parameters": { 6873 // "commandId": { 6874 // "description": "Immutable. Immutable ID of Chrome OS Device Command.", 6875 // "format": "int64", 6876 // "location": "path", 6877 // "required": true, 6878 // "type": "string" 6879 // }, 6880 // "customerId": { 6881 // "description": "Immutable. Immutable ID of the G Suite account.", 6882 // "location": "path", 6883 // "required": true, 6884 // "type": "string" 6885 // }, 6886 // "deviceId": { 6887 // "description": "Immutable. Immutable ID of Chrome OS Device.", 6888 // "location": "path", 6889 // "required": true, 6890 // "type": "string" 6891 // } 6892 // }, 6893 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}", 6894 // "response": { 6895 // "$ref": "DirectoryChromeosdevicesCommand" 6896 // }, 6897 // "scopes": [ 6898 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 6899 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 6900 // ] 6901 // } 6902 6903} 6904 6905// method id "directory.customers.get": 6906 6907type CustomersGetCall struct { 6908 s *Service 6909 customerKey string 6910 urlParams_ gensupport.URLParams 6911 ifNoneMatch_ string 6912 ctx_ context.Context 6913 header_ http.Header 6914} 6915 6916// Get: Retrieves a customer. 6917func (r *CustomersService) Get(customerKey string) *CustomersGetCall { 6918 c := &CustomersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6919 c.customerKey = customerKey 6920 return c 6921} 6922 6923// Fields allows partial responses to be retrieved. See 6924// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6925// for more information. 6926func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall { 6927 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6928 return c 6929} 6930 6931// IfNoneMatch sets the optional parameter which makes the operation 6932// fail if the object's ETag matches the given value. This is useful for 6933// getting updates only after the object has changed since the last 6934// request. Use googleapi.IsNotModified to check whether the response 6935// error from Do is the result of In-None-Match. 6936func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall { 6937 c.ifNoneMatch_ = entityTag 6938 return c 6939} 6940 6941// Context sets the context to be used in this call's Do method. Any 6942// pending HTTP request will be aborted if the provided context is 6943// canceled. 6944func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall { 6945 c.ctx_ = ctx 6946 return c 6947} 6948 6949// Header returns an http.Header that can be modified by the caller to 6950// add HTTP headers to the request. 6951func (c *CustomersGetCall) Header() http.Header { 6952 if c.header_ == nil { 6953 c.header_ = make(http.Header) 6954 } 6955 return c.header_ 6956} 6957 6958func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { 6959 reqHeaders := make(http.Header) 6960 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6961 for k, v := range c.header_ { 6962 reqHeaders[k] = v 6963 } 6964 reqHeaders.Set("User-Agent", c.s.userAgent()) 6965 if c.ifNoneMatch_ != "" { 6966 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6967 } 6968 var body io.Reader = nil 6969 c.urlParams_.Set("alt", alt) 6970 c.urlParams_.Set("prettyPrint", "false") 6971 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 6972 urls += "?" + c.urlParams_.Encode() 6973 req, err := http.NewRequest("GET", urls, body) 6974 if err != nil { 6975 return nil, err 6976 } 6977 req.Header = reqHeaders 6978 googleapi.Expand(req.URL, map[string]string{ 6979 "customerKey": c.customerKey, 6980 }) 6981 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6982} 6983 6984// Do executes the "directory.customers.get" call. 6985// Exactly one of *Customer or error will be non-nil. Any non-2xx status 6986// code is an error. Response headers are in either 6987// *Customer.ServerResponse.Header or (if a response was returned at 6988// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6989// to check whether the returned error was because 6990// http.StatusNotModified was returned. 6991func (c *CustomersGetCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 6992 gensupport.SetOptions(c.urlParams_, opts...) 6993 res, err := c.doRequest("json") 6994 if res != nil && res.StatusCode == http.StatusNotModified { 6995 if res.Body != nil { 6996 res.Body.Close() 6997 } 6998 return nil, &googleapi.Error{ 6999 Code: res.StatusCode, 7000 Header: res.Header, 7001 } 7002 } 7003 if err != nil { 7004 return nil, err 7005 } 7006 defer googleapi.CloseBody(res) 7007 if err := googleapi.CheckResponse(res); err != nil { 7008 return nil, err 7009 } 7010 ret := &Customer{ 7011 ServerResponse: googleapi.ServerResponse{ 7012 Header: res.Header, 7013 HTTPStatusCode: res.StatusCode, 7014 }, 7015 } 7016 target := &ret 7017 if err := gensupport.DecodeResponse(target, res); err != nil { 7018 return nil, err 7019 } 7020 return ret, nil 7021 // { 7022 // "description": "Retrieves a customer.", 7023 // "flatPath": "admin/directory/v1/customers/{customerKey}", 7024 // "httpMethod": "GET", 7025 // "id": "directory.customers.get", 7026 // "parameterOrder": [ 7027 // "customerKey" 7028 // ], 7029 // "parameters": { 7030 // "customerKey": { 7031 // "description": "Id of the customer to be retrieved", 7032 // "location": "path", 7033 // "required": true, 7034 // "type": "string" 7035 // } 7036 // }, 7037 // "path": "admin/directory/v1/customers/{customerKey}", 7038 // "response": { 7039 // "$ref": "Customer" 7040 // }, 7041 // "scopes": [ 7042 // "https://www.googleapis.com/auth/admin.directory.customer", 7043 // "https://www.googleapis.com/auth/admin.directory.customer.readonly" 7044 // ] 7045 // } 7046 7047} 7048 7049// method id "directory.customers.patch": 7050 7051type CustomersPatchCall struct { 7052 s *Service 7053 customerKey string 7054 customer *Customer 7055 urlParams_ gensupport.URLParams 7056 ctx_ context.Context 7057 header_ http.Header 7058} 7059 7060// Patch: Patch Customers via Apiary Patch Orchestration 7061func (r *CustomersService) Patch(customerKey string, customer *Customer) *CustomersPatchCall { 7062 c := &CustomersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7063 c.customerKey = customerKey 7064 c.customer = customer 7065 return c 7066} 7067 7068// Fields allows partial responses to be retrieved. See 7069// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7070// for more information. 7071func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall { 7072 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7073 return c 7074} 7075 7076// Context sets the context to be used in this call's Do method. Any 7077// pending HTTP request will be aborted if the provided context is 7078// canceled. 7079func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall { 7080 c.ctx_ = ctx 7081 return c 7082} 7083 7084// Header returns an http.Header that can be modified by the caller to 7085// add HTTP headers to the request. 7086func (c *CustomersPatchCall) Header() http.Header { 7087 if c.header_ == nil { 7088 c.header_ = make(http.Header) 7089 } 7090 return c.header_ 7091} 7092 7093func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { 7094 reqHeaders := make(http.Header) 7095 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7096 for k, v := range c.header_ { 7097 reqHeaders[k] = v 7098 } 7099 reqHeaders.Set("User-Agent", c.s.userAgent()) 7100 var body io.Reader = nil 7101 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) 7102 if err != nil { 7103 return nil, err 7104 } 7105 reqHeaders.Set("Content-Type", "application/json") 7106 c.urlParams_.Set("alt", alt) 7107 c.urlParams_.Set("prettyPrint", "false") 7108 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 7109 urls += "?" + c.urlParams_.Encode() 7110 req, err := http.NewRequest("PATCH", urls, body) 7111 if err != nil { 7112 return nil, err 7113 } 7114 req.Header = reqHeaders 7115 googleapi.Expand(req.URL, map[string]string{ 7116 "customerKey": c.customerKey, 7117 }) 7118 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7119} 7120 7121// Do executes the "directory.customers.patch" call. 7122// Exactly one of *Customer or error will be non-nil. Any non-2xx status 7123// code is an error. Response headers are in either 7124// *Customer.ServerResponse.Header or (if a response was returned at 7125// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7126// to check whether the returned error was because 7127// http.StatusNotModified was returned. 7128func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 7129 gensupport.SetOptions(c.urlParams_, opts...) 7130 res, err := c.doRequest("json") 7131 if res != nil && res.StatusCode == http.StatusNotModified { 7132 if res.Body != nil { 7133 res.Body.Close() 7134 } 7135 return nil, &googleapi.Error{ 7136 Code: res.StatusCode, 7137 Header: res.Header, 7138 } 7139 } 7140 if err != nil { 7141 return nil, err 7142 } 7143 defer googleapi.CloseBody(res) 7144 if err := googleapi.CheckResponse(res); err != nil { 7145 return nil, err 7146 } 7147 ret := &Customer{ 7148 ServerResponse: googleapi.ServerResponse{ 7149 Header: res.Header, 7150 HTTPStatusCode: res.StatusCode, 7151 }, 7152 } 7153 target := &ret 7154 if err := gensupport.DecodeResponse(target, res); err != nil { 7155 return nil, err 7156 } 7157 return ret, nil 7158 // { 7159 // "description": "Patch Customers via Apiary Patch Orchestration", 7160 // "flatPath": "admin/directory/v1/customers/{customerKey}", 7161 // "httpMethod": "PATCH", 7162 // "id": "directory.customers.patch", 7163 // "parameterOrder": [ 7164 // "customerKey" 7165 // ], 7166 // "parameters": { 7167 // "customerKey": { 7168 // "description": "Id of the customer to be updated", 7169 // "location": "path", 7170 // "required": true, 7171 // "type": "string" 7172 // } 7173 // }, 7174 // "path": "admin/directory/v1/customers/{customerKey}", 7175 // "request": { 7176 // "$ref": "Customer" 7177 // }, 7178 // "response": { 7179 // "$ref": "Customer" 7180 // }, 7181 // "scopes": [ 7182 // "https://www.googleapis.com/auth/admin.directory.customer" 7183 // ] 7184 // } 7185 7186} 7187 7188// method id "directory.customers.update": 7189 7190type CustomersUpdateCall struct { 7191 s *Service 7192 customerKey string 7193 customer *Customer 7194 urlParams_ gensupport.URLParams 7195 ctx_ context.Context 7196 header_ http.Header 7197} 7198 7199// Update: Updates a customer. 7200func (r *CustomersService) Update(customerKey string, customer *Customer) *CustomersUpdateCall { 7201 c := &CustomersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7202 c.customerKey = customerKey 7203 c.customer = customer 7204 return c 7205} 7206 7207// Fields allows partial responses to be retrieved. See 7208// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7209// for more information. 7210func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall { 7211 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7212 return c 7213} 7214 7215// Context sets the context to be used in this call's Do method. Any 7216// pending HTTP request will be aborted if the provided context is 7217// canceled. 7218func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall { 7219 c.ctx_ = ctx 7220 return c 7221} 7222 7223// Header returns an http.Header that can be modified by the caller to 7224// add HTTP headers to the request. 7225func (c *CustomersUpdateCall) Header() http.Header { 7226 if c.header_ == nil { 7227 c.header_ = make(http.Header) 7228 } 7229 return c.header_ 7230} 7231 7232func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, error) { 7233 reqHeaders := make(http.Header) 7234 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7235 for k, v := range c.header_ { 7236 reqHeaders[k] = v 7237 } 7238 reqHeaders.Set("User-Agent", c.s.userAgent()) 7239 var body io.Reader = nil 7240 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) 7241 if err != nil { 7242 return nil, err 7243 } 7244 reqHeaders.Set("Content-Type", "application/json") 7245 c.urlParams_.Set("alt", alt) 7246 c.urlParams_.Set("prettyPrint", "false") 7247 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 7248 urls += "?" + c.urlParams_.Encode() 7249 req, err := http.NewRequest("PUT", urls, body) 7250 if err != nil { 7251 return nil, err 7252 } 7253 req.Header = reqHeaders 7254 googleapi.Expand(req.URL, map[string]string{ 7255 "customerKey": c.customerKey, 7256 }) 7257 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7258} 7259 7260// Do executes the "directory.customers.update" call. 7261// Exactly one of *Customer or error will be non-nil. Any non-2xx status 7262// code is an error. Response headers are in either 7263// *Customer.ServerResponse.Header or (if a response was returned at 7264// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7265// to check whether the returned error was because 7266// http.StatusNotModified was returned. 7267func (c *CustomersUpdateCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 7268 gensupport.SetOptions(c.urlParams_, opts...) 7269 res, err := c.doRequest("json") 7270 if res != nil && res.StatusCode == http.StatusNotModified { 7271 if res.Body != nil { 7272 res.Body.Close() 7273 } 7274 return nil, &googleapi.Error{ 7275 Code: res.StatusCode, 7276 Header: res.Header, 7277 } 7278 } 7279 if err != nil { 7280 return nil, err 7281 } 7282 defer googleapi.CloseBody(res) 7283 if err := googleapi.CheckResponse(res); err != nil { 7284 return nil, err 7285 } 7286 ret := &Customer{ 7287 ServerResponse: googleapi.ServerResponse{ 7288 Header: res.Header, 7289 HTTPStatusCode: res.StatusCode, 7290 }, 7291 } 7292 target := &ret 7293 if err := gensupport.DecodeResponse(target, res); err != nil { 7294 return nil, err 7295 } 7296 return ret, nil 7297 // { 7298 // "description": "Updates a customer.", 7299 // "flatPath": "admin/directory/v1/customers/{customerKey}", 7300 // "httpMethod": "PUT", 7301 // "id": "directory.customers.update", 7302 // "parameterOrder": [ 7303 // "customerKey" 7304 // ], 7305 // "parameters": { 7306 // "customerKey": { 7307 // "description": "Id of the customer to be updated", 7308 // "location": "path", 7309 // "required": true, 7310 // "type": "string" 7311 // } 7312 // }, 7313 // "path": "admin/directory/v1/customers/{customerKey}", 7314 // "request": { 7315 // "$ref": "Customer" 7316 // }, 7317 // "response": { 7318 // "$ref": "Customer" 7319 // }, 7320 // "scopes": [ 7321 // "https://www.googleapis.com/auth/admin.directory.customer" 7322 // ] 7323 // } 7324 7325} 7326 7327// method id "directory.domainAliases.delete": 7328 7329type DomainAliasesDeleteCall struct { 7330 s *Service 7331 customer string 7332 domainAliasName string 7333 urlParams_ gensupport.URLParams 7334 ctx_ context.Context 7335 header_ http.Header 7336} 7337 7338// Delete: Deletes a domain Alias of the customer. 7339func (r *DomainAliasesService) Delete(customer string, domainAliasName string) *DomainAliasesDeleteCall { 7340 c := &DomainAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7341 c.customer = customer 7342 c.domainAliasName = domainAliasName 7343 return c 7344} 7345 7346// Fields allows partial responses to be retrieved. See 7347// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7348// for more information. 7349func (c *DomainAliasesDeleteCall) Fields(s ...googleapi.Field) *DomainAliasesDeleteCall { 7350 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7351 return c 7352} 7353 7354// Context sets the context to be used in this call's Do method. Any 7355// pending HTTP request will be aborted if the provided context is 7356// canceled. 7357func (c *DomainAliasesDeleteCall) Context(ctx context.Context) *DomainAliasesDeleteCall { 7358 c.ctx_ = ctx 7359 return c 7360} 7361 7362// Header returns an http.Header that can be modified by the caller to 7363// add HTTP headers to the request. 7364func (c *DomainAliasesDeleteCall) Header() http.Header { 7365 if c.header_ == nil { 7366 c.header_ = make(http.Header) 7367 } 7368 return c.header_ 7369} 7370 7371func (c *DomainAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 7372 reqHeaders := make(http.Header) 7373 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7374 for k, v := range c.header_ { 7375 reqHeaders[k] = v 7376 } 7377 reqHeaders.Set("User-Agent", c.s.userAgent()) 7378 var body io.Reader = nil 7379 c.urlParams_.Set("alt", alt) 7380 c.urlParams_.Set("prettyPrint", "false") 7381 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") 7382 urls += "?" + c.urlParams_.Encode() 7383 req, err := http.NewRequest("DELETE", urls, body) 7384 if err != nil { 7385 return nil, err 7386 } 7387 req.Header = reqHeaders 7388 googleapi.Expand(req.URL, map[string]string{ 7389 "customer": c.customer, 7390 "domainAliasName": c.domainAliasName, 7391 }) 7392 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7393} 7394 7395// Do executes the "directory.domainAliases.delete" call. 7396func (c *DomainAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 7397 gensupport.SetOptions(c.urlParams_, opts...) 7398 res, err := c.doRequest("json") 7399 if err != nil { 7400 return err 7401 } 7402 defer googleapi.CloseBody(res) 7403 if err := googleapi.CheckResponse(res); err != nil { 7404 return err 7405 } 7406 return nil 7407 // { 7408 // "description": "Deletes a domain Alias of the customer.", 7409 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 7410 // "httpMethod": "DELETE", 7411 // "id": "directory.domainAliases.delete", 7412 // "parameterOrder": [ 7413 // "customer", 7414 // "domainAliasName" 7415 // ], 7416 // "parameters": { 7417 // "customer": { 7418 // "description": "Immutable ID of the G Suite account.", 7419 // "location": "path", 7420 // "required": true, 7421 // "type": "string" 7422 // }, 7423 // "domainAliasName": { 7424 // "description": "Name of domain alias to be retrieved.", 7425 // "location": "path", 7426 // "required": true, 7427 // "type": "string" 7428 // } 7429 // }, 7430 // "path": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 7431 // "scopes": [ 7432 // "https://www.googleapis.com/auth/admin.directory.domain" 7433 // ] 7434 // } 7435 7436} 7437 7438// method id "directory.domainAliases.get": 7439 7440type DomainAliasesGetCall struct { 7441 s *Service 7442 customer string 7443 domainAliasName string 7444 urlParams_ gensupport.URLParams 7445 ifNoneMatch_ string 7446 ctx_ context.Context 7447 header_ http.Header 7448} 7449 7450// Get: Retrieves a domain alias of the customer. 7451func (r *DomainAliasesService) Get(customer string, domainAliasName string) *DomainAliasesGetCall { 7452 c := &DomainAliasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7453 c.customer = customer 7454 c.domainAliasName = domainAliasName 7455 return c 7456} 7457 7458// Fields allows partial responses to be retrieved. See 7459// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7460// for more information. 7461func (c *DomainAliasesGetCall) Fields(s ...googleapi.Field) *DomainAliasesGetCall { 7462 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7463 return c 7464} 7465 7466// IfNoneMatch sets the optional parameter which makes the operation 7467// fail if the object's ETag matches the given value. This is useful for 7468// getting updates only after the object has changed since the last 7469// request. Use googleapi.IsNotModified to check whether the response 7470// error from Do is the result of In-None-Match. 7471func (c *DomainAliasesGetCall) IfNoneMatch(entityTag string) *DomainAliasesGetCall { 7472 c.ifNoneMatch_ = entityTag 7473 return c 7474} 7475 7476// Context sets the context to be used in this call's Do method. Any 7477// pending HTTP request will be aborted if the provided context is 7478// canceled. 7479func (c *DomainAliasesGetCall) Context(ctx context.Context) *DomainAliasesGetCall { 7480 c.ctx_ = ctx 7481 return c 7482} 7483 7484// Header returns an http.Header that can be modified by the caller to 7485// add HTTP headers to the request. 7486func (c *DomainAliasesGetCall) Header() http.Header { 7487 if c.header_ == nil { 7488 c.header_ = make(http.Header) 7489 } 7490 return c.header_ 7491} 7492 7493func (c *DomainAliasesGetCall) doRequest(alt string) (*http.Response, error) { 7494 reqHeaders := make(http.Header) 7495 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7496 for k, v := range c.header_ { 7497 reqHeaders[k] = v 7498 } 7499 reqHeaders.Set("User-Agent", c.s.userAgent()) 7500 if c.ifNoneMatch_ != "" { 7501 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7502 } 7503 var body io.Reader = nil 7504 c.urlParams_.Set("alt", alt) 7505 c.urlParams_.Set("prettyPrint", "false") 7506 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") 7507 urls += "?" + c.urlParams_.Encode() 7508 req, err := http.NewRequest("GET", urls, body) 7509 if err != nil { 7510 return nil, err 7511 } 7512 req.Header = reqHeaders 7513 googleapi.Expand(req.URL, map[string]string{ 7514 "customer": c.customer, 7515 "domainAliasName": c.domainAliasName, 7516 }) 7517 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7518} 7519 7520// Do executes the "directory.domainAliases.get" call. 7521// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx 7522// status code is an error. Response headers are in either 7523// *DomainAlias.ServerResponse.Header or (if a response was returned at 7524// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7525// to check whether the returned error was because 7526// http.StatusNotModified was returned. 7527func (c *DomainAliasesGetCall) Do(opts ...googleapi.CallOption) (*DomainAlias, error) { 7528 gensupport.SetOptions(c.urlParams_, opts...) 7529 res, err := c.doRequest("json") 7530 if res != nil && res.StatusCode == http.StatusNotModified { 7531 if res.Body != nil { 7532 res.Body.Close() 7533 } 7534 return nil, &googleapi.Error{ 7535 Code: res.StatusCode, 7536 Header: res.Header, 7537 } 7538 } 7539 if err != nil { 7540 return nil, err 7541 } 7542 defer googleapi.CloseBody(res) 7543 if err := googleapi.CheckResponse(res); err != nil { 7544 return nil, err 7545 } 7546 ret := &DomainAlias{ 7547 ServerResponse: googleapi.ServerResponse{ 7548 Header: res.Header, 7549 HTTPStatusCode: res.StatusCode, 7550 }, 7551 } 7552 target := &ret 7553 if err := gensupport.DecodeResponse(target, res); err != nil { 7554 return nil, err 7555 } 7556 return ret, nil 7557 // { 7558 // "description": "Retrieves a domain alias of the customer.", 7559 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 7560 // "httpMethod": "GET", 7561 // "id": "directory.domainAliases.get", 7562 // "parameterOrder": [ 7563 // "customer", 7564 // "domainAliasName" 7565 // ], 7566 // "parameters": { 7567 // "customer": { 7568 // "description": "Immutable ID of the G Suite account.", 7569 // "location": "path", 7570 // "required": true, 7571 // "type": "string" 7572 // }, 7573 // "domainAliasName": { 7574 // "description": "Name of domain alias to be retrieved.", 7575 // "location": "path", 7576 // "required": true, 7577 // "type": "string" 7578 // } 7579 // }, 7580 // "path": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 7581 // "response": { 7582 // "$ref": "DomainAlias" 7583 // }, 7584 // "scopes": [ 7585 // "https://www.googleapis.com/auth/admin.directory.domain", 7586 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 7587 // ] 7588 // } 7589 7590} 7591 7592// method id "directory.domainAliases.insert": 7593 7594type DomainAliasesInsertCall struct { 7595 s *Service 7596 customer string 7597 domainalias *DomainAlias 7598 urlParams_ gensupport.URLParams 7599 ctx_ context.Context 7600 header_ http.Header 7601} 7602 7603// Insert: Inserts a domain alias of the customer. 7604func (r *DomainAliasesService) Insert(customer string, domainalias *DomainAlias) *DomainAliasesInsertCall { 7605 c := &DomainAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7606 c.customer = customer 7607 c.domainalias = domainalias 7608 return c 7609} 7610 7611// Fields allows partial responses to be retrieved. See 7612// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7613// for more information. 7614func (c *DomainAliasesInsertCall) Fields(s ...googleapi.Field) *DomainAliasesInsertCall { 7615 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7616 return c 7617} 7618 7619// Context sets the context to be used in this call's Do method. Any 7620// pending HTTP request will be aborted if the provided context is 7621// canceled. 7622func (c *DomainAliasesInsertCall) Context(ctx context.Context) *DomainAliasesInsertCall { 7623 c.ctx_ = ctx 7624 return c 7625} 7626 7627// Header returns an http.Header that can be modified by the caller to 7628// add HTTP headers to the request. 7629func (c *DomainAliasesInsertCall) Header() http.Header { 7630 if c.header_ == nil { 7631 c.header_ = make(http.Header) 7632 } 7633 return c.header_ 7634} 7635 7636func (c *DomainAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 7637 reqHeaders := make(http.Header) 7638 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7639 for k, v := range c.header_ { 7640 reqHeaders[k] = v 7641 } 7642 reqHeaders.Set("User-Agent", c.s.userAgent()) 7643 var body io.Reader = nil 7644 body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainalias) 7645 if err != nil { 7646 return nil, err 7647 } 7648 reqHeaders.Set("Content-Type", "application/json") 7649 c.urlParams_.Set("alt", alt) 7650 c.urlParams_.Set("prettyPrint", "false") 7651 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases") 7652 urls += "?" + c.urlParams_.Encode() 7653 req, err := http.NewRequest("POST", urls, body) 7654 if err != nil { 7655 return nil, err 7656 } 7657 req.Header = reqHeaders 7658 googleapi.Expand(req.URL, map[string]string{ 7659 "customer": c.customer, 7660 }) 7661 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7662} 7663 7664// Do executes the "directory.domainAliases.insert" call. 7665// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx 7666// status code is an error. Response headers are in either 7667// *DomainAlias.ServerResponse.Header or (if a response was returned at 7668// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7669// to check whether the returned error was because 7670// http.StatusNotModified was returned. 7671func (c *DomainAliasesInsertCall) Do(opts ...googleapi.CallOption) (*DomainAlias, error) { 7672 gensupport.SetOptions(c.urlParams_, opts...) 7673 res, err := c.doRequest("json") 7674 if res != nil && res.StatusCode == http.StatusNotModified { 7675 if res.Body != nil { 7676 res.Body.Close() 7677 } 7678 return nil, &googleapi.Error{ 7679 Code: res.StatusCode, 7680 Header: res.Header, 7681 } 7682 } 7683 if err != nil { 7684 return nil, err 7685 } 7686 defer googleapi.CloseBody(res) 7687 if err := googleapi.CheckResponse(res); err != nil { 7688 return nil, err 7689 } 7690 ret := &DomainAlias{ 7691 ServerResponse: googleapi.ServerResponse{ 7692 Header: res.Header, 7693 HTTPStatusCode: res.StatusCode, 7694 }, 7695 } 7696 target := &ret 7697 if err := gensupport.DecodeResponse(target, res); err != nil { 7698 return nil, err 7699 } 7700 return ret, nil 7701 // { 7702 // "description": "Inserts a domain alias of the customer.", 7703 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases", 7704 // "httpMethod": "POST", 7705 // "id": "directory.domainAliases.insert", 7706 // "parameterOrder": [ 7707 // "customer" 7708 // ], 7709 // "parameters": { 7710 // "customer": { 7711 // "description": "Immutable ID of the G Suite account.", 7712 // "location": "path", 7713 // "required": true, 7714 // "type": "string" 7715 // } 7716 // }, 7717 // "path": "admin/directory/v1/customer/{customer}/domainaliases", 7718 // "request": { 7719 // "$ref": "DomainAlias" 7720 // }, 7721 // "response": { 7722 // "$ref": "DomainAlias" 7723 // }, 7724 // "scopes": [ 7725 // "https://www.googleapis.com/auth/admin.directory.domain" 7726 // ] 7727 // } 7728 7729} 7730 7731// method id "directory.domainAliases.list": 7732 7733type DomainAliasesListCall struct { 7734 s *Service 7735 customer string 7736 urlParams_ gensupport.URLParams 7737 ifNoneMatch_ string 7738 ctx_ context.Context 7739 header_ http.Header 7740} 7741 7742// List: Lists the domain aliases of the customer. 7743func (r *DomainAliasesService) List(customer string) *DomainAliasesListCall { 7744 c := &DomainAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7745 c.customer = customer 7746 return c 7747} 7748 7749// ParentDomainName sets the optional parameter "parentDomainName": Name 7750// of the parent domain for which domain aliases are to be fetched. 7751func (c *DomainAliasesListCall) ParentDomainName(parentDomainName string) *DomainAliasesListCall { 7752 c.urlParams_.Set("parentDomainName", parentDomainName) 7753 return c 7754} 7755 7756// Fields allows partial responses to be retrieved. See 7757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7758// for more information. 7759func (c *DomainAliasesListCall) Fields(s ...googleapi.Field) *DomainAliasesListCall { 7760 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7761 return c 7762} 7763 7764// IfNoneMatch sets the optional parameter which makes the operation 7765// fail if the object's ETag matches the given value. This is useful for 7766// getting updates only after the object has changed since the last 7767// request. Use googleapi.IsNotModified to check whether the response 7768// error from Do is the result of In-None-Match. 7769func (c *DomainAliasesListCall) IfNoneMatch(entityTag string) *DomainAliasesListCall { 7770 c.ifNoneMatch_ = entityTag 7771 return c 7772} 7773 7774// Context sets the context to be used in this call's Do method. Any 7775// pending HTTP request will be aborted if the provided context is 7776// canceled. 7777func (c *DomainAliasesListCall) Context(ctx context.Context) *DomainAliasesListCall { 7778 c.ctx_ = ctx 7779 return c 7780} 7781 7782// Header returns an http.Header that can be modified by the caller to 7783// add HTTP headers to the request. 7784func (c *DomainAliasesListCall) Header() http.Header { 7785 if c.header_ == nil { 7786 c.header_ = make(http.Header) 7787 } 7788 return c.header_ 7789} 7790 7791func (c *DomainAliasesListCall) doRequest(alt string) (*http.Response, error) { 7792 reqHeaders := make(http.Header) 7793 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7794 for k, v := range c.header_ { 7795 reqHeaders[k] = v 7796 } 7797 reqHeaders.Set("User-Agent", c.s.userAgent()) 7798 if c.ifNoneMatch_ != "" { 7799 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7800 } 7801 var body io.Reader = nil 7802 c.urlParams_.Set("alt", alt) 7803 c.urlParams_.Set("prettyPrint", "false") 7804 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases") 7805 urls += "?" + c.urlParams_.Encode() 7806 req, err := http.NewRequest("GET", urls, body) 7807 if err != nil { 7808 return nil, err 7809 } 7810 req.Header = reqHeaders 7811 googleapi.Expand(req.URL, map[string]string{ 7812 "customer": c.customer, 7813 }) 7814 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7815} 7816 7817// Do executes the "directory.domainAliases.list" call. 7818// Exactly one of *DomainAliases or error will be non-nil. Any non-2xx 7819// status code is an error. Response headers are in either 7820// *DomainAliases.ServerResponse.Header or (if a response was returned 7821// at all) in error.(*googleapi.Error).Header. Use 7822// googleapi.IsNotModified to check whether the returned error was 7823// because http.StatusNotModified was returned. 7824func (c *DomainAliasesListCall) Do(opts ...googleapi.CallOption) (*DomainAliases, error) { 7825 gensupport.SetOptions(c.urlParams_, opts...) 7826 res, err := c.doRequest("json") 7827 if res != nil && res.StatusCode == http.StatusNotModified { 7828 if res.Body != nil { 7829 res.Body.Close() 7830 } 7831 return nil, &googleapi.Error{ 7832 Code: res.StatusCode, 7833 Header: res.Header, 7834 } 7835 } 7836 if err != nil { 7837 return nil, err 7838 } 7839 defer googleapi.CloseBody(res) 7840 if err := googleapi.CheckResponse(res); err != nil { 7841 return nil, err 7842 } 7843 ret := &DomainAliases{ 7844 ServerResponse: googleapi.ServerResponse{ 7845 Header: res.Header, 7846 HTTPStatusCode: res.StatusCode, 7847 }, 7848 } 7849 target := &ret 7850 if err := gensupport.DecodeResponse(target, res); err != nil { 7851 return nil, err 7852 } 7853 return ret, nil 7854 // { 7855 // "description": "Lists the domain aliases of the customer.", 7856 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases", 7857 // "httpMethod": "GET", 7858 // "id": "directory.domainAliases.list", 7859 // "parameterOrder": [ 7860 // "customer" 7861 // ], 7862 // "parameters": { 7863 // "customer": { 7864 // "description": "Immutable ID of the G Suite account.", 7865 // "location": "path", 7866 // "required": true, 7867 // "type": "string" 7868 // }, 7869 // "parentDomainName": { 7870 // "description": "Name of the parent domain for which domain aliases are to be fetched.", 7871 // "location": "query", 7872 // "type": "string" 7873 // } 7874 // }, 7875 // "path": "admin/directory/v1/customer/{customer}/domainaliases", 7876 // "response": { 7877 // "$ref": "DomainAliases" 7878 // }, 7879 // "scopes": [ 7880 // "https://www.googleapis.com/auth/admin.directory.domain", 7881 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 7882 // ] 7883 // } 7884 7885} 7886 7887// method id "directory.domains.delete": 7888 7889type DomainsDeleteCall struct { 7890 s *Service 7891 customer string 7892 domainName string 7893 urlParams_ gensupport.URLParams 7894 ctx_ context.Context 7895 header_ http.Header 7896} 7897 7898// Delete: Deletes a domain of the customer. 7899func (r *DomainsService) Delete(customer string, domainName string) *DomainsDeleteCall { 7900 c := &DomainsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7901 c.customer = customer 7902 c.domainName = domainName 7903 return c 7904} 7905 7906// Fields allows partial responses to be retrieved. See 7907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7908// for more information. 7909func (c *DomainsDeleteCall) Fields(s ...googleapi.Field) *DomainsDeleteCall { 7910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7911 return c 7912} 7913 7914// Context sets the context to be used in this call's Do method. Any 7915// pending HTTP request will be aborted if the provided context is 7916// canceled. 7917func (c *DomainsDeleteCall) Context(ctx context.Context) *DomainsDeleteCall { 7918 c.ctx_ = ctx 7919 return c 7920} 7921 7922// Header returns an http.Header that can be modified by the caller to 7923// add HTTP headers to the request. 7924func (c *DomainsDeleteCall) Header() http.Header { 7925 if c.header_ == nil { 7926 c.header_ = make(http.Header) 7927 } 7928 return c.header_ 7929} 7930 7931func (c *DomainsDeleteCall) doRequest(alt string) (*http.Response, error) { 7932 reqHeaders := make(http.Header) 7933 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7934 for k, v := range c.header_ { 7935 reqHeaders[k] = v 7936 } 7937 reqHeaders.Set("User-Agent", c.s.userAgent()) 7938 var body io.Reader = nil 7939 c.urlParams_.Set("alt", alt) 7940 c.urlParams_.Set("prettyPrint", "false") 7941 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") 7942 urls += "?" + c.urlParams_.Encode() 7943 req, err := http.NewRequest("DELETE", urls, body) 7944 if err != nil { 7945 return nil, err 7946 } 7947 req.Header = reqHeaders 7948 googleapi.Expand(req.URL, map[string]string{ 7949 "customer": c.customer, 7950 "domainName": c.domainName, 7951 }) 7952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7953} 7954 7955// Do executes the "directory.domains.delete" call. 7956func (c *DomainsDeleteCall) Do(opts ...googleapi.CallOption) error { 7957 gensupport.SetOptions(c.urlParams_, opts...) 7958 res, err := c.doRequest("json") 7959 if err != nil { 7960 return err 7961 } 7962 defer googleapi.CloseBody(res) 7963 if err := googleapi.CheckResponse(res); err != nil { 7964 return err 7965 } 7966 return nil 7967 // { 7968 // "description": "Deletes a domain of the customer.", 7969 // "flatPath": "admin/directory/v1/customer/{customer}/domains/{domainName}", 7970 // "httpMethod": "DELETE", 7971 // "id": "directory.domains.delete", 7972 // "parameterOrder": [ 7973 // "customer", 7974 // "domainName" 7975 // ], 7976 // "parameters": { 7977 // "customer": { 7978 // "description": "Immutable ID of the G Suite account.", 7979 // "location": "path", 7980 // "required": true, 7981 // "type": "string" 7982 // }, 7983 // "domainName": { 7984 // "description": "Name of domain to be deleted", 7985 // "location": "path", 7986 // "required": true, 7987 // "type": "string" 7988 // } 7989 // }, 7990 // "path": "admin/directory/v1/customer/{customer}/domains/{domainName}", 7991 // "scopes": [ 7992 // "https://www.googleapis.com/auth/admin.directory.domain" 7993 // ] 7994 // } 7995 7996} 7997 7998// method id "directory.domains.get": 7999 8000type DomainsGetCall struct { 8001 s *Service 8002 customer string 8003 domainName string 8004 urlParams_ gensupport.URLParams 8005 ifNoneMatch_ string 8006 ctx_ context.Context 8007 header_ http.Header 8008} 8009 8010// Get: Retrieves a domain of the customer. 8011func (r *DomainsService) Get(customer string, domainName string) *DomainsGetCall { 8012 c := &DomainsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8013 c.customer = customer 8014 c.domainName = domainName 8015 return c 8016} 8017 8018// Fields allows partial responses to be retrieved. See 8019// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8020// for more information. 8021func (c *DomainsGetCall) Fields(s ...googleapi.Field) *DomainsGetCall { 8022 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8023 return c 8024} 8025 8026// IfNoneMatch sets the optional parameter which makes the operation 8027// fail if the object's ETag matches the given value. This is useful for 8028// getting updates only after the object has changed since the last 8029// request. Use googleapi.IsNotModified to check whether the response 8030// error from Do is the result of In-None-Match. 8031func (c *DomainsGetCall) IfNoneMatch(entityTag string) *DomainsGetCall { 8032 c.ifNoneMatch_ = entityTag 8033 return c 8034} 8035 8036// Context sets the context to be used in this call's Do method. Any 8037// pending HTTP request will be aborted if the provided context is 8038// canceled. 8039func (c *DomainsGetCall) Context(ctx context.Context) *DomainsGetCall { 8040 c.ctx_ = ctx 8041 return c 8042} 8043 8044// Header returns an http.Header that can be modified by the caller to 8045// add HTTP headers to the request. 8046func (c *DomainsGetCall) Header() http.Header { 8047 if c.header_ == nil { 8048 c.header_ = make(http.Header) 8049 } 8050 return c.header_ 8051} 8052 8053func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { 8054 reqHeaders := make(http.Header) 8055 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8056 for k, v := range c.header_ { 8057 reqHeaders[k] = v 8058 } 8059 reqHeaders.Set("User-Agent", c.s.userAgent()) 8060 if c.ifNoneMatch_ != "" { 8061 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8062 } 8063 var body io.Reader = nil 8064 c.urlParams_.Set("alt", alt) 8065 c.urlParams_.Set("prettyPrint", "false") 8066 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") 8067 urls += "?" + c.urlParams_.Encode() 8068 req, err := http.NewRequest("GET", urls, body) 8069 if err != nil { 8070 return nil, err 8071 } 8072 req.Header = reqHeaders 8073 googleapi.Expand(req.URL, map[string]string{ 8074 "customer": c.customer, 8075 "domainName": c.domainName, 8076 }) 8077 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8078} 8079 8080// Do executes the "directory.domains.get" call. 8081// Exactly one of *Domains or error will be non-nil. Any non-2xx status 8082// code is an error. Response headers are in either 8083// *Domains.ServerResponse.Header or (if a response was returned at all) 8084// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8085// check whether the returned error was because http.StatusNotModified 8086// was returned. 8087func (c *DomainsGetCall) Do(opts ...googleapi.CallOption) (*Domains, error) { 8088 gensupport.SetOptions(c.urlParams_, opts...) 8089 res, err := c.doRequest("json") 8090 if res != nil && res.StatusCode == http.StatusNotModified { 8091 if res.Body != nil { 8092 res.Body.Close() 8093 } 8094 return nil, &googleapi.Error{ 8095 Code: res.StatusCode, 8096 Header: res.Header, 8097 } 8098 } 8099 if err != nil { 8100 return nil, err 8101 } 8102 defer googleapi.CloseBody(res) 8103 if err := googleapi.CheckResponse(res); err != nil { 8104 return nil, err 8105 } 8106 ret := &Domains{ 8107 ServerResponse: googleapi.ServerResponse{ 8108 Header: res.Header, 8109 HTTPStatusCode: res.StatusCode, 8110 }, 8111 } 8112 target := &ret 8113 if err := gensupport.DecodeResponse(target, res); err != nil { 8114 return nil, err 8115 } 8116 return ret, nil 8117 // { 8118 // "description": "Retrieves a domain of the customer.", 8119 // "flatPath": "admin/directory/v1/customer/{customer}/domains/{domainName}", 8120 // "httpMethod": "GET", 8121 // "id": "directory.domains.get", 8122 // "parameterOrder": [ 8123 // "customer", 8124 // "domainName" 8125 // ], 8126 // "parameters": { 8127 // "customer": { 8128 // "description": "Immutable ID of the G Suite account.", 8129 // "location": "path", 8130 // "required": true, 8131 // "type": "string" 8132 // }, 8133 // "domainName": { 8134 // "description": "Name of domain to be retrieved", 8135 // "location": "path", 8136 // "required": true, 8137 // "type": "string" 8138 // } 8139 // }, 8140 // "path": "admin/directory/v1/customer/{customer}/domains/{domainName}", 8141 // "response": { 8142 // "$ref": "Domains" 8143 // }, 8144 // "scopes": [ 8145 // "https://www.googleapis.com/auth/admin.directory.domain", 8146 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 8147 // ] 8148 // } 8149 8150} 8151 8152// method id "directory.domains.insert": 8153 8154type DomainsInsertCall struct { 8155 s *Service 8156 customer string 8157 domains *Domains 8158 urlParams_ gensupport.URLParams 8159 ctx_ context.Context 8160 header_ http.Header 8161} 8162 8163// Insert: Inserts a domain of the customer. 8164func (r *DomainsService) Insert(customer string, domains *Domains) *DomainsInsertCall { 8165 c := &DomainsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8166 c.customer = customer 8167 c.domains = domains 8168 return c 8169} 8170 8171// Fields allows partial responses to be retrieved. See 8172// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8173// for more information. 8174func (c *DomainsInsertCall) Fields(s ...googleapi.Field) *DomainsInsertCall { 8175 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8176 return c 8177} 8178 8179// Context sets the context to be used in this call's Do method. Any 8180// pending HTTP request will be aborted if the provided context is 8181// canceled. 8182func (c *DomainsInsertCall) Context(ctx context.Context) *DomainsInsertCall { 8183 c.ctx_ = ctx 8184 return c 8185} 8186 8187// Header returns an http.Header that can be modified by the caller to 8188// add HTTP headers to the request. 8189func (c *DomainsInsertCall) Header() http.Header { 8190 if c.header_ == nil { 8191 c.header_ = make(http.Header) 8192 } 8193 return c.header_ 8194} 8195 8196func (c *DomainsInsertCall) doRequest(alt string) (*http.Response, error) { 8197 reqHeaders := make(http.Header) 8198 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8199 for k, v := range c.header_ { 8200 reqHeaders[k] = v 8201 } 8202 reqHeaders.Set("User-Agent", c.s.userAgent()) 8203 var body io.Reader = nil 8204 body, err := googleapi.WithoutDataWrapper.JSONReader(c.domains) 8205 if err != nil { 8206 return nil, err 8207 } 8208 reqHeaders.Set("Content-Type", "application/json") 8209 c.urlParams_.Set("alt", alt) 8210 c.urlParams_.Set("prettyPrint", "false") 8211 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains") 8212 urls += "?" + c.urlParams_.Encode() 8213 req, err := http.NewRequest("POST", urls, body) 8214 if err != nil { 8215 return nil, err 8216 } 8217 req.Header = reqHeaders 8218 googleapi.Expand(req.URL, map[string]string{ 8219 "customer": c.customer, 8220 }) 8221 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8222} 8223 8224// Do executes the "directory.domains.insert" call. 8225// Exactly one of *Domains or error will be non-nil. Any non-2xx status 8226// code is an error. Response headers are in either 8227// *Domains.ServerResponse.Header or (if a response was returned at all) 8228// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8229// check whether the returned error was because http.StatusNotModified 8230// was returned. 8231func (c *DomainsInsertCall) Do(opts ...googleapi.CallOption) (*Domains, error) { 8232 gensupport.SetOptions(c.urlParams_, opts...) 8233 res, err := c.doRequest("json") 8234 if res != nil && res.StatusCode == http.StatusNotModified { 8235 if res.Body != nil { 8236 res.Body.Close() 8237 } 8238 return nil, &googleapi.Error{ 8239 Code: res.StatusCode, 8240 Header: res.Header, 8241 } 8242 } 8243 if err != nil { 8244 return nil, err 8245 } 8246 defer googleapi.CloseBody(res) 8247 if err := googleapi.CheckResponse(res); err != nil { 8248 return nil, err 8249 } 8250 ret := &Domains{ 8251 ServerResponse: googleapi.ServerResponse{ 8252 Header: res.Header, 8253 HTTPStatusCode: res.StatusCode, 8254 }, 8255 } 8256 target := &ret 8257 if err := gensupport.DecodeResponse(target, res); err != nil { 8258 return nil, err 8259 } 8260 return ret, nil 8261 // { 8262 // "description": "Inserts a domain of the customer.", 8263 // "flatPath": "admin/directory/v1/customer/{customer}/domains", 8264 // "httpMethod": "POST", 8265 // "id": "directory.domains.insert", 8266 // "parameterOrder": [ 8267 // "customer" 8268 // ], 8269 // "parameters": { 8270 // "customer": { 8271 // "description": "Immutable ID of the G Suite account.", 8272 // "location": "path", 8273 // "required": true, 8274 // "type": "string" 8275 // } 8276 // }, 8277 // "path": "admin/directory/v1/customer/{customer}/domains", 8278 // "request": { 8279 // "$ref": "Domains" 8280 // }, 8281 // "response": { 8282 // "$ref": "Domains" 8283 // }, 8284 // "scopes": [ 8285 // "https://www.googleapis.com/auth/admin.directory.domain" 8286 // ] 8287 // } 8288 8289} 8290 8291// method id "directory.domains.list": 8292 8293type DomainsListCall struct { 8294 s *Service 8295 customer string 8296 urlParams_ gensupport.URLParams 8297 ifNoneMatch_ string 8298 ctx_ context.Context 8299 header_ http.Header 8300} 8301 8302// List: Lists the domains of the customer. 8303func (r *DomainsService) List(customer string) *DomainsListCall { 8304 c := &DomainsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8305 c.customer = customer 8306 return c 8307} 8308 8309// Fields allows partial responses to be retrieved. See 8310// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8311// for more information. 8312func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall { 8313 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8314 return c 8315} 8316 8317// IfNoneMatch sets the optional parameter which makes the operation 8318// fail if the object's ETag matches the given value. This is useful for 8319// getting updates only after the object has changed since the last 8320// request. Use googleapi.IsNotModified to check whether the response 8321// error from Do is the result of In-None-Match. 8322func (c *DomainsListCall) IfNoneMatch(entityTag string) *DomainsListCall { 8323 c.ifNoneMatch_ = entityTag 8324 return c 8325} 8326 8327// Context sets the context to be used in this call's Do method. Any 8328// pending HTTP request will be aborted if the provided context is 8329// canceled. 8330func (c *DomainsListCall) Context(ctx context.Context) *DomainsListCall { 8331 c.ctx_ = ctx 8332 return c 8333} 8334 8335// Header returns an http.Header that can be modified by the caller to 8336// add HTTP headers to the request. 8337func (c *DomainsListCall) Header() http.Header { 8338 if c.header_ == nil { 8339 c.header_ = make(http.Header) 8340 } 8341 return c.header_ 8342} 8343 8344func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { 8345 reqHeaders := make(http.Header) 8346 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8347 for k, v := range c.header_ { 8348 reqHeaders[k] = v 8349 } 8350 reqHeaders.Set("User-Agent", c.s.userAgent()) 8351 if c.ifNoneMatch_ != "" { 8352 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8353 } 8354 var body io.Reader = nil 8355 c.urlParams_.Set("alt", alt) 8356 c.urlParams_.Set("prettyPrint", "false") 8357 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains") 8358 urls += "?" + c.urlParams_.Encode() 8359 req, err := http.NewRequest("GET", urls, body) 8360 if err != nil { 8361 return nil, err 8362 } 8363 req.Header = reqHeaders 8364 googleapi.Expand(req.URL, map[string]string{ 8365 "customer": c.customer, 8366 }) 8367 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8368} 8369 8370// Do executes the "directory.domains.list" call. 8371// Exactly one of *Domains2 or error will be non-nil. Any non-2xx status 8372// code is an error. Response headers are in either 8373// *Domains2.ServerResponse.Header or (if a response was returned at 8374// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8375// to check whether the returned error was because 8376// http.StatusNotModified was returned. 8377func (c *DomainsListCall) Do(opts ...googleapi.CallOption) (*Domains2, error) { 8378 gensupport.SetOptions(c.urlParams_, opts...) 8379 res, err := c.doRequest("json") 8380 if res != nil && res.StatusCode == http.StatusNotModified { 8381 if res.Body != nil { 8382 res.Body.Close() 8383 } 8384 return nil, &googleapi.Error{ 8385 Code: res.StatusCode, 8386 Header: res.Header, 8387 } 8388 } 8389 if err != nil { 8390 return nil, err 8391 } 8392 defer googleapi.CloseBody(res) 8393 if err := googleapi.CheckResponse(res); err != nil { 8394 return nil, err 8395 } 8396 ret := &Domains2{ 8397 ServerResponse: googleapi.ServerResponse{ 8398 Header: res.Header, 8399 HTTPStatusCode: res.StatusCode, 8400 }, 8401 } 8402 target := &ret 8403 if err := gensupport.DecodeResponse(target, res); err != nil { 8404 return nil, err 8405 } 8406 return ret, nil 8407 // { 8408 // "description": "Lists the domains of the customer.", 8409 // "flatPath": "admin/directory/v1/customer/{customer}/domains", 8410 // "httpMethod": "GET", 8411 // "id": "directory.domains.list", 8412 // "parameterOrder": [ 8413 // "customer" 8414 // ], 8415 // "parameters": { 8416 // "customer": { 8417 // "description": "Immutable ID of the G Suite account.", 8418 // "location": "path", 8419 // "required": true, 8420 // "type": "string" 8421 // } 8422 // }, 8423 // "path": "admin/directory/v1/customer/{customer}/domains", 8424 // "response": { 8425 // "$ref": "Domains2" 8426 // }, 8427 // "scopes": [ 8428 // "https://www.googleapis.com/auth/admin.directory.domain", 8429 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 8430 // ] 8431 // } 8432 8433} 8434 8435// method id "directory.groups.delete": 8436 8437type GroupsDeleteCall struct { 8438 s *Service 8439 groupKey string 8440 urlParams_ gensupport.URLParams 8441 ctx_ context.Context 8442 header_ http.Header 8443} 8444 8445// Delete: Deletes a group. 8446func (r *GroupsService) Delete(groupKey string) *GroupsDeleteCall { 8447 c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8448 c.groupKey = groupKey 8449 return c 8450} 8451 8452// Fields allows partial responses to be retrieved. See 8453// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8454// for more information. 8455func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { 8456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8457 return c 8458} 8459 8460// Context sets the context to be used in this call's Do method. Any 8461// pending HTTP request will be aborted if the provided context is 8462// canceled. 8463func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { 8464 c.ctx_ = ctx 8465 return c 8466} 8467 8468// Header returns an http.Header that can be modified by the caller to 8469// add HTTP headers to the request. 8470func (c *GroupsDeleteCall) Header() http.Header { 8471 if c.header_ == nil { 8472 c.header_ = make(http.Header) 8473 } 8474 return c.header_ 8475} 8476 8477func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 8478 reqHeaders := make(http.Header) 8479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8480 for k, v := range c.header_ { 8481 reqHeaders[k] = v 8482 } 8483 reqHeaders.Set("User-Agent", c.s.userAgent()) 8484 var body io.Reader = nil 8485 c.urlParams_.Set("alt", alt) 8486 c.urlParams_.Set("prettyPrint", "false") 8487 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 8488 urls += "?" + c.urlParams_.Encode() 8489 req, err := http.NewRequest("DELETE", urls, body) 8490 if err != nil { 8491 return nil, err 8492 } 8493 req.Header = reqHeaders 8494 googleapi.Expand(req.URL, map[string]string{ 8495 "groupKey": c.groupKey, 8496 }) 8497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8498} 8499 8500// Do executes the "directory.groups.delete" call. 8501func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) error { 8502 gensupport.SetOptions(c.urlParams_, opts...) 8503 res, err := c.doRequest("json") 8504 if err != nil { 8505 return err 8506 } 8507 defer googleapi.CloseBody(res) 8508 if err := googleapi.CheckResponse(res); err != nil { 8509 return err 8510 } 8511 return nil 8512 // { 8513 // "description": "Deletes a group.", 8514 // "flatPath": "admin/directory/v1/groups/{groupKey}", 8515 // "httpMethod": "DELETE", 8516 // "id": "directory.groups.delete", 8517 // "parameterOrder": [ 8518 // "groupKey" 8519 // ], 8520 // "parameters": { 8521 // "groupKey": { 8522 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 8523 // "location": "path", 8524 // "required": true, 8525 // "type": "string" 8526 // } 8527 // }, 8528 // "path": "admin/directory/v1/groups/{groupKey}", 8529 // "scopes": [ 8530 // "https://www.googleapis.com/auth/admin.directory.group" 8531 // ] 8532 // } 8533 8534} 8535 8536// method id "directory.groups.get": 8537 8538type GroupsGetCall struct { 8539 s *Service 8540 groupKey string 8541 urlParams_ gensupport.URLParams 8542 ifNoneMatch_ string 8543 ctx_ context.Context 8544 header_ http.Header 8545} 8546 8547// Get: Retrieves a group's properties. 8548func (r *GroupsService) Get(groupKey string) *GroupsGetCall { 8549 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8550 c.groupKey = groupKey 8551 return c 8552} 8553 8554// Fields allows partial responses to be retrieved. See 8555// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8556// for more information. 8557func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 8558 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8559 return c 8560} 8561 8562// IfNoneMatch sets the optional parameter which makes the operation 8563// fail if the object's ETag matches the given value. This is useful for 8564// getting updates only after the object has changed since the last 8565// request. Use googleapi.IsNotModified to check whether the response 8566// error from Do is the result of In-None-Match. 8567func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 8568 c.ifNoneMatch_ = entityTag 8569 return c 8570} 8571 8572// Context sets the context to be used in this call's Do method. Any 8573// pending HTTP request will be aborted if the provided context is 8574// canceled. 8575func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 8576 c.ctx_ = ctx 8577 return c 8578} 8579 8580// Header returns an http.Header that can be modified by the caller to 8581// add HTTP headers to the request. 8582func (c *GroupsGetCall) Header() http.Header { 8583 if c.header_ == nil { 8584 c.header_ = make(http.Header) 8585 } 8586 return c.header_ 8587} 8588 8589func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 8590 reqHeaders := make(http.Header) 8591 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8592 for k, v := range c.header_ { 8593 reqHeaders[k] = v 8594 } 8595 reqHeaders.Set("User-Agent", c.s.userAgent()) 8596 if c.ifNoneMatch_ != "" { 8597 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8598 } 8599 var body io.Reader = nil 8600 c.urlParams_.Set("alt", alt) 8601 c.urlParams_.Set("prettyPrint", "false") 8602 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 8603 urls += "?" + c.urlParams_.Encode() 8604 req, err := http.NewRequest("GET", urls, body) 8605 if err != nil { 8606 return nil, err 8607 } 8608 req.Header = reqHeaders 8609 googleapi.Expand(req.URL, map[string]string{ 8610 "groupKey": c.groupKey, 8611 }) 8612 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8613} 8614 8615// Do executes the "directory.groups.get" call. 8616// Exactly one of *Group or error will be non-nil. Any non-2xx status 8617// code is an error. Response headers are in either 8618// *Group.ServerResponse.Header or (if a response was returned at all) 8619// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8620// check whether the returned error was because http.StatusNotModified 8621// was returned. 8622func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 8623 gensupport.SetOptions(c.urlParams_, opts...) 8624 res, err := c.doRequest("json") 8625 if res != nil && res.StatusCode == http.StatusNotModified { 8626 if res.Body != nil { 8627 res.Body.Close() 8628 } 8629 return nil, &googleapi.Error{ 8630 Code: res.StatusCode, 8631 Header: res.Header, 8632 } 8633 } 8634 if err != nil { 8635 return nil, err 8636 } 8637 defer googleapi.CloseBody(res) 8638 if err := googleapi.CheckResponse(res); err != nil { 8639 return nil, err 8640 } 8641 ret := &Group{ 8642 ServerResponse: googleapi.ServerResponse{ 8643 Header: res.Header, 8644 HTTPStatusCode: res.StatusCode, 8645 }, 8646 } 8647 target := &ret 8648 if err := gensupport.DecodeResponse(target, res); err != nil { 8649 return nil, err 8650 } 8651 return ret, nil 8652 // { 8653 // "description": "Retrieves a group's properties.", 8654 // "flatPath": "admin/directory/v1/groups/{groupKey}", 8655 // "httpMethod": "GET", 8656 // "id": "directory.groups.get", 8657 // "parameterOrder": [ 8658 // "groupKey" 8659 // ], 8660 // "parameters": { 8661 // "groupKey": { 8662 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 8663 // "location": "path", 8664 // "required": true, 8665 // "type": "string" 8666 // } 8667 // }, 8668 // "path": "admin/directory/v1/groups/{groupKey}", 8669 // "response": { 8670 // "$ref": "Group" 8671 // }, 8672 // "scopes": [ 8673 // "https://www.googleapis.com/auth/admin.directory.group", 8674 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 8675 // ] 8676 // } 8677 8678} 8679 8680// method id "directory.groups.insert": 8681 8682type GroupsInsertCall struct { 8683 s *Service 8684 group *Group 8685 urlParams_ gensupport.URLParams 8686 ctx_ context.Context 8687 header_ http.Header 8688} 8689 8690// Insert: Creates a group. 8691func (r *GroupsService) Insert(group *Group) *GroupsInsertCall { 8692 c := &GroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8693 c.group = group 8694 return c 8695} 8696 8697// Fields allows partial responses to be retrieved. See 8698// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8699// for more information. 8700func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { 8701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8702 return c 8703} 8704 8705// Context sets the context to be used in this call's Do method. Any 8706// pending HTTP request will be aborted if the provided context is 8707// canceled. 8708func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { 8709 c.ctx_ = ctx 8710 return c 8711} 8712 8713// Header returns an http.Header that can be modified by the caller to 8714// add HTTP headers to the request. 8715func (c *GroupsInsertCall) Header() http.Header { 8716 if c.header_ == nil { 8717 c.header_ = make(http.Header) 8718 } 8719 return c.header_ 8720} 8721 8722func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) { 8723 reqHeaders := make(http.Header) 8724 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8725 for k, v := range c.header_ { 8726 reqHeaders[k] = v 8727 } 8728 reqHeaders.Set("User-Agent", c.s.userAgent()) 8729 var body io.Reader = nil 8730 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 8731 if err != nil { 8732 return nil, err 8733 } 8734 reqHeaders.Set("Content-Type", "application/json") 8735 c.urlParams_.Set("alt", alt) 8736 c.urlParams_.Set("prettyPrint", "false") 8737 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups") 8738 urls += "?" + c.urlParams_.Encode() 8739 req, err := http.NewRequest("POST", urls, body) 8740 if err != nil { 8741 return nil, err 8742 } 8743 req.Header = reqHeaders 8744 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8745} 8746 8747// Do executes the "directory.groups.insert" call. 8748// Exactly one of *Group or error will be non-nil. Any non-2xx status 8749// code is an error. Response headers are in either 8750// *Group.ServerResponse.Header or (if a response was returned at all) 8751// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8752// check whether the returned error was because http.StatusNotModified 8753// was returned. 8754func (c *GroupsInsertCall) Do(opts ...googleapi.CallOption) (*Group, error) { 8755 gensupport.SetOptions(c.urlParams_, opts...) 8756 res, err := c.doRequest("json") 8757 if res != nil && res.StatusCode == http.StatusNotModified { 8758 if res.Body != nil { 8759 res.Body.Close() 8760 } 8761 return nil, &googleapi.Error{ 8762 Code: res.StatusCode, 8763 Header: res.Header, 8764 } 8765 } 8766 if err != nil { 8767 return nil, err 8768 } 8769 defer googleapi.CloseBody(res) 8770 if err := googleapi.CheckResponse(res); err != nil { 8771 return nil, err 8772 } 8773 ret := &Group{ 8774 ServerResponse: googleapi.ServerResponse{ 8775 Header: res.Header, 8776 HTTPStatusCode: res.StatusCode, 8777 }, 8778 } 8779 target := &ret 8780 if err := gensupport.DecodeResponse(target, res); err != nil { 8781 return nil, err 8782 } 8783 return ret, nil 8784 // { 8785 // "description": "Creates a group.", 8786 // "flatPath": "admin/directory/v1/groups", 8787 // "httpMethod": "POST", 8788 // "id": "directory.groups.insert", 8789 // "parameterOrder": [], 8790 // "parameters": {}, 8791 // "path": "admin/directory/v1/groups", 8792 // "request": { 8793 // "$ref": "Group" 8794 // }, 8795 // "response": { 8796 // "$ref": "Group" 8797 // }, 8798 // "scopes": [ 8799 // "https://www.googleapis.com/auth/admin.directory.group" 8800 // ] 8801 // } 8802 8803} 8804 8805// method id "directory.groups.list": 8806 8807type GroupsListCall struct { 8808 s *Service 8809 urlParams_ gensupport.URLParams 8810 ifNoneMatch_ string 8811 ctx_ context.Context 8812 header_ http.Header 8813} 8814 8815// List: Retrieve all groups of a domain or of a user given a userKey 8816// (paginated) 8817func (r *GroupsService) List() *GroupsListCall { 8818 c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8819 return c 8820} 8821 8822// Customer sets the optional parameter "customer": The unique ID for 8823// the customer's G Suite account. In case of a multi-domain account, to 8824// fetch all groups for a customer, fill this field instead of domain. 8825// As an account administrator, you can also use the `my_customer` alias 8826// to represent your account's `customerId`. The `customerId` is also 8827// returned as part of the 8828// [Users](/admin-sdk/directory/v1/reference/users) 8829func (c *GroupsListCall) Customer(customer string) *GroupsListCall { 8830 c.urlParams_.Set("customer", customer) 8831 return c 8832} 8833 8834// Domain sets the optional parameter "domain": The domain name. Use 8835// this field to get fields from only one domain. To return all domains 8836// for a customer account, use the `customer` query parameter instead. 8837func (c *GroupsListCall) Domain(domain string) *GroupsListCall { 8838 c.urlParams_.Set("domain", domain) 8839 return c 8840} 8841 8842// MaxResults sets the optional parameter "maxResults": Maximum number 8843// of results to return. Max allowed value is 200. 8844func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { 8845 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 8846 return c 8847} 8848 8849// OrderBy sets the optional parameter "orderBy": Column to use for 8850// sorting results 8851// 8852// Possible values: 8853// "orderByUndefined" 8854// "email" - Email of the group. 8855func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { 8856 c.urlParams_.Set("orderBy", orderBy) 8857 return c 8858} 8859 8860// PageToken sets the optional parameter "pageToken": Token to specify 8861// next page in the list 8862func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { 8863 c.urlParams_.Set("pageToken", pageToken) 8864 return c 8865} 8866 8867// Query sets the optional parameter "query": Query string search. 8868// Should be of the form "". Complete documentation is at https: 8869// //developers.google.com/admin-sdk/directory/v1/guides/search-groups 8870func (c *GroupsListCall) Query(query string) *GroupsListCall { 8871 c.urlParams_.Set("query", query) 8872 return c 8873} 8874 8875// SortOrder sets the optional parameter "sortOrder": Whether to return 8876// results in ascending or descending order. Only of use when orderBy is 8877// also used 8878// 8879// Possible values: 8880// "SORT_ORDER_UNDEFINED" 8881// "ASCENDING" - Ascending order. 8882// "DESCENDING" - Descending order. 8883func (c *GroupsListCall) SortOrder(sortOrder string) *GroupsListCall { 8884 c.urlParams_.Set("sortOrder", sortOrder) 8885 return c 8886} 8887 8888// UserKey sets the optional parameter "userKey": Email or immutable ID 8889// of the user if only those groups are to be listed, the given user is 8890// a member of. If it's an ID, it should match with the ID of the user 8891// object. 8892func (c *GroupsListCall) UserKey(userKey string) *GroupsListCall { 8893 c.urlParams_.Set("userKey", userKey) 8894 return c 8895} 8896 8897// Fields allows partial responses to be retrieved. See 8898// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8899// for more information. 8900func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { 8901 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8902 return c 8903} 8904 8905// IfNoneMatch sets the optional parameter which makes the operation 8906// fail if the object's ETag matches the given value. This is useful for 8907// getting updates only after the object has changed since the last 8908// request. Use googleapi.IsNotModified to check whether the response 8909// error from Do is the result of In-None-Match. 8910func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { 8911 c.ifNoneMatch_ = entityTag 8912 return c 8913} 8914 8915// Context sets the context to be used in this call's Do method. Any 8916// pending HTTP request will be aborted if the provided context is 8917// canceled. 8918func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { 8919 c.ctx_ = ctx 8920 return c 8921} 8922 8923// Header returns an http.Header that can be modified by the caller to 8924// add HTTP headers to the request. 8925func (c *GroupsListCall) Header() http.Header { 8926 if c.header_ == nil { 8927 c.header_ = make(http.Header) 8928 } 8929 return c.header_ 8930} 8931 8932func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { 8933 reqHeaders := make(http.Header) 8934 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8935 for k, v := range c.header_ { 8936 reqHeaders[k] = v 8937 } 8938 reqHeaders.Set("User-Agent", c.s.userAgent()) 8939 if c.ifNoneMatch_ != "" { 8940 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8941 } 8942 var body io.Reader = nil 8943 c.urlParams_.Set("alt", alt) 8944 c.urlParams_.Set("prettyPrint", "false") 8945 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups") 8946 urls += "?" + c.urlParams_.Encode() 8947 req, err := http.NewRequest("GET", urls, body) 8948 if err != nil { 8949 return nil, err 8950 } 8951 req.Header = reqHeaders 8952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8953} 8954 8955// Do executes the "directory.groups.list" call. 8956// Exactly one of *Groups or error will be non-nil. Any non-2xx status 8957// code is an error. Response headers are in either 8958// *Groups.ServerResponse.Header or (if a response was returned at all) 8959// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8960// check whether the returned error was because http.StatusNotModified 8961// was returned. 8962func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*Groups, error) { 8963 gensupport.SetOptions(c.urlParams_, opts...) 8964 res, err := c.doRequest("json") 8965 if res != nil && res.StatusCode == http.StatusNotModified { 8966 if res.Body != nil { 8967 res.Body.Close() 8968 } 8969 return nil, &googleapi.Error{ 8970 Code: res.StatusCode, 8971 Header: res.Header, 8972 } 8973 } 8974 if err != nil { 8975 return nil, err 8976 } 8977 defer googleapi.CloseBody(res) 8978 if err := googleapi.CheckResponse(res); err != nil { 8979 return nil, err 8980 } 8981 ret := &Groups{ 8982 ServerResponse: googleapi.ServerResponse{ 8983 Header: res.Header, 8984 HTTPStatusCode: res.StatusCode, 8985 }, 8986 } 8987 target := &ret 8988 if err := gensupport.DecodeResponse(target, res); err != nil { 8989 return nil, err 8990 } 8991 return ret, nil 8992 // { 8993 // "description": "Retrieve all groups of a domain or of a user given a userKey (paginated)", 8994 // "flatPath": "admin/directory/v1/groups", 8995 // "httpMethod": "GET", 8996 // "id": "directory.groups.list", 8997 // "parameterOrder": [], 8998 // "parameters": { 8999 // "customer": { 9000 // "description": "The unique ID for the customer's G Suite account. In case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users](/admin-sdk/directory/v1/reference/users)", 9001 // "location": "query", 9002 // "type": "string" 9003 // }, 9004 // "domain": { 9005 // "description": "The domain name. Use this field to get fields from only one domain. To return all domains for a customer account, use the `customer` query parameter instead.", 9006 // "location": "query", 9007 // "type": "string" 9008 // }, 9009 // "maxResults": { 9010 // "default": "200", 9011 // "description": "Maximum number of results to return. Max allowed value is 200.", 9012 // "format": "int32", 9013 // "location": "query", 9014 // "minimum": "1", 9015 // "type": "integer" 9016 // }, 9017 // "orderBy": { 9018 // "description": "Column to use for sorting results", 9019 // "enum": [ 9020 // "orderByUndefined", 9021 // "email" 9022 // ], 9023 // "enumDescriptions": [ 9024 // "", 9025 // "Email of the group." 9026 // ], 9027 // "location": "query", 9028 // "type": "string" 9029 // }, 9030 // "pageToken": { 9031 // "description": "Token to specify next page in the list", 9032 // "location": "query", 9033 // "type": "string" 9034 // }, 9035 // "query": { 9036 // "description": "Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-groups", 9037 // "location": "query", 9038 // "type": "string" 9039 // }, 9040 // "sortOrder": { 9041 // "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", 9042 // "enum": [ 9043 // "SORT_ORDER_UNDEFINED", 9044 // "ASCENDING", 9045 // "DESCENDING" 9046 // ], 9047 // "enumDescriptions": [ 9048 // "", 9049 // "Ascending order.", 9050 // "Descending order." 9051 // ], 9052 // "location": "query", 9053 // "type": "string" 9054 // }, 9055 // "userKey": { 9056 // "description": "Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object.", 9057 // "location": "query", 9058 // "type": "string" 9059 // } 9060 // }, 9061 // "path": "admin/directory/v1/groups", 9062 // "response": { 9063 // "$ref": "Groups" 9064 // }, 9065 // "scopes": [ 9066 // "https://www.googleapis.com/auth/admin.directory.group", 9067 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 9068 // ] 9069 // } 9070 9071} 9072 9073// Pages invokes f for each page of results. 9074// A non-nil error returned from f will halt the iteration. 9075// The provided context supersedes any context provided to the Context method. 9076func (c *GroupsListCall) Pages(ctx context.Context, f func(*Groups) error) error { 9077 c.ctx_ = ctx 9078 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9079 for { 9080 x, err := c.Do() 9081 if err != nil { 9082 return err 9083 } 9084 if err := f(x); err != nil { 9085 return err 9086 } 9087 if x.NextPageToken == "" { 9088 return nil 9089 } 9090 c.PageToken(x.NextPageToken) 9091 } 9092} 9093 9094// method id "directory.groups.patch": 9095 9096type GroupsPatchCall struct { 9097 s *Service 9098 groupKey string 9099 group *Group 9100 urlParams_ gensupport.URLParams 9101 ctx_ context.Context 9102 header_ http.Header 9103} 9104 9105// Patch: Updates a group's properties. This method supports [patch 9106// semantics](/admin-sdk/directory/v1/guides/performance#patch). 9107func (r *GroupsService) Patch(groupKey string, group *Group) *GroupsPatchCall { 9108 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9109 c.groupKey = groupKey 9110 c.group = group 9111 return c 9112} 9113 9114// Fields allows partial responses to be retrieved. See 9115// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9116// for more information. 9117func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 9118 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9119 return c 9120} 9121 9122// Context sets the context to be used in this call's Do method. Any 9123// pending HTTP request will be aborted if the provided context is 9124// canceled. 9125func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 9126 c.ctx_ = ctx 9127 return c 9128} 9129 9130// Header returns an http.Header that can be modified by the caller to 9131// add HTTP headers to the request. 9132func (c *GroupsPatchCall) Header() http.Header { 9133 if c.header_ == nil { 9134 c.header_ = make(http.Header) 9135 } 9136 return c.header_ 9137} 9138 9139func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 9140 reqHeaders := make(http.Header) 9141 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9142 for k, v := range c.header_ { 9143 reqHeaders[k] = v 9144 } 9145 reqHeaders.Set("User-Agent", c.s.userAgent()) 9146 var body io.Reader = nil 9147 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 9148 if err != nil { 9149 return nil, err 9150 } 9151 reqHeaders.Set("Content-Type", "application/json") 9152 c.urlParams_.Set("alt", alt) 9153 c.urlParams_.Set("prettyPrint", "false") 9154 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 9155 urls += "?" + c.urlParams_.Encode() 9156 req, err := http.NewRequest("PATCH", urls, body) 9157 if err != nil { 9158 return nil, err 9159 } 9160 req.Header = reqHeaders 9161 googleapi.Expand(req.URL, map[string]string{ 9162 "groupKey": c.groupKey, 9163 }) 9164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9165} 9166 9167// Do executes the "directory.groups.patch" call. 9168// Exactly one of *Group or error will be non-nil. Any non-2xx status 9169// code is an error. Response headers are in either 9170// *Group.ServerResponse.Header or (if a response was returned at all) 9171// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9172// check whether the returned error was because http.StatusNotModified 9173// was returned. 9174func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Group, error) { 9175 gensupport.SetOptions(c.urlParams_, opts...) 9176 res, err := c.doRequest("json") 9177 if res != nil && res.StatusCode == http.StatusNotModified { 9178 if res.Body != nil { 9179 res.Body.Close() 9180 } 9181 return nil, &googleapi.Error{ 9182 Code: res.StatusCode, 9183 Header: res.Header, 9184 } 9185 } 9186 if err != nil { 9187 return nil, err 9188 } 9189 defer googleapi.CloseBody(res) 9190 if err := googleapi.CheckResponse(res); err != nil { 9191 return nil, err 9192 } 9193 ret := &Group{ 9194 ServerResponse: googleapi.ServerResponse{ 9195 Header: res.Header, 9196 HTTPStatusCode: res.StatusCode, 9197 }, 9198 } 9199 target := &ret 9200 if err := gensupport.DecodeResponse(target, res); err != nil { 9201 return nil, err 9202 } 9203 return ret, nil 9204 // { 9205 // "description": "Updates a group's properties. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 9206 // "flatPath": "admin/directory/v1/groups/{groupKey}", 9207 // "httpMethod": "PATCH", 9208 // "id": "directory.groups.patch", 9209 // "parameterOrder": [ 9210 // "groupKey" 9211 // ], 9212 // "parameters": { 9213 // "groupKey": { 9214 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9215 // "location": "path", 9216 // "required": true, 9217 // "type": "string" 9218 // } 9219 // }, 9220 // "path": "admin/directory/v1/groups/{groupKey}", 9221 // "request": { 9222 // "$ref": "Group" 9223 // }, 9224 // "response": { 9225 // "$ref": "Group" 9226 // }, 9227 // "scopes": [ 9228 // "https://www.googleapis.com/auth/admin.directory.group" 9229 // ] 9230 // } 9231 9232} 9233 9234// method id "directory.groups.update": 9235 9236type GroupsUpdateCall struct { 9237 s *Service 9238 groupKey string 9239 group *Group 9240 urlParams_ gensupport.URLParams 9241 ctx_ context.Context 9242 header_ http.Header 9243} 9244 9245// Update: Updates a group's properties. 9246func (r *GroupsService) Update(groupKey string, group *Group) *GroupsUpdateCall { 9247 c := &GroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9248 c.groupKey = groupKey 9249 c.group = group 9250 return c 9251} 9252 9253// Fields allows partial responses to be retrieved. See 9254// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9255// for more information. 9256func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall { 9257 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9258 return c 9259} 9260 9261// Context sets the context to be used in this call's Do method. Any 9262// pending HTTP request will be aborted if the provided context is 9263// canceled. 9264func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall { 9265 c.ctx_ = ctx 9266 return c 9267} 9268 9269// Header returns an http.Header that can be modified by the caller to 9270// add HTTP headers to the request. 9271func (c *GroupsUpdateCall) Header() http.Header { 9272 if c.header_ == nil { 9273 c.header_ = make(http.Header) 9274 } 9275 return c.header_ 9276} 9277 9278func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 9279 reqHeaders := make(http.Header) 9280 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9281 for k, v := range c.header_ { 9282 reqHeaders[k] = v 9283 } 9284 reqHeaders.Set("User-Agent", c.s.userAgent()) 9285 var body io.Reader = nil 9286 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 9287 if err != nil { 9288 return nil, err 9289 } 9290 reqHeaders.Set("Content-Type", "application/json") 9291 c.urlParams_.Set("alt", alt) 9292 c.urlParams_.Set("prettyPrint", "false") 9293 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 9294 urls += "?" + c.urlParams_.Encode() 9295 req, err := http.NewRequest("PUT", urls, body) 9296 if err != nil { 9297 return nil, err 9298 } 9299 req.Header = reqHeaders 9300 googleapi.Expand(req.URL, map[string]string{ 9301 "groupKey": c.groupKey, 9302 }) 9303 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9304} 9305 9306// Do executes the "directory.groups.update" call. 9307// Exactly one of *Group or error will be non-nil. Any non-2xx status 9308// code is an error. Response headers are in either 9309// *Group.ServerResponse.Header or (if a response was returned at all) 9310// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9311// check whether the returned error was because http.StatusNotModified 9312// was returned. 9313func (c *GroupsUpdateCall) Do(opts ...googleapi.CallOption) (*Group, error) { 9314 gensupport.SetOptions(c.urlParams_, opts...) 9315 res, err := c.doRequest("json") 9316 if res != nil && res.StatusCode == http.StatusNotModified { 9317 if res.Body != nil { 9318 res.Body.Close() 9319 } 9320 return nil, &googleapi.Error{ 9321 Code: res.StatusCode, 9322 Header: res.Header, 9323 } 9324 } 9325 if err != nil { 9326 return nil, err 9327 } 9328 defer googleapi.CloseBody(res) 9329 if err := googleapi.CheckResponse(res); err != nil { 9330 return nil, err 9331 } 9332 ret := &Group{ 9333 ServerResponse: googleapi.ServerResponse{ 9334 Header: res.Header, 9335 HTTPStatusCode: res.StatusCode, 9336 }, 9337 } 9338 target := &ret 9339 if err := gensupport.DecodeResponse(target, res); err != nil { 9340 return nil, err 9341 } 9342 return ret, nil 9343 // { 9344 // "description": "Updates a group's properties.", 9345 // "flatPath": "admin/directory/v1/groups/{groupKey}", 9346 // "httpMethod": "PUT", 9347 // "id": "directory.groups.update", 9348 // "parameterOrder": [ 9349 // "groupKey" 9350 // ], 9351 // "parameters": { 9352 // "groupKey": { 9353 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9354 // "location": "path", 9355 // "required": true, 9356 // "type": "string" 9357 // } 9358 // }, 9359 // "path": "admin/directory/v1/groups/{groupKey}", 9360 // "request": { 9361 // "$ref": "Group" 9362 // }, 9363 // "response": { 9364 // "$ref": "Group" 9365 // }, 9366 // "scopes": [ 9367 // "https://www.googleapis.com/auth/admin.directory.group" 9368 // ] 9369 // } 9370 9371} 9372 9373// method id "directory.groups.aliases.delete": 9374 9375type GroupsAliasesDeleteCall struct { 9376 s *Service 9377 groupKey string 9378 alias string 9379 urlParams_ gensupport.URLParams 9380 ctx_ context.Context 9381 header_ http.Header 9382} 9383 9384// Delete: Removes an alias. 9385func (r *GroupsAliasesService) Delete(groupKey string, alias string) *GroupsAliasesDeleteCall { 9386 c := &GroupsAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9387 c.groupKey = groupKey 9388 c.alias = alias 9389 return c 9390} 9391 9392// Fields allows partial responses to be retrieved. See 9393// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9394// for more information. 9395func (c *GroupsAliasesDeleteCall) Fields(s ...googleapi.Field) *GroupsAliasesDeleteCall { 9396 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9397 return c 9398} 9399 9400// Context sets the context to be used in this call's Do method. Any 9401// pending HTTP request will be aborted if the provided context is 9402// canceled. 9403func (c *GroupsAliasesDeleteCall) Context(ctx context.Context) *GroupsAliasesDeleteCall { 9404 c.ctx_ = ctx 9405 return c 9406} 9407 9408// Header returns an http.Header that can be modified by the caller to 9409// add HTTP headers to the request. 9410func (c *GroupsAliasesDeleteCall) Header() http.Header { 9411 if c.header_ == nil { 9412 c.header_ = make(http.Header) 9413 } 9414 return c.header_ 9415} 9416 9417func (c *GroupsAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 9418 reqHeaders := make(http.Header) 9419 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9420 for k, v := range c.header_ { 9421 reqHeaders[k] = v 9422 } 9423 reqHeaders.Set("User-Agent", c.s.userAgent()) 9424 var body io.Reader = nil 9425 c.urlParams_.Set("alt", alt) 9426 c.urlParams_.Set("prettyPrint", "false") 9427 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases/{alias}") 9428 urls += "?" + c.urlParams_.Encode() 9429 req, err := http.NewRequest("DELETE", urls, body) 9430 if err != nil { 9431 return nil, err 9432 } 9433 req.Header = reqHeaders 9434 googleapi.Expand(req.URL, map[string]string{ 9435 "groupKey": c.groupKey, 9436 "alias": c.alias, 9437 }) 9438 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9439} 9440 9441// Do executes the "directory.groups.aliases.delete" call. 9442func (c *GroupsAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 9443 gensupport.SetOptions(c.urlParams_, opts...) 9444 res, err := c.doRequest("json") 9445 if err != nil { 9446 return err 9447 } 9448 defer googleapi.CloseBody(res) 9449 if err := googleapi.CheckResponse(res); err != nil { 9450 return err 9451 } 9452 return nil 9453 // { 9454 // "description": "Removes an alias.", 9455 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases/{alias}", 9456 // "httpMethod": "DELETE", 9457 // "id": "directory.groups.aliases.delete", 9458 // "parameterOrder": [ 9459 // "groupKey", 9460 // "alias" 9461 // ], 9462 // "parameters": { 9463 // "alias": { 9464 // "description": "The alias to be removed", 9465 // "location": "path", 9466 // "required": true, 9467 // "type": "string" 9468 // }, 9469 // "groupKey": { 9470 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9471 // "location": "path", 9472 // "required": true, 9473 // "type": "string" 9474 // } 9475 // }, 9476 // "path": "admin/directory/v1/groups/{groupKey}/aliases/{alias}", 9477 // "scopes": [ 9478 // "https://www.googleapis.com/auth/admin.directory.group" 9479 // ] 9480 // } 9481 9482} 9483 9484// method id "directory.groups.aliases.insert": 9485 9486type GroupsAliasesInsertCall struct { 9487 s *Service 9488 groupKey string 9489 alias *Alias 9490 urlParams_ gensupport.URLParams 9491 ctx_ context.Context 9492 header_ http.Header 9493} 9494 9495// Insert: Adds an alias for the group. 9496func (r *GroupsAliasesService) Insert(groupKey string, alias *Alias) *GroupsAliasesInsertCall { 9497 c := &GroupsAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9498 c.groupKey = groupKey 9499 c.alias = alias 9500 return c 9501} 9502 9503// Fields allows partial responses to be retrieved. See 9504// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9505// for more information. 9506func (c *GroupsAliasesInsertCall) Fields(s ...googleapi.Field) *GroupsAliasesInsertCall { 9507 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9508 return c 9509} 9510 9511// Context sets the context to be used in this call's Do method. Any 9512// pending HTTP request will be aborted if the provided context is 9513// canceled. 9514func (c *GroupsAliasesInsertCall) Context(ctx context.Context) *GroupsAliasesInsertCall { 9515 c.ctx_ = ctx 9516 return c 9517} 9518 9519// Header returns an http.Header that can be modified by the caller to 9520// add HTTP headers to the request. 9521func (c *GroupsAliasesInsertCall) Header() http.Header { 9522 if c.header_ == nil { 9523 c.header_ = make(http.Header) 9524 } 9525 return c.header_ 9526} 9527 9528func (c *GroupsAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 9529 reqHeaders := make(http.Header) 9530 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9531 for k, v := range c.header_ { 9532 reqHeaders[k] = v 9533 } 9534 reqHeaders.Set("User-Agent", c.s.userAgent()) 9535 var body io.Reader = nil 9536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) 9537 if err != nil { 9538 return nil, err 9539 } 9540 reqHeaders.Set("Content-Type", "application/json") 9541 c.urlParams_.Set("alt", alt) 9542 c.urlParams_.Set("prettyPrint", "false") 9543 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases") 9544 urls += "?" + c.urlParams_.Encode() 9545 req, err := http.NewRequest("POST", urls, body) 9546 if err != nil { 9547 return nil, err 9548 } 9549 req.Header = reqHeaders 9550 googleapi.Expand(req.URL, map[string]string{ 9551 "groupKey": c.groupKey, 9552 }) 9553 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9554} 9555 9556// Do executes the "directory.groups.aliases.insert" call. 9557// Exactly one of *Alias or error will be non-nil. Any non-2xx status 9558// code is an error. Response headers are in either 9559// *Alias.ServerResponse.Header or (if a response was returned at all) 9560// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9561// check whether the returned error was because http.StatusNotModified 9562// was returned. 9563func (c *GroupsAliasesInsertCall) Do(opts ...googleapi.CallOption) (*Alias, error) { 9564 gensupport.SetOptions(c.urlParams_, opts...) 9565 res, err := c.doRequest("json") 9566 if res != nil && res.StatusCode == http.StatusNotModified { 9567 if res.Body != nil { 9568 res.Body.Close() 9569 } 9570 return nil, &googleapi.Error{ 9571 Code: res.StatusCode, 9572 Header: res.Header, 9573 } 9574 } 9575 if err != nil { 9576 return nil, err 9577 } 9578 defer googleapi.CloseBody(res) 9579 if err := googleapi.CheckResponse(res); err != nil { 9580 return nil, err 9581 } 9582 ret := &Alias{ 9583 ServerResponse: googleapi.ServerResponse{ 9584 Header: res.Header, 9585 HTTPStatusCode: res.StatusCode, 9586 }, 9587 } 9588 target := &ret 9589 if err := gensupport.DecodeResponse(target, res); err != nil { 9590 return nil, err 9591 } 9592 return ret, nil 9593 // { 9594 // "description": "Adds an alias for the group.", 9595 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases", 9596 // "httpMethod": "POST", 9597 // "id": "directory.groups.aliases.insert", 9598 // "parameterOrder": [ 9599 // "groupKey" 9600 // ], 9601 // "parameters": { 9602 // "groupKey": { 9603 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9604 // "location": "path", 9605 // "required": true, 9606 // "type": "string" 9607 // } 9608 // }, 9609 // "path": "admin/directory/v1/groups/{groupKey}/aliases", 9610 // "request": { 9611 // "$ref": "Alias" 9612 // }, 9613 // "response": { 9614 // "$ref": "Alias" 9615 // }, 9616 // "scopes": [ 9617 // "https://www.googleapis.com/auth/admin.directory.group" 9618 // ] 9619 // } 9620 9621} 9622 9623// method id "directory.groups.aliases.list": 9624 9625type GroupsAliasesListCall struct { 9626 s *Service 9627 groupKey string 9628 urlParams_ gensupport.URLParams 9629 ifNoneMatch_ string 9630 ctx_ context.Context 9631 header_ http.Header 9632} 9633 9634// List: Lists all aliases for a group. 9635func (r *GroupsAliasesService) List(groupKey string) *GroupsAliasesListCall { 9636 c := &GroupsAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9637 c.groupKey = groupKey 9638 return c 9639} 9640 9641// Fields allows partial responses to be retrieved. See 9642// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9643// for more information. 9644func (c *GroupsAliasesListCall) Fields(s ...googleapi.Field) *GroupsAliasesListCall { 9645 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9646 return c 9647} 9648 9649// IfNoneMatch sets the optional parameter which makes the operation 9650// fail if the object's ETag matches the given value. This is useful for 9651// getting updates only after the object has changed since the last 9652// request. Use googleapi.IsNotModified to check whether the response 9653// error from Do is the result of In-None-Match. 9654func (c *GroupsAliasesListCall) IfNoneMatch(entityTag string) *GroupsAliasesListCall { 9655 c.ifNoneMatch_ = entityTag 9656 return c 9657} 9658 9659// Context sets the context to be used in this call's Do method. Any 9660// pending HTTP request will be aborted if the provided context is 9661// canceled. 9662func (c *GroupsAliasesListCall) Context(ctx context.Context) *GroupsAliasesListCall { 9663 c.ctx_ = ctx 9664 return c 9665} 9666 9667// Header returns an http.Header that can be modified by the caller to 9668// add HTTP headers to the request. 9669func (c *GroupsAliasesListCall) Header() http.Header { 9670 if c.header_ == nil { 9671 c.header_ = make(http.Header) 9672 } 9673 return c.header_ 9674} 9675 9676func (c *GroupsAliasesListCall) doRequest(alt string) (*http.Response, error) { 9677 reqHeaders := make(http.Header) 9678 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9679 for k, v := range c.header_ { 9680 reqHeaders[k] = v 9681 } 9682 reqHeaders.Set("User-Agent", c.s.userAgent()) 9683 if c.ifNoneMatch_ != "" { 9684 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9685 } 9686 var body io.Reader = nil 9687 c.urlParams_.Set("alt", alt) 9688 c.urlParams_.Set("prettyPrint", "false") 9689 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases") 9690 urls += "?" + c.urlParams_.Encode() 9691 req, err := http.NewRequest("GET", urls, body) 9692 if err != nil { 9693 return nil, err 9694 } 9695 req.Header = reqHeaders 9696 googleapi.Expand(req.URL, map[string]string{ 9697 "groupKey": c.groupKey, 9698 }) 9699 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9700} 9701 9702// Do executes the "directory.groups.aliases.list" call. 9703// Exactly one of *Aliases or error will be non-nil. Any non-2xx status 9704// code is an error. Response headers are in either 9705// *Aliases.ServerResponse.Header or (if a response was returned at all) 9706// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9707// check whether the returned error was because http.StatusNotModified 9708// was returned. 9709func (c *GroupsAliasesListCall) Do(opts ...googleapi.CallOption) (*Aliases, error) { 9710 gensupport.SetOptions(c.urlParams_, opts...) 9711 res, err := c.doRequest("json") 9712 if res != nil && res.StatusCode == http.StatusNotModified { 9713 if res.Body != nil { 9714 res.Body.Close() 9715 } 9716 return nil, &googleapi.Error{ 9717 Code: res.StatusCode, 9718 Header: res.Header, 9719 } 9720 } 9721 if err != nil { 9722 return nil, err 9723 } 9724 defer googleapi.CloseBody(res) 9725 if err := googleapi.CheckResponse(res); err != nil { 9726 return nil, err 9727 } 9728 ret := &Aliases{ 9729 ServerResponse: googleapi.ServerResponse{ 9730 Header: res.Header, 9731 HTTPStatusCode: res.StatusCode, 9732 }, 9733 } 9734 target := &ret 9735 if err := gensupport.DecodeResponse(target, res); err != nil { 9736 return nil, err 9737 } 9738 return ret, nil 9739 // { 9740 // "description": "Lists all aliases for a group.", 9741 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases", 9742 // "httpMethod": "GET", 9743 // "id": "directory.groups.aliases.list", 9744 // "parameterOrder": [ 9745 // "groupKey" 9746 // ], 9747 // "parameters": { 9748 // "groupKey": { 9749 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9750 // "location": "path", 9751 // "required": true, 9752 // "type": "string" 9753 // } 9754 // }, 9755 // "path": "admin/directory/v1/groups/{groupKey}/aliases", 9756 // "response": { 9757 // "$ref": "Aliases" 9758 // }, 9759 // "scopes": [ 9760 // "https://www.googleapis.com/auth/admin.directory.group", 9761 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 9762 // ] 9763 // } 9764 9765} 9766 9767// method id "directory.members.delete": 9768 9769type MembersDeleteCall struct { 9770 s *Service 9771 groupKey string 9772 memberKey string 9773 urlParams_ gensupport.URLParams 9774 ctx_ context.Context 9775 header_ http.Header 9776} 9777 9778// Delete: Removes a member from a group. 9779func (r *MembersService) Delete(groupKey string, memberKey string) *MembersDeleteCall { 9780 c := &MembersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9781 c.groupKey = groupKey 9782 c.memberKey = memberKey 9783 return c 9784} 9785 9786// Fields allows partial responses to be retrieved. See 9787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9788// for more information. 9789func (c *MembersDeleteCall) Fields(s ...googleapi.Field) *MembersDeleteCall { 9790 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9791 return c 9792} 9793 9794// Context sets the context to be used in this call's Do method. Any 9795// pending HTTP request will be aborted if the provided context is 9796// canceled. 9797func (c *MembersDeleteCall) Context(ctx context.Context) *MembersDeleteCall { 9798 c.ctx_ = ctx 9799 return c 9800} 9801 9802// Header returns an http.Header that can be modified by the caller to 9803// add HTTP headers to the request. 9804func (c *MembersDeleteCall) Header() http.Header { 9805 if c.header_ == nil { 9806 c.header_ = make(http.Header) 9807 } 9808 return c.header_ 9809} 9810 9811func (c *MembersDeleteCall) doRequest(alt string) (*http.Response, error) { 9812 reqHeaders := make(http.Header) 9813 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9814 for k, v := range c.header_ { 9815 reqHeaders[k] = v 9816 } 9817 reqHeaders.Set("User-Agent", c.s.userAgent()) 9818 var body io.Reader = nil 9819 c.urlParams_.Set("alt", alt) 9820 c.urlParams_.Set("prettyPrint", "false") 9821 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 9822 urls += "?" + c.urlParams_.Encode() 9823 req, err := http.NewRequest("DELETE", urls, body) 9824 if err != nil { 9825 return nil, err 9826 } 9827 req.Header = reqHeaders 9828 googleapi.Expand(req.URL, map[string]string{ 9829 "groupKey": c.groupKey, 9830 "memberKey": c.memberKey, 9831 }) 9832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9833} 9834 9835// Do executes the "directory.members.delete" call. 9836func (c *MembersDeleteCall) Do(opts ...googleapi.CallOption) error { 9837 gensupport.SetOptions(c.urlParams_, opts...) 9838 res, err := c.doRequest("json") 9839 if err != nil { 9840 return err 9841 } 9842 defer googleapi.CloseBody(res) 9843 if err := googleapi.CheckResponse(res); err != nil { 9844 return err 9845 } 9846 return nil 9847 // { 9848 // "description": "Removes a member from a group.", 9849 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 9850 // "httpMethod": "DELETE", 9851 // "id": "directory.members.delete", 9852 // "parameterOrder": [ 9853 // "groupKey", 9854 // "memberKey" 9855 // ], 9856 // "parameters": { 9857 // "groupKey": { 9858 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 9859 // "location": "path", 9860 // "required": true, 9861 // "type": "string" 9862 // }, 9863 // "memberKey": { 9864 // "description": "Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.", 9865 // "location": "path", 9866 // "required": true, 9867 // "type": "string" 9868 // } 9869 // }, 9870 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 9871 // "scopes": [ 9872 // "https://www.googleapis.com/auth/admin.directory.group", 9873 // "https://www.googleapis.com/auth/admin.directory.group.member" 9874 // ] 9875 // } 9876 9877} 9878 9879// method id "directory.members.get": 9880 9881type MembersGetCall struct { 9882 s *Service 9883 groupKey string 9884 memberKey string 9885 urlParams_ gensupport.URLParams 9886 ifNoneMatch_ string 9887 ctx_ context.Context 9888 header_ http.Header 9889} 9890 9891// Get: Retrieves a group member's properties. 9892func (r *MembersService) Get(groupKey string, memberKey string) *MembersGetCall { 9893 c := &MembersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9894 c.groupKey = groupKey 9895 c.memberKey = memberKey 9896 return c 9897} 9898 9899// Fields allows partial responses to be retrieved. See 9900// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9901// for more information. 9902func (c *MembersGetCall) Fields(s ...googleapi.Field) *MembersGetCall { 9903 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9904 return c 9905} 9906 9907// IfNoneMatch sets the optional parameter which makes the operation 9908// fail if the object's ETag matches the given value. This is useful for 9909// getting updates only after the object has changed since the last 9910// request. Use googleapi.IsNotModified to check whether the response 9911// error from Do is the result of In-None-Match. 9912func (c *MembersGetCall) IfNoneMatch(entityTag string) *MembersGetCall { 9913 c.ifNoneMatch_ = entityTag 9914 return c 9915} 9916 9917// Context sets the context to be used in this call's Do method. Any 9918// pending HTTP request will be aborted if the provided context is 9919// canceled. 9920func (c *MembersGetCall) Context(ctx context.Context) *MembersGetCall { 9921 c.ctx_ = ctx 9922 return c 9923} 9924 9925// Header returns an http.Header that can be modified by the caller to 9926// add HTTP headers to the request. 9927func (c *MembersGetCall) Header() http.Header { 9928 if c.header_ == nil { 9929 c.header_ = make(http.Header) 9930 } 9931 return c.header_ 9932} 9933 9934func (c *MembersGetCall) doRequest(alt string) (*http.Response, error) { 9935 reqHeaders := make(http.Header) 9936 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9937 for k, v := range c.header_ { 9938 reqHeaders[k] = v 9939 } 9940 reqHeaders.Set("User-Agent", c.s.userAgent()) 9941 if c.ifNoneMatch_ != "" { 9942 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9943 } 9944 var body io.Reader = nil 9945 c.urlParams_.Set("alt", alt) 9946 c.urlParams_.Set("prettyPrint", "false") 9947 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 9948 urls += "?" + c.urlParams_.Encode() 9949 req, err := http.NewRequest("GET", urls, body) 9950 if err != nil { 9951 return nil, err 9952 } 9953 req.Header = reqHeaders 9954 googleapi.Expand(req.URL, map[string]string{ 9955 "groupKey": c.groupKey, 9956 "memberKey": c.memberKey, 9957 }) 9958 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9959} 9960 9961// Do executes the "directory.members.get" call. 9962// Exactly one of *Member or error will be non-nil. Any non-2xx status 9963// code is an error. Response headers are in either 9964// *Member.ServerResponse.Header or (if a response was returned at all) 9965// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9966// check whether the returned error was because http.StatusNotModified 9967// was returned. 9968func (c *MembersGetCall) Do(opts ...googleapi.CallOption) (*Member, error) { 9969 gensupport.SetOptions(c.urlParams_, opts...) 9970 res, err := c.doRequest("json") 9971 if res != nil && res.StatusCode == http.StatusNotModified { 9972 if res.Body != nil { 9973 res.Body.Close() 9974 } 9975 return nil, &googleapi.Error{ 9976 Code: res.StatusCode, 9977 Header: res.Header, 9978 } 9979 } 9980 if err != nil { 9981 return nil, err 9982 } 9983 defer googleapi.CloseBody(res) 9984 if err := googleapi.CheckResponse(res); err != nil { 9985 return nil, err 9986 } 9987 ret := &Member{ 9988 ServerResponse: googleapi.ServerResponse{ 9989 Header: res.Header, 9990 HTTPStatusCode: res.StatusCode, 9991 }, 9992 } 9993 target := &ret 9994 if err := gensupport.DecodeResponse(target, res); err != nil { 9995 return nil, err 9996 } 9997 return ret, nil 9998 // { 9999 // "description": "Retrieves a group member's properties.", 10000 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10001 // "httpMethod": "GET", 10002 // "id": "directory.members.get", 10003 // "parameterOrder": [ 10004 // "groupKey", 10005 // "memberKey" 10006 // ], 10007 // "parameters": { 10008 // "groupKey": { 10009 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10010 // "location": "path", 10011 // "required": true, 10012 // "type": "string" 10013 // }, 10014 // "memberKey": { 10015 // "description": "Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.", 10016 // "location": "path", 10017 // "required": true, 10018 // "type": "string" 10019 // } 10020 // }, 10021 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10022 // "response": { 10023 // "$ref": "Member" 10024 // }, 10025 // "scopes": [ 10026 // "https://www.googleapis.com/auth/admin.directory.group", 10027 // "https://www.googleapis.com/auth/admin.directory.group.member", 10028 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 10029 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 10030 // ] 10031 // } 10032 10033} 10034 10035// method id "directory.members.hasMember": 10036 10037type MembersHasMemberCall struct { 10038 s *Service 10039 groupKey string 10040 memberKey string 10041 urlParams_ gensupport.URLParams 10042 ifNoneMatch_ string 10043 ctx_ context.Context 10044 header_ http.Header 10045} 10046 10047// HasMember: Checks whether the given user is a member of the group. 10048// Membership can be direct or nested. 10049func (r *MembersService) HasMember(groupKey string, memberKey string) *MembersHasMemberCall { 10050 c := &MembersHasMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10051 c.groupKey = groupKey 10052 c.memberKey = memberKey 10053 return c 10054} 10055 10056// Fields allows partial responses to be retrieved. See 10057// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10058// for more information. 10059func (c *MembersHasMemberCall) Fields(s ...googleapi.Field) *MembersHasMemberCall { 10060 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10061 return c 10062} 10063 10064// IfNoneMatch sets the optional parameter which makes the operation 10065// fail if the object's ETag matches the given value. This is useful for 10066// getting updates only after the object has changed since the last 10067// request. Use googleapi.IsNotModified to check whether the response 10068// error from Do is the result of In-None-Match. 10069func (c *MembersHasMemberCall) IfNoneMatch(entityTag string) *MembersHasMemberCall { 10070 c.ifNoneMatch_ = entityTag 10071 return c 10072} 10073 10074// Context sets the context to be used in this call's Do method. Any 10075// pending HTTP request will be aborted if the provided context is 10076// canceled. 10077func (c *MembersHasMemberCall) Context(ctx context.Context) *MembersHasMemberCall { 10078 c.ctx_ = ctx 10079 return c 10080} 10081 10082// Header returns an http.Header that can be modified by the caller to 10083// add HTTP headers to the request. 10084func (c *MembersHasMemberCall) Header() http.Header { 10085 if c.header_ == nil { 10086 c.header_ = make(http.Header) 10087 } 10088 return c.header_ 10089} 10090 10091func (c *MembersHasMemberCall) doRequest(alt string) (*http.Response, error) { 10092 reqHeaders := make(http.Header) 10093 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10094 for k, v := range c.header_ { 10095 reqHeaders[k] = v 10096 } 10097 reqHeaders.Set("User-Agent", c.s.userAgent()) 10098 if c.ifNoneMatch_ != "" { 10099 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10100 } 10101 var body io.Reader = nil 10102 c.urlParams_.Set("alt", alt) 10103 c.urlParams_.Set("prettyPrint", "false") 10104 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}") 10105 urls += "?" + c.urlParams_.Encode() 10106 req, err := http.NewRequest("GET", urls, body) 10107 if err != nil { 10108 return nil, err 10109 } 10110 req.Header = reqHeaders 10111 googleapi.Expand(req.URL, map[string]string{ 10112 "groupKey": c.groupKey, 10113 "memberKey": c.memberKey, 10114 }) 10115 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10116} 10117 10118// Do executes the "directory.members.hasMember" call. 10119// Exactly one of *MembersHasMember or error will be non-nil. Any 10120// non-2xx status code is an error. Response headers are in either 10121// *MembersHasMember.ServerResponse.Header or (if a response was 10122// returned at all) in error.(*googleapi.Error).Header. Use 10123// googleapi.IsNotModified to check whether the returned error was 10124// because http.StatusNotModified was returned. 10125func (c *MembersHasMemberCall) Do(opts ...googleapi.CallOption) (*MembersHasMember, error) { 10126 gensupport.SetOptions(c.urlParams_, opts...) 10127 res, err := c.doRequest("json") 10128 if res != nil && res.StatusCode == http.StatusNotModified { 10129 if res.Body != nil { 10130 res.Body.Close() 10131 } 10132 return nil, &googleapi.Error{ 10133 Code: res.StatusCode, 10134 Header: res.Header, 10135 } 10136 } 10137 if err != nil { 10138 return nil, err 10139 } 10140 defer googleapi.CloseBody(res) 10141 if err := googleapi.CheckResponse(res); err != nil { 10142 return nil, err 10143 } 10144 ret := &MembersHasMember{ 10145 ServerResponse: googleapi.ServerResponse{ 10146 Header: res.Header, 10147 HTTPStatusCode: res.StatusCode, 10148 }, 10149 } 10150 target := &ret 10151 if err := gensupport.DecodeResponse(target, res); err != nil { 10152 return nil, err 10153 } 10154 return ret, nil 10155 // { 10156 // "description": "Checks whether the given user is a member of the group. Membership can be direct or nested.", 10157 // "flatPath": "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}", 10158 // "httpMethod": "GET", 10159 // "id": "directory.members.hasMember", 10160 // "parameterOrder": [ 10161 // "groupKey", 10162 // "memberKey" 10163 // ], 10164 // "parameters": { 10165 // "groupKey": { 10166 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10167 // "location": "path", 10168 // "required": true, 10169 // "type": "string" 10170 // }, 10171 // "memberKey": { 10172 // "description": "Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID.", 10173 // "location": "path", 10174 // "required": true, 10175 // "type": "string" 10176 // } 10177 // }, 10178 // "path": "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}", 10179 // "response": { 10180 // "$ref": "MembersHasMember" 10181 // }, 10182 // "scopes": [ 10183 // "https://www.googleapis.com/auth/admin.directory.group", 10184 // "https://www.googleapis.com/auth/admin.directory.group.member", 10185 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 10186 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 10187 // ] 10188 // } 10189 10190} 10191 10192// method id "directory.members.insert": 10193 10194type MembersInsertCall struct { 10195 s *Service 10196 groupKey string 10197 member *Member 10198 urlParams_ gensupport.URLParams 10199 ctx_ context.Context 10200 header_ http.Header 10201} 10202 10203// Insert: Adds a user to the specified group. 10204func (r *MembersService) Insert(groupKey string, member *Member) *MembersInsertCall { 10205 c := &MembersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10206 c.groupKey = groupKey 10207 c.member = member 10208 return c 10209} 10210 10211// Fields allows partial responses to be retrieved. See 10212// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10213// for more information. 10214func (c *MembersInsertCall) Fields(s ...googleapi.Field) *MembersInsertCall { 10215 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10216 return c 10217} 10218 10219// Context sets the context to be used in this call's Do method. Any 10220// pending HTTP request will be aborted if the provided context is 10221// canceled. 10222func (c *MembersInsertCall) Context(ctx context.Context) *MembersInsertCall { 10223 c.ctx_ = ctx 10224 return c 10225} 10226 10227// Header returns an http.Header that can be modified by the caller to 10228// add HTTP headers to the request. 10229func (c *MembersInsertCall) Header() http.Header { 10230 if c.header_ == nil { 10231 c.header_ = make(http.Header) 10232 } 10233 return c.header_ 10234} 10235 10236func (c *MembersInsertCall) doRequest(alt string) (*http.Response, error) { 10237 reqHeaders := make(http.Header) 10238 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10239 for k, v := range c.header_ { 10240 reqHeaders[k] = v 10241 } 10242 reqHeaders.Set("User-Agent", c.s.userAgent()) 10243 var body io.Reader = nil 10244 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 10245 if err != nil { 10246 return nil, err 10247 } 10248 reqHeaders.Set("Content-Type", "application/json") 10249 c.urlParams_.Set("alt", alt) 10250 c.urlParams_.Set("prettyPrint", "false") 10251 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members") 10252 urls += "?" + c.urlParams_.Encode() 10253 req, err := http.NewRequest("POST", urls, body) 10254 if err != nil { 10255 return nil, err 10256 } 10257 req.Header = reqHeaders 10258 googleapi.Expand(req.URL, map[string]string{ 10259 "groupKey": c.groupKey, 10260 }) 10261 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10262} 10263 10264// Do executes the "directory.members.insert" call. 10265// Exactly one of *Member or error will be non-nil. Any non-2xx status 10266// code is an error. Response headers are in either 10267// *Member.ServerResponse.Header or (if a response was returned at all) 10268// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10269// check whether the returned error was because http.StatusNotModified 10270// was returned. 10271func (c *MembersInsertCall) Do(opts ...googleapi.CallOption) (*Member, error) { 10272 gensupport.SetOptions(c.urlParams_, opts...) 10273 res, err := c.doRequest("json") 10274 if res != nil && res.StatusCode == http.StatusNotModified { 10275 if res.Body != nil { 10276 res.Body.Close() 10277 } 10278 return nil, &googleapi.Error{ 10279 Code: res.StatusCode, 10280 Header: res.Header, 10281 } 10282 } 10283 if err != nil { 10284 return nil, err 10285 } 10286 defer googleapi.CloseBody(res) 10287 if err := googleapi.CheckResponse(res); err != nil { 10288 return nil, err 10289 } 10290 ret := &Member{ 10291 ServerResponse: googleapi.ServerResponse{ 10292 Header: res.Header, 10293 HTTPStatusCode: res.StatusCode, 10294 }, 10295 } 10296 target := &ret 10297 if err := gensupport.DecodeResponse(target, res); err != nil { 10298 return nil, err 10299 } 10300 return ret, nil 10301 // { 10302 // "description": "Adds a user to the specified group.", 10303 // "flatPath": "admin/directory/v1/groups/{groupKey}/members", 10304 // "httpMethod": "POST", 10305 // "id": "directory.members.insert", 10306 // "parameterOrder": [ 10307 // "groupKey" 10308 // ], 10309 // "parameters": { 10310 // "groupKey": { 10311 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10312 // "location": "path", 10313 // "required": true, 10314 // "type": "string" 10315 // } 10316 // }, 10317 // "path": "admin/directory/v1/groups/{groupKey}/members", 10318 // "request": { 10319 // "$ref": "Member" 10320 // }, 10321 // "response": { 10322 // "$ref": "Member" 10323 // }, 10324 // "scopes": [ 10325 // "https://www.googleapis.com/auth/admin.directory.group", 10326 // "https://www.googleapis.com/auth/admin.directory.group.member" 10327 // ] 10328 // } 10329 10330} 10331 10332// method id "directory.members.list": 10333 10334type MembersListCall struct { 10335 s *Service 10336 groupKey string 10337 urlParams_ gensupport.URLParams 10338 ifNoneMatch_ string 10339 ctx_ context.Context 10340 header_ http.Header 10341} 10342 10343// List: Retrieves a paginated list of all members in a group. 10344func (r *MembersService) List(groupKey string) *MembersListCall { 10345 c := &MembersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10346 c.groupKey = groupKey 10347 return c 10348} 10349 10350// IncludeDerivedMembership sets the optional parameter 10351// "includeDerivedMembership": Whether to list indirect memberships. 10352// Default: false. 10353func (c *MembersListCall) IncludeDerivedMembership(includeDerivedMembership bool) *MembersListCall { 10354 c.urlParams_.Set("includeDerivedMembership", fmt.Sprint(includeDerivedMembership)) 10355 return c 10356} 10357 10358// MaxResults sets the optional parameter "maxResults": Maximum number 10359// of results to return. Max allowed value is 200. 10360func (c *MembersListCall) MaxResults(maxResults int64) *MembersListCall { 10361 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10362 return c 10363} 10364 10365// PageToken sets the optional parameter "pageToken": Token to specify 10366// next page in the list. 10367func (c *MembersListCall) PageToken(pageToken string) *MembersListCall { 10368 c.urlParams_.Set("pageToken", pageToken) 10369 return c 10370} 10371 10372// Roles sets the optional parameter "roles": The `roles` query 10373// parameter allows you to retrieve group members by role. Allowed 10374// values are `OWNER`, `MANAGER`, and `MEMBER`. 10375func (c *MembersListCall) Roles(roles string) *MembersListCall { 10376 c.urlParams_.Set("roles", roles) 10377 return c 10378} 10379 10380// Fields allows partial responses to be retrieved. See 10381// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10382// for more information. 10383func (c *MembersListCall) Fields(s ...googleapi.Field) *MembersListCall { 10384 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10385 return c 10386} 10387 10388// IfNoneMatch sets the optional parameter which makes the operation 10389// fail if the object's ETag matches the given value. This is useful for 10390// getting updates only after the object has changed since the last 10391// request. Use googleapi.IsNotModified to check whether the response 10392// error from Do is the result of In-None-Match. 10393func (c *MembersListCall) IfNoneMatch(entityTag string) *MembersListCall { 10394 c.ifNoneMatch_ = entityTag 10395 return c 10396} 10397 10398// Context sets the context to be used in this call's Do method. Any 10399// pending HTTP request will be aborted if the provided context is 10400// canceled. 10401func (c *MembersListCall) Context(ctx context.Context) *MembersListCall { 10402 c.ctx_ = ctx 10403 return c 10404} 10405 10406// Header returns an http.Header that can be modified by the caller to 10407// add HTTP headers to the request. 10408func (c *MembersListCall) Header() http.Header { 10409 if c.header_ == nil { 10410 c.header_ = make(http.Header) 10411 } 10412 return c.header_ 10413} 10414 10415func (c *MembersListCall) doRequest(alt string) (*http.Response, error) { 10416 reqHeaders := make(http.Header) 10417 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10418 for k, v := range c.header_ { 10419 reqHeaders[k] = v 10420 } 10421 reqHeaders.Set("User-Agent", c.s.userAgent()) 10422 if c.ifNoneMatch_ != "" { 10423 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10424 } 10425 var body io.Reader = nil 10426 c.urlParams_.Set("alt", alt) 10427 c.urlParams_.Set("prettyPrint", "false") 10428 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members") 10429 urls += "?" + c.urlParams_.Encode() 10430 req, err := http.NewRequest("GET", urls, body) 10431 if err != nil { 10432 return nil, err 10433 } 10434 req.Header = reqHeaders 10435 googleapi.Expand(req.URL, map[string]string{ 10436 "groupKey": c.groupKey, 10437 }) 10438 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10439} 10440 10441// Do executes the "directory.members.list" call. 10442// Exactly one of *Members or error will be non-nil. Any non-2xx status 10443// code is an error. Response headers are in either 10444// *Members.ServerResponse.Header or (if a response was returned at all) 10445// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10446// check whether the returned error was because http.StatusNotModified 10447// was returned. 10448func (c *MembersListCall) Do(opts ...googleapi.CallOption) (*Members, error) { 10449 gensupport.SetOptions(c.urlParams_, opts...) 10450 res, err := c.doRequest("json") 10451 if res != nil && res.StatusCode == http.StatusNotModified { 10452 if res.Body != nil { 10453 res.Body.Close() 10454 } 10455 return nil, &googleapi.Error{ 10456 Code: res.StatusCode, 10457 Header: res.Header, 10458 } 10459 } 10460 if err != nil { 10461 return nil, err 10462 } 10463 defer googleapi.CloseBody(res) 10464 if err := googleapi.CheckResponse(res); err != nil { 10465 return nil, err 10466 } 10467 ret := &Members{ 10468 ServerResponse: googleapi.ServerResponse{ 10469 Header: res.Header, 10470 HTTPStatusCode: res.StatusCode, 10471 }, 10472 } 10473 target := &ret 10474 if err := gensupport.DecodeResponse(target, res); err != nil { 10475 return nil, err 10476 } 10477 return ret, nil 10478 // { 10479 // "description": "Retrieves a paginated list of all members in a group.", 10480 // "flatPath": "admin/directory/v1/groups/{groupKey}/members", 10481 // "httpMethod": "GET", 10482 // "id": "directory.members.list", 10483 // "parameterOrder": [ 10484 // "groupKey" 10485 // ], 10486 // "parameters": { 10487 // "groupKey": { 10488 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10489 // "location": "path", 10490 // "required": true, 10491 // "type": "string" 10492 // }, 10493 // "includeDerivedMembership": { 10494 // "description": "Whether to list indirect memberships. Default: false.", 10495 // "location": "query", 10496 // "type": "boolean" 10497 // }, 10498 // "maxResults": { 10499 // "default": "200", 10500 // "description": "Maximum number of results to return. Max allowed value is 200.", 10501 // "format": "int32", 10502 // "location": "query", 10503 // "minimum": "1", 10504 // "type": "integer" 10505 // }, 10506 // "pageToken": { 10507 // "description": "Token to specify next page in the list.", 10508 // "location": "query", 10509 // "type": "string" 10510 // }, 10511 // "roles": { 10512 // "description": "The `roles` query parameter allows you to retrieve group members by role. Allowed values are `OWNER`, `MANAGER`, and `MEMBER`.", 10513 // "location": "query", 10514 // "type": "string" 10515 // } 10516 // }, 10517 // "path": "admin/directory/v1/groups/{groupKey}/members", 10518 // "response": { 10519 // "$ref": "Members" 10520 // }, 10521 // "scopes": [ 10522 // "https://www.googleapis.com/auth/admin.directory.group", 10523 // "https://www.googleapis.com/auth/admin.directory.group.member", 10524 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 10525 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 10526 // ] 10527 // } 10528 10529} 10530 10531// Pages invokes f for each page of results. 10532// A non-nil error returned from f will halt the iteration. 10533// The provided context supersedes any context provided to the Context method. 10534func (c *MembersListCall) Pages(ctx context.Context, f func(*Members) error) error { 10535 c.ctx_ = ctx 10536 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10537 for { 10538 x, err := c.Do() 10539 if err != nil { 10540 return err 10541 } 10542 if err := f(x); err != nil { 10543 return err 10544 } 10545 if x.NextPageToken == "" { 10546 return nil 10547 } 10548 c.PageToken(x.NextPageToken) 10549 } 10550} 10551 10552// method id "directory.members.patch": 10553 10554type MembersPatchCall struct { 10555 s *Service 10556 groupKey string 10557 memberKey string 10558 member *Member 10559 urlParams_ gensupport.URLParams 10560 ctx_ context.Context 10561 header_ http.Header 10562} 10563 10564// Patch: Updates the membership properties of a user in the specified 10565// group. This method supports [patch 10566// semantics](/admin-sdk/directory/v1/guides/performance#patch). 10567func (r *MembersService) Patch(groupKey string, memberKey string, member *Member) *MembersPatchCall { 10568 c := &MembersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10569 c.groupKey = groupKey 10570 c.memberKey = memberKey 10571 c.member = member 10572 return c 10573} 10574 10575// Fields allows partial responses to be retrieved. See 10576// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10577// for more information. 10578func (c *MembersPatchCall) Fields(s ...googleapi.Field) *MembersPatchCall { 10579 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10580 return c 10581} 10582 10583// Context sets the context to be used in this call's Do method. Any 10584// pending HTTP request will be aborted if the provided context is 10585// canceled. 10586func (c *MembersPatchCall) Context(ctx context.Context) *MembersPatchCall { 10587 c.ctx_ = ctx 10588 return c 10589} 10590 10591// Header returns an http.Header that can be modified by the caller to 10592// add HTTP headers to the request. 10593func (c *MembersPatchCall) Header() http.Header { 10594 if c.header_ == nil { 10595 c.header_ = make(http.Header) 10596 } 10597 return c.header_ 10598} 10599 10600func (c *MembersPatchCall) doRequest(alt string) (*http.Response, error) { 10601 reqHeaders := make(http.Header) 10602 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10603 for k, v := range c.header_ { 10604 reqHeaders[k] = v 10605 } 10606 reqHeaders.Set("User-Agent", c.s.userAgent()) 10607 var body io.Reader = nil 10608 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 10609 if err != nil { 10610 return nil, err 10611 } 10612 reqHeaders.Set("Content-Type", "application/json") 10613 c.urlParams_.Set("alt", alt) 10614 c.urlParams_.Set("prettyPrint", "false") 10615 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 10616 urls += "?" + c.urlParams_.Encode() 10617 req, err := http.NewRequest("PATCH", urls, body) 10618 if err != nil { 10619 return nil, err 10620 } 10621 req.Header = reqHeaders 10622 googleapi.Expand(req.URL, map[string]string{ 10623 "groupKey": c.groupKey, 10624 "memberKey": c.memberKey, 10625 }) 10626 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10627} 10628 10629// Do executes the "directory.members.patch" call. 10630// Exactly one of *Member or error will be non-nil. Any non-2xx status 10631// code is an error. Response headers are in either 10632// *Member.ServerResponse.Header or (if a response was returned at all) 10633// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10634// check whether the returned error was because http.StatusNotModified 10635// was returned. 10636func (c *MembersPatchCall) Do(opts ...googleapi.CallOption) (*Member, error) { 10637 gensupport.SetOptions(c.urlParams_, opts...) 10638 res, err := c.doRequest("json") 10639 if res != nil && res.StatusCode == http.StatusNotModified { 10640 if res.Body != nil { 10641 res.Body.Close() 10642 } 10643 return nil, &googleapi.Error{ 10644 Code: res.StatusCode, 10645 Header: res.Header, 10646 } 10647 } 10648 if err != nil { 10649 return nil, err 10650 } 10651 defer googleapi.CloseBody(res) 10652 if err := googleapi.CheckResponse(res); err != nil { 10653 return nil, err 10654 } 10655 ret := &Member{ 10656 ServerResponse: googleapi.ServerResponse{ 10657 Header: res.Header, 10658 HTTPStatusCode: res.StatusCode, 10659 }, 10660 } 10661 target := &ret 10662 if err := gensupport.DecodeResponse(target, res); err != nil { 10663 return nil, err 10664 } 10665 return ret, nil 10666 // { 10667 // "description": "Updates the membership properties of a user in the specified group. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 10668 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10669 // "httpMethod": "PATCH", 10670 // "id": "directory.members.patch", 10671 // "parameterOrder": [ 10672 // "groupKey", 10673 // "memberKey" 10674 // ], 10675 // "parameters": { 10676 // "groupKey": { 10677 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10678 // "location": "path", 10679 // "required": true, 10680 // "type": "string" 10681 // }, 10682 // "memberKey": { 10683 // "description": "Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.", 10684 // "location": "path", 10685 // "required": true, 10686 // "type": "string" 10687 // } 10688 // }, 10689 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10690 // "request": { 10691 // "$ref": "Member" 10692 // }, 10693 // "response": { 10694 // "$ref": "Member" 10695 // }, 10696 // "scopes": [ 10697 // "https://www.googleapis.com/auth/admin.directory.group", 10698 // "https://www.googleapis.com/auth/admin.directory.group.member" 10699 // ] 10700 // } 10701 10702} 10703 10704// method id "directory.members.update": 10705 10706type MembersUpdateCall struct { 10707 s *Service 10708 groupKey string 10709 memberKey string 10710 member *Member 10711 urlParams_ gensupport.URLParams 10712 ctx_ context.Context 10713 header_ http.Header 10714} 10715 10716// Update: Updates the membership of a user in the specified group. 10717func (r *MembersService) Update(groupKey string, memberKey string, member *Member) *MembersUpdateCall { 10718 c := &MembersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10719 c.groupKey = groupKey 10720 c.memberKey = memberKey 10721 c.member = member 10722 return c 10723} 10724 10725// Fields allows partial responses to be retrieved. See 10726// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10727// for more information. 10728func (c *MembersUpdateCall) Fields(s ...googleapi.Field) *MembersUpdateCall { 10729 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10730 return c 10731} 10732 10733// Context sets the context to be used in this call's Do method. Any 10734// pending HTTP request will be aborted if the provided context is 10735// canceled. 10736func (c *MembersUpdateCall) Context(ctx context.Context) *MembersUpdateCall { 10737 c.ctx_ = ctx 10738 return c 10739} 10740 10741// Header returns an http.Header that can be modified by the caller to 10742// add HTTP headers to the request. 10743func (c *MembersUpdateCall) Header() http.Header { 10744 if c.header_ == nil { 10745 c.header_ = make(http.Header) 10746 } 10747 return c.header_ 10748} 10749 10750func (c *MembersUpdateCall) doRequest(alt string) (*http.Response, error) { 10751 reqHeaders := make(http.Header) 10752 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10753 for k, v := range c.header_ { 10754 reqHeaders[k] = v 10755 } 10756 reqHeaders.Set("User-Agent", c.s.userAgent()) 10757 var body io.Reader = nil 10758 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 10759 if err != nil { 10760 return nil, err 10761 } 10762 reqHeaders.Set("Content-Type", "application/json") 10763 c.urlParams_.Set("alt", alt) 10764 c.urlParams_.Set("prettyPrint", "false") 10765 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 10766 urls += "?" + c.urlParams_.Encode() 10767 req, err := http.NewRequest("PUT", urls, body) 10768 if err != nil { 10769 return nil, err 10770 } 10771 req.Header = reqHeaders 10772 googleapi.Expand(req.URL, map[string]string{ 10773 "groupKey": c.groupKey, 10774 "memberKey": c.memberKey, 10775 }) 10776 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10777} 10778 10779// Do executes the "directory.members.update" call. 10780// Exactly one of *Member or error will be non-nil. Any non-2xx status 10781// code is an error. Response headers are in either 10782// *Member.ServerResponse.Header or (if a response was returned at all) 10783// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10784// check whether the returned error was because http.StatusNotModified 10785// was returned. 10786func (c *MembersUpdateCall) Do(opts ...googleapi.CallOption) (*Member, error) { 10787 gensupport.SetOptions(c.urlParams_, opts...) 10788 res, err := c.doRequest("json") 10789 if res != nil && res.StatusCode == http.StatusNotModified { 10790 if res.Body != nil { 10791 res.Body.Close() 10792 } 10793 return nil, &googleapi.Error{ 10794 Code: res.StatusCode, 10795 Header: res.Header, 10796 } 10797 } 10798 if err != nil { 10799 return nil, err 10800 } 10801 defer googleapi.CloseBody(res) 10802 if err := googleapi.CheckResponse(res); err != nil { 10803 return nil, err 10804 } 10805 ret := &Member{ 10806 ServerResponse: googleapi.ServerResponse{ 10807 Header: res.Header, 10808 HTTPStatusCode: res.StatusCode, 10809 }, 10810 } 10811 target := &ret 10812 if err := gensupport.DecodeResponse(target, res); err != nil { 10813 return nil, err 10814 } 10815 return ret, nil 10816 // { 10817 // "description": "Updates the membership of a user in the specified group.", 10818 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10819 // "httpMethod": "PUT", 10820 // "id": "directory.members.update", 10821 // "parameterOrder": [ 10822 // "groupKey", 10823 // "memberKey" 10824 // ], 10825 // "parameters": { 10826 // "groupKey": { 10827 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10828 // "location": "path", 10829 // "required": true, 10830 // "type": "string" 10831 // }, 10832 // "memberKey": { 10833 // "description": "Identifies the group member in the API request. A group member can be a user or another group. The value can be the member's (group or user) primary email address, alias, or unique ID.", 10834 // "location": "path", 10835 // "required": true, 10836 // "type": "string" 10837 // } 10838 // }, 10839 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 10840 // "request": { 10841 // "$ref": "Member" 10842 // }, 10843 // "response": { 10844 // "$ref": "Member" 10845 // }, 10846 // "scopes": [ 10847 // "https://www.googleapis.com/auth/admin.directory.group", 10848 // "https://www.googleapis.com/auth/admin.directory.group.member" 10849 // ] 10850 // } 10851 10852} 10853 10854// method id "directory.mobiledevices.action": 10855 10856type MobiledevicesActionCall struct { 10857 s *Service 10858 customerId string 10859 resourceId string 10860 mobiledeviceaction *MobileDeviceAction 10861 urlParams_ gensupport.URLParams 10862 ctx_ context.Context 10863 header_ http.Header 10864} 10865 10866// Action: Takes an action that affects a mobile device. For example, 10867// remotely wiping a device. 10868func (r *MobiledevicesService) Action(customerId string, resourceId string, mobiledeviceaction *MobileDeviceAction) *MobiledevicesActionCall { 10869 c := &MobiledevicesActionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10870 c.customerId = customerId 10871 c.resourceId = resourceId 10872 c.mobiledeviceaction = mobiledeviceaction 10873 return c 10874} 10875 10876// Fields allows partial responses to be retrieved. See 10877// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10878// for more information. 10879func (c *MobiledevicesActionCall) Fields(s ...googleapi.Field) *MobiledevicesActionCall { 10880 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10881 return c 10882} 10883 10884// Context sets the context to be used in this call's Do method. Any 10885// pending HTTP request will be aborted if the provided context is 10886// canceled. 10887func (c *MobiledevicesActionCall) Context(ctx context.Context) *MobiledevicesActionCall { 10888 c.ctx_ = ctx 10889 return c 10890} 10891 10892// Header returns an http.Header that can be modified by the caller to 10893// add HTTP headers to the request. 10894func (c *MobiledevicesActionCall) Header() http.Header { 10895 if c.header_ == nil { 10896 c.header_ = make(http.Header) 10897 } 10898 return c.header_ 10899} 10900 10901func (c *MobiledevicesActionCall) doRequest(alt string) (*http.Response, error) { 10902 reqHeaders := make(http.Header) 10903 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10904 for k, v := range c.header_ { 10905 reqHeaders[k] = v 10906 } 10907 reqHeaders.Set("User-Agent", c.s.userAgent()) 10908 var body io.Reader = nil 10909 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobiledeviceaction) 10910 if err != nil { 10911 return nil, err 10912 } 10913 reqHeaders.Set("Content-Type", "application/json") 10914 c.urlParams_.Set("alt", alt) 10915 c.urlParams_.Set("prettyPrint", "false") 10916 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action") 10917 urls += "?" + c.urlParams_.Encode() 10918 req, err := http.NewRequest("POST", urls, body) 10919 if err != nil { 10920 return nil, err 10921 } 10922 req.Header = reqHeaders 10923 googleapi.Expand(req.URL, map[string]string{ 10924 "customerId": c.customerId, 10925 "resourceId": c.resourceId, 10926 }) 10927 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10928} 10929 10930// Do executes the "directory.mobiledevices.action" call. 10931func (c *MobiledevicesActionCall) Do(opts ...googleapi.CallOption) error { 10932 gensupport.SetOptions(c.urlParams_, opts...) 10933 res, err := c.doRequest("json") 10934 if err != nil { 10935 return err 10936 } 10937 defer googleapi.CloseBody(res) 10938 if err := googleapi.CheckResponse(res); err != nil { 10939 return err 10940 } 10941 return nil 10942 // { 10943 // "description": "Takes an action that affects a mobile device. For example, remotely wiping a device.", 10944 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action", 10945 // "httpMethod": "POST", 10946 // "id": "directory.mobiledevices.action", 10947 // "parameterOrder": [ 10948 // "customerId", 10949 // "resourceId" 10950 // ], 10951 // "parameters": { 10952 // "customerId": { 10953 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 10954 // "location": "path", 10955 // "required": true, 10956 // "type": "string" 10957 // }, 10958 // "resourceId": { 10959 // "description": "The unique ID the API service uses to identify the mobile device.", 10960 // "location": "path", 10961 // "required": true, 10962 // "type": "string" 10963 // } 10964 // }, 10965 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action", 10966 // "request": { 10967 // "$ref": "MobileDeviceAction" 10968 // }, 10969 // "scopes": [ 10970 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 10971 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action" 10972 // ] 10973 // } 10974 10975} 10976 10977// method id "directory.mobiledevices.delete": 10978 10979type MobiledevicesDeleteCall struct { 10980 s *Service 10981 customerId string 10982 resourceId string 10983 urlParams_ gensupport.URLParams 10984 ctx_ context.Context 10985 header_ http.Header 10986} 10987 10988// Delete: Removes a mobile device. 10989func (r *MobiledevicesService) Delete(customerId string, resourceId string) *MobiledevicesDeleteCall { 10990 c := &MobiledevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10991 c.customerId = customerId 10992 c.resourceId = resourceId 10993 return c 10994} 10995 10996// Fields allows partial responses to be retrieved. See 10997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10998// for more information. 10999func (c *MobiledevicesDeleteCall) Fields(s ...googleapi.Field) *MobiledevicesDeleteCall { 11000 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11001 return c 11002} 11003 11004// Context sets the context to be used in this call's Do method. Any 11005// pending HTTP request will be aborted if the provided context is 11006// canceled. 11007func (c *MobiledevicesDeleteCall) Context(ctx context.Context) *MobiledevicesDeleteCall { 11008 c.ctx_ = ctx 11009 return c 11010} 11011 11012// Header returns an http.Header that can be modified by the caller to 11013// add HTTP headers to the request. 11014func (c *MobiledevicesDeleteCall) Header() http.Header { 11015 if c.header_ == nil { 11016 c.header_ = make(http.Header) 11017 } 11018 return c.header_ 11019} 11020 11021func (c *MobiledevicesDeleteCall) doRequest(alt string) (*http.Response, error) { 11022 reqHeaders := make(http.Header) 11023 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11024 for k, v := range c.header_ { 11025 reqHeaders[k] = v 11026 } 11027 reqHeaders.Set("User-Agent", c.s.userAgent()) 11028 var body io.Reader = nil 11029 c.urlParams_.Set("alt", alt) 11030 c.urlParams_.Set("prettyPrint", "false") 11031 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") 11032 urls += "?" + c.urlParams_.Encode() 11033 req, err := http.NewRequest("DELETE", urls, body) 11034 if err != nil { 11035 return nil, err 11036 } 11037 req.Header = reqHeaders 11038 googleapi.Expand(req.URL, map[string]string{ 11039 "customerId": c.customerId, 11040 "resourceId": c.resourceId, 11041 }) 11042 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11043} 11044 11045// Do executes the "directory.mobiledevices.delete" call. 11046func (c *MobiledevicesDeleteCall) Do(opts ...googleapi.CallOption) error { 11047 gensupport.SetOptions(c.urlParams_, opts...) 11048 res, err := c.doRequest("json") 11049 if err != nil { 11050 return err 11051 } 11052 defer googleapi.CloseBody(res) 11053 if err := googleapi.CheckResponse(res); err != nil { 11054 return err 11055 } 11056 return nil 11057 // { 11058 // "description": "Removes a mobile device.", 11059 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 11060 // "httpMethod": "DELETE", 11061 // "id": "directory.mobiledevices.delete", 11062 // "parameterOrder": [ 11063 // "customerId", 11064 // "resourceId" 11065 // ], 11066 // "parameters": { 11067 // "customerId": { 11068 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11069 // "location": "path", 11070 // "required": true, 11071 // "type": "string" 11072 // }, 11073 // "resourceId": { 11074 // "description": "The unique ID the API service uses to identify the mobile device.", 11075 // "location": "path", 11076 // "required": true, 11077 // "type": "string" 11078 // } 11079 // }, 11080 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 11081 // "scopes": [ 11082 // "https://www.googleapis.com/auth/admin.directory.device.mobile" 11083 // ] 11084 // } 11085 11086} 11087 11088// method id "directory.mobiledevices.get": 11089 11090type MobiledevicesGetCall struct { 11091 s *Service 11092 customerId string 11093 resourceId string 11094 urlParams_ gensupport.URLParams 11095 ifNoneMatch_ string 11096 ctx_ context.Context 11097 header_ http.Header 11098} 11099 11100// Get: Retrieves a mobile device's properties. 11101func (r *MobiledevicesService) Get(customerId string, resourceId string) *MobiledevicesGetCall { 11102 c := &MobiledevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11103 c.customerId = customerId 11104 c.resourceId = resourceId 11105 return c 11106} 11107 11108// Projection sets the optional parameter "projection": Restrict 11109// information returned to a set of selected fields. 11110// 11111// Possible values: 11112// "PROJECTION_UNDEFINED" 11113// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 11114// model, status, type, and status) 11115// "FULL" - Includes all metadata fields 11116func (c *MobiledevicesGetCall) Projection(projection string) *MobiledevicesGetCall { 11117 c.urlParams_.Set("projection", projection) 11118 return c 11119} 11120 11121// Fields allows partial responses to be retrieved. See 11122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11123// for more information. 11124func (c *MobiledevicesGetCall) Fields(s ...googleapi.Field) *MobiledevicesGetCall { 11125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11126 return c 11127} 11128 11129// IfNoneMatch sets the optional parameter which makes the operation 11130// fail if the object's ETag matches the given value. This is useful for 11131// getting updates only after the object has changed since the last 11132// request. Use googleapi.IsNotModified to check whether the response 11133// error from Do is the result of In-None-Match. 11134func (c *MobiledevicesGetCall) IfNoneMatch(entityTag string) *MobiledevicesGetCall { 11135 c.ifNoneMatch_ = entityTag 11136 return c 11137} 11138 11139// Context sets the context to be used in this call's Do method. Any 11140// pending HTTP request will be aborted if the provided context is 11141// canceled. 11142func (c *MobiledevicesGetCall) Context(ctx context.Context) *MobiledevicesGetCall { 11143 c.ctx_ = ctx 11144 return c 11145} 11146 11147// Header returns an http.Header that can be modified by the caller to 11148// add HTTP headers to the request. 11149func (c *MobiledevicesGetCall) Header() http.Header { 11150 if c.header_ == nil { 11151 c.header_ = make(http.Header) 11152 } 11153 return c.header_ 11154} 11155 11156func (c *MobiledevicesGetCall) doRequest(alt string) (*http.Response, error) { 11157 reqHeaders := make(http.Header) 11158 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11159 for k, v := range c.header_ { 11160 reqHeaders[k] = v 11161 } 11162 reqHeaders.Set("User-Agent", c.s.userAgent()) 11163 if c.ifNoneMatch_ != "" { 11164 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11165 } 11166 var body io.Reader = nil 11167 c.urlParams_.Set("alt", alt) 11168 c.urlParams_.Set("prettyPrint", "false") 11169 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") 11170 urls += "?" + c.urlParams_.Encode() 11171 req, err := http.NewRequest("GET", urls, body) 11172 if err != nil { 11173 return nil, err 11174 } 11175 req.Header = reqHeaders 11176 googleapi.Expand(req.URL, map[string]string{ 11177 "customerId": c.customerId, 11178 "resourceId": c.resourceId, 11179 }) 11180 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11181} 11182 11183// Do executes the "directory.mobiledevices.get" call. 11184// Exactly one of *MobileDevice or error will be non-nil. Any non-2xx 11185// status code is an error. Response headers are in either 11186// *MobileDevice.ServerResponse.Header or (if a response was returned at 11187// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11188// to check whether the returned error was because 11189// http.StatusNotModified was returned. 11190func (c *MobiledevicesGetCall) Do(opts ...googleapi.CallOption) (*MobileDevice, error) { 11191 gensupport.SetOptions(c.urlParams_, opts...) 11192 res, err := c.doRequest("json") 11193 if res != nil && res.StatusCode == http.StatusNotModified { 11194 if res.Body != nil { 11195 res.Body.Close() 11196 } 11197 return nil, &googleapi.Error{ 11198 Code: res.StatusCode, 11199 Header: res.Header, 11200 } 11201 } 11202 if err != nil { 11203 return nil, err 11204 } 11205 defer googleapi.CloseBody(res) 11206 if err := googleapi.CheckResponse(res); err != nil { 11207 return nil, err 11208 } 11209 ret := &MobileDevice{ 11210 ServerResponse: googleapi.ServerResponse{ 11211 Header: res.Header, 11212 HTTPStatusCode: res.StatusCode, 11213 }, 11214 } 11215 target := &ret 11216 if err := gensupport.DecodeResponse(target, res); err != nil { 11217 return nil, err 11218 } 11219 return ret, nil 11220 // { 11221 // "description": "Retrieves a mobile device's properties.", 11222 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 11223 // "httpMethod": "GET", 11224 // "id": "directory.mobiledevices.get", 11225 // "parameterOrder": [ 11226 // "customerId", 11227 // "resourceId" 11228 // ], 11229 // "parameters": { 11230 // "customerId": { 11231 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11232 // "location": "path", 11233 // "required": true, 11234 // "type": "string" 11235 // }, 11236 // "projection": { 11237 // "description": "Restrict information returned to a set of selected fields.", 11238 // "enum": [ 11239 // "PROJECTION_UNDEFINED", 11240 // "BASIC", 11241 // "FULL" 11242 // ], 11243 // "enumDescriptions": [ 11244 // "", 11245 // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", 11246 // "Includes all metadata fields" 11247 // ], 11248 // "location": "query", 11249 // "type": "string" 11250 // }, 11251 // "resourceId": { 11252 // "description": "The unique ID the API service uses to identify the mobile device.", 11253 // "location": "path", 11254 // "required": true, 11255 // "type": "string" 11256 // } 11257 // }, 11258 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 11259 // "response": { 11260 // "$ref": "MobileDevice" 11261 // }, 11262 // "scopes": [ 11263 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 11264 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 11265 // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 11266 // ] 11267 // } 11268 11269} 11270 11271// method id "directory.mobiledevices.list": 11272 11273type MobiledevicesListCall struct { 11274 s *Service 11275 customerId string 11276 urlParams_ gensupport.URLParams 11277 ifNoneMatch_ string 11278 ctx_ context.Context 11279 header_ http.Header 11280} 11281 11282// List: Retrieves a paginated list of all mobile devices for an 11283// account. 11284func (r *MobiledevicesService) List(customerId string) *MobiledevicesListCall { 11285 c := &MobiledevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11286 c.customerId = customerId 11287 return c 11288} 11289 11290// MaxResults sets the optional parameter "maxResults": Maximum number 11291// of results to return. Max allowed value is 100. 11292func (c *MobiledevicesListCall) MaxResults(maxResults int64) *MobiledevicesListCall { 11293 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11294 return c 11295} 11296 11297// OrderBy sets the optional parameter "orderBy": Device property to use 11298// for sorting results. 11299// 11300// Possible values: 11301// "orderByUndefined" 11302// "deviceId" - The serial number for a Google Sync mobile device. For 11303// Android devices, this is a software generated unique identifier. 11304// "email" - The device owner's email address. 11305// "lastSync" - Last policy settings sync date time of the device. 11306// "model" - The mobile device's model. 11307// "name" - The device owner's user name. 11308// "os" - The device's operating system. 11309// "status" - The device status. 11310// "type" - Type of the device. 11311func (c *MobiledevicesListCall) OrderBy(orderBy string) *MobiledevicesListCall { 11312 c.urlParams_.Set("orderBy", orderBy) 11313 return c 11314} 11315 11316// PageToken sets the optional parameter "pageToken": Token to specify 11317// next page in the list 11318func (c *MobiledevicesListCall) PageToken(pageToken string) *MobiledevicesListCall { 11319 c.urlParams_.Set("pageToken", pageToken) 11320 return c 11321} 11322 11323// Projection sets the optional parameter "projection": Restrict 11324// information returned to a set of selected fields. 11325// 11326// Possible values: 11327// "PROJECTION_UNDEFINED" 11328// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 11329// model, status, type, and status) 11330// "FULL" - Includes all metadata fields 11331func (c *MobiledevicesListCall) Projection(projection string) *MobiledevicesListCall { 11332 c.urlParams_.Set("projection", projection) 11333 return c 11334} 11335 11336// Query sets the optional parameter "query": Search string in the 11337// format given at 11338// http://support.google.com/a/bin/answer.py?answer=1408863#search 11339func (c *MobiledevicesListCall) Query(query string) *MobiledevicesListCall { 11340 c.urlParams_.Set("query", query) 11341 return c 11342} 11343 11344// SortOrder sets the optional parameter "sortOrder": Whether to return 11345// results in ascending or descending order. Must be used with the 11346// `orderBy` parameter. 11347// 11348// Possible values: 11349// "SORT_ORDER_UNDEFINED" 11350// "ASCENDING" - Ascending order. 11351// "DESCENDING" - Descending order. 11352func (c *MobiledevicesListCall) SortOrder(sortOrder string) *MobiledevicesListCall { 11353 c.urlParams_.Set("sortOrder", sortOrder) 11354 return c 11355} 11356 11357// Fields allows partial responses to be retrieved. See 11358// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11359// for more information. 11360func (c *MobiledevicesListCall) Fields(s ...googleapi.Field) *MobiledevicesListCall { 11361 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11362 return c 11363} 11364 11365// IfNoneMatch sets the optional parameter which makes the operation 11366// fail if the object's ETag matches the given value. This is useful for 11367// getting updates only after the object has changed since the last 11368// request. Use googleapi.IsNotModified to check whether the response 11369// error from Do is the result of In-None-Match. 11370func (c *MobiledevicesListCall) IfNoneMatch(entityTag string) *MobiledevicesListCall { 11371 c.ifNoneMatch_ = entityTag 11372 return c 11373} 11374 11375// Context sets the context to be used in this call's Do method. Any 11376// pending HTTP request will be aborted if the provided context is 11377// canceled. 11378func (c *MobiledevicesListCall) Context(ctx context.Context) *MobiledevicesListCall { 11379 c.ctx_ = ctx 11380 return c 11381} 11382 11383// Header returns an http.Header that can be modified by the caller to 11384// add HTTP headers to the request. 11385func (c *MobiledevicesListCall) Header() http.Header { 11386 if c.header_ == nil { 11387 c.header_ = make(http.Header) 11388 } 11389 return c.header_ 11390} 11391 11392func (c *MobiledevicesListCall) doRequest(alt string) (*http.Response, error) { 11393 reqHeaders := make(http.Header) 11394 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11395 for k, v := range c.header_ { 11396 reqHeaders[k] = v 11397 } 11398 reqHeaders.Set("User-Agent", c.s.userAgent()) 11399 if c.ifNoneMatch_ != "" { 11400 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11401 } 11402 var body io.Reader = nil 11403 c.urlParams_.Set("alt", alt) 11404 c.urlParams_.Set("prettyPrint", "false") 11405 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile") 11406 urls += "?" + c.urlParams_.Encode() 11407 req, err := http.NewRequest("GET", urls, body) 11408 if err != nil { 11409 return nil, err 11410 } 11411 req.Header = reqHeaders 11412 googleapi.Expand(req.URL, map[string]string{ 11413 "customerId": c.customerId, 11414 }) 11415 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11416} 11417 11418// Do executes the "directory.mobiledevices.list" call. 11419// Exactly one of *MobileDevices or error will be non-nil. Any non-2xx 11420// status code is an error. Response headers are in either 11421// *MobileDevices.ServerResponse.Header or (if a response was returned 11422// at all) in error.(*googleapi.Error).Header. Use 11423// googleapi.IsNotModified to check whether the returned error was 11424// because http.StatusNotModified was returned. 11425func (c *MobiledevicesListCall) Do(opts ...googleapi.CallOption) (*MobileDevices, error) { 11426 gensupport.SetOptions(c.urlParams_, opts...) 11427 res, err := c.doRequest("json") 11428 if res != nil && res.StatusCode == http.StatusNotModified { 11429 if res.Body != nil { 11430 res.Body.Close() 11431 } 11432 return nil, &googleapi.Error{ 11433 Code: res.StatusCode, 11434 Header: res.Header, 11435 } 11436 } 11437 if err != nil { 11438 return nil, err 11439 } 11440 defer googleapi.CloseBody(res) 11441 if err := googleapi.CheckResponse(res); err != nil { 11442 return nil, err 11443 } 11444 ret := &MobileDevices{ 11445 ServerResponse: googleapi.ServerResponse{ 11446 Header: res.Header, 11447 HTTPStatusCode: res.StatusCode, 11448 }, 11449 } 11450 target := &ret 11451 if err := gensupport.DecodeResponse(target, res); err != nil { 11452 return nil, err 11453 } 11454 return ret, nil 11455 // { 11456 // "description": "Retrieves a paginated list of all mobile devices for an account.", 11457 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile", 11458 // "httpMethod": "GET", 11459 // "id": "directory.mobiledevices.list", 11460 // "parameterOrder": [ 11461 // "customerId" 11462 // ], 11463 // "parameters": { 11464 // "customerId": { 11465 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11466 // "location": "path", 11467 // "required": true, 11468 // "type": "string" 11469 // }, 11470 // "maxResults": { 11471 // "default": "100", 11472 // "description": "Maximum number of results to return. Max allowed value is 100.", 11473 // "format": "int32", 11474 // "location": "query", 11475 // "maximum": "100", 11476 // "minimum": "1", 11477 // "type": "integer" 11478 // }, 11479 // "orderBy": { 11480 // "description": "Device property to use for sorting results.", 11481 // "enum": [ 11482 // "orderByUndefined", 11483 // "deviceId", 11484 // "email", 11485 // "lastSync", 11486 // "model", 11487 // "name", 11488 // "os", 11489 // "status", 11490 // "type" 11491 // ], 11492 // "enumDescriptions": [ 11493 // "", 11494 // "The serial number for a Google Sync mobile device. For Android devices, this is a software generated unique identifier.", 11495 // "The device owner's email address.", 11496 // "Last policy settings sync date time of the device.", 11497 // "The mobile device's model.", 11498 // "The device owner's user name.", 11499 // "The device's operating system.", 11500 // "The device status.", 11501 // "Type of the device." 11502 // ], 11503 // "location": "query", 11504 // "type": "string" 11505 // }, 11506 // "pageToken": { 11507 // "description": "Token to specify next page in the list", 11508 // "location": "query", 11509 // "type": "string" 11510 // }, 11511 // "projection": { 11512 // "description": "Restrict information returned to a set of selected fields.", 11513 // "enum": [ 11514 // "PROJECTION_UNDEFINED", 11515 // "BASIC", 11516 // "FULL" 11517 // ], 11518 // "enumDescriptions": [ 11519 // "", 11520 // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", 11521 // "Includes all metadata fields" 11522 // ], 11523 // "location": "query", 11524 // "type": "string" 11525 // }, 11526 // "query": { 11527 // "description": "Search string in the format given at http://support.google.com/a/bin/answer.py?answer=1408863#search", 11528 // "location": "query", 11529 // "type": "string" 11530 // }, 11531 // "sortOrder": { 11532 // "description": "Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter.", 11533 // "enum": [ 11534 // "SORT_ORDER_UNDEFINED", 11535 // "ASCENDING", 11536 // "DESCENDING" 11537 // ], 11538 // "enumDescriptions": [ 11539 // "", 11540 // "Ascending order.", 11541 // "Descending order." 11542 // ], 11543 // "location": "query", 11544 // "type": "string" 11545 // } 11546 // }, 11547 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile", 11548 // "response": { 11549 // "$ref": "MobileDevices" 11550 // }, 11551 // "scopes": [ 11552 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 11553 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 11554 // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 11555 // ] 11556 // } 11557 11558} 11559 11560// Pages invokes f for each page of results. 11561// A non-nil error returned from f will halt the iteration. 11562// The provided context supersedes any context provided to the Context method. 11563func (c *MobiledevicesListCall) Pages(ctx context.Context, f func(*MobileDevices) error) error { 11564 c.ctx_ = ctx 11565 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11566 for { 11567 x, err := c.Do() 11568 if err != nil { 11569 return err 11570 } 11571 if err := f(x); err != nil { 11572 return err 11573 } 11574 if x.NextPageToken == "" { 11575 return nil 11576 } 11577 c.PageToken(x.NextPageToken) 11578 } 11579} 11580 11581// method id "directory.orgunits.delete": 11582 11583type OrgunitsDeleteCall struct { 11584 s *Service 11585 customerId string 11586 orgUnitPath string 11587 urlParams_ gensupport.URLParams 11588 ctx_ context.Context 11589 header_ http.Header 11590} 11591 11592// Delete: Removes an organizational unit. 11593func (r *OrgunitsService) Delete(customerId string, orgUnitPath string) *OrgunitsDeleteCall { 11594 c := &OrgunitsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11595 c.customerId = customerId 11596 c.orgUnitPath = orgUnitPath 11597 return c 11598} 11599 11600// Fields allows partial responses to be retrieved. See 11601// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11602// for more information. 11603func (c *OrgunitsDeleteCall) Fields(s ...googleapi.Field) *OrgunitsDeleteCall { 11604 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11605 return c 11606} 11607 11608// Context sets the context to be used in this call's Do method. Any 11609// pending HTTP request will be aborted if the provided context is 11610// canceled. 11611func (c *OrgunitsDeleteCall) Context(ctx context.Context) *OrgunitsDeleteCall { 11612 c.ctx_ = ctx 11613 return c 11614} 11615 11616// Header returns an http.Header that can be modified by the caller to 11617// add HTTP headers to the request. 11618func (c *OrgunitsDeleteCall) Header() http.Header { 11619 if c.header_ == nil { 11620 c.header_ = make(http.Header) 11621 } 11622 return c.header_ 11623} 11624 11625func (c *OrgunitsDeleteCall) doRequest(alt string) (*http.Response, error) { 11626 reqHeaders := make(http.Header) 11627 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11628 for k, v := range c.header_ { 11629 reqHeaders[k] = v 11630 } 11631 reqHeaders.Set("User-Agent", c.s.userAgent()) 11632 var body io.Reader = nil 11633 c.urlParams_.Set("alt", alt) 11634 c.urlParams_.Set("prettyPrint", "false") 11635 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 11636 urls += "?" + c.urlParams_.Encode() 11637 req, err := http.NewRequest("DELETE", urls, body) 11638 if err != nil { 11639 return nil, err 11640 } 11641 req.Header = reqHeaders 11642 googleapi.Expand(req.URL, map[string]string{ 11643 "customerId": c.customerId, 11644 "orgUnitPath": c.orgUnitPath, 11645 }) 11646 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11647} 11648 11649// Do executes the "directory.orgunits.delete" call. 11650func (c *OrgunitsDeleteCall) Do(opts ...googleapi.CallOption) error { 11651 gensupport.SetOptions(c.urlParams_, opts...) 11652 res, err := c.doRequest("json") 11653 if err != nil { 11654 return err 11655 } 11656 defer googleapi.CloseBody(res) 11657 if err := googleapi.CheckResponse(res); err != nil { 11658 return err 11659 } 11660 return nil 11661 // { 11662 // "description": "Removes an organizational unit.", 11663 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 11664 // "httpMethod": "DELETE", 11665 // "id": "directory.orgunits.delete", 11666 // "parameterOrder": [ 11667 // "customerId", 11668 // "orgUnitPath" 11669 // ], 11670 // "parameters": { 11671 // "customerId": { 11672 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11673 // "location": "path", 11674 // "required": true, 11675 // "type": "string" 11676 // }, 11677 // "orgUnitPath": { 11678 // "description": "The full path of the organizational unit or its unique ID.", 11679 // "location": "path", 11680 // "pattern": "^.*$", 11681 // "required": true, 11682 // "type": "string" 11683 // } 11684 // }, 11685 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 11686 // "scopes": [ 11687 // "https://www.googleapis.com/auth/admin.directory.orgunit" 11688 // ] 11689 // } 11690 11691} 11692 11693// method id "directory.orgunits.get": 11694 11695type OrgunitsGetCall struct { 11696 s *Service 11697 customerId string 11698 orgUnitPath string 11699 urlParams_ gensupport.URLParams 11700 ifNoneMatch_ string 11701 ctx_ context.Context 11702 header_ http.Header 11703} 11704 11705// Get: Retrieves an organizational unit. 11706func (r *OrgunitsService) Get(customerId string, orgUnitPath string) *OrgunitsGetCall { 11707 c := &OrgunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11708 c.customerId = customerId 11709 c.orgUnitPath = orgUnitPath 11710 return c 11711} 11712 11713// Fields allows partial responses to be retrieved. See 11714// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11715// for more information. 11716func (c *OrgunitsGetCall) Fields(s ...googleapi.Field) *OrgunitsGetCall { 11717 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11718 return c 11719} 11720 11721// IfNoneMatch sets the optional parameter which makes the operation 11722// fail if the object's ETag matches the given value. This is useful for 11723// getting updates only after the object has changed since the last 11724// request. Use googleapi.IsNotModified to check whether the response 11725// error from Do is the result of In-None-Match. 11726func (c *OrgunitsGetCall) IfNoneMatch(entityTag string) *OrgunitsGetCall { 11727 c.ifNoneMatch_ = entityTag 11728 return c 11729} 11730 11731// Context sets the context to be used in this call's Do method. Any 11732// pending HTTP request will be aborted if the provided context is 11733// canceled. 11734func (c *OrgunitsGetCall) Context(ctx context.Context) *OrgunitsGetCall { 11735 c.ctx_ = ctx 11736 return c 11737} 11738 11739// Header returns an http.Header that can be modified by the caller to 11740// add HTTP headers to the request. 11741func (c *OrgunitsGetCall) Header() http.Header { 11742 if c.header_ == nil { 11743 c.header_ = make(http.Header) 11744 } 11745 return c.header_ 11746} 11747 11748func (c *OrgunitsGetCall) doRequest(alt string) (*http.Response, error) { 11749 reqHeaders := make(http.Header) 11750 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11751 for k, v := range c.header_ { 11752 reqHeaders[k] = v 11753 } 11754 reqHeaders.Set("User-Agent", c.s.userAgent()) 11755 if c.ifNoneMatch_ != "" { 11756 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11757 } 11758 var body io.Reader = nil 11759 c.urlParams_.Set("alt", alt) 11760 c.urlParams_.Set("prettyPrint", "false") 11761 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 11762 urls += "?" + c.urlParams_.Encode() 11763 req, err := http.NewRequest("GET", urls, body) 11764 if err != nil { 11765 return nil, err 11766 } 11767 req.Header = reqHeaders 11768 googleapi.Expand(req.URL, map[string]string{ 11769 "customerId": c.customerId, 11770 "orgUnitPath": c.orgUnitPath, 11771 }) 11772 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11773} 11774 11775// Do executes the "directory.orgunits.get" call. 11776// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 11777// code is an error. Response headers are in either 11778// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 11779// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11780// check whether the returned error was because http.StatusNotModified 11781// was returned. 11782func (c *OrgunitsGetCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 11783 gensupport.SetOptions(c.urlParams_, opts...) 11784 res, err := c.doRequest("json") 11785 if res != nil && res.StatusCode == http.StatusNotModified { 11786 if res.Body != nil { 11787 res.Body.Close() 11788 } 11789 return nil, &googleapi.Error{ 11790 Code: res.StatusCode, 11791 Header: res.Header, 11792 } 11793 } 11794 if err != nil { 11795 return nil, err 11796 } 11797 defer googleapi.CloseBody(res) 11798 if err := googleapi.CheckResponse(res); err != nil { 11799 return nil, err 11800 } 11801 ret := &OrgUnit{ 11802 ServerResponse: googleapi.ServerResponse{ 11803 Header: res.Header, 11804 HTTPStatusCode: res.StatusCode, 11805 }, 11806 } 11807 target := &ret 11808 if err := gensupport.DecodeResponse(target, res); err != nil { 11809 return nil, err 11810 } 11811 return ret, nil 11812 // { 11813 // "description": "Retrieves an organizational unit.", 11814 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 11815 // "httpMethod": "GET", 11816 // "id": "directory.orgunits.get", 11817 // "parameterOrder": [ 11818 // "customerId", 11819 // "orgUnitPath" 11820 // ], 11821 // "parameters": { 11822 // "customerId": { 11823 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11824 // "location": "path", 11825 // "required": true, 11826 // "type": "string" 11827 // }, 11828 // "orgUnitPath": { 11829 // "description": "The full path of the organizational unit or its unique ID.", 11830 // "location": "path", 11831 // "pattern": "^.*$", 11832 // "required": true, 11833 // "type": "string" 11834 // } 11835 // }, 11836 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 11837 // "response": { 11838 // "$ref": "OrgUnit" 11839 // }, 11840 // "scopes": [ 11841 // "https://www.googleapis.com/auth/admin.directory.orgunit", 11842 // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 11843 // ] 11844 // } 11845 11846} 11847 11848// method id "directory.orgunits.insert": 11849 11850type OrgunitsInsertCall struct { 11851 s *Service 11852 customerId string 11853 orgunit *OrgUnit 11854 urlParams_ gensupport.URLParams 11855 ctx_ context.Context 11856 header_ http.Header 11857} 11858 11859// Insert: Adds an organizational unit. 11860func (r *OrgunitsService) Insert(customerId string, orgunit *OrgUnit) *OrgunitsInsertCall { 11861 c := &OrgunitsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11862 c.customerId = customerId 11863 c.orgunit = orgunit 11864 return c 11865} 11866 11867// Fields allows partial responses to be retrieved. See 11868// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11869// for more information. 11870func (c *OrgunitsInsertCall) Fields(s ...googleapi.Field) *OrgunitsInsertCall { 11871 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11872 return c 11873} 11874 11875// Context sets the context to be used in this call's Do method. Any 11876// pending HTTP request will be aborted if the provided context is 11877// canceled. 11878func (c *OrgunitsInsertCall) Context(ctx context.Context) *OrgunitsInsertCall { 11879 c.ctx_ = ctx 11880 return c 11881} 11882 11883// Header returns an http.Header that can be modified by the caller to 11884// add HTTP headers to the request. 11885func (c *OrgunitsInsertCall) Header() http.Header { 11886 if c.header_ == nil { 11887 c.header_ = make(http.Header) 11888 } 11889 return c.header_ 11890} 11891 11892func (c *OrgunitsInsertCall) doRequest(alt string) (*http.Response, error) { 11893 reqHeaders := make(http.Header) 11894 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11895 for k, v := range c.header_ { 11896 reqHeaders[k] = v 11897 } 11898 reqHeaders.Set("User-Agent", c.s.userAgent()) 11899 var body io.Reader = nil 11900 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 11901 if err != nil { 11902 return nil, err 11903 } 11904 reqHeaders.Set("Content-Type", "application/json") 11905 c.urlParams_.Set("alt", alt) 11906 c.urlParams_.Set("prettyPrint", "false") 11907 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits") 11908 urls += "?" + c.urlParams_.Encode() 11909 req, err := http.NewRequest("POST", urls, body) 11910 if err != nil { 11911 return nil, err 11912 } 11913 req.Header = reqHeaders 11914 googleapi.Expand(req.URL, map[string]string{ 11915 "customerId": c.customerId, 11916 }) 11917 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11918} 11919 11920// Do executes the "directory.orgunits.insert" call. 11921// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 11922// code is an error. Response headers are in either 11923// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 11924// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11925// check whether the returned error was because http.StatusNotModified 11926// was returned. 11927func (c *OrgunitsInsertCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 11928 gensupport.SetOptions(c.urlParams_, opts...) 11929 res, err := c.doRequest("json") 11930 if res != nil && res.StatusCode == http.StatusNotModified { 11931 if res.Body != nil { 11932 res.Body.Close() 11933 } 11934 return nil, &googleapi.Error{ 11935 Code: res.StatusCode, 11936 Header: res.Header, 11937 } 11938 } 11939 if err != nil { 11940 return nil, err 11941 } 11942 defer googleapi.CloseBody(res) 11943 if err := googleapi.CheckResponse(res); err != nil { 11944 return nil, err 11945 } 11946 ret := &OrgUnit{ 11947 ServerResponse: googleapi.ServerResponse{ 11948 Header: res.Header, 11949 HTTPStatusCode: res.StatusCode, 11950 }, 11951 } 11952 target := &ret 11953 if err := gensupport.DecodeResponse(target, res); err != nil { 11954 return nil, err 11955 } 11956 return ret, nil 11957 // { 11958 // "description": "Adds an organizational unit.", 11959 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits", 11960 // "httpMethod": "POST", 11961 // "id": "directory.orgunits.insert", 11962 // "parameterOrder": [ 11963 // "customerId" 11964 // ], 11965 // "parameters": { 11966 // "customerId": { 11967 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 11968 // "location": "path", 11969 // "required": true, 11970 // "type": "string" 11971 // } 11972 // }, 11973 // "path": "admin/directory/v1/customer/{customerId}/orgunits", 11974 // "request": { 11975 // "$ref": "OrgUnit" 11976 // }, 11977 // "response": { 11978 // "$ref": "OrgUnit" 11979 // }, 11980 // "scopes": [ 11981 // "https://www.googleapis.com/auth/admin.directory.orgunit" 11982 // ] 11983 // } 11984 11985} 11986 11987// method id "directory.orgunits.list": 11988 11989type OrgunitsListCall struct { 11990 s *Service 11991 customerId string 11992 urlParams_ gensupport.URLParams 11993 ifNoneMatch_ string 11994 ctx_ context.Context 11995 header_ http.Header 11996} 11997 11998// List: Retrieves a list of all organizational units for an account. 11999func (r *OrgunitsService) List(customerId string) *OrgunitsListCall { 12000 c := &OrgunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12001 c.customerId = customerId 12002 return c 12003} 12004 12005// OrgUnitPath sets the optional parameter "orgUnitPath": The full path 12006// to the organizational unit or its unique ID. Returns the children of 12007// the specified organizational unit. 12008func (c *OrgunitsListCall) OrgUnitPath(orgUnitPath string) *OrgunitsListCall { 12009 c.urlParams_.Set("orgUnitPath", orgUnitPath) 12010 return c 12011} 12012 12013// Type sets the optional parameter "type": Whether to return all 12014// sub-organizations or just immediate children. 12015// 12016// Possible values: 12017// "typeUndefined" 12018// "all" - All sub-organizational units. 12019// "children" - Immediate children only (default). 12020func (c *OrgunitsListCall) Type(type_ string) *OrgunitsListCall { 12021 c.urlParams_.Set("type", type_) 12022 return c 12023} 12024 12025// Fields allows partial responses to be retrieved. See 12026// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12027// for more information. 12028func (c *OrgunitsListCall) Fields(s ...googleapi.Field) *OrgunitsListCall { 12029 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12030 return c 12031} 12032 12033// IfNoneMatch sets the optional parameter which makes the operation 12034// fail if the object's ETag matches the given value. This is useful for 12035// getting updates only after the object has changed since the last 12036// request. Use googleapi.IsNotModified to check whether the response 12037// error from Do is the result of In-None-Match. 12038func (c *OrgunitsListCall) IfNoneMatch(entityTag string) *OrgunitsListCall { 12039 c.ifNoneMatch_ = entityTag 12040 return c 12041} 12042 12043// Context sets the context to be used in this call's Do method. Any 12044// pending HTTP request will be aborted if the provided context is 12045// canceled. 12046func (c *OrgunitsListCall) Context(ctx context.Context) *OrgunitsListCall { 12047 c.ctx_ = ctx 12048 return c 12049} 12050 12051// Header returns an http.Header that can be modified by the caller to 12052// add HTTP headers to the request. 12053func (c *OrgunitsListCall) Header() http.Header { 12054 if c.header_ == nil { 12055 c.header_ = make(http.Header) 12056 } 12057 return c.header_ 12058} 12059 12060func (c *OrgunitsListCall) doRequest(alt string) (*http.Response, error) { 12061 reqHeaders := make(http.Header) 12062 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12063 for k, v := range c.header_ { 12064 reqHeaders[k] = v 12065 } 12066 reqHeaders.Set("User-Agent", c.s.userAgent()) 12067 if c.ifNoneMatch_ != "" { 12068 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12069 } 12070 var body io.Reader = nil 12071 c.urlParams_.Set("alt", alt) 12072 c.urlParams_.Set("prettyPrint", "false") 12073 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits") 12074 urls += "?" + c.urlParams_.Encode() 12075 req, err := http.NewRequest("GET", urls, body) 12076 if err != nil { 12077 return nil, err 12078 } 12079 req.Header = reqHeaders 12080 googleapi.Expand(req.URL, map[string]string{ 12081 "customerId": c.customerId, 12082 }) 12083 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12084} 12085 12086// Do executes the "directory.orgunits.list" call. 12087// Exactly one of *OrgUnits or error will be non-nil. Any non-2xx status 12088// code is an error. Response headers are in either 12089// *OrgUnits.ServerResponse.Header or (if a response was returned at 12090// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12091// to check whether the returned error was because 12092// http.StatusNotModified was returned. 12093func (c *OrgunitsListCall) Do(opts ...googleapi.CallOption) (*OrgUnits, error) { 12094 gensupport.SetOptions(c.urlParams_, opts...) 12095 res, err := c.doRequest("json") 12096 if res != nil && res.StatusCode == http.StatusNotModified { 12097 if res.Body != nil { 12098 res.Body.Close() 12099 } 12100 return nil, &googleapi.Error{ 12101 Code: res.StatusCode, 12102 Header: res.Header, 12103 } 12104 } 12105 if err != nil { 12106 return nil, err 12107 } 12108 defer googleapi.CloseBody(res) 12109 if err := googleapi.CheckResponse(res); err != nil { 12110 return nil, err 12111 } 12112 ret := &OrgUnits{ 12113 ServerResponse: googleapi.ServerResponse{ 12114 Header: res.Header, 12115 HTTPStatusCode: res.StatusCode, 12116 }, 12117 } 12118 target := &ret 12119 if err := gensupport.DecodeResponse(target, res); err != nil { 12120 return nil, err 12121 } 12122 return ret, nil 12123 // { 12124 // "description": "Retrieves a list of all organizational units for an account.", 12125 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits", 12126 // "httpMethod": "GET", 12127 // "id": "directory.orgunits.list", 12128 // "parameterOrder": [ 12129 // "customerId" 12130 // ], 12131 // "parameters": { 12132 // "customerId": { 12133 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 12134 // "location": "path", 12135 // "required": true, 12136 // "type": "string" 12137 // }, 12138 // "orgUnitPath": { 12139 // "default": "", 12140 // "description": "The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit.", 12141 // "location": "query", 12142 // "type": "string" 12143 // }, 12144 // "type": { 12145 // "description": "Whether to return all sub-organizations or just immediate children.", 12146 // "enum": [ 12147 // "typeUndefined", 12148 // "all", 12149 // "children" 12150 // ], 12151 // "enumDescriptions": [ 12152 // "", 12153 // "All sub-organizational units.", 12154 // "Immediate children only (default)." 12155 // ], 12156 // "location": "query", 12157 // "type": "string" 12158 // } 12159 // }, 12160 // "path": "admin/directory/v1/customer/{customerId}/orgunits", 12161 // "response": { 12162 // "$ref": "OrgUnits" 12163 // }, 12164 // "scopes": [ 12165 // "https://www.googleapis.com/auth/admin.directory.orgunit", 12166 // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 12167 // ] 12168 // } 12169 12170} 12171 12172// method id "directory.orgunits.patch": 12173 12174type OrgunitsPatchCall struct { 12175 s *Service 12176 customerId string 12177 orgUnitPath string 12178 orgunit *OrgUnit 12179 urlParams_ gensupport.URLParams 12180 ctx_ context.Context 12181 header_ http.Header 12182} 12183 12184// Patch: Updates an organizational unit. This method supports [patch 12185// semantics](/admin-sdk/directory/v1/guides/performance#patch) 12186func (r *OrgunitsService) Patch(customerId string, orgUnitPath string, orgunit *OrgUnit) *OrgunitsPatchCall { 12187 c := &OrgunitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12188 c.customerId = customerId 12189 c.orgUnitPath = orgUnitPath 12190 c.orgunit = orgunit 12191 return c 12192} 12193 12194// Fields allows partial responses to be retrieved. See 12195// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12196// for more information. 12197func (c *OrgunitsPatchCall) Fields(s ...googleapi.Field) *OrgunitsPatchCall { 12198 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12199 return c 12200} 12201 12202// Context sets the context to be used in this call's Do method. Any 12203// pending HTTP request will be aborted if the provided context is 12204// canceled. 12205func (c *OrgunitsPatchCall) Context(ctx context.Context) *OrgunitsPatchCall { 12206 c.ctx_ = ctx 12207 return c 12208} 12209 12210// Header returns an http.Header that can be modified by the caller to 12211// add HTTP headers to the request. 12212func (c *OrgunitsPatchCall) Header() http.Header { 12213 if c.header_ == nil { 12214 c.header_ = make(http.Header) 12215 } 12216 return c.header_ 12217} 12218 12219func (c *OrgunitsPatchCall) doRequest(alt string) (*http.Response, error) { 12220 reqHeaders := make(http.Header) 12221 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12222 for k, v := range c.header_ { 12223 reqHeaders[k] = v 12224 } 12225 reqHeaders.Set("User-Agent", c.s.userAgent()) 12226 var body io.Reader = nil 12227 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 12228 if err != nil { 12229 return nil, err 12230 } 12231 reqHeaders.Set("Content-Type", "application/json") 12232 c.urlParams_.Set("alt", alt) 12233 c.urlParams_.Set("prettyPrint", "false") 12234 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 12235 urls += "?" + c.urlParams_.Encode() 12236 req, err := http.NewRequest("PATCH", urls, body) 12237 if err != nil { 12238 return nil, err 12239 } 12240 req.Header = reqHeaders 12241 googleapi.Expand(req.URL, map[string]string{ 12242 "customerId": c.customerId, 12243 "orgUnitPath": c.orgUnitPath, 12244 }) 12245 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12246} 12247 12248// Do executes the "directory.orgunits.patch" call. 12249// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 12250// code is an error. Response headers are in either 12251// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 12252// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12253// check whether the returned error was because http.StatusNotModified 12254// was returned. 12255func (c *OrgunitsPatchCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 12256 gensupport.SetOptions(c.urlParams_, opts...) 12257 res, err := c.doRequest("json") 12258 if res != nil && res.StatusCode == http.StatusNotModified { 12259 if res.Body != nil { 12260 res.Body.Close() 12261 } 12262 return nil, &googleapi.Error{ 12263 Code: res.StatusCode, 12264 Header: res.Header, 12265 } 12266 } 12267 if err != nil { 12268 return nil, err 12269 } 12270 defer googleapi.CloseBody(res) 12271 if err := googleapi.CheckResponse(res); err != nil { 12272 return nil, err 12273 } 12274 ret := &OrgUnit{ 12275 ServerResponse: googleapi.ServerResponse{ 12276 Header: res.Header, 12277 HTTPStatusCode: res.StatusCode, 12278 }, 12279 } 12280 target := &ret 12281 if err := gensupport.DecodeResponse(target, res); err != nil { 12282 return nil, err 12283 } 12284 return ret, nil 12285 // { 12286 // "description": "Updates an organizational unit. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch)", 12287 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 12288 // "httpMethod": "PATCH", 12289 // "id": "directory.orgunits.patch", 12290 // "parameterOrder": [ 12291 // "customerId", 12292 // "orgUnitPath" 12293 // ], 12294 // "parameters": { 12295 // "customerId": { 12296 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 12297 // "location": "path", 12298 // "required": true, 12299 // "type": "string" 12300 // }, 12301 // "orgUnitPath": { 12302 // "description": "The full path of the organizational unit or its unique ID.", 12303 // "location": "path", 12304 // "pattern": "^.*$", 12305 // "required": true, 12306 // "type": "string" 12307 // } 12308 // }, 12309 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 12310 // "request": { 12311 // "$ref": "OrgUnit" 12312 // }, 12313 // "response": { 12314 // "$ref": "OrgUnit" 12315 // }, 12316 // "scopes": [ 12317 // "https://www.googleapis.com/auth/admin.directory.orgunit" 12318 // ] 12319 // } 12320 12321} 12322 12323// method id "directory.orgunits.update": 12324 12325type OrgunitsUpdateCall struct { 12326 s *Service 12327 customerId string 12328 orgUnitPath string 12329 orgunit *OrgUnit 12330 urlParams_ gensupport.URLParams 12331 ctx_ context.Context 12332 header_ http.Header 12333} 12334 12335// Update: Updates an organizational unit. 12336func (r *OrgunitsService) Update(customerId string, orgUnitPath string, orgunit *OrgUnit) *OrgunitsUpdateCall { 12337 c := &OrgunitsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12338 c.customerId = customerId 12339 c.orgUnitPath = orgUnitPath 12340 c.orgunit = orgunit 12341 return c 12342} 12343 12344// Fields allows partial responses to be retrieved. See 12345// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12346// for more information. 12347func (c *OrgunitsUpdateCall) Fields(s ...googleapi.Field) *OrgunitsUpdateCall { 12348 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12349 return c 12350} 12351 12352// Context sets the context to be used in this call's Do method. Any 12353// pending HTTP request will be aborted if the provided context is 12354// canceled. 12355func (c *OrgunitsUpdateCall) Context(ctx context.Context) *OrgunitsUpdateCall { 12356 c.ctx_ = ctx 12357 return c 12358} 12359 12360// Header returns an http.Header that can be modified by the caller to 12361// add HTTP headers to the request. 12362func (c *OrgunitsUpdateCall) Header() http.Header { 12363 if c.header_ == nil { 12364 c.header_ = make(http.Header) 12365 } 12366 return c.header_ 12367} 12368 12369func (c *OrgunitsUpdateCall) doRequest(alt string) (*http.Response, error) { 12370 reqHeaders := make(http.Header) 12371 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12372 for k, v := range c.header_ { 12373 reqHeaders[k] = v 12374 } 12375 reqHeaders.Set("User-Agent", c.s.userAgent()) 12376 var body io.Reader = nil 12377 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 12378 if err != nil { 12379 return nil, err 12380 } 12381 reqHeaders.Set("Content-Type", "application/json") 12382 c.urlParams_.Set("alt", alt) 12383 c.urlParams_.Set("prettyPrint", "false") 12384 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 12385 urls += "?" + c.urlParams_.Encode() 12386 req, err := http.NewRequest("PUT", urls, body) 12387 if err != nil { 12388 return nil, err 12389 } 12390 req.Header = reqHeaders 12391 googleapi.Expand(req.URL, map[string]string{ 12392 "customerId": c.customerId, 12393 "orgUnitPath": c.orgUnitPath, 12394 }) 12395 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12396} 12397 12398// Do executes the "directory.orgunits.update" call. 12399// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 12400// code is an error. Response headers are in either 12401// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 12402// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12403// check whether the returned error was because http.StatusNotModified 12404// was returned. 12405func (c *OrgunitsUpdateCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 12406 gensupport.SetOptions(c.urlParams_, opts...) 12407 res, err := c.doRequest("json") 12408 if res != nil && res.StatusCode == http.StatusNotModified { 12409 if res.Body != nil { 12410 res.Body.Close() 12411 } 12412 return nil, &googleapi.Error{ 12413 Code: res.StatusCode, 12414 Header: res.Header, 12415 } 12416 } 12417 if err != nil { 12418 return nil, err 12419 } 12420 defer googleapi.CloseBody(res) 12421 if err := googleapi.CheckResponse(res); err != nil { 12422 return nil, err 12423 } 12424 ret := &OrgUnit{ 12425 ServerResponse: googleapi.ServerResponse{ 12426 Header: res.Header, 12427 HTTPStatusCode: res.StatusCode, 12428 }, 12429 } 12430 target := &ret 12431 if err := gensupport.DecodeResponse(target, res); err != nil { 12432 return nil, err 12433 } 12434 return ret, nil 12435 // { 12436 // "description": "Updates an organizational unit.", 12437 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 12438 // "httpMethod": "PUT", 12439 // "id": "directory.orgunits.update", 12440 // "parameterOrder": [ 12441 // "customerId", 12442 // "orgUnitPath" 12443 // ], 12444 // "parameters": { 12445 // "customerId": { 12446 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users).", 12447 // "location": "path", 12448 // "required": true, 12449 // "type": "string" 12450 // }, 12451 // "orgUnitPath": { 12452 // "description": "The full path of the organizational unit or its unique ID.", 12453 // "location": "path", 12454 // "pattern": "^.*$", 12455 // "required": true, 12456 // "type": "string" 12457 // } 12458 // }, 12459 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 12460 // "request": { 12461 // "$ref": "OrgUnit" 12462 // }, 12463 // "response": { 12464 // "$ref": "OrgUnit" 12465 // }, 12466 // "scopes": [ 12467 // "https://www.googleapis.com/auth/admin.directory.orgunit" 12468 // ] 12469 // } 12470 12471} 12472 12473// method id "directory.privileges.list": 12474 12475type PrivilegesListCall struct { 12476 s *Service 12477 customer string 12478 urlParams_ gensupport.URLParams 12479 ifNoneMatch_ string 12480 ctx_ context.Context 12481 header_ http.Header 12482} 12483 12484// List: Retrieves a paginated list of all privileges for a customer. 12485func (r *PrivilegesService) List(customer string) *PrivilegesListCall { 12486 c := &PrivilegesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12487 c.customer = customer 12488 return c 12489} 12490 12491// Fields allows partial responses to be retrieved. See 12492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12493// for more information. 12494func (c *PrivilegesListCall) Fields(s ...googleapi.Field) *PrivilegesListCall { 12495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12496 return c 12497} 12498 12499// IfNoneMatch sets the optional parameter which makes the operation 12500// fail if the object's ETag matches the given value. This is useful for 12501// getting updates only after the object has changed since the last 12502// request. Use googleapi.IsNotModified to check whether the response 12503// error from Do is the result of In-None-Match. 12504func (c *PrivilegesListCall) IfNoneMatch(entityTag string) *PrivilegesListCall { 12505 c.ifNoneMatch_ = entityTag 12506 return c 12507} 12508 12509// Context sets the context to be used in this call's Do method. Any 12510// pending HTTP request will be aborted if the provided context is 12511// canceled. 12512func (c *PrivilegesListCall) Context(ctx context.Context) *PrivilegesListCall { 12513 c.ctx_ = ctx 12514 return c 12515} 12516 12517// Header returns an http.Header that can be modified by the caller to 12518// add HTTP headers to the request. 12519func (c *PrivilegesListCall) Header() http.Header { 12520 if c.header_ == nil { 12521 c.header_ = make(http.Header) 12522 } 12523 return c.header_ 12524} 12525 12526func (c *PrivilegesListCall) doRequest(alt string) (*http.Response, error) { 12527 reqHeaders := make(http.Header) 12528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12529 for k, v := range c.header_ { 12530 reqHeaders[k] = v 12531 } 12532 reqHeaders.Set("User-Agent", c.s.userAgent()) 12533 if c.ifNoneMatch_ != "" { 12534 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12535 } 12536 var body io.Reader = nil 12537 c.urlParams_.Set("alt", alt) 12538 c.urlParams_.Set("prettyPrint", "false") 12539 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/ALL/privileges") 12540 urls += "?" + c.urlParams_.Encode() 12541 req, err := http.NewRequest("GET", urls, body) 12542 if err != nil { 12543 return nil, err 12544 } 12545 req.Header = reqHeaders 12546 googleapi.Expand(req.URL, map[string]string{ 12547 "customer": c.customer, 12548 }) 12549 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12550} 12551 12552// Do executes the "directory.privileges.list" call. 12553// Exactly one of *Privileges or error will be non-nil. Any non-2xx 12554// status code is an error. Response headers are in either 12555// *Privileges.ServerResponse.Header or (if a response was returned at 12556// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12557// to check whether the returned error was because 12558// http.StatusNotModified was returned. 12559func (c *PrivilegesListCall) Do(opts ...googleapi.CallOption) (*Privileges, error) { 12560 gensupport.SetOptions(c.urlParams_, opts...) 12561 res, err := c.doRequest("json") 12562 if res != nil && res.StatusCode == http.StatusNotModified { 12563 if res.Body != nil { 12564 res.Body.Close() 12565 } 12566 return nil, &googleapi.Error{ 12567 Code: res.StatusCode, 12568 Header: res.Header, 12569 } 12570 } 12571 if err != nil { 12572 return nil, err 12573 } 12574 defer googleapi.CloseBody(res) 12575 if err := googleapi.CheckResponse(res); err != nil { 12576 return nil, err 12577 } 12578 ret := &Privileges{ 12579 ServerResponse: googleapi.ServerResponse{ 12580 Header: res.Header, 12581 HTTPStatusCode: res.StatusCode, 12582 }, 12583 } 12584 target := &ret 12585 if err := gensupport.DecodeResponse(target, res); err != nil { 12586 return nil, err 12587 } 12588 return ret, nil 12589 // { 12590 // "description": "Retrieves a paginated list of all privileges for a customer.", 12591 // "flatPath": "admin/directory/v1/customer/{customer}/roles/ALL/privileges", 12592 // "httpMethod": "GET", 12593 // "id": "directory.privileges.list", 12594 // "parameterOrder": [ 12595 // "customer" 12596 // ], 12597 // "parameters": { 12598 // "customer": { 12599 // "description": "Immutable ID of the G Suite account.", 12600 // "location": "path", 12601 // "required": true, 12602 // "type": "string" 12603 // } 12604 // }, 12605 // "path": "admin/directory/v1/customer/{customer}/roles/ALL/privileges", 12606 // "response": { 12607 // "$ref": "Privileges" 12608 // }, 12609 // "scopes": [ 12610 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 12611 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 12612 // ] 12613 // } 12614 12615} 12616 12617// method id "directory.resources.buildings.delete": 12618 12619type ResourcesBuildingsDeleteCall struct { 12620 s *Service 12621 customer string 12622 buildingId string 12623 urlParams_ gensupport.URLParams 12624 ctx_ context.Context 12625 header_ http.Header 12626} 12627 12628// Delete: Deletes a building. 12629func (r *ResourcesBuildingsService) Delete(customer string, buildingId string) *ResourcesBuildingsDeleteCall { 12630 c := &ResourcesBuildingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12631 c.customer = customer 12632 c.buildingId = buildingId 12633 return c 12634} 12635 12636// Fields allows partial responses to be retrieved. See 12637// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12638// for more information. 12639func (c *ResourcesBuildingsDeleteCall) Fields(s ...googleapi.Field) *ResourcesBuildingsDeleteCall { 12640 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12641 return c 12642} 12643 12644// Context sets the context to be used in this call's Do method. Any 12645// pending HTTP request will be aborted if the provided context is 12646// canceled. 12647func (c *ResourcesBuildingsDeleteCall) Context(ctx context.Context) *ResourcesBuildingsDeleteCall { 12648 c.ctx_ = ctx 12649 return c 12650} 12651 12652// Header returns an http.Header that can be modified by the caller to 12653// add HTTP headers to the request. 12654func (c *ResourcesBuildingsDeleteCall) Header() http.Header { 12655 if c.header_ == nil { 12656 c.header_ = make(http.Header) 12657 } 12658 return c.header_ 12659} 12660 12661func (c *ResourcesBuildingsDeleteCall) doRequest(alt string) (*http.Response, error) { 12662 reqHeaders := make(http.Header) 12663 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12664 for k, v := range c.header_ { 12665 reqHeaders[k] = v 12666 } 12667 reqHeaders.Set("User-Agent", c.s.userAgent()) 12668 var body io.Reader = nil 12669 c.urlParams_.Set("alt", alt) 12670 c.urlParams_.Set("prettyPrint", "false") 12671 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 12672 urls += "?" + c.urlParams_.Encode() 12673 req, err := http.NewRequest("DELETE", urls, body) 12674 if err != nil { 12675 return nil, err 12676 } 12677 req.Header = reqHeaders 12678 googleapi.Expand(req.URL, map[string]string{ 12679 "customer": c.customer, 12680 "buildingId": c.buildingId, 12681 }) 12682 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12683} 12684 12685// Do executes the "directory.resources.buildings.delete" call. 12686func (c *ResourcesBuildingsDeleteCall) Do(opts ...googleapi.CallOption) error { 12687 gensupport.SetOptions(c.urlParams_, opts...) 12688 res, err := c.doRequest("json") 12689 if err != nil { 12690 return err 12691 } 12692 defer googleapi.CloseBody(res) 12693 if err := googleapi.CheckResponse(res); err != nil { 12694 return err 12695 } 12696 return nil 12697 // { 12698 // "description": "Deletes a building.", 12699 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 12700 // "httpMethod": "DELETE", 12701 // "id": "directory.resources.buildings.delete", 12702 // "parameterOrder": [ 12703 // "customer", 12704 // "buildingId" 12705 // ], 12706 // "parameters": { 12707 // "buildingId": { 12708 // "description": "The id of the building to delete.", 12709 // "location": "path", 12710 // "required": true, 12711 // "type": "string" 12712 // }, 12713 // "customer": { 12714 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 12715 // "location": "path", 12716 // "required": true, 12717 // "type": "string" 12718 // } 12719 // }, 12720 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 12721 // "scopes": [ 12722 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 12723 // ] 12724 // } 12725 12726} 12727 12728// method id "directory.resources.buildings.get": 12729 12730type ResourcesBuildingsGetCall struct { 12731 s *Service 12732 customer string 12733 buildingId string 12734 urlParams_ gensupport.URLParams 12735 ifNoneMatch_ string 12736 ctx_ context.Context 12737 header_ http.Header 12738} 12739 12740// Get: Retrieves a building. 12741func (r *ResourcesBuildingsService) Get(customer string, buildingId string) *ResourcesBuildingsGetCall { 12742 c := &ResourcesBuildingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12743 c.customer = customer 12744 c.buildingId = buildingId 12745 return c 12746} 12747 12748// Fields allows partial responses to be retrieved. See 12749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12750// for more information. 12751func (c *ResourcesBuildingsGetCall) Fields(s ...googleapi.Field) *ResourcesBuildingsGetCall { 12752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12753 return c 12754} 12755 12756// IfNoneMatch sets the optional parameter which makes the operation 12757// fail if the object's ETag matches the given value. This is useful for 12758// getting updates only after the object has changed since the last 12759// request. Use googleapi.IsNotModified to check whether the response 12760// error from Do is the result of In-None-Match. 12761func (c *ResourcesBuildingsGetCall) IfNoneMatch(entityTag string) *ResourcesBuildingsGetCall { 12762 c.ifNoneMatch_ = entityTag 12763 return c 12764} 12765 12766// Context sets the context to be used in this call's Do method. Any 12767// pending HTTP request will be aborted if the provided context is 12768// canceled. 12769func (c *ResourcesBuildingsGetCall) Context(ctx context.Context) *ResourcesBuildingsGetCall { 12770 c.ctx_ = ctx 12771 return c 12772} 12773 12774// Header returns an http.Header that can be modified by the caller to 12775// add HTTP headers to the request. 12776func (c *ResourcesBuildingsGetCall) Header() http.Header { 12777 if c.header_ == nil { 12778 c.header_ = make(http.Header) 12779 } 12780 return c.header_ 12781} 12782 12783func (c *ResourcesBuildingsGetCall) doRequest(alt string) (*http.Response, error) { 12784 reqHeaders := make(http.Header) 12785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12786 for k, v := range c.header_ { 12787 reqHeaders[k] = v 12788 } 12789 reqHeaders.Set("User-Agent", c.s.userAgent()) 12790 if c.ifNoneMatch_ != "" { 12791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12792 } 12793 var body io.Reader = nil 12794 c.urlParams_.Set("alt", alt) 12795 c.urlParams_.Set("prettyPrint", "false") 12796 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 12797 urls += "?" + c.urlParams_.Encode() 12798 req, err := http.NewRequest("GET", urls, body) 12799 if err != nil { 12800 return nil, err 12801 } 12802 req.Header = reqHeaders 12803 googleapi.Expand(req.URL, map[string]string{ 12804 "customer": c.customer, 12805 "buildingId": c.buildingId, 12806 }) 12807 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12808} 12809 12810// Do executes the "directory.resources.buildings.get" call. 12811// Exactly one of *Building or error will be non-nil. Any non-2xx status 12812// code is an error. Response headers are in either 12813// *Building.ServerResponse.Header or (if a response was returned at 12814// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12815// to check whether the returned error was because 12816// http.StatusNotModified was returned. 12817func (c *ResourcesBuildingsGetCall) Do(opts ...googleapi.CallOption) (*Building, error) { 12818 gensupport.SetOptions(c.urlParams_, opts...) 12819 res, err := c.doRequest("json") 12820 if res != nil && res.StatusCode == http.StatusNotModified { 12821 if res.Body != nil { 12822 res.Body.Close() 12823 } 12824 return nil, &googleapi.Error{ 12825 Code: res.StatusCode, 12826 Header: res.Header, 12827 } 12828 } 12829 if err != nil { 12830 return nil, err 12831 } 12832 defer googleapi.CloseBody(res) 12833 if err := googleapi.CheckResponse(res); err != nil { 12834 return nil, err 12835 } 12836 ret := &Building{ 12837 ServerResponse: googleapi.ServerResponse{ 12838 Header: res.Header, 12839 HTTPStatusCode: res.StatusCode, 12840 }, 12841 } 12842 target := &ret 12843 if err := gensupport.DecodeResponse(target, res); err != nil { 12844 return nil, err 12845 } 12846 return ret, nil 12847 // { 12848 // "description": "Retrieves a building.", 12849 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 12850 // "httpMethod": "GET", 12851 // "id": "directory.resources.buildings.get", 12852 // "parameterOrder": [ 12853 // "customer", 12854 // "buildingId" 12855 // ], 12856 // "parameters": { 12857 // "buildingId": { 12858 // "description": "The unique ID of the building to retrieve.", 12859 // "location": "path", 12860 // "required": true, 12861 // "type": "string" 12862 // }, 12863 // "customer": { 12864 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 12865 // "location": "path", 12866 // "required": true, 12867 // "type": "string" 12868 // } 12869 // }, 12870 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 12871 // "response": { 12872 // "$ref": "Building" 12873 // }, 12874 // "scopes": [ 12875 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 12876 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 12877 // ] 12878 // } 12879 12880} 12881 12882// method id "directory.resources.buildings.insert": 12883 12884type ResourcesBuildingsInsertCall struct { 12885 s *Service 12886 customer string 12887 building *Building 12888 urlParams_ gensupport.URLParams 12889 ctx_ context.Context 12890 header_ http.Header 12891} 12892 12893// Insert: Inserts a building. 12894func (r *ResourcesBuildingsService) Insert(customer string, building *Building) *ResourcesBuildingsInsertCall { 12895 c := &ResourcesBuildingsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12896 c.customer = customer 12897 c.building = building 12898 return c 12899} 12900 12901// CoordinatesSource sets the optional parameter "coordinatesSource": 12902// Source from which Building.coordinates are derived. 12903// 12904// Possible values: 12905// "COORDINATES_SOURCE_UNDEFINED" 12906// "CLIENT_SPECIFIED" - Building.coordinates are set to the 12907// coordinates included in the request. 12908// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 12909// populated based on the postal address. 12910// "SOURCE_UNSPECIFIED" (default) - Defaults to 12911// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 12912// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 12913func (c *ResourcesBuildingsInsertCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsInsertCall { 12914 c.urlParams_.Set("coordinatesSource", coordinatesSource) 12915 return c 12916} 12917 12918// Fields allows partial responses to be retrieved. See 12919// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12920// for more information. 12921func (c *ResourcesBuildingsInsertCall) Fields(s ...googleapi.Field) *ResourcesBuildingsInsertCall { 12922 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12923 return c 12924} 12925 12926// Context sets the context to be used in this call's Do method. Any 12927// pending HTTP request will be aborted if the provided context is 12928// canceled. 12929func (c *ResourcesBuildingsInsertCall) Context(ctx context.Context) *ResourcesBuildingsInsertCall { 12930 c.ctx_ = ctx 12931 return c 12932} 12933 12934// Header returns an http.Header that can be modified by the caller to 12935// add HTTP headers to the request. 12936func (c *ResourcesBuildingsInsertCall) Header() http.Header { 12937 if c.header_ == nil { 12938 c.header_ = make(http.Header) 12939 } 12940 return c.header_ 12941} 12942 12943func (c *ResourcesBuildingsInsertCall) doRequest(alt string) (*http.Response, error) { 12944 reqHeaders := make(http.Header) 12945 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12946 for k, v := range c.header_ { 12947 reqHeaders[k] = v 12948 } 12949 reqHeaders.Set("User-Agent", c.s.userAgent()) 12950 var body io.Reader = nil 12951 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 12952 if err != nil { 12953 return nil, err 12954 } 12955 reqHeaders.Set("Content-Type", "application/json") 12956 c.urlParams_.Set("alt", alt) 12957 c.urlParams_.Set("prettyPrint", "false") 12958 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings") 12959 urls += "?" + c.urlParams_.Encode() 12960 req, err := http.NewRequest("POST", urls, body) 12961 if err != nil { 12962 return nil, err 12963 } 12964 req.Header = reqHeaders 12965 googleapi.Expand(req.URL, map[string]string{ 12966 "customer": c.customer, 12967 }) 12968 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12969} 12970 12971// Do executes the "directory.resources.buildings.insert" call. 12972// Exactly one of *Building or error will be non-nil. Any non-2xx status 12973// code is an error. Response headers are in either 12974// *Building.ServerResponse.Header or (if a response was returned at 12975// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12976// to check whether the returned error was because 12977// http.StatusNotModified was returned. 12978func (c *ResourcesBuildingsInsertCall) Do(opts ...googleapi.CallOption) (*Building, error) { 12979 gensupport.SetOptions(c.urlParams_, opts...) 12980 res, err := c.doRequest("json") 12981 if res != nil && res.StatusCode == http.StatusNotModified { 12982 if res.Body != nil { 12983 res.Body.Close() 12984 } 12985 return nil, &googleapi.Error{ 12986 Code: res.StatusCode, 12987 Header: res.Header, 12988 } 12989 } 12990 if err != nil { 12991 return nil, err 12992 } 12993 defer googleapi.CloseBody(res) 12994 if err := googleapi.CheckResponse(res); err != nil { 12995 return nil, err 12996 } 12997 ret := &Building{ 12998 ServerResponse: googleapi.ServerResponse{ 12999 Header: res.Header, 13000 HTTPStatusCode: res.StatusCode, 13001 }, 13002 } 13003 target := &ret 13004 if err := gensupport.DecodeResponse(target, res); err != nil { 13005 return nil, err 13006 } 13007 return ret, nil 13008 // { 13009 // "description": "Inserts a building.", 13010 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings", 13011 // "httpMethod": "POST", 13012 // "id": "directory.resources.buildings.insert", 13013 // "parameterOrder": [ 13014 // "customer" 13015 // ], 13016 // "parameters": { 13017 // "coordinatesSource": { 13018 // "default": "SOURCE_UNSPECIFIED", 13019 // "description": "Source from which Building.coordinates are derived.", 13020 // "enum": [ 13021 // "COORDINATES_SOURCE_UNDEFINED", 13022 // "CLIENT_SPECIFIED", 13023 // "RESOLVED_FROM_ADDRESS", 13024 // "SOURCE_UNSPECIFIED" 13025 // ], 13026 // "enumDescriptions": [ 13027 // "", 13028 // "Building.coordinates are set to the coordinates included in the request.", 13029 // "Building.coordinates are automatically populated based on the postal address.", 13030 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 13031 // ], 13032 // "location": "query", 13033 // "type": "string" 13034 // }, 13035 // "customer": { 13036 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13037 // "location": "path", 13038 // "required": true, 13039 // "type": "string" 13040 // } 13041 // }, 13042 // "path": "admin/directory/v1/customer/{customer}/resources/buildings", 13043 // "request": { 13044 // "$ref": "Building" 13045 // }, 13046 // "response": { 13047 // "$ref": "Building" 13048 // }, 13049 // "scopes": [ 13050 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 13051 // ] 13052 // } 13053 13054} 13055 13056// method id "directory.resources.buildings.list": 13057 13058type ResourcesBuildingsListCall struct { 13059 s *Service 13060 customer string 13061 urlParams_ gensupport.URLParams 13062 ifNoneMatch_ string 13063 ctx_ context.Context 13064 header_ http.Header 13065} 13066 13067// List: Retrieves a list of buildings for an account. 13068func (r *ResourcesBuildingsService) List(customer string) *ResourcesBuildingsListCall { 13069 c := &ResourcesBuildingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13070 c.customer = customer 13071 return c 13072} 13073 13074// MaxResults sets the optional parameter "maxResults": Maximum number 13075// of results to return. 13076func (c *ResourcesBuildingsListCall) MaxResults(maxResults int64) *ResourcesBuildingsListCall { 13077 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 13078 return c 13079} 13080 13081// PageToken sets the optional parameter "pageToken": Token to specify 13082// the next page in the list. 13083func (c *ResourcesBuildingsListCall) PageToken(pageToken string) *ResourcesBuildingsListCall { 13084 c.urlParams_.Set("pageToken", pageToken) 13085 return c 13086} 13087 13088// Fields allows partial responses to be retrieved. See 13089// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13090// for more information. 13091func (c *ResourcesBuildingsListCall) Fields(s ...googleapi.Field) *ResourcesBuildingsListCall { 13092 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13093 return c 13094} 13095 13096// IfNoneMatch sets the optional parameter which makes the operation 13097// fail if the object's ETag matches the given value. This is useful for 13098// getting updates only after the object has changed since the last 13099// request. Use googleapi.IsNotModified to check whether the response 13100// error from Do is the result of In-None-Match. 13101func (c *ResourcesBuildingsListCall) IfNoneMatch(entityTag string) *ResourcesBuildingsListCall { 13102 c.ifNoneMatch_ = entityTag 13103 return c 13104} 13105 13106// Context sets the context to be used in this call's Do method. Any 13107// pending HTTP request will be aborted if the provided context is 13108// canceled. 13109func (c *ResourcesBuildingsListCall) Context(ctx context.Context) *ResourcesBuildingsListCall { 13110 c.ctx_ = ctx 13111 return c 13112} 13113 13114// Header returns an http.Header that can be modified by the caller to 13115// add HTTP headers to the request. 13116func (c *ResourcesBuildingsListCall) Header() http.Header { 13117 if c.header_ == nil { 13118 c.header_ = make(http.Header) 13119 } 13120 return c.header_ 13121} 13122 13123func (c *ResourcesBuildingsListCall) doRequest(alt string) (*http.Response, error) { 13124 reqHeaders := make(http.Header) 13125 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13126 for k, v := range c.header_ { 13127 reqHeaders[k] = v 13128 } 13129 reqHeaders.Set("User-Agent", c.s.userAgent()) 13130 if c.ifNoneMatch_ != "" { 13131 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13132 } 13133 var body io.Reader = nil 13134 c.urlParams_.Set("alt", alt) 13135 c.urlParams_.Set("prettyPrint", "false") 13136 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings") 13137 urls += "?" + c.urlParams_.Encode() 13138 req, err := http.NewRequest("GET", urls, body) 13139 if err != nil { 13140 return nil, err 13141 } 13142 req.Header = reqHeaders 13143 googleapi.Expand(req.URL, map[string]string{ 13144 "customer": c.customer, 13145 }) 13146 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13147} 13148 13149// Do executes the "directory.resources.buildings.list" call. 13150// Exactly one of *Buildings or error will be non-nil. Any non-2xx 13151// status code is an error. Response headers are in either 13152// *Buildings.ServerResponse.Header or (if a response was returned at 13153// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13154// to check whether the returned error was because 13155// http.StatusNotModified was returned. 13156func (c *ResourcesBuildingsListCall) Do(opts ...googleapi.CallOption) (*Buildings, error) { 13157 gensupport.SetOptions(c.urlParams_, opts...) 13158 res, err := c.doRequest("json") 13159 if res != nil && res.StatusCode == http.StatusNotModified { 13160 if res.Body != nil { 13161 res.Body.Close() 13162 } 13163 return nil, &googleapi.Error{ 13164 Code: res.StatusCode, 13165 Header: res.Header, 13166 } 13167 } 13168 if err != nil { 13169 return nil, err 13170 } 13171 defer googleapi.CloseBody(res) 13172 if err := googleapi.CheckResponse(res); err != nil { 13173 return nil, err 13174 } 13175 ret := &Buildings{ 13176 ServerResponse: googleapi.ServerResponse{ 13177 Header: res.Header, 13178 HTTPStatusCode: res.StatusCode, 13179 }, 13180 } 13181 target := &ret 13182 if err := gensupport.DecodeResponse(target, res); err != nil { 13183 return nil, err 13184 } 13185 return ret, nil 13186 // { 13187 // "description": "Retrieves a list of buildings for an account.", 13188 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings", 13189 // "httpMethod": "GET", 13190 // "id": "directory.resources.buildings.list", 13191 // "parameterOrder": [ 13192 // "customer" 13193 // ], 13194 // "parameters": { 13195 // "customer": { 13196 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13197 // "location": "path", 13198 // "required": true, 13199 // "type": "string" 13200 // }, 13201 // "maxResults": { 13202 // "description": "Maximum number of results to return.", 13203 // "format": "int32", 13204 // "location": "query", 13205 // "maximum": "500", 13206 // "minimum": "1", 13207 // "type": "integer" 13208 // }, 13209 // "pageToken": { 13210 // "description": "Token to specify the next page in the list.", 13211 // "location": "query", 13212 // "type": "string" 13213 // } 13214 // }, 13215 // "path": "admin/directory/v1/customer/{customer}/resources/buildings", 13216 // "response": { 13217 // "$ref": "Buildings" 13218 // }, 13219 // "scopes": [ 13220 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 13221 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 13222 // ] 13223 // } 13224 13225} 13226 13227// Pages invokes f for each page of results. 13228// A non-nil error returned from f will halt the iteration. 13229// The provided context supersedes any context provided to the Context method. 13230func (c *ResourcesBuildingsListCall) Pages(ctx context.Context, f func(*Buildings) error) error { 13231 c.ctx_ = ctx 13232 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13233 for { 13234 x, err := c.Do() 13235 if err != nil { 13236 return err 13237 } 13238 if err := f(x); err != nil { 13239 return err 13240 } 13241 if x.NextPageToken == "" { 13242 return nil 13243 } 13244 c.PageToken(x.NextPageToken) 13245 } 13246} 13247 13248// method id "directory.resources.buildings.patch": 13249 13250type ResourcesBuildingsPatchCall struct { 13251 s *Service 13252 customer string 13253 buildingId string 13254 building *Building 13255 urlParams_ gensupport.URLParams 13256 ctx_ context.Context 13257 header_ http.Header 13258} 13259 13260// Patch: Patches a building via Apiary Patch Orchestration. 13261func (r *ResourcesBuildingsService) Patch(customer string, buildingId string, building *Building) *ResourcesBuildingsPatchCall { 13262 c := &ResourcesBuildingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13263 c.customer = customer 13264 c.buildingId = buildingId 13265 c.building = building 13266 return c 13267} 13268 13269// CoordinatesSource sets the optional parameter "coordinatesSource": 13270// Source from which Building.coordinates are derived. 13271// 13272// Possible values: 13273// "COORDINATES_SOURCE_UNDEFINED" 13274// "CLIENT_SPECIFIED" - Building.coordinates are set to the 13275// coordinates included in the request. 13276// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 13277// populated based on the postal address. 13278// "SOURCE_UNSPECIFIED" (default) - Defaults to 13279// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 13280// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 13281func (c *ResourcesBuildingsPatchCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsPatchCall { 13282 c.urlParams_.Set("coordinatesSource", coordinatesSource) 13283 return c 13284} 13285 13286// Fields allows partial responses to be retrieved. See 13287// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13288// for more information. 13289func (c *ResourcesBuildingsPatchCall) Fields(s ...googleapi.Field) *ResourcesBuildingsPatchCall { 13290 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13291 return c 13292} 13293 13294// Context sets the context to be used in this call's Do method. Any 13295// pending HTTP request will be aborted if the provided context is 13296// canceled. 13297func (c *ResourcesBuildingsPatchCall) Context(ctx context.Context) *ResourcesBuildingsPatchCall { 13298 c.ctx_ = ctx 13299 return c 13300} 13301 13302// Header returns an http.Header that can be modified by the caller to 13303// add HTTP headers to the request. 13304func (c *ResourcesBuildingsPatchCall) Header() http.Header { 13305 if c.header_ == nil { 13306 c.header_ = make(http.Header) 13307 } 13308 return c.header_ 13309} 13310 13311func (c *ResourcesBuildingsPatchCall) doRequest(alt string) (*http.Response, error) { 13312 reqHeaders := make(http.Header) 13313 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13314 for k, v := range c.header_ { 13315 reqHeaders[k] = v 13316 } 13317 reqHeaders.Set("User-Agent", c.s.userAgent()) 13318 var body io.Reader = nil 13319 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 13320 if err != nil { 13321 return nil, err 13322 } 13323 reqHeaders.Set("Content-Type", "application/json") 13324 c.urlParams_.Set("alt", alt) 13325 c.urlParams_.Set("prettyPrint", "false") 13326 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 13327 urls += "?" + c.urlParams_.Encode() 13328 req, err := http.NewRequest("PATCH", urls, body) 13329 if err != nil { 13330 return nil, err 13331 } 13332 req.Header = reqHeaders 13333 googleapi.Expand(req.URL, map[string]string{ 13334 "customer": c.customer, 13335 "buildingId": c.buildingId, 13336 }) 13337 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13338} 13339 13340// Do executes the "directory.resources.buildings.patch" call. 13341// Exactly one of *Building or error will be non-nil. Any non-2xx status 13342// code is an error. Response headers are in either 13343// *Building.ServerResponse.Header or (if a response was returned at 13344// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13345// to check whether the returned error was because 13346// http.StatusNotModified was returned. 13347func (c *ResourcesBuildingsPatchCall) Do(opts ...googleapi.CallOption) (*Building, error) { 13348 gensupport.SetOptions(c.urlParams_, opts...) 13349 res, err := c.doRequest("json") 13350 if res != nil && res.StatusCode == http.StatusNotModified { 13351 if res.Body != nil { 13352 res.Body.Close() 13353 } 13354 return nil, &googleapi.Error{ 13355 Code: res.StatusCode, 13356 Header: res.Header, 13357 } 13358 } 13359 if err != nil { 13360 return nil, err 13361 } 13362 defer googleapi.CloseBody(res) 13363 if err := googleapi.CheckResponse(res); err != nil { 13364 return nil, err 13365 } 13366 ret := &Building{ 13367 ServerResponse: googleapi.ServerResponse{ 13368 Header: res.Header, 13369 HTTPStatusCode: res.StatusCode, 13370 }, 13371 } 13372 target := &ret 13373 if err := gensupport.DecodeResponse(target, res); err != nil { 13374 return nil, err 13375 } 13376 return ret, nil 13377 // { 13378 // "description": "Patches a building via Apiary Patch Orchestration.", 13379 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 13380 // "httpMethod": "PATCH", 13381 // "id": "directory.resources.buildings.patch", 13382 // "parameterOrder": [ 13383 // "customer", 13384 // "buildingId" 13385 // ], 13386 // "parameters": { 13387 // "buildingId": { 13388 // "description": "The id of the building to update.", 13389 // "location": "path", 13390 // "required": true, 13391 // "type": "string" 13392 // }, 13393 // "coordinatesSource": { 13394 // "default": "SOURCE_UNSPECIFIED", 13395 // "description": "Source from which Building.coordinates are derived.", 13396 // "enum": [ 13397 // "COORDINATES_SOURCE_UNDEFINED", 13398 // "CLIENT_SPECIFIED", 13399 // "RESOLVED_FROM_ADDRESS", 13400 // "SOURCE_UNSPECIFIED" 13401 // ], 13402 // "enumDescriptions": [ 13403 // "", 13404 // "Building.coordinates are set to the coordinates included in the request.", 13405 // "Building.coordinates are automatically populated based on the postal address.", 13406 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 13407 // ], 13408 // "location": "query", 13409 // "type": "string" 13410 // }, 13411 // "customer": { 13412 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13413 // "location": "path", 13414 // "required": true, 13415 // "type": "string" 13416 // } 13417 // }, 13418 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 13419 // "request": { 13420 // "$ref": "Building" 13421 // }, 13422 // "response": { 13423 // "$ref": "Building" 13424 // }, 13425 // "scopes": [ 13426 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 13427 // ] 13428 // } 13429 13430} 13431 13432// method id "directory.resources.buildings.update": 13433 13434type ResourcesBuildingsUpdateCall struct { 13435 s *Service 13436 customer string 13437 buildingId string 13438 building *Building 13439 urlParams_ gensupport.URLParams 13440 ctx_ context.Context 13441 header_ http.Header 13442} 13443 13444// Update: Updates a building. 13445func (r *ResourcesBuildingsService) Update(customer string, buildingId string, building *Building) *ResourcesBuildingsUpdateCall { 13446 c := &ResourcesBuildingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13447 c.customer = customer 13448 c.buildingId = buildingId 13449 c.building = building 13450 return c 13451} 13452 13453// CoordinatesSource sets the optional parameter "coordinatesSource": 13454// Source from which Building.coordinates are derived. 13455// 13456// Possible values: 13457// "COORDINATES_SOURCE_UNDEFINED" 13458// "CLIENT_SPECIFIED" - Building.coordinates are set to the 13459// coordinates included in the request. 13460// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 13461// populated based on the postal address. 13462// "SOURCE_UNSPECIFIED" (default) - Defaults to 13463// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 13464// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 13465func (c *ResourcesBuildingsUpdateCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsUpdateCall { 13466 c.urlParams_.Set("coordinatesSource", coordinatesSource) 13467 return c 13468} 13469 13470// Fields allows partial responses to be retrieved. See 13471// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13472// for more information. 13473func (c *ResourcesBuildingsUpdateCall) Fields(s ...googleapi.Field) *ResourcesBuildingsUpdateCall { 13474 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13475 return c 13476} 13477 13478// Context sets the context to be used in this call's Do method. Any 13479// pending HTTP request will be aborted if the provided context is 13480// canceled. 13481func (c *ResourcesBuildingsUpdateCall) Context(ctx context.Context) *ResourcesBuildingsUpdateCall { 13482 c.ctx_ = ctx 13483 return c 13484} 13485 13486// Header returns an http.Header that can be modified by the caller to 13487// add HTTP headers to the request. 13488func (c *ResourcesBuildingsUpdateCall) Header() http.Header { 13489 if c.header_ == nil { 13490 c.header_ = make(http.Header) 13491 } 13492 return c.header_ 13493} 13494 13495func (c *ResourcesBuildingsUpdateCall) doRequest(alt string) (*http.Response, error) { 13496 reqHeaders := make(http.Header) 13497 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13498 for k, v := range c.header_ { 13499 reqHeaders[k] = v 13500 } 13501 reqHeaders.Set("User-Agent", c.s.userAgent()) 13502 var body io.Reader = nil 13503 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 13504 if err != nil { 13505 return nil, err 13506 } 13507 reqHeaders.Set("Content-Type", "application/json") 13508 c.urlParams_.Set("alt", alt) 13509 c.urlParams_.Set("prettyPrint", "false") 13510 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 13511 urls += "?" + c.urlParams_.Encode() 13512 req, err := http.NewRequest("PUT", urls, body) 13513 if err != nil { 13514 return nil, err 13515 } 13516 req.Header = reqHeaders 13517 googleapi.Expand(req.URL, map[string]string{ 13518 "customer": c.customer, 13519 "buildingId": c.buildingId, 13520 }) 13521 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13522} 13523 13524// Do executes the "directory.resources.buildings.update" call. 13525// Exactly one of *Building or error will be non-nil. Any non-2xx status 13526// code is an error. Response headers are in either 13527// *Building.ServerResponse.Header or (if a response was returned at 13528// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13529// to check whether the returned error was because 13530// http.StatusNotModified was returned. 13531func (c *ResourcesBuildingsUpdateCall) Do(opts ...googleapi.CallOption) (*Building, error) { 13532 gensupport.SetOptions(c.urlParams_, opts...) 13533 res, err := c.doRequest("json") 13534 if res != nil && res.StatusCode == http.StatusNotModified { 13535 if res.Body != nil { 13536 res.Body.Close() 13537 } 13538 return nil, &googleapi.Error{ 13539 Code: res.StatusCode, 13540 Header: res.Header, 13541 } 13542 } 13543 if err != nil { 13544 return nil, err 13545 } 13546 defer googleapi.CloseBody(res) 13547 if err := googleapi.CheckResponse(res); err != nil { 13548 return nil, err 13549 } 13550 ret := &Building{ 13551 ServerResponse: googleapi.ServerResponse{ 13552 Header: res.Header, 13553 HTTPStatusCode: res.StatusCode, 13554 }, 13555 } 13556 target := &ret 13557 if err := gensupport.DecodeResponse(target, res); err != nil { 13558 return nil, err 13559 } 13560 return ret, nil 13561 // { 13562 // "description": "Updates a building.", 13563 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 13564 // "httpMethod": "PUT", 13565 // "id": "directory.resources.buildings.update", 13566 // "parameterOrder": [ 13567 // "customer", 13568 // "buildingId" 13569 // ], 13570 // "parameters": { 13571 // "buildingId": { 13572 // "description": "The id of the building to update.", 13573 // "location": "path", 13574 // "required": true, 13575 // "type": "string" 13576 // }, 13577 // "coordinatesSource": { 13578 // "default": "SOURCE_UNSPECIFIED", 13579 // "description": "Source from which Building.coordinates are derived.", 13580 // "enum": [ 13581 // "COORDINATES_SOURCE_UNDEFINED", 13582 // "CLIENT_SPECIFIED", 13583 // "RESOLVED_FROM_ADDRESS", 13584 // "SOURCE_UNSPECIFIED" 13585 // ], 13586 // "enumDescriptions": [ 13587 // "", 13588 // "Building.coordinates are set to the coordinates included in the request.", 13589 // "Building.coordinates are automatically populated based on the postal address.", 13590 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 13591 // ], 13592 // "location": "query", 13593 // "type": "string" 13594 // }, 13595 // "customer": { 13596 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13597 // "location": "path", 13598 // "required": true, 13599 // "type": "string" 13600 // } 13601 // }, 13602 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 13603 // "request": { 13604 // "$ref": "Building" 13605 // }, 13606 // "response": { 13607 // "$ref": "Building" 13608 // }, 13609 // "scopes": [ 13610 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 13611 // ] 13612 // } 13613 13614} 13615 13616// method id "directory.resources.calendars.delete": 13617 13618type ResourcesCalendarsDeleteCall struct { 13619 s *Service 13620 customer string 13621 calendarResourceId string 13622 urlParams_ gensupport.URLParams 13623 ctx_ context.Context 13624 header_ http.Header 13625} 13626 13627// Delete: Deletes a calendar resource. 13628func (r *ResourcesCalendarsService) Delete(customer string, calendarResourceId string) *ResourcesCalendarsDeleteCall { 13629 c := &ResourcesCalendarsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13630 c.customer = customer 13631 c.calendarResourceId = calendarResourceId 13632 return c 13633} 13634 13635// Fields allows partial responses to be retrieved. See 13636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13637// for more information. 13638func (c *ResourcesCalendarsDeleteCall) Fields(s ...googleapi.Field) *ResourcesCalendarsDeleteCall { 13639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13640 return c 13641} 13642 13643// Context sets the context to be used in this call's Do method. Any 13644// pending HTTP request will be aborted if the provided context is 13645// canceled. 13646func (c *ResourcesCalendarsDeleteCall) Context(ctx context.Context) *ResourcesCalendarsDeleteCall { 13647 c.ctx_ = ctx 13648 return c 13649} 13650 13651// Header returns an http.Header that can be modified by the caller to 13652// add HTTP headers to the request. 13653func (c *ResourcesCalendarsDeleteCall) Header() http.Header { 13654 if c.header_ == nil { 13655 c.header_ = make(http.Header) 13656 } 13657 return c.header_ 13658} 13659 13660func (c *ResourcesCalendarsDeleteCall) doRequest(alt string) (*http.Response, error) { 13661 reqHeaders := make(http.Header) 13662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13663 for k, v := range c.header_ { 13664 reqHeaders[k] = v 13665 } 13666 reqHeaders.Set("User-Agent", c.s.userAgent()) 13667 var body io.Reader = nil 13668 c.urlParams_.Set("alt", alt) 13669 c.urlParams_.Set("prettyPrint", "false") 13670 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 13671 urls += "?" + c.urlParams_.Encode() 13672 req, err := http.NewRequest("DELETE", urls, body) 13673 if err != nil { 13674 return nil, err 13675 } 13676 req.Header = reqHeaders 13677 googleapi.Expand(req.URL, map[string]string{ 13678 "customer": c.customer, 13679 "calendarResourceId": c.calendarResourceId, 13680 }) 13681 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13682} 13683 13684// Do executes the "directory.resources.calendars.delete" call. 13685func (c *ResourcesCalendarsDeleteCall) Do(opts ...googleapi.CallOption) error { 13686 gensupport.SetOptions(c.urlParams_, opts...) 13687 res, err := c.doRequest("json") 13688 if err != nil { 13689 return err 13690 } 13691 defer googleapi.CloseBody(res) 13692 if err := googleapi.CheckResponse(res); err != nil { 13693 return err 13694 } 13695 return nil 13696 // { 13697 // "description": "Deletes a calendar resource.", 13698 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 13699 // "httpMethod": "DELETE", 13700 // "id": "directory.resources.calendars.delete", 13701 // "parameterOrder": [ 13702 // "customer", 13703 // "calendarResourceId" 13704 // ], 13705 // "parameters": { 13706 // "calendarResourceId": { 13707 // "description": "The unique ID of the calendar resource to delete.", 13708 // "location": "path", 13709 // "required": true, 13710 // "type": "string" 13711 // }, 13712 // "customer": { 13713 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13714 // "location": "path", 13715 // "required": true, 13716 // "type": "string" 13717 // } 13718 // }, 13719 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 13720 // "scopes": [ 13721 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 13722 // ] 13723 // } 13724 13725} 13726 13727// method id "directory.resources.calendars.get": 13728 13729type ResourcesCalendarsGetCall struct { 13730 s *Service 13731 customer string 13732 calendarResourceId string 13733 urlParams_ gensupport.URLParams 13734 ifNoneMatch_ string 13735 ctx_ context.Context 13736 header_ http.Header 13737} 13738 13739// Get: Retrieves a calendar resource. 13740func (r *ResourcesCalendarsService) Get(customer string, calendarResourceId string) *ResourcesCalendarsGetCall { 13741 c := &ResourcesCalendarsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13742 c.customer = customer 13743 c.calendarResourceId = calendarResourceId 13744 return c 13745} 13746 13747// Fields allows partial responses to be retrieved. See 13748// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13749// for more information. 13750func (c *ResourcesCalendarsGetCall) Fields(s ...googleapi.Field) *ResourcesCalendarsGetCall { 13751 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13752 return c 13753} 13754 13755// IfNoneMatch sets the optional parameter which makes the operation 13756// fail if the object's ETag matches the given value. This is useful for 13757// getting updates only after the object has changed since the last 13758// request. Use googleapi.IsNotModified to check whether the response 13759// error from Do is the result of In-None-Match. 13760func (c *ResourcesCalendarsGetCall) IfNoneMatch(entityTag string) *ResourcesCalendarsGetCall { 13761 c.ifNoneMatch_ = entityTag 13762 return c 13763} 13764 13765// Context sets the context to be used in this call's Do method. Any 13766// pending HTTP request will be aborted if the provided context is 13767// canceled. 13768func (c *ResourcesCalendarsGetCall) Context(ctx context.Context) *ResourcesCalendarsGetCall { 13769 c.ctx_ = ctx 13770 return c 13771} 13772 13773// Header returns an http.Header that can be modified by the caller to 13774// add HTTP headers to the request. 13775func (c *ResourcesCalendarsGetCall) Header() http.Header { 13776 if c.header_ == nil { 13777 c.header_ = make(http.Header) 13778 } 13779 return c.header_ 13780} 13781 13782func (c *ResourcesCalendarsGetCall) doRequest(alt string) (*http.Response, error) { 13783 reqHeaders := make(http.Header) 13784 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13785 for k, v := range c.header_ { 13786 reqHeaders[k] = v 13787 } 13788 reqHeaders.Set("User-Agent", c.s.userAgent()) 13789 if c.ifNoneMatch_ != "" { 13790 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13791 } 13792 var body io.Reader = nil 13793 c.urlParams_.Set("alt", alt) 13794 c.urlParams_.Set("prettyPrint", "false") 13795 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 13796 urls += "?" + c.urlParams_.Encode() 13797 req, err := http.NewRequest("GET", urls, body) 13798 if err != nil { 13799 return nil, err 13800 } 13801 req.Header = reqHeaders 13802 googleapi.Expand(req.URL, map[string]string{ 13803 "customer": c.customer, 13804 "calendarResourceId": c.calendarResourceId, 13805 }) 13806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13807} 13808 13809// Do executes the "directory.resources.calendars.get" call. 13810// Exactly one of *CalendarResource or error will be non-nil. Any 13811// non-2xx status code is an error. Response headers are in either 13812// *CalendarResource.ServerResponse.Header or (if a response was 13813// returned at all) in error.(*googleapi.Error).Header. Use 13814// googleapi.IsNotModified to check whether the returned error was 13815// because http.StatusNotModified was returned. 13816func (c *ResourcesCalendarsGetCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 13817 gensupport.SetOptions(c.urlParams_, opts...) 13818 res, err := c.doRequest("json") 13819 if res != nil && res.StatusCode == http.StatusNotModified { 13820 if res.Body != nil { 13821 res.Body.Close() 13822 } 13823 return nil, &googleapi.Error{ 13824 Code: res.StatusCode, 13825 Header: res.Header, 13826 } 13827 } 13828 if err != nil { 13829 return nil, err 13830 } 13831 defer googleapi.CloseBody(res) 13832 if err := googleapi.CheckResponse(res); err != nil { 13833 return nil, err 13834 } 13835 ret := &CalendarResource{ 13836 ServerResponse: googleapi.ServerResponse{ 13837 Header: res.Header, 13838 HTTPStatusCode: res.StatusCode, 13839 }, 13840 } 13841 target := &ret 13842 if err := gensupport.DecodeResponse(target, res); err != nil { 13843 return nil, err 13844 } 13845 return ret, nil 13846 // { 13847 // "description": "Retrieves a calendar resource.", 13848 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 13849 // "httpMethod": "GET", 13850 // "id": "directory.resources.calendars.get", 13851 // "parameterOrder": [ 13852 // "customer", 13853 // "calendarResourceId" 13854 // ], 13855 // "parameters": { 13856 // "calendarResourceId": { 13857 // "description": "The unique ID of the calendar resource to retrieve.", 13858 // "location": "path", 13859 // "required": true, 13860 // "type": "string" 13861 // }, 13862 // "customer": { 13863 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 13864 // "location": "path", 13865 // "required": true, 13866 // "type": "string" 13867 // } 13868 // }, 13869 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 13870 // "response": { 13871 // "$ref": "CalendarResource" 13872 // }, 13873 // "scopes": [ 13874 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 13875 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 13876 // ] 13877 // } 13878 13879} 13880 13881// method id "directory.resources.calendars.insert": 13882 13883type ResourcesCalendarsInsertCall struct { 13884 s *Service 13885 customer string 13886 calendarresource *CalendarResource 13887 urlParams_ gensupport.URLParams 13888 ctx_ context.Context 13889 header_ http.Header 13890} 13891 13892// Insert: Inserts a calendar resource. 13893func (r *ResourcesCalendarsService) Insert(customer string, calendarresource *CalendarResource) *ResourcesCalendarsInsertCall { 13894 c := &ResourcesCalendarsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13895 c.customer = customer 13896 c.calendarresource = calendarresource 13897 return c 13898} 13899 13900// Fields allows partial responses to be retrieved. See 13901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13902// for more information. 13903func (c *ResourcesCalendarsInsertCall) Fields(s ...googleapi.Field) *ResourcesCalendarsInsertCall { 13904 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13905 return c 13906} 13907 13908// Context sets the context to be used in this call's Do method. Any 13909// pending HTTP request will be aborted if the provided context is 13910// canceled. 13911func (c *ResourcesCalendarsInsertCall) Context(ctx context.Context) *ResourcesCalendarsInsertCall { 13912 c.ctx_ = ctx 13913 return c 13914} 13915 13916// Header returns an http.Header that can be modified by the caller to 13917// add HTTP headers to the request. 13918func (c *ResourcesCalendarsInsertCall) Header() http.Header { 13919 if c.header_ == nil { 13920 c.header_ = make(http.Header) 13921 } 13922 return c.header_ 13923} 13924 13925func (c *ResourcesCalendarsInsertCall) doRequest(alt string) (*http.Response, error) { 13926 reqHeaders := make(http.Header) 13927 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13928 for k, v := range c.header_ { 13929 reqHeaders[k] = v 13930 } 13931 reqHeaders.Set("User-Agent", c.s.userAgent()) 13932 var body io.Reader = nil 13933 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 13934 if err != nil { 13935 return nil, err 13936 } 13937 reqHeaders.Set("Content-Type", "application/json") 13938 c.urlParams_.Set("alt", alt) 13939 c.urlParams_.Set("prettyPrint", "false") 13940 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars") 13941 urls += "?" + c.urlParams_.Encode() 13942 req, err := http.NewRequest("POST", urls, body) 13943 if err != nil { 13944 return nil, err 13945 } 13946 req.Header = reqHeaders 13947 googleapi.Expand(req.URL, map[string]string{ 13948 "customer": c.customer, 13949 }) 13950 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13951} 13952 13953// Do executes the "directory.resources.calendars.insert" call. 13954// Exactly one of *CalendarResource or error will be non-nil. Any 13955// non-2xx status code is an error. Response headers are in either 13956// *CalendarResource.ServerResponse.Header or (if a response was 13957// returned at all) in error.(*googleapi.Error).Header. Use 13958// googleapi.IsNotModified to check whether the returned error was 13959// because http.StatusNotModified was returned. 13960func (c *ResourcesCalendarsInsertCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 13961 gensupport.SetOptions(c.urlParams_, opts...) 13962 res, err := c.doRequest("json") 13963 if res != nil && res.StatusCode == http.StatusNotModified { 13964 if res.Body != nil { 13965 res.Body.Close() 13966 } 13967 return nil, &googleapi.Error{ 13968 Code: res.StatusCode, 13969 Header: res.Header, 13970 } 13971 } 13972 if err != nil { 13973 return nil, err 13974 } 13975 defer googleapi.CloseBody(res) 13976 if err := googleapi.CheckResponse(res); err != nil { 13977 return nil, err 13978 } 13979 ret := &CalendarResource{ 13980 ServerResponse: googleapi.ServerResponse{ 13981 Header: res.Header, 13982 HTTPStatusCode: res.StatusCode, 13983 }, 13984 } 13985 target := &ret 13986 if err := gensupport.DecodeResponse(target, res); err != nil { 13987 return nil, err 13988 } 13989 return ret, nil 13990 // { 13991 // "description": "Inserts a calendar resource.", 13992 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars", 13993 // "httpMethod": "POST", 13994 // "id": "directory.resources.calendars.insert", 13995 // "parameterOrder": [ 13996 // "customer" 13997 // ], 13998 // "parameters": { 13999 // "customer": { 14000 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14001 // "location": "path", 14002 // "required": true, 14003 // "type": "string" 14004 // } 14005 // }, 14006 // "path": "admin/directory/v1/customer/{customer}/resources/calendars", 14007 // "request": { 14008 // "$ref": "CalendarResource" 14009 // }, 14010 // "response": { 14011 // "$ref": "CalendarResource" 14012 // }, 14013 // "scopes": [ 14014 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14015 // ] 14016 // } 14017 14018} 14019 14020// method id "directory.resources.calendars.list": 14021 14022type ResourcesCalendarsListCall struct { 14023 s *Service 14024 customer string 14025 urlParams_ gensupport.URLParams 14026 ifNoneMatch_ string 14027 ctx_ context.Context 14028 header_ http.Header 14029} 14030 14031// List: Retrieves a list of calendar resources for an account. 14032func (r *ResourcesCalendarsService) List(customer string) *ResourcesCalendarsListCall { 14033 c := &ResourcesCalendarsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14034 c.customer = customer 14035 return c 14036} 14037 14038// MaxResults sets the optional parameter "maxResults": Maximum number 14039// of results to return. 14040func (c *ResourcesCalendarsListCall) MaxResults(maxResults int64) *ResourcesCalendarsListCall { 14041 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 14042 return c 14043} 14044 14045// OrderBy sets the optional parameter "orderBy": Field(s) to sort 14046// results by in either ascending or descending order. Supported fields 14047// include `resourceId`, `resourceName`, `capacity`, `buildingId`, and 14048// `floorName`. If no order is specified, defaults to ascending. Should 14049// be of the form "field [asc|desc], field [asc|desc], ...". For example 14050// `buildingId, capacity desc` would return results sorted first by 14051// `buildingId` in ascending order then by `capacity` in descending 14052// order. 14053func (c *ResourcesCalendarsListCall) OrderBy(orderBy string) *ResourcesCalendarsListCall { 14054 c.urlParams_.Set("orderBy", orderBy) 14055 return c 14056} 14057 14058// PageToken sets the optional parameter "pageToken": Token to specify 14059// the next page in the list. 14060func (c *ResourcesCalendarsListCall) PageToken(pageToken string) *ResourcesCalendarsListCall { 14061 c.urlParams_.Set("pageToken", pageToken) 14062 return c 14063} 14064 14065// Query sets the optional parameter "query": String query used to 14066// filter results. Should be of the form "field operator value" where 14067// field can be any of supported fields and operators can be any of 14068// supported operations. Operators include '=' for exact match, '!=' for 14069// mismatch and ':' for prefix match or HAS match where applicable. For 14070// prefix match, the value should always be followed by a *. Logical 14071// operators NOT and AND are supported (in this order of precedence). 14072// Supported fields include `generatedResourceName`, `name`, 14073// `buildingId`, `floor_name`, `capacity`, 14074// `featureInstances.feature.name`, `resourceEmail`, `resourceCategory`. 14075// For example `buildingId=US-NYC-9TH AND 14076// featureInstances.feature.name:Phone`. 14077func (c *ResourcesCalendarsListCall) Query(query string) *ResourcesCalendarsListCall { 14078 c.urlParams_.Set("query", query) 14079 return c 14080} 14081 14082// Fields allows partial responses to be retrieved. See 14083// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14084// for more information. 14085func (c *ResourcesCalendarsListCall) Fields(s ...googleapi.Field) *ResourcesCalendarsListCall { 14086 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14087 return c 14088} 14089 14090// IfNoneMatch sets the optional parameter which makes the operation 14091// fail if the object's ETag matches the given value. This is useful for 14092// getting updates only after the object has changed since the last 14093// request. Use googleapi.IsNotModified to check whether the response 14094// error from Do is the result of In-None-Match. 14095func (c *ResourcesCalendarsListCall) IfNoneMatch(entityTag string) *ResourcesCalendarsListCall { 14096 c.ifNoneMatch_ = entityTag 14097 return c 14098} 14099 14100// Context sets the context to be used in this call's Do method. Any 14101// pending HTTP request will be aborted if the provided context is 14102// canceled. 14103func (c *ResourcesCalendarsListCall) Context(ctx context.Context) *ResourcesCalendarsListCall { 14104 c.ctx_ = ctx 14105 return c 14106} 14107 14108// Header returns an http.Header that can be modified by the caller to 14109// add HTTP headers to the request. 14110func (c *ResourcesCalendarsListCall) Header() http.Header { 14111 if c.header_ == nil { 14112 c.header_ = make(http.Header) 14113 } 14114 return c.header_ 14115} 14116 14117func (c *ResourcesCalendarsListCall) doRequest(alt string) (*http.Response, error) { 14118 reqHeaders := make(http.Header) 14119 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14120 for k, v := range c.header_ { 14121 reqHeaders[k] = v 14122 } 14123 reqHeaders.Set("User-Agent", c.s.userAgent()) 14124 if c.ifNoneMatch_ != "" { 14125 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14126 } 14127 var body io.Reader = nil 14128 c.urlParams_.Set("alt", alt) 14129 c.urlParams_.Set("prettyPrint", "false") 14130 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars") 14131 urls += "?" + c.urlParams_.Encode() 14132 req, err := http.NewRequest("GET", urls, body) 14133 if err != nil { 14134 return nil, err 14135 } 14136 req.Header = reqHeaders 14137 googleapi.Expand(req.URL, map[string]string{ 14138 "customer": c.customer, 14139 }) 14140 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14141} 14142 14143// Do executes the "directory.resources.calendars.list" call. 14144// Exactly one of *CalendarResources or error will be non-nil. Any 14145// non-2xx status code is an error. Response headers are in either 14146// *CalendarResources.ServerResponse.Header or (if a response was 14147// returned at all) in error.(*googleapi.Error).Header. Use 14148// googleapi.IsNotModified to check whether the returned error was 14149// because http.StatusNotModified was returned. 14150func (c *ResourcesCalendarsListCall) Do(opts ...googleapi.CallOption) (*CalendarResources, error) { 14151 gensupport.SetOptions(c.urlParams_, opts...) 14152 res, err := c.doRequest("json") 14153 if res != nil && res.StatusCode == http.StatusNotModified { 14154 if res.Body != nil { 14155 res.Body.Close() 14156 } 14157 return nil, &googleapi.Error{ 14158 Code: res.StatusCode, 14159 Header: res.Header, 14160 } 14161 } 14162 if err != nil { 14163 return nil, err 14164 } 14165 defer googleapi.CloseBody(res) 14166 if err := googleapi.CheckResponse(res); err != nil { 14167 return nil, err 14168 } 14169 ret := &CalendarResources{ 14170 ServerResponse: googleapi.ServerResponse{ 14171 Header: res.Header, 14172 HTTPStatusCode: res.StatusCode, 14173 }, 14174 } 14175 target := &ret 14176 if err := gensupport.DecodeResponse(target, res); err != nil { 14177 return nil, err 14178 } 14179 return ret, nil 14180 // { 14181 // "description": "Retrieves a list of calendar resources for an account.", 14182 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars", 14183 // "httpMethod": "GET", 14184 // "id": "directory.resources.calendars.list", 14185 // "parameterOrder": [ 14186 // "customer" 14187 // ], 14188 // "parameters": { 14189 // "customer": { 14190 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14191 // "location": "path", 14192 // "required": true, 14193 // "type": "string" 14194 // }, 14195 // "maxResults": { 14196 // "description": "Maximum number of results to return.", 14197 // "format": "int32", 14198 // "location": "query", 14199 // "maximum": "500", 14200 // "minimum": "1", 14201 // "type": "integer" 14202 // }, 14203 // "orderBy": { 14204 // "description": "Field(s) to sort results by in either ascending or descending order. Supported fields include `resourceId`, `resourceName`, `capacity`, `buildingId`, and `floorName`. If no order is specified, defaults to ascending. Should be of the form \"field [asc|desc], field [asc|desc], ...\". For example `buildingId, capacity desc` would return results sorted first by `buildingId` in ascending order then by `capacity` in descending order.", 14205 // "location": "query", 14206 // "type": "string" 14207 // }, 14208 // "pageToken": { 14209 // "description": "Token to specify the next page in the list.", 14210 // "location": "query", 14211 // "type": "string" 14212 // }, 14213 // "query": { 14214 // "description": "String query used to filter results. Should be of the form \"field operator value\" where field can be any of supported fields and operators can be any of supported operations. Operators include '=' for exact match, '!=' for mismatch and ':' for prefix match or HAS match where applicable. For prefix match, the value should always be followed by a *. Logical operators NOT and AND are supported (in this order of precedence). Supported fields include `generatedResourceName`, `name`, `buildingId`, `floor_name`, `capacity`, `featureInstances.feature.name`, `resourceEmail`, `resourceCategory`. For example `buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone`.", 14215 // "location": "query", 14216 // "type": "string" 14217 // } 14218 // }, 14219 // "path": "admin/directory/v1/customer/{customer}/resources/calendars", 14220 // "response": { 14221 // "$ref": "CalendarResources" 14222 // }, 14223 // "scopes": [ 14224 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 14225 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 14226 // ] 14227 // } 14228 14229} 14230 14231// Pages invokes f for each page of results. 14232// A non-nil error returned from f will halt the iteration. 14233// The provided context supersedes any context provided to the Context method. 14234func (c *ResourcesCalendarsListCall) Pages(ctx context.Context, f func(*CalendarResources) error) error { 14235 c.ctx_ = ctx 14236 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 14237 for { 14238 x, err := c.Do() 14239 if err != nil { 14240 return err 14241 } 14242 if err := f(x); err != nil { 14243 return err 14244 } 14245 if x.NextPageToken == "" { 14246 return nil 14247 } 14248 c.PageToken(x.NextPageToken) 14249 } 14250} 14251 14252// method id "directory.resources.calendars.patch": 14253 14254type ResourcesCalendarsPatchCall struct { 14255 s *Service 14256 customer string 14257 calendarResourceId string 14258 calendarresource *CalendarResource 14259 urlParams_ gensupport.URLParams 14260 ctx_ context.Context 14261 header_ http.Header 14262} 14263 14264// Patch: Patches a calendar resource via Apiary Patch Orchestration. 14265func (r *ResourcesCalendarsService) Patch(customer string, calendarResourceId string, calendarresource *CalendarResource) *ResourcesCalendarsPatchCall { 14266 c := &ResourcesCalendarsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14267 c.customer = customer 14268 c.calendarResourceId = calendarResourceId 14269 c.calendarresource = calendarresource 14270 return c 14271} 14272 14273// Fields allows partial responses to be retrieved. See 14274// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14275// for more information. 14276func (c *ResourcesCalendarsPatchCall) Fields(s ...googleapi.Field) *ResourcesCalendarsPatchCall { 14277 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14278 return c 14279} 14280 14281// Context sets the context to be used in this call's Do method. Any 14282// pending HTTP request will be aborted if the provided context is 14283// canceled. 14284func (c *ResourcesCalendarsPatchCall) Context(ctx context.Context) *ResourcesCalendarsPatchCall { 14285 c.ctx_ = ctx 14286 return c 14287} 14288 14289// Header returns an http.Header that can be modified by the caller to 14290// add HTTP headers to the request. 14291func (c *ResourcesCalendarsPatchCall) Header() http.Header { 14292 if c.header_ == nil { 14293 c.header_ = make(http.Header) 14294 } 14295 return c.header_ 14296} 14297 14298func (c *ResourcesCalendarsPatchCall) doRequest(alt string) (*http.Response, error) { 14299 reqHeaders := make(http.Header) 14300 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14301 for k, v := range c.header_ { 14302 reqHeaders[k] = v 14303 } 14304 reqHeaders.Set("User-Agent", c.s.userAgent()) 14305 var body io.Reader = nil 14306 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 14307 if err != nil { 14308 return nil, err 14309 } 14310 reqHeaders.Set("Content-Type", "application/json") 14311 c.urlParams_.Set("alt", alt) 14312 c.urlParams_.Set("prettyPrint", "false") 14313 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 14314 urls += "?" + c.urlParams_.Encode() 14315 req, err := http.NewRequest("PATCH", urls, body) 14316 if err != nil { 14317 return nil, err 14318 } 14319 req.Header = reqHeaders 14320 googleapi.Expand(req.URL, map[string]string{ 14321 "customer": c.customer, 14322 "calendarResourceId": c.calendarResourceId, 14323 }) 14324 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14325} 14326 14327// Do executes the "directory.resources.calendars.patch" call. 14328// Exactly one of *CalendarResource or error will be non-nil. Any 14329// non-2xx status code is an error. Response headers are in either 14330// *CalendarResource.ServerResponse.Header or (if a response was 14331// returned at all) in error.(*googleapi.Error).Header. Use 14332// googleapi.IsNotModified to check whether the returned error was 14333// because http.StatusNotModified was returned. 14334func (c *ResourcesCalendarsPatchCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 14335 gensupport.SetOptions(c.urlParams_, opts...) 14336 res, err := c.doRequest("json") 14337 if res != nil && res.StatusCode == http.StatusNotModified { 14338 if res.Body != nil { 14339 res.Body.Close() 14340 } 14341 return nil, &googleapi.Error{ 14342 Code: res.StatusCode, 14343 Header: res.Header, 14344 } 14345 } 14346 if err != nil { 14347 return nil, err 14348 } 14349 defer googleapi.CloseBody(res) 14350 if err := googleapi.CheckResponse(res); err != nil { 14351 return nil, err 14352 } 14353 ret := &CalendarResource{ 14354 ServerResponse: googleapi.ServerResponse{ 14355 Header: res.Header, 14356 HTTPStatusCode: res.StatusCode, 14357 }, 14358 } 14359 target := &ret 14360 if err := gensupport.DecodeResponse(target, res); err != nil { 14361 return nil, err 14362 } 14363 return ret, nil 14364 // { 14365 // "description": "Patches a calendar resource via Apiary Patch Orchestration.", 14366 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 14367 // "httpMethod": "PATCH", 14368 // "id": "directory.resources.calendars.patch", 14369 // "parameterOrder": [ 14370 // "customer", 14371 // "calendarResourceId" 14372 // ], 14373 // "parameters": { 14374 // "calendarResourceId": { 14375 // "description": "The unique ID of the calendar resource to update.", 14376 // "location": "path", 14377 // "required": true, 14378 // "type": "string" 14379 // }, 14380 // "customer": { 14381 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14382 // "location": "path", 14383 // "required": true, 14384 // "type": "string" 14385 // } 14386 // }, 14387 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 14388 // "request": { 14389 // "$ref": "CalendarResource" 14390 // }, 14391 // "response": { 14392 // "$ref": "CalendarResource" 14393 // }, 14394 // "scopes": [ 14395 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14396 // ] 14397 // } 14398 14399} 14400 14401// method id "directory.resources.calendars.update": 14402 14403type ResourcesCalendarsUpdateCall struct { 14404 s *Service 14405 customer string 14406 calendarResourceId string 14407 calendarresource *CalendarResource 14408 urlParams_ gensupport.URLParams 14409 ctx_ context.Context 14410 header_ http.Header 14411} 14412 14413// Update: Updates a calendar resource. This method supports patch 14414// semantics, meaning you only need to include the fields you wish to 14415// update. Fields that are not present in the request will be preserved. 14416func (r *ResourcesCalendarsService) Update(customer string, calendarResourceId string, calendarresource *CalendarResource) *ResourcesCalendarsUpdateCall { 14417 c := &ResourcesCalendarsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14418 c.customer = customer 14419 c.calendarResourceId = calendarResourceId 14420 c.calendarresource = calendarresource 14421 return c 14422} 14423 14424// Fields allows partial responses to be retrieved. See 14425// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14426// for more information. 14427func (c *ResourcesCalendarsUpdateCall) Fields(s ...googleapi.Field) *ResourcesCalendarsUpdateCall { 14428 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14429 return c 14430} 14431 14432// Context sets the context to be used in this call's Do method. Any 14433// pending HTTP request will be aborted if the provided context is 14434// canceled. 14435func (c *ResourcesCalendarsUpdateCall) Context(ctx context.Context) *ResourcesCalendarsUpdateCall { 14436 c.ctx_ = ctx 14437 return c 14438} 14439 14440// Header returns an http.Header that can be modified by the caller to 14441// add HTTP headers to the request. 14442func (c *ResourcesCalendarsUpdateCall) Header() http.Header { 14443 if c.header_ == nil { 14444 c.header_ = make(http.Header) 14445 } 14446 return c.header_ 14447} 14448 14449func (c *ResourcesCalendarsUpdateCall) doRequest(alt string) (*http.Response, error) { 14450 reqHeaders := make(http.Header) 14451 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14452 for k, v := range c.header_ { 14453 reqHeaders[k] = v 14454 } 14455 reqHeaders.Set("User-Agent", c.s.userAgent()) 14456 var body io.Reader = nil 14457 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 14458 if err != nil { 14459 return nil, err 14460 } 14461 reqHeaders.Set("Content-Type", "application/json") 14462 c.urlParams_.Set("alt", alt) 14463 c.urlParams_.Set("prettyPrint", "false") 14464 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 14465 urls += "?" + c.urlParams_.Encode() 14466 req, err := http.NewRequest("PUT", urls, body) 14467 if err != nil { 14468 return nil, err 14469 } 14470 req.Header = reqHeaders 14471 googleapi.Expand(req.URL, map[string]string{ 14472 "customer": c.customer, 14473 "calendarResourceId": c.calendarResourceId, 14474 }) 14475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14476} 14477 14478// Do executes the "directory.resources.calendars.update" call. 14479// Exactly one of *CalendarResource or error will be non-nil. Any 14480// non-2xx status code is an error. Response headers are in either 14481// *CalendarResource.ServerResponse.Header or (if a response was 14482// returned at all) in error.(*googleapi.Error).Header. Use 14483// googleapi.IsNotModified to check whether the returned error was 14484// because http.StatusNotModified was returned. 14485func (c *ResourcesCalendarsUpdateCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 14486 gensupport.SetOptions(c.urlParams_, opts...) 14487 res, err := c.doRequest("json") 14488 if res != nil && res.StatusCode == http.StatusNotModified { 14489 if res.Body != nil { 14490 res.Body.Close() 14491 } 14492 return nil, &googleapi.Error{ 14493 Code: res.StatusCode, 14494 Header: res.Header, 14495 } 14496 } 14497 if err != nil { 14498 return nil, err 14499 } 14500 defer googleapi.CloseBody(res) 14501 if err := googleapi.CheckResponse(res); err != nil { 14502 return nil, err 14503 } 14504 ret := &CalendarResource{ 14505 ServerResponse: googleapi.ServerResponse{ 14506 Header: res.Header, 14507 HTTPStatusCode: res.StatusCode, 14508 }, 14509 } 14510 target := &ret 14511 if err := gensupport.DecodeResponse(target, res); err != nil { 14512 return nil, err 14513 } 14514 return ret, nil 14515 // { 14516 // "description": "Updates a calendar resource. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved.", 14517 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 14518 // "httpMethod": "PUT", 14519 // "id": "directory.resources.calendars.update", 14520 // "parameterOrder": [ 14521 // "customer", 14522 // "calendarResourceId" 14523 // ], 14524 // "parameters": { 14525 // "calendarResourceId": { 14526 // "description": "The unique ID of the calendar resource to update.", 14527 // "location": "path", 14528 // "required": true, 14529 // "type": "string" 14530 // }, 14531 // "customer": { 14532 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14533 // "location": "path", 14534 // "required": true, 14535 // "type": "string" 14536 // } 14537 // }, 14538 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 14539 // "request": { 14540 // "$ref": "CalendarResource" 14541 // }, 14542 // "response": { 14543 // "$ref": "CalendarResource" 14544 // }, 14545 // "scopes": [ 14546 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14547 // ] 14548 // } 14549 14550} 14551 14552// method id "directory.resources.features.delete": 14553 14554type ResourcesFeaturesDeleteCall struct { 14555 s *Service 14556 customer string 14557 featureKey string 14558 urlParams_ gensupport.URLParams 14559 ctx_ context.Context 14560 header_ http.Header 14561} 14562 14563// Delete: Deletes a feature. 14564func (r *ResourcesFeaturesService) Delete(customer string, featureKey string) *ResourcesFeaturesDeleteCall { 14565 c := &ResourcesFeaturesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14566 c.customer = customer 14567 c.featureKey = featureKey 14568 return c 14569} 14570 14571// Fields allows partial responses to be retrieved. See 14572// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14573// for more information. 14574func (c *ResourcesFeaturesDeleteCall) Fields(s ...googleapi.Field) *ResourcesFeaturesDeleteCall { 14575 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14576 return c 14577} 14578 14579// Context sets the context to be used in this call's Do method. Any 14580// pending HTTP request will be aborted if the provided context is 14581// canceled. 14582func (c *ResourcesFeaturesDeleteCall) Context(ctx context.Context) *ResourcesFeaturesDeleteCall { 14583 c.ctx_ = ctx 14584 return c 14585} 14586 14587// Header returns an http.Header that can be modified by the caller to 14588// add HTTP headers to the request. 14589func (c *ResourcesFeaturesDeleteCall) Header() http.Header { 14590 if c.header_ == nil { 14591 c.header_ = make(http.Header) 14592 } 14593 return c.header_ 14594} 14595 14596func (c *ResourcesFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { 14597 reqHeaders := make(http.Header) 14598 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14599 for k, v := range c.header_ { 14600 reqHeaders[k] = v 14601 } 14602 reqHeaders.Set("User-Agent", c.s.userAgent()) 14603 var body io.Reader = nil 14604 c.urlParams_.Set("alt", alt) 14605 c.urlParams_.Set("prettyPrint", "false") 14606 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 14607 urls += "?" + c.urlParams_.Encode() 14608 req, err := http.NewRequest("DELETE", urls, body) 14609 if err != nil { 14610 return nil, err 14611 } 14612 req.Header = reqHeaders 14613 googleapi.Expand(req.URL, map[string]string{ 14614 "customer": c.customer, 14615 "featureKey": c.featureKey, 14616 }) 14617 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14618} 14619 14620// Do executes the "directory.resources.features.delete" call. 14621func (c *ResourcesFeaturesDeleteCall) Do(opts ...googleapi.CallOption) error { 14622 gensupport.SetOptions(c.urlParams_, opts...) 14623 res, err := c.doRequest("json") 14624 if err != nil { 14625 return err 14626 } 14627 defer googleapi.CloseBody(res) 14628 if err := googleapi.CheckResponse(res); err != nil { 14629 return err 14630 } 14631 return nil 14632 // { 14633 // "description": "Deletes a feature.", 14634 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 14635 // "httpMethod": "DELETE", 14636 // "id": "directory.resources.features.delete", 14637 // "parameterOrder": [ 14638 // "customer", 14639 // "featureKey" 14640 // ], 14641 // "parameters": { 14642 // "customer": { 14643 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14644 // "location": "path", 14645 // "required": true, 14646 // "type": "string" 14647 // }, 14648 // "featureKey": { 14649 // "description": "The unique ID of the feature to delete.", 14650 // "location": "path", 14651 // "required": true, 14652 // "type": "string" 14653 // } 14654 // }, 14655 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 14656 // "scopes": [ 14657 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14658 // ] 14659 // } 14660 14661} 14662 14663// method id "directory.resources.features.get": 14664 14665type ResourcesFeaturesGetCall struct { 14666 s *Service 14667 customer string 14668 featureKey string 14669 urlParams_ gensupport.URLParams 14670 ifNoneMatch_ string 14671 ctx_ context.Context 14672 header_ http.Header 14673} 14674 14675// Get: Retrieves a feature. 14676func (r *ResourcesFeaturesService) Get(customer string, featureKey string) *ResourcesFeaturesGetCall { 14677 c := &ResourcesFeaturesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14678 c.customer = customer 14679 c.featureKey = featureKey 14680 return c 14681} 14682 14683// Fields allows partial responses to be retrieved. See 14684// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14685// for more information. 14686func (c *ResourcesFeaturesGetCall) Fields(s ...googleapi.Field) *ResourcesFeaturesGetCall { 14687 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14688 return c 14689} 14690 14691// IfNoneMatch sets the optional parameter which makes the operation 14692// fail if the object's ETag matches the given value. This is useful for 14693// getting updates only after the object has changed since the last 14694// request. Use googleapi.IsNotModified to check whether the response 14695// error from Do is the result of In-None-Match. 14696func (c *ResourcesFeaturesGetCall) IfNoneMatch(entityTag string) *ResourcesFeaturesGetCall { 14697 c.ifNoneMatch_ = entityTag 14698 return c 14699} 14700 14701// Context sets the context to be used in this call's Do method. Any 14702// pending HTTP request will be aborted if the provided context is 14703// canceled. 14704func (c *ResourcesFeaturesGetCall) Context(ctx context.Context) *ResourcesFeaturesGetCall { 14705 c.ctx_ = ctx 14706 return c 14707} 14708 14709// Header returns an http.Header that can be modified by the caller to 14710// add HTTP headers to the request. 14711func (c *ResourcesFeaturesGetCall) Header() http.Header { 14712 if c.header_ == nil { 14713 c.header_ = make(http.Header) 14714 } 14715 return c.header_ 14716} 14717 14718func (c *ResourcesFeaturesGetCall) doRequest(alt string) (*http.Response, error) { 14719 reqHeaders := make(http.Header) 14720 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14721 for k, v := range c.header_ { 14722 reqHeaders[k] = v 14723 } 14724 reqHeaders.Set("User-Agent", c.s.userAgent()) 14725 if c.ifNoneMatch_ != "" { 14726 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14727 } 14728 var body io.Reader = nil 14729 c.urlParams_.Set("alt", alt) 14730 c.urlParams_.Set("prettyPrint", "false") 14731 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 14732 urls += "?" + c.urlParams_.Encode() 14733 req, err := http.NewRequest("GET", urls, body) 14734 if err != nil { 14735 return nil, err 14736 } 14737 req.Header = reqHeaders 14738 googleapi.Expand(req.URL, map[string]string{ 14739 "customer": c.customer, 14740 "featureKey": c.featureKey, 14741 }) 14742 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14743} 14744 14745// Do executes the "directory.resources.features.get" call. 14746// Exactly one of *Feature or error will be non-nil. Any non-2xx status 14747// code is an error. Response headers are in either 14748// *Feature.ServerResponse.Header or (if a response was returned at all) 14749// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14750// check whether the returned error was because http.StatusNotModified 14751// was returned. 14752func (c *ResourcesFeaturesGetCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 14753 gensupport.SetOptions(c.urlParams_, opts...) 14754 res, err := c.doRequest("json") 14755 if res != nil && res.StatusCode == http.StatusNotModified { 14756 if res.Body != nil { 14757 res.Body.Close() 14758 } 14759 return nil, &googleapi.Error{ 14760 Code: res.StatusCode, 14761 Header: res.Header, 14762 } 14763 } 14764 if err != nil { 14765 return nil, err 14766 } 14767 defer googleapi.CloseBody(res) 14768 if err := googleapi.CheckResponse(res); err != nil { 14769 return nil, err 14770 } 14771 ret := &Feature{ 14772 ServerResponse: googleapi.ServerResponse{ 14773 Header: res.Header, 14774 HTTPStatusCode: res.StatusCode, 14775 }, 14776 } 14777 target := &ret 14778 if err := gensupport.DecodeResponse(target, res); err != nil { 14779 return nil, err 14780 } 14781 return ret, nil 14782 // { 14783 // "description": "Retrieves a feature.", 14784 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 14785 // "httpMethod": "GET", 14786 // "id": "directory.resources.features.get", 14787 // "parameterOrder": [ 14788 // "customer", 14789 // "featureKey" 14790 // ], 14791 // "parameters": { 14792 // "customer": { 14793 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14794 // "location": "path", 14795 // "required": true, 14796 // "type": "string" 14797 // }, 14798 // "featureKey": { 14799 // "description": "The unique ID of the feature to retrieve.", 14800 // "location": "path", 14801 // "required": true, 14802 // "type": "string" 14803 // } 14804 // }, 14805 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 14806 // "response": { 14807 // "$ref": "Feature" 14808 // }, 14809 // "scopes": [ 14810 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 14811 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 14812 // ] 14813 // } 14814 14815} 14816 14817// method id "directory.resources.features.insert": 14818 14819type ResourcesFeaturesInsertCall struct { 14820 s *Service 14821 customer string 14822 feature *Feature 14823 urlParams_ gensupport.URLParams 14824 ctx_ context.Context 14825 header_ http.Header 14826} 14827 14828// Insert: Inserts a feature. 14829func (r *ResourcesFeaturesService) Insert(customer string, feature *Feature) *ResourcesFeaturesInsertCall { 14830 c := &ResourcesFeaturesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14831 c.customer = customer 14832 c.feature = feature 14833 return c 14834} 14835 14836// Fields allows partial responses to be retrieved. See 14837// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14838// for more information. 14839func (c *ResourcesFeaturesInsertCall) Fields(s ...googleapi.Field) *ResourcesFeaturesInsertCall { 14840 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14841 return c 14842} 14843 14844// Context sets the context to be used in this call's Do method. Any 14845// pending HTTP request will be aborted if the provided context is 14846// canceled. 14847func (c *ResourcesFeaturesInsertCall) Context(ctx context.Context) *ResourcesFeaturesInsertCall { 14848 c.ctx_ = ctx 14849 return c 14850} 14851 14852// Header returns an http.Header that can be modified by the caller to 14853// add HTTP headers to the request. 14854func (c *ResourcesFeaturesInsertCall) Header() http.Header { 14855 if c.header_ == nil { 14856 c.header_ = make(http.Header) 14857 } 14858 return c.header_ 14859} 14860 14861func (c *ResourcesFeaturesInsertCall) doRequest(alt string) (*http.Response, error) { 14862 reqHeaders := make(http.Header) 14863 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 14864 for k, v := range c.header_ { 14865 reqHeaders[k] = v 14866 } 14867 reqHeaders.Set("User-Agent", c.s.userAgent()) 14868 var body io.Reader = nil 14869 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 14870 if err != nil { 14871 return nil, err 14872 } 14873 reqHeaders.Set("Content-Type", "application/json") 14874 c.urlParams_.Set("alt", alt) 14875 c.urlParams_.Set("prettyPrint", "false") 14876 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features") 14877 urls += "?" + c.urlParams_.Encode() 14878 req, err := http.NewRequest("POST", urls, body) 14879 if err != nil { 14880 return nil, err 14881 } 14882 req.Header = reqHeaders 14883 googleapi.Expand(req.URL, map[string]string{ 14884 "customer": c.customer, 14885 }) 14886 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14887} 14888 14889// Do executes the "directory.resources.features.insert" call. 14890// Exactly one of *Feature or error will be non-nil. Any non-2xx status 14891// code is an error. Response headers are in either 14892// *Feature.ServerResponse.Header or (if a response was returned at all) 14893// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14894// check whether the returned error was because http.StatusNotModified 14895// was returned. 14896func (c *ResourcesFeaturesInsertCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 14897 gensupport.SetOptions(c.urlParams_, opts...) 14898 res, err := c.doRequest("json") 14899 if res != nil && res.StatusCode == http.StatusNotModified { 14900 if res.Body != nil { 14901 res.Body.Close() 14902 } 14903 return nil, &googleapi.Error{ 14904 Code: res.StatusCode, 14905 Header: res.Header, 14906 } 14907 } 14908 if err != nil { 14909 return nil, err 14910 } 14911 defer googleapi.CloseBody(res) 14912 if err := googleapi.CheckResponse(res); err != nil { 14913 return nil, err 14914 } 14915 ret := &Feature{ 14916 ServerResponse: googleapi.ServerResponse{ 14917 Header: res.Header, 14918 HTTPStatusCode: res.StatusCode, 14919 }, 14920 } 14921 target := &ret 14922 if err := gensupport.DecodeResponse(target, res); err != nil { 14923 return nil, err 14924 } 14925 return ret, nil 14926 // { 14927 // "description": "Inserts a feature.", 14928 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features", 14929 // "httpMethod": "POST", 14930 // "id": "directory.resources.features.insert", 14931 // "parameterOrder": [ 14932 // "customer" 14933 // ], 14934 // "parameters": { 14935 // "customer": { 14936 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14937 // "location": "path", 14938 // "required": true, 14939 // "type": "string" 14940 // } 14941 // }, 14942 // "path": "admin/directory/v1/customer/{customer}/resources/features", 14943 // "request": { 14944 // "$ref": "Feature" 14945 // }, 14946 // "response": { 14947 // "$ref": "Feature" 14948 // }, 14949 // "scopes": [ 14950 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14951 // ] 14952 // } 14953 14954} 14955 14956// method id "directory.resources.features.list": 14957 14958type ResourcesFeaturesListCall struct { 14959 s *Service 14960 customer string 14961 urlParams_ gensupport.URLParams 14962 ifNoneMatch_ string 14963 ctx_ context.Context 14964 header_ http.Header 14965} 14966 14967// List: Retrieves a list of features for an account. 14968func (r *ResourcesFeaturesService) List(customer string) *ResourcesFeaturesListCall { 14969 c := &ResourcesFeaturesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14970 c.customer = customer 14971 return c 14972} 14973 14974// MaxResults sets the optional parameter "maxResults": Maximum number 14975// of results to return. 14976func (c *ResourcesFeaturesListCall) MaxResults(maxResults int64) *ResourcesFeaturesListCall { 14977 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 14978 return c 14979} 14980 14981// PageToken sets the optional parameter "pageToken": Token to specify 14982// the next page in the list. 14983func (c *ResourcesFeaturesListCall) PageToken(pageToken string) *ResourcesFeaturesListCall { 14984 c.urlParams_.Set("pageToken", pageToken) 14985 return c 14986} 14987 14988// Fields allows partial responses to be retrieved. See 14989// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14990// for more information. 14991func (c *ResourcesFeaturesListCall) Fields(s ...googleapi.Field) *ResourcesFeaturesListCall { 14992 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14993 return c 14994} 14995 14996// IfNoneMatch sets the optional parameter which makes the operation 14997// fail if the object's ETag matches the given value. This is useful for 14998// getting updates only after the object has changed since the last 14999// request. Use googleapi.IsNotModified to check whether the response 15000// error from Do is the result of In-None-Match. 15001func (c *ResourcesFeaturesListCall) IfNoneMatch(entityTag string) *ResourcesFeaturesListCall { 15002 c.ifNoneMatch_ = entityTag 15003 return c 15004} 15005 15006// Context sets the context to be used in this call's Do method. Any 15007// pending HTTP request will be aborted if the provided context is 15008// canceled. 15009func (c *ResourcesFeaturesListCall) Context(ctx context.Context) *ResourcesFeaturesListCall { 15010 c.ctx_ = ctx 15011 return c 15012} 15013 15014// Header returns an http.Header that can be modified by the caller to 15015// add HTTP headers to the request. 15016func (c *ResourcesFeaturesListCall) Header() http.Header { 15017 if c.header_ == nil { 15018 c.header_ = make(http.Header) 15019 } 15020 return c.header_ 15021} 15022 15023func (c *ResourcesFeaturesListCall) doRequest(alt string) (*http.Response, error) { 15024 reqHeaders := make(http.Header) 15025 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15026 for k, v := range c.header_ { 15027 reqHeaders[k] = v 15028 } 15029 reqHeaders.Set("User-Agent", c.s.userAgent()) 15030 if c.ifNoneMatch_ != "" { 15031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15032 } 15033 var body io.Reader = nil 15034 c.urlParams_.Set("alt", alt) 15035 c.urlParams_.Set("prettyPrint", "false") 15036 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features") 15037 urls += "?" + c.urlParams_.Encode() 15038 req, err := http.NewRequest("GET", urls, body) 15039 if err != nil { 15040 return nil, err 15041 } 15042 req.Header = reqHeaders 15043 googleapi.Expand(req.URL, map[string]string{ 15044 "customer": c.customer, 15045 }) 15046 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15047} 15048 15049// Do executes the "directory.resources.features.list" call. 15050// Exactly one of *Features or error will be non-nil. Any non-2xx status 15051// code is an error. Response headers are in either 15052// *Features.ServerResponse.Header or (if a response was returned at 15053// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15054// to check whether the returned error was because 15055// http.StatusNotModified was returned. 15056func (c *ResourcesFeaturesListCall) Do(opts ...googleapi.CallOption) (*Features, error) { 15057 gensupport.SetOptions(c.urlParams_, opts...) 15058 res, err := c.doRequest("json") 15059 if res != nil && res.StatusCode == http.StatusNotModified { 15060 if res.Body != nil { 15061 res.Body.Close() 15062 } 15063 return nil, &googleapi.Error{ 15064 Code: res.StatusCode, 15065 Header: res.Header, 15066 } 15067 } 15068 if err != nil { 15069 return nil, err 15070 } 15071 defer googleapi.CloseBody(res) 15072 if err := googleapi.CheckResponse(res); err != nil { 15073 return nil, err 15074 } 15075 ret := &Features{ 15076 ServerResponse: googleapi.ServerResponse{ 15077 Header: res.Header, 15078 HTTPStatusCode: res.StatusCode, 15079 }, 15080 } 15081 target := &ret 15082 if err := gensupport.DecodeResponse(target, res); err != nil { 15083 return nil, err 15084 } 15085 return ret, nil 15086 // { 15087 // "description": "Retrieves a list of features for an account.", 15088 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features", 15089 // "httpMethod": "GET", 15090 // "id": "directory.resources.features.list", 15091 // "parameterOrder": [ 15092 // "customer" 15093 // ], 15094 // "parameters": { 15095 // "customer": { 15096 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15097 // "location": "path", 15098 // "required": true, 15099 // "type": "string" 15100 // }, 15101 // "maxResults": { 15102 // "description": "Maximum number of results to return.", 15103 // "format": "int32", 15104 // "location": "query", 15105 // "maximum": "500", 15106 // "minimum": "1", 15107 // "type": "integer" 15108 // }, 15109 // "pageToken": { 15110 // "description": "Token to specify the next page in the list.", 15111 // "location": "query", 15112 // "type": "string" 15113 // } 15114 // }, 15115 // "path": "admin/directory/v1/customer/{customer}/resources/features", 15116 // "response": { 15117 // "$ref": "Features" 15118 // }, 15119 // "scopes": [ 15120 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 15121 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 15122 // ] 15123 // } 15124 15125} 15126 15127// Pages invokes f for each page of results. 15128// A non-nil error returned from f will halt the iteration. 15129// The provided context supersedes any context provided to the Context method. 15130func (c *ResourcesFeaturesListCall) Pages(ctx context.Context, f func(*Features) error) error { 15131 c.ctx_ = ctx 15132 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 15133 for { 15134 x, err := c.Do() 15135 if err != nil { 15136 return err 15137 } 15138 if err := f(x); err != nil { 15139 return err 15140 } 15141 if x.NextPageToken == "" { 15142 return nil 15143 } 15144 c.PageToken(x.NextPageToken) 15145 } 15146} 15147 15148// method id "directory.resources.features.patch": 15149 15150type ResourcesFeaturesPatchCall struct { 15151 s *Service 15152 customer string 15153 featureKey string 15154 feature *Feature 15155 urlParams_ gensupport.URLParams 15156 ctx_ context.Context 15157 header_ http.Header 15158} 15159 15160// Patch: Patches a feature via Apiary Patch Orchestration. 15161func (r *ResourcesFeaturesService) Patch(customer string, featureKey string, feature *Feature) *ResourcesFeaturesPatchCall { 15162 c := &ResourcesFeaturesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15163 c.customer = customer 15164 c.featureKey = featureKey 15165 c.feature = feature 15166 return c 15167} 15168 15169// Fields allows partial responses to be retrieved. See 15170// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15171// for more information. 15172func (c *ResourcesFeaturesPatchCall) Fields(s ...googleapi.Field) *ResourcesFeaturesPatchCall { 15173 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15174 return c 15175} 15176 15177// Context sets the context to be used in this call's Do method. Any 15178// pending HTTP request will be aborted if the provided context is 15179// canceled. 15180func (c *ResourcesFeaturesPatchCall) Context(ctx context.Context) *ResourcesFeaturesPatchCall { 15181 c.ctx_ = ctx 15182 return c 15183} 15184 15185// Header returns an http.Header that can be modified by the caller to 15186// add HTTP headers to the request. 15187func (c *ResourcesFeaturesPatchCall) Header() http.Header { 15188 if c.header_ == nil { 15189 c.header_ = make(http.Header) 15190 } 15191 return c.header_ 15192} 15193 15194func (c *ResourcesFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { 15195 reqHeaders := make(http.Header) 15196 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15197 for k, v := range c.header_ { 15198 reqHeaders[k] = v 15199 } 15200 reqHeaders.Set("User-Agent", c.s.userAgent()) 15201 var body io.Reader = nil 15202 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 15203 if err != nil { 15204 return nil, err 15205 } 15206 reqHeaders.Set("Content-Type", "application/json") 15207 c.urlParams_.Set("alt", alt) 15208 c.urlParams_.Set("prettyPrint", "false") 15209 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 15210 urls += "?" + c.urlParams_.Encode() 15211 req, err := http.NewRequest("PATCH", urls, body) 15212 if err != nil { 15213 return nil, err 15214 } 15215 req.Header = reqHeaders 15216 googleapi.Expand(req.URL, map[string]string{ 15217 "customer": c.customer, 15218 "featureKey": c.featureKey, 15219 }) 15220 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15221} 15222 15223// Do executes the "directory.resources.features.patch" call. 15224// Exactly one of *Feature or error will be non-nil. Any non-2xx status 15225// code is an error. Response headers are in either 15226// *Feature.ServerResponse.Header or (if a response was returned at all) 15227// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15228// check whether the returned error was because http.StatusNotModified 15229// was returned. 15230func (c *ResourcesFeaturesPatchCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 15231 gensupport.SetOptions(c.urlParams_, opts...) 15232 res, err := c.doRequest("json") 15233 if res != nil && res.StatusCode == http.StatusNotModified { 15234 if res.Body != nil { 15235 res.Body.Close() 15236 } 15237 return nil, &googleapi.Error{ 15238 Code: res.StatusCode, 15239 Header: res.Header, 15240 } 15241 } 15242 if err != nil { 15243 return nil, err 15244 } 15245 defer googleapi.CloseBody(res) 15246 if err := googleapi.CheckResponse(res); err != nil { 15247 return nil, err 15248 } 15249 ret := &Feature{ 15250 ServerResponse: googleapi.ServerResponse{ 15251 Header: res.Header, 15252 HTTPStatusCode: res.StatusCode, 15253 }, 15254 } 15255 target := &ret 15256 if err := gensupport.DecodeResponse(target, res); err != nil { 15257 return nil, err 15258 } 15259 return ret, nil 15260 // { 15261 // "description": "Patches a feature via Apiary Patch Orchestration.", 15262 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 15263 // "httpMethod": "PATCH", 15264 // "id": "directory.resources.features.patch", 15265 // "parameterOrder": [ 15266 // "customer", 15267 // "featureKey" 15268 // ], 15269 // "parameters": { 15270 // "customer": { 15271 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15272 // "location": "path", 15273 // "required": true, 15274 // "type": "string" 15275 // }, 15276 // "featureKey": { 15277 // "description": "The unique ID of the feature to update.", 15278 // "location": "path", 15279 // "required": true, 15280 // "type": "string" 15281 // } 15282 // }, 15283 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 15284 // "request": { 15285 // "$ref": "Feature" 15286 // }, 15287 // "response": { 15288 // "$ref": "Feature" 15289 // }, 15290 // "scopes": [ 15291 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15292 // ] 15293 // } 15294 15295} 15296 15297// method id "directory.resources.features.rename": 15298 15299type ResourcesFeaturesRenameCall struct { 15300 s *Service 15301 customer string 15302 oldName string 15303 featurerename *FeatureRename 15304 urlParams_ gensupport.URLParams 15305 ctx_ context.Context 15306 header_ http.Header 15307} 15308 15309// Rename: Renames a feature. 15310func (r *ResourcesFeaturesService) Rename(customer string, oldName string, featurerename *FeatureRename) *ResourcesFeaturesRenameCall { 15311 c := &ResourcesFeaturesRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15312 c.customer = customer 15313 c.oldName = oldName 15314 c.featurerename = featurerename 15315 return c 15316} 15317 15318// Fields allows partial responses to be retrieved. See 15319// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15320// for more information. 15321func (c *ResourcesFeaturesRenameCall) Fields(s ...googleapi.Field) *ResourcesFeaturesRenameCall { 15322 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15323 return c 15324} 15325 15326// Context sets the context to be used in this call's Do method. Any 15327// pending HTTP request will be aborted if the provided context is 15328// canceled. 15329func (c *ResourcesFeaturesRenameCall) Context(ctx context.Context) *ResourcesFeaturesRenameCall { 15330 c.ctx_ = ctx 15331 return c 15332} 15333 15334// Header returns an http.Header that can be modified by the caller to 15335// add HTTP headers to the request. 15336func (c *ResourcesFeaturesRenameCall) Header() http.Header { 15337 if c.header_ == nil { 15338 c.header_ = make(http.Header) 15339 } 15340 return c.header_ 15341} 15342 15343func (c *ResourcesFeaturesRenameCall) doRequest(alt string) (*http.Response, error) { 15344 reqHeaders := make(http.Header) 15345 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15346 for k, v := range c.header_ { 15347 reqHeaders[k] = v 15348 } 15349 reqHeaders.Set("User-Agent", c.s.userAgent()) 15350 var body io.Reader = nil 15351 body, err := googleapi.WithoutDataWrapper.JSONReader(c.featurerename) 15352 if err != nil { 15353 return nil, err 15354 } 15355 reqHeaders.Set("Content-Type", "application/json") 15356 c.urlParams_.Set("alt", alt) 15357 c.urlParams_.Set("prettyPrint", "false") 15358 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename") 15359 urls += "?" + c.urlParams_.Encode() 15360 req, err := http.NewRequest("POST", urls, body) 15361 if err != nil { 15362 return nil, err 15363 } 15364 req.Header = reqHeaders 15365 googleapi.Expand(req.URL, map[string]string{ 15366 "customer": c.customer, 15367 "oldName": c.oldName, 15368 }) 15369 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15370} 15371 15372// Do executes the "directory.resources.features.rename" call. 15373func (c *ResourcesFeaturesRenameCall) Do(opts ...googleapi.CallOption) error { 15374 gensupport.SetOptions(c.urlParams_, opts...) 15375 res, err := c.doRequest("json") 15376 if err != nil { 15377 return err 15378 } 15379 defer googleapi.CloseBody(res) 15380 if err := googleapi.CheckResponse(res); err != nil { 15381 return err 15382 } 15383 return nil 15384 // { 15385 // "description": "Renames a feature.", 15386 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename", 15387 // "httpMethod": "POST", 15388 // "id": "directory.resources.features.rename", 15389 // "parameterOrder": [ 15390 // "customer", 15391 // "oldName" 15392 // ], 15393 // "parameters": { 15394 // "customer": { 15395 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15396 // "location": "path", 15397 // "required": true, 15398 // "type": "string" 15399 // }, 15400 // "oldName": { 15401 // "description": "The unique ID of the feature to rename.", 15402 // "location": "path", 15403 // "required": true, 15404 // "type": "string" 15405 // } 15406 // }, 15407 // "path": "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename", 15408 // "request": { 15409 // "$ref": "FeatureRename" 15410 // }, 15411 // "scopes": [ 15412 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15413 // ] 15414 // } 15415 15416} 15417 15418// method id "directory.resources.features.update": 15419 15420type ResourcesFeaturesUpdateCall struct { 15421 s *Service 15422 customer string 15423 featureKey string 15424 feature *Feature 15425 urlParams_ gensupport.URLParams 15426 ctx_ context.Context 15427 header_ http.Header 15428} 15429 15430// Update: Updates a feature. 15431func (r *ResourcesFeaturesService) Update(customer string, featureKey string, feature *Feature) *ResourcesFeaturesUpdateCall { 15432 c := &ResourcesFeaturesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15433 c.customer = customer 15434 c.featureKey = featureKey 15435 c.feature = feature 15436 return c 15437} 15438 15439// Fields allows partial responses to be retrieved. See 15440// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15441// for more information. 15442func (c *ResourcesFeaturesUpdateCall) Fields(s ...googleapi.Field) *ResourcesFeaturesUpdateCall { 15443 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15444 return c 15445} 15446 15447// Context sets the context to be used in this call's Do method. Any 15448// pending HTTP request will be aborted if the provided context is 15449// canceled. 15450func (c *ResourcesFeaturesUpdateCall) Context(ctx context.Context) *ResourcesFeaturesUpdateCall { 15451 c.ctx_ = ctx 15452 return c 15453} 15454 15455// Header returns an http.Header that can be modified by the caller to 15456// add HTTP headers to the request. 15457func (c *ResourcesFeaturesUpdateCall) Header() http.Header { 15458 if c.header_ == nil { 15459 c.header_ = make(http.Header) 15460 } 15461 return c.header_ 15462} 15463 15464func (c *ResourcesFeaturesUpdateCall) doRequest(alt string) (*http.Response, error) { 15465 reqHeaders := make(http.Header) 15466 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15467 for k, v := range c.header_ { 15468 reqHeaders[k] = v 15469 } 15470 reqHeaders.Set("User-Agent", c.s.userAgent()) 15471 var body io.Reader = nil 15472 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 15473 if err != nil { 15474 return nil, err 15475 } 15476 reqHeaders.Set("Content-Type", "application/json") 15477 c.urlParams_.Set("alt", alt) 15478 c.urlParams_.Set("prettyPrint", "false") 15479 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 15480 urls += "?" + c.urlParams_.Encode() 15481 req, err := http.NewRequest("PUT", urls, body) 15482 if err != nil { 15483 return nil, err 15484 } 15485 req.Header = reqHeaders 15486 googleapi.Expand(req.URL, map[string]string{ 15487 "customer": c.customer, 15488 "featureKey": c.featureKey, 15489 }) 15490 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15491} 15492 15493// Do executes the "directory.resources.features.update" call. 15494// Exactly one of *Feature or error will be non-nil. Any non-2xx status 15495// code is an error. Response headers are in either 15496// *Feature.ServerResponse.Header or (if a response was returned at all) 15497// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15498// check whether the returned error was because http.StatusNotModified 15499// was returned. 15500func (c *ResourcesFeaturesUpdateCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 15501 gensupport.SetOptions(c.urlParams_, opts...) 15502 res, err := c.doRequest("json") 15503 if res != nil && res.StatusCode == http.StatusNotModified { 15504 if res.Body != nil { 15505 res.Body.Close() 15506 } 15507 return nil, &googleapi.Error{ 15508 Code: res.StatusCode, 15509 Header: res.Header, 15510 } 15511 } 15512 if err != nil { 15513 return nil, err 15514 } 15515 defer googleapi.CloseBody(res) 15516 if err := googleapi.CheckResponse(res); err != nil { 15517 return nil, err 15518 } 15519 ret := &Feature{ 15520 ServerResponse: googleapi.ServerResponse{ 15521 Header: res.Header, 15522 HTTPStatusCode: res.StatusCode, 15523 }, 15524 } 15525 target := &ret 15526 if err := gensupport.DecodeResponse(target, res); err != nil { 15527 return nil, err 15528 } 15529 return ret, nil 15530 // { 15531 // "description": "Updates a feature.", 15532 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 15533 // "httpMethod": "PUT", 15534 // "id": "directory.resources.features.update", 15535 // "parameterOrder": [ 15536 // "customer", 15537 // "featureKey" 15538 // ], 15539 // "parameters": { 15540 // "customer": { 15541 // "description": "The unique ID for the customer's G Suite account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15542 // "location": "path", 15543 // "required": true, 15544 // "type": "string" 15545 // }, 15546 // "featureKey": { 15547 // "description": "The unique ID of the feature to update.", 15548 // "location": "path", 15549 // "required": true, 15550 // "type": "string" 15551 // } 15552 // }, 15553 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 15554 // "request": { 15555 // "$ref": "Feature" 15556 // }, 15557 // "response": { 15558 // "$ref": "Feature" 15559 // }, 15560 // "scopes": [ 15561 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15562 // ] 15563 // } 15564 15565} 15566 15567// method id "directory.roleAssignments.delete": 15568 15569type RoleAssignmentsDeleteCall struct { 15570 s *Service 15571 customer string 15572 roleAssignmentId string 15573 urlParams_ gensupport.URLParams 15574 ctx_ context.Context 15575 header_ http.Header 15576} 15577 15578// Delete: Deletes a role assignment. 15579func (r *RoleAssignmentsService) Delete(customer string, roleAssignmentId string) *RoleAssignmentsDeleteCall { 15580 c := &RoleAssignmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15581 c.customer = customer 15582 c.roleAssignmentId = roleAssignmentId 15583 return c 15584} 15585 15586// Fields allows partial responses to be retrieved. See 15587// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15588// for more information. 15589func (c *RoleAssignmentsDeleteCall) Fields(s ...googleapi.Field) *RoleAssignmentsDeleteCall { 15590 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15591 return c 15592} 15593 15594// Context sets the context to be used in this call's Do method. Any 15595// pending HTTP request will be aborted if the provided context is 15596// canceled. 15597func (c *RoleAssignmentsDeleteCall) Context(ctx context.Context) *RoleAssignmentsDeleteCall { 15598 c.ctx_ = ctx 15599 return c 15600} 15601 15602// Header returns an http.Header that can be modified by the caller to 15603// add HTTP headers to the request. 15604func (c *RoleAssignmentsDeleteCall) Header() http.Header { 15605 if c.header_ == nil { 15606 c.header_ = make(http.Header) 15607 } 15608 return c.header_ 15609} 15610 15611func (c *RoleAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { 15612 reqHeaders := make(http.Header) 15613 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15614 for k, v := range c.header_ { 15615 reqHeaders[k] = v 15616 } 15617 reqHeaders.Set("User-Agent", c.s.userAgent()) 15618 var body io.Reader = nil 15619 c.urlParams_.Set("alt", alt) 15620 c.urlParams_.Set("prettyPrint", "false") 15621 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") 15622 urls += "?" + c.urlParams_.Encode() 15623 req, err := http.NewRequest("DELETE", urls, body) 15624 if err != nil { 15625 return nil, err 15626 } 15627 req.Header = reqHeaders 15628 googleapi.Expand(req.URL, map[string]string{ 15629 "customer": c.customer, 15630 "roleAssignmentId": c.roleAssignmentId, 15631 }) 15632 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15633} 15634 15635// Do executes the "directory.roleAssignments.delete" call. 15636func (c *RoleAssignmentsDeleteCall) Do(opts ...googleapi.CallOption) error { 15637 gensupport.SetOptions(c.urlParams_, opts...) 15638 res, err := c.doRequest("json") 15639 if err != nil { 15640 return err 15641 } 15642 defer googleapi.CloseBody(res) 15643 if err := googleapi.CheckResponse(res); err != nil { 15644 return err 15645 } 15646 return nil 15647 // { 15648 // "description": "Deletes a role assignment.", 15649 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 15650 // "httpMethod": "DELETE", 15651 // "id": "directory.roleAssignments.delete", 15652 // "parameterOrder": [ 15653 // "customer", 15654 // "roleAssignmentId" 15655 // ], 15656 // "parameters": { 15657 // "customer": { 15658 // "description": "Immutable ID of the G Suite account.", 15659 // "location": "path", 15660 // "required": true, 15661 // "type": "string" 15662 // }, 15663 // "roleAssignmentId": { 15664 // "description": "Immutable ID of the role assignment.", 15665 // "location": "path", 15666 // "required": true, 15667 // "type": "string" 15668 // } 15669 // }, 15670 // "path": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 15671 // "scopes": [ 15672 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 15673 // ] 15674 // } 15675 15676} 15677 15678// method id "directory.roleAssignments.get": 15679 15680type RoleAssignmentsGetCall struct { 15681 s *Service 15682 customer string 15683 roleAssignmentId string 15684 urlParams_ gensupport.URLParams 15685 ifNoneMatch_ string 15686 ctx_ context.Context 15687 header_ http.Header 15688} 15689 15690// Get: Retrieve a role assignment. 15691func (r *RoleAssignmentsService) Get(customer string, roleAssignmentId string) *RoleAssignmentsGetCall { 15692 c := &RoleAssignmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15693 c.customer = customer 15694 c.roleAssignmentId = roleAssignmentId 15695 return c 15696} 15697 15698// Fields allows partial responses to be retrieved. See 15699// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15700// for more information. 15701func (c *RoleAssignmentsGetCall) Fields(s ...googleapi.Field) *RoleAssignmentsGetCall { 15702 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15703 return c 15704} 15705 15706// IfNoneMatch sets the optional parameter which makes the operation 15707// fail if the object's ETag matches the given value. This is useful for 15708// getting updates only after the object has changed since the last 15709// request. Use googleapi.IsNotModified to check whether the response 15710// error from Do is the result of In-None-Match. 15711func (c *RoleAssignmentsGetCall) IfNoneMatch(entityTag string) *RoleAssignmentsGetCall { 15712 c.ifNoneMatch_ = entityTag 15713 return c 15714} 15715 15716// Context sets the context to be used in this call's Do method. Any 15717// pending HTTP request will be aborted if the provided context is 15718// canceled. 15719func (c *RoleAssignmentsGetCall) Context(ctx context.Context) *RoleAssignmentsGetCall { 15720 c.ctx_ = ctx 15721 return c 15722} 15723 15724// Header returns an http.Header that can be modified by the caller to 15725// add HTTP headers to the request. 15726func (c *RoleAssignmentsGetCall) Header() http.Header { 15727 if c.header_ == nil { 15728 c.header_ = make(http.Header) 15729 } 15730 return c.header_ 15731} 15732 15733func (c *RoleAssignmentsGetCall) doRequest(alt string) (*http.Response, error) { 15734 reqHeaders := make(http.Header) 15735 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15736 for k, v := range c.header_ { 15737 reqHeaders[k] = v 15738 } 15739 reqHeaders.Set("User-Agent", c.s.userAgent()) 15740 if c.ifNoneMatch_ != "" { 15741 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15742 } 15743 var body io.Reader = nil 15744 c.urlParams_.Set("alt", alt) 15745 c.urlParams_.Set("prettyPrint", "false") 15746 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") 15747 urls += "?" + c.urlParams_.Encode() 15748 req, err := http.NewRequest("GET", urls, body) 15749 if err != nil { 15750 return nil, err 15751 } 15752 req.Header = reqHeaders 15753 googleapi.Expand(req.URL, map[string]string{ 15754 "customer": c.customer, 15755 "roleAssignmentId": c.roleAssignmentId, 15756 }) 15757 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15758} 15759 15760// Do executes the "directory.roleAssignments.get" call. 15761// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx 15762// status code is an error. Response headers are in either 15763// *RoleAssignment.ServerResponse.Header or (if a response was returned 15764// at all) in error.(*googleapi.Error).Header. Use 15765// googleapi.IsNotModified to check whether the returned error was 15766// because http.StatusNotModified was returned. 15767func (c *RoleAssignmentsGetCall) Do(opts ...googleapi.CallOption) (*RoleAssignment, error) { 15768 gensupport.SetOptions(c.urlParams_, opts...) 15769 res, err := c.doRequest("json") 15770 if res != nil && res.StatusCode == http.StatusNotModified { 15771 if res.Body != nil { 15772 res.Body.Close() 15773 } 15774 return nil, &googleapi.Error{ 15775 Code: res.StatusCode, 15776 Header: res.Header, 15777 } 15778 } 15779 if err != nil { 15780 return nil, err 15781 } 15782 defer googleapi.CloseBody(res) 15783 if err := googleapi.CheckResponse(res); err != nil { 15784 return nil, err 15785 } 15786 ret := &RoleAssignment{ 15787 ServerResponse: googleapi.ServerResponse{ 15788 Header: res.Header, 15789 HTTPStatusCode: res.StatusCode, 15790 }, 15791 } 15792 target := &ret 15793 if err := gensupport.DecodeResponse(target, res); err != nil { 15794 return nil, err 15795 } 15796 return ret, nil 15797 // { 15798 // "description": "Retrieve a role assignment.", 15799 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 15800 // "httpMethod": "GET", 15801 // "id": "directory.roleAssignments.get", 15802 // "parameterOrder": [ 15803 // "customer", 15804 // "roleAssignmentId" 15805 // ], 15806 // "parameters": { 15807 // "customer": { 15808 // "description": "Immutable ID of the G Suite account.", 15809 // "location": "path", 15810 // "required": true, 15811 // "type": "string" 15812 // }, 15813 // "roleAssignmentId": { 15814 // "description": "Immutable ID of the role assignment.", 15815 // "location": "path", 15816 // "required": true, 15817 // "type": "string" 15818 // } 15819 // }, 15820 // "path": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 15821 // "response": { 15822 // "$ref": "RoleAssignment" 15823 // }, 15824 // "scopes": [ 15825 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 15826 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 15827 // ] 15828 // } 15829 15830} 15831 15832// method id "directory.roleAssignments.insert": 15833 15834type RoleAssignmentsInsertCall struct { 15835 s *Service 15836 customer string 15837 roleassignment *RoleAssignment 15838 urlParams_ gensupport.URLParams 15839 ctx_ context.Context 15840 header_ http.Header 15841} 15842 15843// Insert: Creates a role assignment. 15844func (r *RoleAssignmentsService) Insert(customer string, roleassignment *RoleAssignment) *RoleAssignmentsInsertCall { 15845 c := &RoleAssignmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15846 c.customer = customer 15847 c.roleassignment = roleassignment 15848 return c 15849} 15850 15851// Fields allows partial responses to be retrieved. See 15852// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15853// for more information. 15854func (c *RoleAssignmentsInsertCall) Fields(s ...googleapi.Field) *RoleAssignmentsInsertCall { 15855 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15856 return c 15857} 15858 15859// Context sets the context to be used in this call's Do method. Any 15860// pending HTTP request will be aborted if the provided context is 15861// canceled. 15862func (c *RoleAssignmentsInsertCall) Context(ctx context.Context) *RoleAssignmentsInsertCall { 15863 c.ctx_ = ctx 15864 return c 15865} 15866 15867// Header returns an http.Header that can be modified by the caller to 15868// add HTTP headers to the request. 15869func (c *RoleAssignmentsInsertCall) Header() http.Header { 15870 if c.header_ == nil { 15871 c.header_ = make(http.Header) 15872 } 15873 return c.header_ 15874} 15875 15876func (c *RoleAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { 15877 reqHeaders := make(http.Header) 15878 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 15879 for k, v := range c.header_ { 15880 reqHeaders[k] = v 15881 } 15882 reqHeaders.Set("User-Agent", c.s.userAgent()) 15883 var body io.Reader = nil 15884 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roleassignment) 15885 if err != nil { 15886 return nil, err 15887 } 15888 reqHeaders.Set("Content-Type", "application/json") 15889 c.urlParams_.Set("alt", alt) 15890 c.urlParams_.Set("prettyPrint", "false") 15891 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments") 15892 urls += "?" + c.urlParams_.Encode() 15893 req, err := http.NewRequest("POST", urls, body) 15894 if err != nil { 15895 return nil, err 15896 } 15897 req.Header = reqHeaders 15898 googleapi.Expand(req.URL, map[string]string{ 15899 "customer": c.customer, 15900 }) 15901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15902} 15903 15904// Do executes the "directory.roleAssignments.insert" call. 15905// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx 15906// status code is an error. Response headers are in either 15907// *RoleAssignment.ServerResponse.Header or (if a response was returned 15908// at all) in error.(*googleapi.Error).Header. Use 15909// googleapi.IsNotModified to check whether the returned error was 15910// because http.StatusNotModified was returned. 15911func (c *RoleAssignmentsInsertCall) Do(opts ...googleapi.CallOption) (*RoleAssignment, error) { 15912 gensupport.SetOptions(c.urlParams_, opts...) 15913 res, err := c.doRequest("json") 15914 if res != nil && res.StatusCode == http.StatusNotModified { 15915 if res.Body != nil { 15916 res.Body.Close() 15917 } 15918 return nil, &googleapi.Error{ 15919 Code: res.StatusCode, 15920 Header: res.Header, 15921 } 15922 } 15923 if err != nil { 15924 return nil, err 15925 } 15926 defer googleapi.CloseBody(res) 15927 if err := googleapi.CheckResponse(res); err != nil { 15928 return nil, err 15929 } 15930 ret := &RoleAssignment{ 15931 ServerResponse: googleapi.ServerResponse{ 15932 Header: res.Header, 15933 HTTPStatusCode: res.StatusCode, 15934 }, 15935 } 15936 target := &ret 15937 if err := gensupport.DecodeResponse(target, res); err != nil { 15938 return nil, err 15939 } 15940 return ret, nil 15941 // { 15942 // "description": "Creates a role assignment.", 15943 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments", 15944 // "httpMethod": "POST", 15945 // "id": "directory.roleAssignments.insert", 15946 // "parameterOrder": [ 15947 // "customer" 15948 // ], 15949 // "parameters": { 15950 // "customer": { 15951 // "description": "Immutable ID of the G Suite account.", 15952 // "location": "path", 15953 // "required": true, 15954 // "type": "string" 15955 // } 15956 // }, 15957 // "path": "admin/directory/v1/customer/{customer}/roleassignments", 15958 // "request": { 15959 // "$ref": "RoleAssignment" 15960 // }, 15961 // "response": { 15962 // "$ref": "RoleAssignment" 15963 // }, 15964 // "scopes": [ 15965 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 15966 // ] 15967 // } 15968 15969} 15970 15971// method id "directory.roleAssignments.list": 15972 15973type RoleAssignmentsListCall struct { 15974 s *Service 15975 customer string 15976 urlParams_ gensupport.URLParams 15977 ifNoneMatch_ string 15978 ctx_ context.Context 15979 header_ http.Header 15980} 15981 15982// List: Retrieves a paginated list of all roleAssignments. 15983func (r *RoleAssignmentsService) List(customer string) *RoleAssignmentsListCall { 15984 c := &RoleAssignmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15985 c.customer = customer 15986 return c 15987} 15988 15989// MaxResults sets the optional parameter "maxResults": Maximum number 15990// of results to return. 15991func (c *RoleAssignmentsListCall) MaxResults(maxResults int64) *RoleAssignmentsListCall { 15992 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 15993 return c 15994} 15995 15996// PageToken sets the optional parameter "pageToken": Token to specify 15997// the next page in the list. 15998func (c *RoleAssignmentsListCall) PageToken(pageToken string) *RoleAssignmentsListCall { 15999 c.urlParams_.Set("pageToken", pageToken) 16000 return c 16001} 16002 16003// RoleId sets the optional parameter "roleId": Immutable ID of a role. 16004// If included in the request, returns only role assignments containing 16005// this role ID. 16006func (c *RoleAssignmentsListCall) RoleId(roleId string) *RoleAssignmentsListCall { 16007 c.urlParams_.Set("roleId", roleId) 16008 return c 16009} 16010 16011// UserKey sets the optional parameter "userKey": The user's primary 16012// email address, alias email address, or unique user ID. If included in 16013// the request, returns role assignments only for this user. 16014func (c *RoleAssignmentsListCall) UserKey(userKey string) *RoleAssignmentsListCall { 16015 c.urlParams_.Set("userKey", userKey) 16016 return c 16017} 16018 16019// Fields allows partial responses to be retrieved. See 16020// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16021// for more information. 16022func (c *RoleAssignmentsListCall) Fields(s ...googleapi.Field) *RoleAssignmentsListCall { 16023 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16024 return c 16025} 16026 16027// IfNoneMatch sets the optional parameter which makes the operation 16028// fail if the object's ETag matches the given value. This is useful for 16029// getting updates only after the object has changed since the last 16030// request. Use googleapi.IsNotModified to check whether the response 16031// error from Do is the result of In-None-Match. 16032func (c *RoleAssignmentsListCall) IfNoneMatch(entityTag string) *RoleAssignmentsListCall { 16033 c.ifNoneMatch_ = entityTag 16034 return c 16035} 16036 16037// Context sets the context to be used in this call's Do method. Any 16038// pending HTTP request will be aborted if the provided context is 16039// canceled. 16040func (c *RoleAssignmentsListCall) Context(ctx context.Context) *RoleAssignmentsListCall { 16041 c.ctx_ = ctx 16042 return c 16043} 16044 16045// Header returns an http.Header that can be modified by the caller to 16046// add HTTP headers to the request. 16047func (c *RoleAssignmentsListCall) Header() http.Header { 16048 if c.header_ == nil { 16049 c.header_ = make(http.Header) 16050 } 16051 return c.header_ 16052} 16053 16054func (c *RoleAssignmentsListCall) doRequest(alt string) (*http.Response, error) { 16055 reqHeaders := make(http.Header) 16056 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16057 for k, v := range c.header_ { 16058 reqHeaders[k] = v 16059 } 16060 reqHeaders.Set("User-Agent", c.s.userAgent()) 16061 if c.ifNoneMatch_ != "" { 16062 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16063 } 16064 var body io.Reader = nil 16065 c.urlParams_.Set("alt", alt) 16066 c.urlParams_.Set("prettyPrint", "false") 16067 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments") 16068 urls += "?" + c.urlParams_.Encode() 16069 req, err := http.NewRequest("GET", urls, body) 16070 if err != nil { 16071 return nil, err 16072 } 16073 req.Header = reqHeaders 16074 googleapi.Expand(req.URL, map[string]string{ 16075 "customer": c.customer, 16076 }) 16077 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16078} 16079 16080// Do executes the "directory.roleAssignments.list" call. 16081// Exactly one of *RoleAssignments or error will be non-nil. Any non-2xx 16082// status code is an error. Response headers are in either 16083// *RoleAssignments.ServerResponse.Header or (if a response was returned 16084// at all) in error.(*googleapi.Error).Header. Use 16085// googleapi.IsNotModified to check whether the returned error was 16086// because http.StatusNotModified was returned. 16087func (c *RoleAssignmentsListCall) Do(opts ...googleapi.CallOption) (*RoleAssignments, error) { 16088 gensupport.SetOptions(c.urlParams_, opts...) 16089 res, err := c.doRequest("json") 16090 if res != nil && res.StatusCode == http.StatusNotModified { 16091 if res.Body != nil { 16092 res.Body.Close() 16093 } 16094 return nil, &googleapi.Error{ 16095 Code: res.StatusCode, 16096 Header: res.Header, 16097 } 16098 } 16099 if err != nil { 16100 return nil, err 16101 } 16102 defer googleapi.CloseBody(res) 16103 if err := googleapi.CheckResponse(res); err != nil { 16104 return nil, err 16105 } 16106 ret := &RoleAssignments{ 16107 ServerResponse: googleapi.ServerResponse{ 16108 Header: res.Header, 16109 HTTPStatusCode: res.StatusCode, 16110 }, 16111 } 16112 target := &ret 16113 if err := gensupport.DecodeResponse(target, res); err != nil { 16114 return nil, err 16115 } 16116 return ret, nil 16117 // { 16118 // "description": "Retrieves a paginated list of all roleAssignments.", 16119 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments", 16120 // "httpMethod": "GET", 16121 // "id": "directory.roleAssignments.list", 16122 // "parameterOrder": [ 16123 // "customer" 16124 // ], 16125 // "parameters": { 16126 // "customer": { 16127 // "description": "Immutable ID of the G Suite account.", 16128 // "location": "path", 16129 // "required": true, 16130 // "type": "string" 16131 // }, 16132 // "maxResults": { 16133 // "description": "Maximum number of results to return.", 16134 // "format": "int32", 16135 // "location": "query", 16136 // "maximum": "200", 16137 // "minimum": "1", 16138 // "type": "integer" 16139 // }, 16140 // "pageToken": { 16141 // "description": "Token to specify the next page in the list.", 16142 // "location": "query", 16143 // "type": "string" 16144 // }, 16145 // "roleId": { 16146 // "description": "Immutable ID of a role. If included in the request, returns only role assignments containing this role ID.", 16147 // "location": "query", 16148 // "type": "string" 16149 // }, 16150 // "userKey": { 16151 // "description": "The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user.", 16152 // "location": "query", 16153 // "type": "string" 16154 // } 16155 // }, 16156 // "path": "admin/directory/v1/customer/{customer}/roleassignments", 16157 // "response": { 16158 // "$ref": "RoleAssignments" 16159 // }, 16160 // "scopes": [ 16161 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 16162 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 16163 // ] 16164 // } 16165 16166} 16167 16168// Pages invokes f for each page of results. 16169// A non-nil error returned from f will halt the iteration. 16170// The provided context supersedes any context provided to the Context method. 16171func (c *RoleAssignmentsListCall) Pages(ctx context.Context, f func(*RoleAssignments) error) error { 16172 c.ctx_ = ctx 16173 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 16174 for { 16175 x, err := c.Do() 16176 if err != nil { 16177 return err 16178 } 16179 if err := f(x); err != nil { 16180 return err 16181 } 16182 if x.NextPageToken == "" { 16183 return nil 16184 } 16185 c.PageToken(x.NextPageToken) 16186 } 16187} 16188 16189// method id "directory.roles.delete": 16190 16191type RolesDeleteCall struct { 16192 s *Service 16193 customer string 16194 roleId string 16195 urlParams_ gensupport.URLParams 16196 ctx_ context.Context 16197 header_ http.Header 16198} 16199 16200// Delete: Deletes a role. 16201func (r *RolesService) Delete(customer string, roleId string) *RolesDeleteCall { 16202 c := &RolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16203 c.customer = customer 16204 c.roleId = roleId 16205 return c 16206} 16207 16208// Fields allows partial responses to be retrieved. See 16209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16210// for more information. 16211func (c *RolesDeleteCall) Fields(s ...googleapi.Field) *RolesDeleteCall { 16212 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16213 return c 16214} 16215 16216// Context sets the context to be used in this call's Do method. Any 16217// pending HTTP request will be aborted if the provided context is 16218// canceled. 16219func (c *RolesDeleteCall) Context(ctx context.Context) *RolesDeleteCall { 16220 c.ctx_ = ctx 16221 return c 16222} 16223 16224// Header returns an http.Header that can be modified by the caller to 16225// add HTTP headers to the request. 16226func (c *RolesDeleteCall) Header() http.Header { 16227 if c.header_ == nil { 16228 c.header_ = make(http.Header) 16229 } 16230 return c.header_ 16231} 16232 16233func (c *RolesDeleteCall) doRequest(alt string) (*http.Response, error) { 16234 reqHeaders := make(http.Header) 16235 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16236 for k, v := range c.header_ { 16237 reqHeaders[k] = v 16238 } 16239 reqHeaders.Set("User-Agent", c.s.userAgent()) 16240 var body io.Reader = nil 16241 c.urlParams_.Set("alt", alt) 16242 c.urlParams_.Set("prettyPrint", "false") 16243 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 16244 urls += "?" + c.urlParams_.Encode() 16245 req, err := http.NewRequest("DELETE", urls, body) 16246 if err != nil { 16247 return nil, err 16248 } 16249 req.Header = reqHeaders 16250 googleapi.Expand(req.URL, map[string]string{ 16251 "customer": c.customer, 16252 "roleId": c.roleId, 16253 }) 16254 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16255} 16256 16257// Do executes the "directory.roles.delete" call. 16258func (c *RolesDeleteCall) Do(opts ...googleapi.CallOption) error { 16259 gensupport.SetOptions(c.urlParams_, opts...) 16260 res, err := c.doRequest("json") 16261 if err != nil { 16262 return err 16263 } 16264 defer googleapi.CloseBody(res) 16265 if err := googleapi.CheckResponse(res); err != nil { 16266 return err 16267 } 16268 return nil 16269 // { 16270 // "description": "Deletes a role.", 16271 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16272 // "httpMethod": "DELETE", 16273 // "id": "directory.roles.delete", 16274 // "parameterOrder": [ 16275 // "customer", 16276 // "roleId" 16277 // ], 16278 // "parameters": { 16279 // "customer": { 16280 // "description": "Immutable ID of the G Suite account.", 16281 // "location": "path", 16282 // "required": true, 16283 // "type": "string" 16284 // }, 16285 // "roleId": { 16286 // "description": "Immutable ID of the role.", 16287 // "location": "path", 16288 // "required": true, 16289 // "type": "string" 16290 // } 16291 // }, 16292 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16293 // "scopes": [ 16294 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 16295 // ] 16296 // } 16297 16298} 16299 16300// method id "directory.roles.get": 16301 16302type RolesGetCall struct { 16303 s *Service 16304 customer string 16305 roleId string 16306 urlParams_ gensupport.URLParams 16307 ifNoneMatch_ string 16308 ctx_ context.Context 16309 header_ http.Header 16310} 16311 16312// Get: Retrieves a role. 16313func (r *RolesService) Get(customer string, roleId string) *RolesGetCall { 16314 c := &RolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16315 c.customer = customer 16316 c.roleId = roleId 16317 return c 16318} 16319 16320// Fields allows partial responses to be retrieved. See 16321// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16322// for more information. 16323func (c *RolesGetCall) Fields(s ...googleapi.Field) *RolesGetCall { 16324 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16325 return c 16326} 16327 16328// IfNoneMatch sets the optional parameter which makes the operation 16329// fail if the object's ETag matches the given value. This is useful for 16330// getting updates only after the object has changed since the last 16331// request. Use googleapi.IsNotModified to check whether the response 16332// error from Do is the result of In-None-Match. 16333func (c *RolesGetCall) IfNoneMatch(entityTag string) *RolesGetCall { 16334 c.ifNoneMatch_ = entityTag 16335 return c 16336} 16337 16338// Context sets the context to be used in this call's Do method. Any 16339// pending HTTP request will be aborted if the provided context is 16340// canceled. 16341func (c *RolesGetCall) Context(ctx context.Context) *RolesGetCall { 16342 c.ctx_ = ctx 16343 return c 16344} 16345 16346// Header returns an http.Header that can be modified by the caller to 16347// add HTTP headers to the request. 16348func (c *RolesGetCall) Header() http.Header { 16349 if c.header_ == nil { 16350 c.header_ = make(http.Header) 16351 } 16352 return c.header_ 16353} 16354 16355func (c *RolesGetCall) doRequest(alt string) (*http.Response, error) { 16356 reqHeaders := make(http.Header) 16357 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16358 for k, v := range c.header_ { 16359 reqHeaders[k] = v 16360 } 16361 reqHeaders.Set("User-Agent", c.s.userAgent()) 16362 if c.ifNoneMatch_ != "" { 16363 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16364 } 16365 var body io.Reader = nil 16366 c.urlParams_.Set("alt", alt) 16367 c.urlParams_.Set("prettyPrint", "false") 16368 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 16369 urls += "?" + c.urlParams_.Encode() 16370 req, err := http.NewRequest("GET", urls, body) 16371 if err != nil { 16372 return nil, err 16373 } 16374 req.Header = reqHeaders 16375 googleapi.Expand(req.URL, map[string]string{ 16376 "customer": c.customer, 16377 "roleId": c.roleId, 16378 }) 16379 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16380} 16381 16382// Do executes the "directory.roles.get" call. 16383// Exactly one of *Role or error will be non-nil. Any non-2xx status 16384// code is an error. Response headers are in either 16385// *Role.ServerResponse.Header or (if a response was returned at all) in 16386// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 16387// whether the returned error was because http.StatusNotModified was 16388// returned. 16389func (c *RolesGetCall) Do(opts ...googleapi.CallOption) (*Role, error) { 16390 gensupport.SetOptions(c.urlParams_, opts...) 16391 res, err := c.doRequest("json") 16392 if res != nil && res.StatusCode == http.StatusNotModified { 16393 if res.Body != nil { 16394 res.Body.Close() 16395 } 16396 return nil, &googleapi.Error{ 16397 Code: res.StatusCode, 16398 Header: res.Header, 16399 } 16400 } 16401 if err != nil { 16402 return nil, err 16403 } 16404 defer googleapi.CloseBody(res) 16405 if err := googleapi.CheckResponse(res); err != nil { 16406 return nil, err 16407 } 16408 ret := &Role{ 16409 ServerResponse: googleapi.ServerResponse{ 16410 Header: res.Header, 16411 HTTPStatusCode: res.StatusCode, 16412 }, 16413 } 16414 target := &ret 16415 if err := gensupport.DecodeResponse(target, res); err != nil { 16416 return nil, err 16417 } 16418 return ret, nil 16419 // { 16420 // "description": "Retrieves a role.", 16421 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16422 // "httpMethod": "GET", 16423 // "id": "directory.roles.get", 16424 // "parameterOrder": [ 16425 // "customer", 16426 // "roleId" 16427 // ], 16428 // "parameters": { 16429 // "customer": { 16430 // "description": "Immutable ID of the G Suite account.", 16431 // "location": "path", 16432 // "required": true, 16433 // "type": "string" 16434 // }, 16435 // "roleId": { 16436 // "description": "Immutable ID of the role.", 16437 // "location": "path", 16438 // "required": true, 16439 // "type": "string" 16440 // } 16441 // }, 16442 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16443 // "response": { 16444 // "$ref": "Role" 16445 // }, 16446 // "scopes": [ 16447 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 16448 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 16449 // ] 16450 // } 16451 16452} 16453 16454// method id "directory.roles.insert": 16455 16456type RolesInsertCall struct { 16457 s *Service 16458 customer string 16459 role *Role 16460 urlParams_ gensupport.URLParams 16461 ctx_ context.Context 16462 header_ http.Header 16463} 16464 16465// Insert: Creates a role. 16466func (r *RolesService) Insert(customer string, role *Role) *RolesInsertCall { 16467 c := &RolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16468 c.customer = customer 16469 c.role = role 16470 return c 16471} 16472 16473// Fields allows partial responses to be retrieved. See 16474// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16475// for more information. 16476func (c *RolesInsertCall) Fields(s ...googleapi.Field) *RolesInsertCall { 16477 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16478 return c 16479} 16480 16481// Context sets the context to be used in this call's Do method. Any 16482// pending HTTP request will be aborted if the provided context is 16483// canceled. 16484func (c *RolesInsertCall) Context(ctx context.Context) *RolesInsertCall { 16485 c.ctx_ = ctx 16486 return c 16487} 16488 16489// Header returns an http.Header that can be modified by the caller to 16490// add HTTP headers to the request. 16491func (c *RolesInsertCall) Header() http.Header { 16492 if c.header_ == nil { 16493 c.header_ = make(http.Header) 16494 } 16495 return c.header_ 16496} 16497 16498func (c *RolesInsertCall) doRequest(alt string) (*http.Response, error) { 16499 reqHeaders := make(http.Header) 16500 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16501 for k, v := range c.header_ { 16502 reqHeaders[k] = v 16503 } 16504 reqHeaders.Set("User-Agent", c.s.userAgent()) 16505 var body io.Reader = nil 16506 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 16507 if err != nil { 16508 return nil, err 16509 } 16510 reqHeaders.Set("Content-Type", "application/json") 16511 c.urlParams_.Set("alt", alt) 16512 c.urlParams_.Set("prettyPrint", "false") 16513 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles") 16514 urls += "?" + c.urlParams_.Encode() 16515 req, err := http.NewRequest("POST", urls, body) 16516 if err != nil { 16517 return nil, err 16518 } 16519 req.Header = reqHeaders 16520 googleapi.Expand(req.URL, map[string]string{ 16521 "customer": c.customer, 16522 }) 16523 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16524} 16525 16526// Do executes the "directory.roles.insert" call. 16527// Exactly one of *Role or error will be non-nil. Any non-2xx status 16528// code is an error. Response headers are in either 16529// *Role.ServerResponse.Header or (if a response was returned at all) in 16530// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 16531// whether the returned error was because http.StatusNotModified was 16532// returned. 16533func (c *RolesInsertCall) Do(opts ...googleapi.CallOption) (*Role, error) { 16534 gensupport.SetOptions(c.urlParams_, opts...) 16535 res, err := c.doRequest("json") 16536 if res != nil && res.StatusCode == http.StatusNotModified { 16537 if res.Body != nil { 16538 res.Body.Close() 16539 } 16540 return nil, &googleapi.Error{ 16541 Code: res.StatusCode, 16542 Header: res.Header, 16543 } 16544 } 16545 if err != nil { 16546 return nil, err 16547 } 16548 defer googleapi.CloseBody(res) 16549 if err := googleapi.CheckResponse(res); err != nil { 16550 return nil, err 16551 } 16552 ret := &Role{ 16553 ServerResponse: googleapi.ServerResponse{ 16554 Header: res.Header, 16555 HTTPStatusCode: res.StatusCode, 16556 }, 16557 } 16558 target := &ret 16559 if err := gensupport.DecodeResponse(target, res); err != nil { 16560 return nil, err 16561 } 16562 return ret, nil 16563 // { 16564 // "description": "Creates a role.", 16565 // "flatPath": "admin/directory/v1/customer/{customer}/roles", 16566 // "httpMethod": "POST", 16567 // "id": "directory.roles.insert", 16568 // "parameterOrder": [ 16569 // "customer" 16570 // ], 16571 // "parameters": { 16572 // "customer": { 16573 // "description": "Immutable ID of the G Suite account.", 16574 // "location": "path", 16575 // "required": true, 16576 // "type": "string" 16577 // } 16578 // }, 16579 // "path": "admin/directory/v1/customer/{customer}/roles", 16580 // "request": { 16581 // "$ref": "Role" 16582 // }, 16583 // "response": { 16584 // "$ref": "Role" 16585 // }, 16586 // "scopes": [ 16587 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 16588 // ] 16589 // } 16590 16591} 16592 16593// method id "directory.roles.list": 16594 16595type RolesListCall struct { 16596 s *Service 16597 customer string 16598 urlParams_ gensupport.URLParams 16599 ifNoneMatch_ string 16600 ctx_ context.Context 16601 header_ http.Header 16602} 16603 16604// List: Retrieves a paginated list of all the roles in a domain. 16605func (r *RolesService) List(customer string) *RolesListCall { 16606 c := &RolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16607 c.customer = customer 16608 return c 16609} 16610 16611// MaxResults sets the optional parameter "maxResults": Maximum number 16612// of results to return. 16613func (c *RolesListCall) MaxResults(maxResults int64) *RolesListCall { 16614 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 16615 return c 16616} 16617 16618// PageToken sets the optional parameter "pageToken": Token to specify 16619// the next page in the list. 16620func (c *RolesListCall) PageToken(pageToken string) *RolesListCall { 16621 c.urlParams_.Set("pageToken", pageToken) 16622 return c 16623} 16624 16625// Fields allows partial responses to be retrieved. See 16626// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16627// for more information. 16628func (c *RolesListCall) Fields(s ...googleapi.Field) *RolesListCall { 16629 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16630 return c 16631} 16632 16633// IfNoneMatch sets the optional parameter which makes the operation 16634// fail if the object's ETag matches the given value. This is useful for 16635// getting updates only after the object has changed since the last 16636// request. Use googleapi.IsNotModified to check whether the response 16637// error from Do is the result of In-None-Match. 16638func (c *RolesListCall) IfNoneMatch(entityTag string) *RolesListCall { 16639 c.ifNoneMatch_ = entityTag 16640 return c 16641} 16642 16643// Context sets the context to be used in this call's Do method. Any 16644// pending HTTP request will be aborted if the provided context is 16645// canceled. 16646func (c *RolesListCall) Context(ctx context.Context) *RolesListCall { 16647 c.ctx_ = ctx 16648 return c 16649} 16650 16651// Header returns an http.Header that can be modified by the caller to 16652// add HTTP headers to the request. 16653func (c *RolesListCall) Header() http.Header { 16654 if c.header_ == nil { 16655 c.header_ = make(http.Header) 16656 } 16657 return c.header_ 16658} 16659 16660func (c *RolesListCall) doRequest(alt string) (*http.Response, error) { 16661 reqHeaders := make(http.Header) 16662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16663 for k, v := range c.header_ { 16664 reqHeaders[k] = v 16665 } 16666 reqHeaders.Set("User-Agent", c.s.userAgent()) 16667 if c.ifNoneMatch_ != "" { 16668 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16669 } 16670 var body io.Reader = nil 16671 c.urlParams_.Set("alt", alt) 16672 c.urlParams_.Set("prettyPrint", "false") 16673 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles") 16674 urls += "?" + c.urlParams_.Encode() 16675 req, err := http.NewRequest("GET", urls, body) 16676 if err != nil { 16677 return nil, err 16678 } 16679 req.Header = reqHeaders 16680 googleapi.Expand(req.URL, map[string]string{ 16681 "customer": c.customer, 16682 }) 16683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16684} 16685 16686// Do executes the "directory.roles.list" call. 16687// Exactly one of *Roles or error will be non-nil. Any non-2xx status 16688// code is an error. Response headers are in either 16689// *Roles.ServerResponse.Header or (if a response was returned at all) 16690// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 16691// check whether the returned error was because http.StatusNotModified 16692// was returned. 16693func (c *RolesListCall) Do(opts ...googleapi.CallOption) (*Roles, error) { 16694 gensupport.SetOptions(c.urlParams_, opts...) 16695 res, err := c.doRequest("json") 16696 if res != nil && res.StatusCode == http.StatusNotModified { 16697 if res.Body != nil { 16698 res.Body.Close() 16699 } 16700 return nil, &googleapi.Error{ 16701 Code: res.StatusCode, 16702 Header: res.Header, 16703 } 16704 } 16705 if err != nil { 16706 return nil, err 16707 } 16708 defer googleapi.CloseBody(res) 16709 if err := googleapi.CheckResponse(res); err != nil { 16710 return nil, err 16711 } 16712 ret := &Roles{ 16713 ServerResponse: googleapi.ServerResponse{ 16714 Header: res.Header, 16715 HTTPStatusCode: res.StatusCode, 16716 }, 16717 } 16718 target := &ret 16719 if err := gensupport.DecodeResponse(target, res); err != nil { 16720 return nil, err 16721 } 16722 return ret, nil 16723 // { 16724 // "description": "Retrieves a paginated list of all the roles in a domain.", 16725 // "flatPath": "admin/directory/v1/customer/{customer}/roles", 16726 // "httpMethod": "GET", 16727 // "id": "directory.roles.list", 16728 // "parameterOrder": [ 16729 // "customer" 16730 // ], 16731 // "parameters": { 16732 // "customer": { 16733 // "description": "Immutable ID of the G Suite account.", 16734 // "location": "path", 16735 // "required": true, 16736 // "type": "string" 16737 // }, 16738 // "maxResults": { 16739 // "description": "Maximum number of results to return.", 16740 // "format": "int32", 16741 // "location": "query", 16742 // "maximum": "100", 16743 // "minimum": "1", 16744 // "type": "integer" 16745 // }, 16746 // "pageToken": { 16747 // "description": "Token to specify the next page in the list.", 16748 // "location": "query", 16749 // "type": "string" 16750 // } 16751 // }, 16752 // "path": "admin/directory/v1/customer/{customer}/roles", 16753 // "response": { 16754 // "$ref": "Roles" 16755 // }, 16756 // "scopes": [ 16757 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 16758 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 16759 // ] 16760 // } 16761 16762} 16763 16764// Pages invokes f for each page of results. 16765// A non-nil error returned from f will halt the iteration. 16766// The provided context supersedes any context provided to the Context method. 16767func (c *RolesListCall) Pages(ctx context.Context, f func(*Roles) error) error { 16768 c.ctx_ = ctx 16769 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 16770 for { 16771 x, err := c.Do() 16772 if err != nil { 16773 return err 16774 } 16775 if err := f(x); err != nil { 16776 return err 16777 } 16778 if x.NextPageToken == "" { 16779 return nil 16780 } 16781 c.PageToken(x.NextPageToken) 16782 } 16783} 16784 16785// method id "directory.roles.patch": 16786 16787type RolesPatchCall struct { 16788 s *Service 16789 customer string 16790 roleId string 16791 role *Role 16792 urlParams_ gensupport.URLParams 16793 ctx_ context.Context 16794 header_ http.Header 16795} 16796 16797// Patch: Patch role via Apiary Patch Orchestration 16798func (r *RolesService) Patch(customer string, roleId string, role *Role) *RolesPatchCall { 16799 c := &RolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16800 c.customer = customer 16801 c.roleId = roleId 16802 c.role = role 16803 return c 16804} 16805 16806// Fields allows partial responses to be retrieved. See 16807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16808// for more information. 16809func (c *RolesPatchCall) Fields(s ...googleapi.Field) *RolesPatchCall { 16810 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16811 return c 16812} 16813 16814// Context sets the context to be used in this call's Do method. Any 16815// pending HTTP request will be aborted if the provided context is 16816// canceled. 16817func (c *RolesPatchCall) Context(ctx context.Context) *RolesPatchCall { 16818 c.ctx_ = ctx 16819 return c 16820} 16821 16822// Header returns an http.Header that can be modified by the caller to 16823// add HTTP headers to the request. 16824func (c *RolesPatchCall) Header() http.Header { 16825 if c.header_ == nil { 16826 c.header_ = make(http.Header) 16827 } 16828 return c.header_ 16829} 16830 16831func (c *RolesPatchCall) doRequest(alt string) (*http.Response, error) { 16832 reqHeaders := make(http.Header) 16833 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16834 for k, v := range c.header_ { 16835 reqHeaders[k] = v 16836 } 16837 reqHeaders.Set("User-Agent", c.s.userAgent()) 16838 var body io.Reader = nil 16839 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 16840 if err != nil { 16841 return nil, err 16842 } 16843 reqHeaders.Set("Content-Type", "application/json") 16844 c.urlParams_.Set("alt", alt) 16845 c.urlParams_.Set("prettyPrint", "false") 16846 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 16847 urls += "?" + c.urlParams_.Encode() 16848 req, err := http.NewRequest("PATCH", urls, body) 16849 if err != nil { 16850 return nil, err 16851 } 16852 req.Header = reqHeaders 16853 googleapi.Expand(req.URL, map[string]string{ 16854 "customer": c.customer, 16855 "roleId": c.roleId, 16856 }) 16857 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16858} 16859 16860// Do executes the "directory.roles.patch" call. 16861// Exactly one of *Role or error will be non-nil. Any non-2xx status 16862// code is an error. Response headers are in either 16863// *Role.ServerResponse.Header or (if a response was returned at all) in 16864// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 16865// whether the returned error was because http.StatusNotModified was 16866// returned. 16867func (c *RolesPatchCall) Do(opts ...googleapi.CallOption) (*Role, error) { 16868 gensupport.SetOptions(c.urlParams_, opts...) 16869 res, err := c.doRequest("json") 16870 if res != nil && res.StatusCode == http.StatusNotModified { 16871 if res.Body != nil { 16872 res.Body.Close() 16873 } 16874 return nil, &googleapi.Error{ 16875 Code: res.StatusCode, 16876 Header: res.Header, 16877 } 16878 } 16879 if err != nil { 16880 return nil, err 16881 } 16882 defer googleapi.CloseBody(res) 16883 if err := googleapi.CheckResponse(res); err != nil { 16884 return nil, err 16885 } 16886 ret := &Role{ 16887 ServerResponse: googleapi.ServerResponse{ 16888 Header: res.Header, 16889 HTTPStatusCode: res.StatusCode, 16890 }, 16891 } 16892 target := &ret 16893 if err := gensupport.DecodeResponse(target, res); err != nil { 16894 return nil, err 16895 } 16896 return ret, nil 16897 // { 16898 // "description": "Patch role via Apiary Patch Orchestration", 16899 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16900 // "httpMethod": "PATCH", 16901 // "id": "directory.roles.patch", 16902 // "parameterOrder": [ 16903 // "customer", 16904 // "roleId" 16905 // ], 16906 // "parameters": { 16907 // "customer": { 16908 // "description": "Immutable ID of the G Suite account.", 16909 // "location": "path", 16910 // "required": true, 16911 // "type": "string" 16912 // }, 16913 // "roleId": { 16914 // "description": "Immutable ID of the role.", 16915 // "location": "path", 16916 // "required": true, 16917 // "type": "string" 16918 // } 16919 // }, 16920 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 16921 // "request": { 16922 // "$ref": "Role" 16923 // }, 16924 // "response": { 16925 // "$ref": "Role" 16926 // }, 16927 // "scopes": [ 16928 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 16929 // ] 16930 // } 16931 16932} 16933 16934// method id "directory.roles.update": 16935 16936type RolesUpdateCall struct { 16937 s *Service 16938 customer string 16939 roleId string 16940 role *Role 16941 urlParams_ gensupport.URLParams 16942 ctx_ context.Context 16943 header_ http.Header 16944} 16945 16946// Update: Updates a role. 16947func (r *RolesService) Update(customer string, roleId string, role *Role) *RolesUpdateCall { 16948 c := &RolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16949 c.customer = customer 16950 c.roleId = roleId 16951 c.role = role 16952 return c 16953} 16954 16955// Fields allows partial responses to be retrieved. See 16956// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16957// for more information. 16958func (c *RolesUpdateCall) Fields(s ...googleapi.Field) *RolesUpdateCall { 16959 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16960 return c 16961} 16962 16963// Context sets the context to be used in this call's Do method. Any 16964// pending HTTP request will be aborted if the provided context is 16965// canceled. 16966func (c *RolesUpdateCall) Context(ctx context.Context) *RolesUpdateCall { 16967 c.ctx_ = ctx 16968 return c 16969} 16970 16971// Header returns an http.Header that can be modified by the caller to 16972// add HTTP headers to the request. 16973func (c *RolesUpdateCall) Header() http.Header { 16974 if c.header_ == nil { 16975 c.header_ = make(http.Header) 16976 } 16977 return c.header_ 16978} 16979 16980func (c *RolesUpdateCall) doRequest(alt string) (*http.Response, error) { 16981 reqHeaders := make(http.Header) 16982 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 16983 for k, v := range c.header_ { 16984 reqHeaders[k] = v 16985 } 16986 reqHeaders.Set("User-Agent", c.s.userAgent()) 16987 var body io.Reader = nil 16988 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 16989 if err != nil { 16990 return nil, err 16991 } 16992 reqHeaders.Set("Content-Type", "application/json") 16993 c.urlParams_.Set("alt", alt) 16994 c.urlParams_.Set("prettyPrint", "false") 16995 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 16996 urls += "?" + c.urlParams_.Encode() 16997 req, err := http.NewRequest("PUT", urls, body) 16998 if err != nil { 16999 return nil, err 17000 } 17001 req.Header = reqHeaders 17002 googleapi.Expand(req.URL, map[string]string{ 17003 "customer": c.customer, 17004 "roleId": c.roleId, 17005 }) 17006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17007} 17008 17009// Do executes the "directory.roles.update" call. 17010// Exactly one of *Role or error will be non-nil. Any non-2xx status 17011// code is an error. Response headers are in either 17012// *Role.ServerResponse.Header or (if a response was returned at all) in 17013// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 17014// whether the returned error was because http.StatusNotModified was 17015// returned. 17016func (c *RolesUpdateCall) Do(opts ...googleapi.CallOption) (*Role, error) { 17017 gensupport.SetOptions(c.urlParams_, opts...) 17018 res, err := c.doRequest("json") 17019 if res != nil && res.StatusCode == http.StatusNotModified { 17020 if res.Body != nil { 17021 res.Body.Close() 17022 } 17023 return nil, &googleapi.Error{ 17024 Code: res.StatusCode, 17025 Header: res.Header, 17026 } 17027 } 17028 if err != nil { 17029 return nil, err 17030 } 17031 defer googleapi.CloseBody(res) 17032 if err := googleapi.CheckResponse(res); err != nil { 17033 return nil, err 17034 } 17035 ret := &Role{ 17036 ServerResponse: googleapi.ServerResponse{ 17037 Header: res.Header, 17038 HTTPStatusCode: res.StatusCode, 17039 }, 17040 } 17041 target := &ret 17042 if err := gensupport.DecodeResponse(target, res); err != nil { 17043 return nil, err 17044 } 17045 return ret, nil 17046 // { 17047 // "description": "Updates a role.", 17048 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 17049 // "httpMethod": "PUT", 17050 // "id": "directory.roles.update", 17051 // "parameterOrder": [ 17052 // "customer", 17053 // "roleId" 17054 // ], 17055 // "parameters": { 17056 // "customer": { 17057 // "description": "Immutable ID of the G Suite account.", 17058 // "location": "path", 17059 // "required": true, 17060 // "type": "string" 17061 // }, 17062 // "roleId": { 17063 // "description": "Immutable ID of the role.", 17064 // "location": "path", 17065 // "required": true, 17066 // "type": "string" 17067 // } 17068 // }, 17069 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 17070 // "request": { 17071 // "$ref": "Role" 17072 // }, 17073 // "response": { 17074 // "$ref": "Role" 17075 // }, 17076 // "scopes": [ 17077 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 17078 // ] 17079 // } 17080 17081} 17082 17083// method id "directory.schemas.delete": 17084 17085type SchemasDeleteCall struct { 17086 s *Service 17087 customerId string 17088 schemaKey string 17089 urlParams_ gensupport.URLParams 17090 ctx_ context.Context 17091 header_ http.Header 17092} 17093 17094// Delete: Delete schema 17095func (r *SchemasService) Delete(customerId string, schemaKey string) *SchemasDeleteCall { 17096 c := &SchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17097 c.customerId = customerId 17098 c.schemaKey = schemaKey 17099 return c 17100} 17101 17102// Fields allows partial responses to be retrieved. See 17103// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17104// for more information. 17105func (c *SchemasDeleteCall) Fields(s ...googleapi.Field) *SchemasDeleteCall { 17106 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17107 return c 17108} 17109 17110// Context sets the context to be used in this call's Do method. Any 17111// pending HTTP request will be aborted if the provided context is 17112// canceled. 17113func (c *SchemasDeleteCall) Context(ctx context.Context) *SchemasDeleteCall { 17114 c.ctx_ = ctx 17115 return c 17116} 17117 17118// Header returns an http.Header that can be modified by the caller to 17119// add HTTP headers to the request. 17120func (c *SchemasDeleteCall) Header() http.Header { 17121 if c.header_ == nil { 17122 c.header_ = make(http.Header) 17123 } 17124 return c.header_ 17125} 17126 17127func (c *SchemasDeleteCall) doRequest(alt string) (*http.Response, error) { 17128 reqHeaders := make(http.Header) 17129 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17130 for k, v := range c.header_ { 17131 reqHeaders[k] = v 17132 } 17133 reqHeaders.Set("User-Agent", c.s.userAgent()) 17134 var body io.Reader = nil 17135 c.urlParams_.Set("alt", alt) 17136 c.urlParams_.Set("prettyPrint", "false") 17137 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 17138 urls += "?" + c.urlParams_.Encode() 17139 req, err := http.NewRequest("DELETE", urls, body) 17140 if err != nil { 17141 return nil, err 17142 } 17143 req.Header = reqHeaders 17144 googleapi.Expand(req.URL, map[string]string{ 17145 "customerId": c.customerId, 17146 "schemaKey": c.schemaKey, 17147 }) 17148 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17149} 17150 17151// Do executes the "directory.schemas.delete" call. 17152func (c *SchemasDeleteCall) Do(opts ...googleapi.CallOption) error { 17153 gensupport.SetOptions(c.urlParams_, opts...) 17154 res, err := c.doRequest("json") 17155 if err != nil { 17156 return err 17157 } 17158 defer googleapi.CloseBody(res) 17159 if err := googleapi.CheckResponse(res); err != nil { 17160 return err 17161 } 17162 return nil 17163 // { 17164 // "description": "Delete schema", 17165 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17166 // "httpMethod": "DELETE", 17167 // "id": "directory.schemas.delete", 17168 // "parameterOrder": [ 17169 // "customerId", 17170 // "schemaKey" 17171 // ], 17172 // "parameters": { 17173 // "customerId": { 17174 // "description": "Immutable ID of the G Suite account.", 17175 // "location": "path", 17176 // "required": true, 17177 // "type": "string" 17178 // }, 17179 // "schemaKey": { 17180 // "description": "Name or immutable ID of the schema.", 17181 // "location": "path", 17182 // "required": true, 17183 // "type": "string" 17184 // } 17185 // }, 17186 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17187 // "scopes": [ 17188 // "https://www.googleapis.com/auth/admin.directory.userschema" 17189 // ] 17190 // } 17191 17192} 17193 17194// method id "directory.schemas.get": 17195 17196type SchemasGetCall struct { 17197 s *Service 17198 customerId string 17199 schemaKey string 17200 urlParams_ gensupport.URLParams 17201 ifNoneMatch_ string 17202 ctx_ context.Context 17203 header_ http.Header 17204} 17205 17206// Get: Retrieve schema 17207func (r *SchemasService) Get(customerId string, schemaKey string) *SchemasGetCall { 17208 c := &SchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17209 c.customerId = customerId 17210 c.schemaKey = schemaKey 17211 return c 17212} 17213 17214// Fields allows partial responses to be retrieved. See 17215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17216// for more information. 17217func (c *SchemasGetCall) Fields(s ...googleapi.Field) *SchemasGetCall { 17218 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17219 return c 17220} 17221 17222// IfNoneMatch sets the optional parameter which makes the operation 17223// fail if the object's ETag matches the given value. This is useful for 17224// getting updates only after the object has changed since the last 17225// request. Use googleapi.IsNotModified to check whether the response 17226// error from Do is the result of In-None-Match. 17227func (c *SchemasGetCall) IfNoneMatch(entityTag string) *SchemasGetCall { 17228 c.ifNoneMatch_ = entityTag 17229 return c 17230} 17231 17232// Context sets the context to be used in this call's Do method. Any 17233// pending HTTP request will be aborted if the provided context is 17234// canceled. 17235func (c *SchemasGetCall) Context(ctx context.Context) *SchemasGetCall { 17236 c.ctx_ = ctx 17237 return c 17238} 17239 17240// Header returns an http.Header that can be modified by the caller to 17241// add HTTP headers to the request. 17242func (c *SchemasGetCall) Header() http.Header { 17243 if c.header_ == nil { 17244 c.header_ = make(http.Header) 17245 } 17246 return c.header_ 17247} 17248 17249func (c *SchemasGetCall) doRequest(alt string) (*http.Response, error) { 17250 reqHeaders := make(http.Header) 17251 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17252 for k, v := range c.header_ { 17253 reqHeaders[k] = v 17254 } 17255 reqHeaders.Set("User-Agent", c.s.userAgent()) 17256 if c.ifNoneMatch_ != "" { 17257 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17258 } 17259 var body io.Reader = nil 17260 c.urlParams_.Set("alt", alt) 17261 c.urlParams_.Set("prettyPrint", "false") 17262 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 17263 urls += "?" + c.urlParams_.Encode() 17264 req, err := http.NewRequest("GET", urls, body) 17265 if err != nil { 17266 return nil, err 17267 } 17268 req.Header = reqHeaders 17269 googleapi.Expand(req.URL, map[string]string{ 17270 "customerId": c.customerId, 17271 "schemaKey": c.schemaKey, 17272 }) 17273 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17274} 17275 17276// Do executes the "directory.schemas.get" call. 17277// Exactly one of *Schema or error will be non-nil. Any non-2xx status 17278// code is an error. Response headers are in either 17279// *Schema.ServerResponse.Header or (if a response was returned at all) 17280// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17281// check whether the returned error was because http.StatusNotModified 17282// was returned. 17283func (c *SchemasGetCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 17284 gensupport.SetOptions(c.urlParams_, opts...) 17285 res, err := c.doRequest("json") 17286 if res != nil && res.StatusCode == http.StatusNotModified { 17287 if res.Body != nil { 17288 res.Body.Close() 17289 } 17290 return nil, &googleapi.Error{ 17291 Code: res.StatusCode, 17292 Header: res.Header, 17293 } 17294 } 17295 if err != nil { 17296 return nil, err 17297 } 17298 defer googleapi.CloseBody(res) 17299 if err := googleapi.CheckResponse(res); err != nil { 17300 return nil, err 17301 } 17302 ret := &Schema{ 17303 ServerResponse: googleapi.ServerResponse{ 17304 Header: res.Header, 17305 HTTPStatusCode: res.StatusCode, 17306 }, 17307 } 17308 target := &ret 17309 if err := gensupport.DecodeResponse(target, res); err != nil { 17310 return nil, err 17311 } 17312 return ret, nil 17313 // { 17314 // "description": "Retrieve schema", 17315 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17316 // "httpMethod": "GET", 17317 // "id": "directory.schemas.get", 17318 // "parameterOrder": [ 17319 // "customerId", 17320 // "schemaKey" 17321 // ], 17322 // "parameters": { 17323 // "customerId": { 17324 // "description": "Immutable ID of the G Suite account.", 17325 // "location": "path", 17326 // "required": true, 17327 // "type": "string" 17328 // }, 17329 // "schemaKey": { 17330 // "description": "Name or immutable ID of the schema.", 17331 // "location": "path", 17332 // "required": true, 17333 // "type": "string" 17334 // } 17335 // }, 17336 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17337 // "response": { 17338 // "$ref": "Schema" 17339 // }, 17340 // "scopes": [ 17341 // "https://www.googleapis.com/auth/admin.directory.userschema", 17342 // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 17343 // ] 17344 // } 17345 17346} 17347 17348// method id "directory.schemas.insert": 17349 17350type SchemasInsertCall struct { 17351 s *Service 17352 customerId string 17353 schema *Schema 17354 urlParams_ gensupport.URLParams 17355 ctx_ context.Context 17356 header_ http.Header 17357} 17358 17359// Insert: Create schema. 17360func (r *SchemasService) Insert(customerId string, schema *Schema) *SchemasInsertCall { 17361 c := &SchemasInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17362 c.customerId = customerId 17363 c.schema = schema 17364 return c 17365} 17366 17367// Fields allows partial responses to be retrieved. See 17368// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17369// for more information. 17370func (c *SchemasInsertCall) Fields(s ...googleapi.Field) *SchemasInsertCall { 17371 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17372 return c 17373} 17374 17375// Context sets the context to be used in this call's Do method. Any 17376// pending HTTP request will be aborted if the provided context is 17377// canceled. 17378func (c *SchemasInsertCall) Context(ctx context.Context) *SchemasInsertCall { 17379 c.ctx_ = ctx 17380 return c 17381} 17382 17383// Header returns an http.Header that can be modified by the caller to 17384// add HTTP headers to the request. 17385func (c *SchemasInsertCall) Header() http.Header { 17386 if c.header_ == nil { 17387 c.header_ = make(http.Header) 17388 } 17389 return c.header_ 17390} 17391 17392func (c *SchemasInsertCall) doRequest(alt string) (*http.Response, error) { 17393 reqHeaders := make(http.Header) 17394 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17395 for k, v := range c.header_ { 17396 reqHeaders[k] = v 17397 } 17398 reqHeaders.Set("User-Agent", c.s.userAgent()) 17399 var body io.Reader = nil 17400 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 17401 if err != nil { 17402 return nil, err 17403 } 17404 reqHeaders.Set("Content-Type", "application/json") 17405 c.urlParams_.Set("alt", alt) 17406 c.urlParams_.Set("prettyPrint", "false") 17407 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas") 17408 urls += "?" + c.urlParams_.Encode() 17409 req, err := http.NewRequest("POST", urls, body) 17410 if err != nil { 17411 return nil, err 17412 } 17413 req.Header = reqHeaders 17414 googleapi.Expand(req.URL, map[string]string{ 17415 "customerId": c.customerId, 17416 }) 17417 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17418} 17419 17420// Do executes the "directory.schemas.insert" call. 17421// Exactly one of *Schema or error will be non-nil. Any non-2xx status 17422// code is an error. Response headers are in either 17423// *Schema.ServerResponse.Header or (if a response was returned at all) 17424// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17425// check whether the returned error was because http.StatusNotModified 17426// was returned. 17427func (c *SchemasInsertCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 17428 gensupport.SetOptions(c.urlParams_, opts...) 17429 res, err := c.doRequest("json") 17430 if res != nil && res.StatusCode == http.StatusNotModified { 17431 if res.Body != nil { 17432 res.Body.Close() 17433 } 17434 return nil, &googleapi.Error{ 17435 Code: res.StatusCode, 17436 Header: res.Header, 17437 } 17438 } 17439 if err != nil { 17440 return nil, err 17441 } 17442 defer googleapi.CloseBody(res) 17443 if err := googleapi.CheckResponse(res); err != nil { 17444 return nil, err 17445 } 17446 ret := &Schema{ 17447 ServerResponse: googleapi.ServerResponse{ 17448 Header: res.Header, 17449 HTTPStatusCode: res.StatusCode, 17450 }, 17451 } 17452 target := &ret 17453 if err := gensupport.DecodeResponse(target, res); err != nil { 17454 return nil, err 17455 } 17456 return ret, nil 17457 // { 17458 // "description": "Create schema.", 17459 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas", 17460 // "httpMethod": "POST", 17461 // "id": "directory.schemas.insert", 17462 // "parameterOrder": [ 17463 // "customerId" 17464 // ], 17465 // "parameters": { 17466 // "customerId": { 17467 // "description": "Immutable ID of the G Suite account.", 17468 // "location": "path", 17469 // "required": true, 17470 // "type": "string" 17471 // } 17472 // }, 17473 // "path": "admin/directory/v1/customer/{customerId}/schemas", 17474 // "request": { 17475 // "$ref": "Schema" 17476 // }, 17477 // "response": { 17478 // "$ref": "Schema" 17479 // }, 17480 // "scopes": [ 17481 // "https://www.googleapis.com/auth/admin.directory.userschema" 17482 // ] 17483 // } 17484 17485} 17486 17487// method id "directory.schemas.list": 17488 17489type SchemasListCall struct { 17490 s *Service 17491 customerId string 17492 urlParams_ gensupport.URLParams 17493 ifNoneMatch_ string 17494 ctx_ context.Context 17495 header_ http.Header 17496} 17497 17498// List: Retrieve all schemas for a customer 17499func (r *SchemasService) List(customerId string) *SchemasListCall { 17500 c := &SchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17501 c.customerId = customerId 17502 return c 17503} 17504 17505// Fields allows partial responses to be retrieved. See 17506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17507// for more information. 17508func (c *SchemasListCall) Fields(s ...googleapi.Field) *SchemasListCall { 17509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17510 return c 17511} 17512 17513// IfNoneMatch sets the optional parameter which makes the operation 17514// fail if the object's ETag matches the given value. This is useful for 17515// getting updates only after the object has changed since the last 17516// request. Use googleapi.IsNotModified to check whether the response 17517// error from Do is the result of In-None-Match. 17518func (c *SchemasListCall) IfNoneMatch(entityTag string) *SchemasListCall { 17519 c.ifNoneMatch_ = entityTag 17520 return c 17521} 17522 17523// Context sets the context to be used in this call's Do method. Any 17524// pending HTTP request will be aborted if the provided context is 17525// canceled. 17526func (c *SchemasListCall) Context(ctx context.Context) *SchemasListCall { 17527 c.ctx_ = ctx 17528 return c 17529} 17530 17531// Header returns an http.Header that can be modified by the caller to 17532// add HTTP headers to the request. 17533func (c *SchemasListCall) Header() http.Header { 17534 if c.header_ == nil { 17535 c.header_ = make(http.Header) 17536 } 17537 return c.header_ 17538} 17539 17540func (c *SchemasListCall) doRequest(alt string) (*http.Response, error) { 17541 reqHeaders := make(http.Header) 17542 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17543 for k, v := range c.header_ { 17544 reqHeaders[k] = v 17545 } 17546 reqHeaders.Set("User-Agent", c.s.userAgent()) 17547 if c.ifNoneMatch_ != "" { 17548 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17549 } 17550 var body io.Reader = nil 17551 c.urlParams_.Set("alt", alt) 17552 c.urlParams_.Set("prettyPrint", "false") 17553 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas") 17554 urls += "?" + c.urlParams_.Encode() 17555 req, err := http.NewRequest("GET", urls, body) 17556 if err != nil { 17557 return nil, err 17558 } 17559 req.Header = reqHeaders 17560 googleapi.Expand(req.URL, map[string]string{ 17561 "customerId": c.customerId, 17562 }) 17563 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17564} 17565 17566// Do executes the "directory.schemas.list" call. 17567// Exactly one of *Schemas or error will be non-nil. Any non-2xx status 17568// code is an error. Response headers are in either 17569// *Schemas.ServerResponse.Header or (if a response was returned at all) 17570// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17571// check whether the returned error was because http.StatusNotModified 17572// was returned. 17573func (c *SchemasListCall) Do(opts ...googleapi.CallOption) (*Schemas, error) { 17574 gensupport.SetOptions(c.urlParams_, opts...) 17575 res, err := c.doRequest("json") 17576 if res != nil && res.StatusCode == http.StatusNotModified { 17577 if res.Body != nil { 17578 res.Body.Close() 17579 } 17580 return nil, &googleapi.Error{ 17581 Code: res.StatusCode, 17582 Header: res.Header, 17583 } 17584 } 17585 if err != nil { 17586 return nil, err 17587 } 17588 defer googleapi.CloseBody(res) 17589 if err := googleapi.CheckResponse(res); err != nil { 17590 return nil, err 17591 } 17592 ret := &Schemas{ 17593 ServerResponse: googleapi.ServerResponse{ 17594 Header: res.Header, 17595 HTTPStatusCode: res.StatusCode, 17596 }, 17597 } 17598 target := &ret 17599 if err := gensupport.DecodeResponse(target, res); err != nil { 17600 return nil, err 17601 } 17602 return ret, nil 17603 // { 17604 // "description": "Retrieve all schemas for a customer", 17605 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas", 17606 // "httpMethod": "GET", 17607 // "id": "directory.schemas.list", 17608 // "parameterOrder": [ 17609 // "customerId" 17610 // ], 17611 // "parameters": { 17612 // "customerId": { 17613 // "description": "Immutable ID of the G Suite account.", 17614 // "location": "path", 17615 // "required": true, 17616 // "type": "string" 17617 // } 17618 // }, 17619 // "path": "admin/directory/v1/customer/{customerId}/schemas", 17620 // "response": { 17621 // "$ref": "Schemas" 17622 // }, 17623 // "scopes": [ 17624 // "https://www.googleapis.com/auth/admin.directory.userschema", 17625 // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 17626 // ] 17627 // } 17628 17629} 17630 17631// method id "directory.schemas.patch": 17632 17633type SchemasPatchCall struct { 17634 s *Service 17635 customerId string 17636 schemaKey string 17637 schema *Schema 17638 urlParams_ gensupport.URLParams 17639 ctx_ context.Context 17640 header_ http.Header 17641} 17642 17643// Patch: Patch Schema via Apiary Patch Orchestration 17644func (r *SchemasService) Patch(customerId string, schemaKey string, schema *Schema) *SchemasPatchCall { 17645 c := &SchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17646 c.customerId = customerId 17647 c.schemaKey = schemaKey 17648 c.schema = schema 17649 return c 17650} 17651 17652// Fields allows partial responses to be retrieved. See 17653// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17654// for more information. 17655func (c *SchemasPatchCall) Fields(s ...googleapi.Field) *SchemasPatchCall { 17656 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17657 return c 17658} 17659 17660// Context sets the context to be used in this call's Do method. Any 17661// pending HTTP request will be aborted if the provided context is 17662// canceled. 17663func (c *SchemasPatchCall) Context(ctx context.Context) *SchemasPatchCall { 17664 c.ctx_ = ctx 17665 return c 17666} 17667 17668// Header returns an http.Header that can be modified by the caller to 17669// add HTTP headers to the request. 17670func (c *SchemasPatchCall) Header() http.Header { 17671 if c.header_ == nil { 17672 c.header_ = make(http.Header) 17673 } 17674 return c.header_ 17675} 17676 17677func (c *SchemasPatchCall) doRequest(alt string) (*http.Response, error) { 17678 reqHeaders := make(http.Header) 17679 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17680 for k, v := range c.header_ { 17681 reqHeaders[k] = v 17682 } 17683 reqHeaders.Set("User-Agent", c.s.userAgent()) 17684 var body io.Reader = nil 17685 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 17686 if err != nil { 17687 return nil, err 17688 } 17689 reqHeaders.Set("Content-Type", "application/json") 17690 c.urlParams_.Set("alt", alt) 17691 c.urlParams_.Set("prettyPrint", "false") 17692 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 17693 urls += "?" + c.urlParams_.Encode() 17694 req, err := http.NewRequest("PATCH", urls, body) 17695 if err != nil { 17696 return nil, err 17697 } 17698 req.Header = reqHeaders 17699 googleapi.Expand(req.URL, map[string]string{ 17700 "customerId": c.customerId, 17701 "schemaKey": c.schemaKey, 17702 }) 17703 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17704} 17705 17706// Do executes the "directory.schemas.patch" call. 17707// Exactly one of *Schema or error will be non-nil. Any non-2xx status 17708// code is an error. Response headers are in either 17709// *Schema.ServerResponse.Header or (if a response was returned at all) 17710// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17711// check whether the returned error was because http.StatusNotModified 17712// was returned. 17713func (c *SchemasPatchCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 17714 gensupport.SetOptions(c.urlParams_, opts...) 17715 res, err := c.doRequest("json") 17716 if res != nil && res.StatusCode == http.StatusNotModified { 17717 if res.Body != nil { 17718 res.Body.Close() 17719 } 17720 return nil, &googleapi.Error{ 17721 Code: res.StatusCode, 17722 Header: res.Header, 17723 } 17724 } 17725 if err != nil { 17726 return nil, err 17727 } 17728 defer googleapi.CloseBody(res) 17729 if err := googleapi.CheckResponse(res); err != nil { 17730 return nil, err 17731 } 17732 ret := &Schema{ 17733 ServerResponse: googleapi.ServerResponse{ 17734 Header: res.Header, 17735 HTTPStatusCode: res.StatusCode, 17736 }, 17737 } 17738 target := &ret 17739 if err := gensupport.DecodeResponse(target, res); err != nil { 17740 return nil, err 17741 } 17742 return ret, nil 17743 // { 17744 // "description": "Patch Schema via Apiary Patch Orchestration", 17745 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17746 // "httpMethod": "PATCH", 17747 // "id": "directory.schemas.patch", 17748 // "parameterOrder": [ 17749 // "customerId", 17750 // "schemaKey" 17751 // ], 17752 // "parameters": { 17753 // "customerId": { 17754 // "description": "Immutable ID of the G Suite account.", 17755 // "location": "path", 17756 // "required": true, 17757 // "type": "string" 17758 // }, 17759 // "schemaKey": { 17760 // "description": "Name or immutable ID of the schema.", 17761 // "location": "path", 17762 // "required": true, 17763 // "type": "string" 17764 // } 17765 // }, 17766 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17767 // "request": { 17768 // "$ref": "Schema" 17769 // }, 17770 // "response": { 17771 // "$ref": "Schema" 17772 // }, 17773 // "scopes": [ 17774 // "https://www.googleapis.com/auth/admin.directory.userschema" 17775 // ] 17776 // } 17777 17778} 17779 17780// method id "directory.schemas.update": 17781 17782type SchemasUpdateCall struct { 17783 s *Service 17784 customerId string 17785 schemaKey string 17786 schema *Schema 17787 urlParams_ gensupport.URLParams 17788 ctx_ context.Context 17789 header_ http.Header 17790} 17791 17792// Update: Update schema 17793func (r *SchemasService) Update(customerId string, schemaKey string, schema *Schema) *SchemasUpdateCall { 17794 c := &SchemasUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17795 c.customerId = customerId 17796 c.schemaKey = schemaKey 17797 c.schema = schema 17798 return c 17799} 17800 17801// Fields allows partial responses to be retrieved. See 17802// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17803// for more information. 17804func (c *SchemasUpdateCall) Fields(s ...googleapi.Field) *SchemasUpdateCall { 17805 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17806 return c 17807} 17808 17809// Context sets the context to be used in this call's Do method. Any 17810// pending HTTP request will be aborted if the provided context is 17811// canceled. 17812func (c *SchemasUpdateCall) Context(ctx context.Context) *SchemasUpdateCall { 17813 c.ctx_ = ctx 17814 return c 17815} 17816 17817// Header returns an http.Header that can be modified by the caller to 17818// add HTTP headers to the request. 17819func (c *SchemasUpdateCall) Header() http.Header { 17820 if c.header_ == nil { 17821 c.header_ = make(http.Header) 17822 } 17823 return c.header_ 17824} 17825 17826func (c *SchemasUpdateCall) doRequest(alt string) (*http.Response, error) { 17827 reqHeaders := make(http.Header) 17828 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17829 for k, v := range c.header_ { 17830 reqHeaders[k] = v 17831 } 17832 reqHeaders.Set("User-Agent", c.s.userAgent()) 17833 var body io.Reader = nil 17834 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 17835 if err != nil { 17836 return nil, err 17837 } 17838 reqHeaders.Set("Content-Type", "application/json") 17839 c.urlParams_.Set("alt", alt) 17840 c.urlParams_.Set("prettyPrint", "false") 17841 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 17842 urls += "?" + c.urlParams_.Encode() 17843 req, err := http.NewRequest("PUT", urls, body) 17844 if err != nil { 17845 return nil, err 17846 } 17847 req.Header = reqHeaders 17848 googleapi.Expand(req.URL, map[string]string{ 17849 "customerId": c.customerId, 17850 "schemaKey": c.schemaKey, 17851 }) 17852 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17853} 17854 17855// Do executes the "directory.schemas.update" call. 17856// Exactly one of *Schema or error will be non-nil. Any non-2xx status 17857// code is an error. Response headers are in either 17858// *Schema.ServerResponse.Header or (if a response was returned at all) 17859// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17860// check whether the returned error was because http.StatusNotModified 17861// was returned. 17862func (c *SchemasUpdateCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 17863 gensupport.SetOptions(c.urlParams_, opts...) 17864 res, err := c.doRequest("json") 17865 if res != nil && res.StatusCode == http.StatusNotModified { 17866 if res.Body != nil { 17867 res.Body.Close() 17868 } 17869 return nil, &googleapi.Error{ 17870 Code: res.StatusCode, 17871 Header: res.Header, 17872 } 17873 } 17874 if err != nil { 17875 return nil, err 17876 } 17877 defer googleapi.CloseBody(res) 17878 if err := googleapi.CheckResponse(res); err != nil { 17879 return nil, err 17880 } 17881 ret := &Schema{ 17882 ServerResponse: googleapi.ServerResponse{ 17883 Header: res.Header, 17884 HTTPStatusCode: res.StatusCode, 17885 }, 17886 } 17887 target := &ret 17888 if err := gensupport.DecodeResponse(target, res); err != nil { 17889 return nil, err 17890 } 17891 return ret, nil 17892 // { 17893 // "description": "Update schema", 17894 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17895 // "httpMethod": "PUT", 17896 // "id": "directory.schemas.update", 17897 // "parameterOrder": [ 17898 // "customerId", 17899 // "schemaKey" 17900 // ], 17901 // "parameters": { 17902 // "customerId": { 17903 // "description": "Immutable ID of the G Suite account.", 17904 // "location": "path", 17905 // "required": true, 17906 // "type": "string" 17907 // }, 17908 // "schemaKey": { 17909 // "description": "Name or immutable ID of the schema.", 17910 // "location": "path", 17911 // "required": true, 17912 // "type": "string" 17913 // } 17914 // }, 17915 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 17916 // "request": { 17917 // "$ref": "Schema" 17918 // }, 17919 // "response": { 17920 // "$ref": "Schema" 17921 // }, 17922 // "scopes": [ 17923 // "https://www.googleapis.com/auth/admin.directory.userschema" 17924 // ] 17925 // } 17926 17927} 17928 17929// method id "directory.tokens.delete": 17930 17931type TokensDeleteCall struct { 17932 s *Service 17933 userKey string 17934 clientId string 17935 urlParams_ gensupport.URLParams 17936 ctx_ context.Context 17937 header_ http.Header 17938} 17939 17940// Delete: Delete all access tokens issued by a user for an application. 17941func (r *TokensService) Delete(userKey string, clientId string) *TokensDeleteCall { 17942 c := &TokensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17943 c.userKey = userKey 17944 c.clientId = clientId 17945 return c 17946} 17947 17948// Fields allows partial responses to be retrieved. See 17949// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17950// for more information. 17951func (c *TokensDeleteCall) Fields(s ...googleapi.Field) *TokensDeleteCall { 17952 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17953 return c 17954} 17955 17956// Context sets the context to be used in this call's Do method. Any 17957// pending HTTP request will be aborted if the provided context is 17958// canceled. 17959func (c *TokensDeleteCall) Context(ctx context.Context) *TokensDeleteCall { 17960 c.ctx_ = ctx 17961 return c 17962} 17963 17964// Header returns an http.Header that can be modified by the caller to 17965// add HTTP headers to the request. 17966func (c *TokensDeleteCall) Header() http.Header { 17967 if c.header_ == nil { 17968 c.header_ = make(http.Header) 17969 } 17970 return c.header_ 17971} 17972 17973func (c *TokensDeleteCall) doRequest(alt string) (*http.Response, error) { 17974 reqHeaders := make(http.Header) 17975 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 17976 for k, v := range c.header_ { 17977 reqHeaders[k] = v 17978 } 17979 reqHeaders.Set("User-Agent", c.s.userAgent()) 17980 var body io.Reader = nil 17981 c.urlParams_.Set("alt", alt) 17982 c.urlParams_.Set("prettyPrint", "false") 17983 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") 17984 urls += "?" + c.urlParams_.Encode() 17985 req, err := http.NewRequest("DELETE", urls, body) 17986 if err != nil { 17987 return nil, err 17988 } 17989 req.Header = reqHeaders 17990 googleapi.Expand(req.URL, map[string]string{ 17991 "userKey": c.userKey, 17992 "clientId": c.clientId, 17993 }) 17994 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17995} 17996 17997// Do executes the "directory.tokens.delete" call. 17998func (c *TokensDeleteCall) Do(opts ...googleapi.CallOption) error { 17999 gensupport.SetOptions(c.urlParams_, opts...) 18000 res, err := c.doRequest("json") 18001 if err != nil { 18002 return err 18003 } 18004 defer googleapi.CloseBody(res) 18005 if err := googleapi.CheckResponse(res); err != nil { 18006 return err 18007 } 18008 return nil 18009 // { 18010 // "description": "Delete all access tokens issued by a user for an application.", 18011 // "flatPath": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 18012 // "httpMethod": "DELETE", 18013 // "id": "directory.tokens.delete", 18014 // "parameterOrder": [ 18015 // "userKey", 18016 // "clientId" 18017 // ], 18018 // "parameters": { 18019 // "clientId": { 18020 // "description": "The Client ID of the application the token is issued to.", 18021 // "location": "path", 18022 // "required": true, 18023 // "type": "string" 18024 // }, 18025 // "userKey": { 18026 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18027 // "location": "path", 18028 // "required": true, 18029 // "type": "string" 18030 // } 18031 // }, 18032 // "path": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 18033 // "scopes": [ 18034 // "https://www.googleapis.com/auth/admin.directory.user.security" 18035 // ] 18036 // } 18037 18038} 18039 18040// method id "directory.tokens.get": 18041 18042type TokensGetCall struct { 18043 s *Service 18044 userKey string 18045 clientId string 18046 urlParams_ gensupport.URLParams 18047 ifNoneMatch_ string 18048 ctx_ context.Context 18049 header_ http.Header 18050} 18051 18052// Get: Get information about an access token issued by a user. 18053func (r *TokensService) Get(userKey string, clientId string) *TokensGetCall { 18054 c := &TokensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18055 c.userKey = userKey 18056 c.clientId = clientId 18057 return c 18058} 18059 18060// Fields allows partial responses to be retrieved. See 18061// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18062// for more information. 18063func (c *TokensGetCall) Fields(s ...googleapi.Field) *TokensGetCall { 18064 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18065 return c 18066} 18067 18068// IfNoneMatch sets the optional parameter which makes the operation 18069// fail if the object's ETag matches the given value. This is useful for 18070// getting updates only after the object has changed since the last 18071// request. Use googleapi.IsNotModified to check whether the response 18072// error from Do is the result of In-None-Match. 18073func (c *TokensGetCall) IfNoneMatch(entityTag string) *TokensGetCall { 18074 c.ifNoneMatch_ = entityTag 18075 return c 18076} 18077 18078// Context sets the context to be used in this call's Do method. Any 18079// pending HTTP request will be aborted if the provided context is 18080// canceled. 18081func (c *TokensGetCall) Context(ctx context.Context) *TokensGetCall { 18082 c.ctx_ = ctx 18083 return c 18084} 18085 18086// Header returns an http.Header that can be modified by the caller to 18087// add HTTP headers to the request. 18088func (c *TokensGetCall) Header() http.Header { 18089 if c.header_ == nil { 18090 c.header_ = make(http.Header) 18091 } 18092 return c.header_ 18093} 18094 18095func (c *TokensGetCall) doRequest(alt string) (*http.Response, error) { 18096 reqHeaders := make(http.Header) 18097 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18098 for k, v := range c.header_ { 18099 reqHeaders[k] = v 18100 } 18101 reqHeaders.Set("User-Agent", c.s.userAgent()) 18102 if c.ifNoneMatch_ != "" { 18103 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18104 } 18105 var body io.Reader = nil 18106 c.urlParams_.Set("alt", alt) 18107 c.urlParams_.Set("prettyPrint", "false") 18108 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") 18109 urls += "?" + c.urlParams_.Encode() 18110 req, err := http.NewRequest("GET", urls, body) 18111 if err != nil { 18112 return nil, err 18113 } 18114 req.Header = reqHeaders 18115 googleapi.Expand(req.URL, map[string]string{ 18116 "userKey": c.userKey, 18117 "clientId": c.clientId, 18118 }) 18119 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18120} 18121 18122// Do executes the "directory.tokens.get" call. 18123// Exactly one of *Token or error will be non-nil. Any non-2xx status 18124// code is an error. Response headers are in either 18125// *Token.ServerResponse.Header or (if a response was returned at all) 18126// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18127// check whether the returned error was because http.StatusNotModified 18128// was returned. 18129func (c *TokensGetCall) Do(opts ...googleapi.CallOption) (*Token, error) { 18130 gensupport.SetOptions(c.urlParams_, opts...) 18131 res, err := c.doRequest("json") 18132 if res != nil && res.StatusCode == http.StatusNotModified { 18133 if res.Body != nil { 18134 res.Body.Close() 18135 } 18136 return nil, &googleapi.Error{ 18137 Code: res.StatusCode, 18138 Header: res.Header, 18139 } 18140 } 18141 if err != nil { 18142 return nil, err 18143 } 18144 defer googleapi.CloseBody(res) 18145 if err := googleapi.CheckResponse(res); err != nil { 18146 return nil, err 18147 } 18148 ret := &Token{ 18149 ServerResponse: googleapi.ServerResponse{ 18150 Header: res.Header, 18151 HTTPStatusCode: res.StatusCode, 18152 }, 18153 } 18154 target := &ret 18155 if err := gensupport.DecodeResponse(target, res); err != nil { 18156 return nil, err 18157 } 18158 return ret, nil 18159 // { 18160 // "description": "Get information about an access token issued by a user.", 18161 // "flatPath": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 18162 // "httpMethod": "GET", 18163 // "id": "directory.tokens.get", 18164 // "parameterOrder": [ 18165 // "userKey", 18166 // "clientId" 18167 // ], 18168 // "parameters": { 18169 // "clientId": { 18170 // "description": "The Client ID of the application the token is issued to.", 18171 // "location": "path", 18172 // "required": true, 18173 // "type": "string" 18174 // }, 18175 // "userKey": { 18176 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18177 // "location": "path", 18178 // "required": true, 18179 // "type": "string" 18180 // } 18181 // }, 18182 // "path": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 18183 // "response": { 18184 // "$ref": "Token" 18185 // }, 18186 // "scopes": [ 18187 // "https://www.googleapis.com/auth/admin.directory.user.security" 18188 // ] 18189 // } 18190 18191} 18192 18193// method id "directory.tokens.list": 18194 18195type TokensListCall struct { 18196 s *Service 18197 userKey string 18198 urlParams_ gensupport.URLParams 18199 ifNoneMatch_ string 18200 ctx_ context.Context 18201 header_ http.Header 18202} 18203 18204// List: Returns the set of tokens specified user has issued to 3rd 18205// party applications. 18206func (r *TokensService) List(userKey string) *TokensListCall { 18207 c := &TokensListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18208 c.userKey = userKey 18209 return c 18210} 18211 18212// Fields allows partial responses to be retrieved. See 18213// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18214// for more information. 18215func (c *TokensListCall) Fields(s ...googleapi.Field) *TokensListCall { 18216 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18217 return c 18218} 18219 18220// IfNoneMatch sets the optional parameter which makes the operation 18221// fail if the object's ETag matches the given value. This is useful for 18222// getting updates only after the object has changed since the last 18223// request. Use googleapi.IsNotModified to check whether the response 18224// error from Do is the result of In-None-Match. 18225func (c *TokensListCall) IfNoneMatch(entityTag string) *TokensListCall { 18226 c.ifNoneMatch_ = entityTag 18227 return c 18228} 18229 18230// Context sets the context to be used in this call's Do method. Any 18231// pending HTTP request will be aborted if the provided context is 18232// canceled. 18233func (c *TokensListCall) Context(ctx context.Context) *TokensListCall { 18234 c.ctx_ = ctx 18235 return c 18236} 18237 18238// Header returns an http.Header that can be modified by the caller to 18239// add HTTP headers to the request. 18240func (c *TokensListCall) Header() http.Header { 18241 if c.header_ == nil { 18242 c.header_ = make(http.Header) 18243 } 18244 return c.header_ 18245} 18246 18247func (c *TokensListCall) doRequest(alt string) (*http.Response, error) { 18248 reqHeaders := make(http.Header) 18249 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18250 for k, v := range c.header_ { 18251 reqHeaders[k] = v 18252 } 18253 reqHeaders.Set("User-Agent", c.s.userAgent()) 18254 if c.ifNoneMatch_ != "" { 18255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18256 } 18257 var body io.Reader = nil 18258 c.urlParams_.Set("alt", alt) 18259 c.urlParams_.Set("prettyPrint", "false") 18260 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens") 18261 urls += "?" + c.urlParams_.Encode() 18262 req, err := http.NewRequest("GET", urls, body) 18263 if err != nil { 18264 return nil, err 18265 } 18266 req.Header = reqHeaders 18267 googleapi.Expand(req.URL, map[string]string{ 18268 "userKey": c.userKey, 18269 }) 18270 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18271} 18272 18273// Do executes the "directory.tokens.list" call. 18274// Exactly one of *Tokens or error will be non-nil. Any non-2xx status 18275// code is an error. Response headers are in either 18276// *Tokens.ServerResponse.Header or (if a response was returned at all) 18277// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 18278// check whether the returned error was because http.StatusNotModified 18279// was returned. 18280func (c *TokensListCall) Do(opts ...googleapi.CallOption) (*Tokens, error) { 18281 gensupport.SetOptions(c.urlParams_, opts...) 18282 res, err := c.doRequest("json") 18283 if res != nil && res.StatusCode == http.StatusNotModified { 18284 if res.Body != nil { 18285 res.Body.Close() 18286 } 18287 return nil, &googleapi.Error{ 18288 Code: res.StatusCode, 18289 Header: res.Header, 18290 } 18291 } 18292 if err != nil { 18293 return nil, err 18294 } 18295 defer googleapi.CloseBody(res) 18296 if err := googleapi.CheckResponse(res); err != nil { 18297 return nil, err 18298 } 18299 ret := &Tokens{ 18300 ServerResponse: googleapi.ServerResponse{ 18301 Header: res.Header, 18302 HTTPStatusCode: res.StatusCode, 18303 }, 18304 } 18305 target := &ret 18306 if err := gensupport.DecodeResponse(target, res); err != nil { 18307 return nil, err 18308 } 18309 return ret, nil 18310 // { 18311 // "description": "Returns the set of tokens specified user has issued to 3rd party applications.", 18312 // "flatPath": "admin/directory/v1/users/{userKey}/tokens", 18313 // "httpMethod": "GET", 18314 // "id": "directory.tokens.list", 18315 // "parameterOrder": [ 18316 // "userKey" 18317 // ], 18318 // "parameters": { 18319 // "userKey": { 18320 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18321 // "location": "path", 18322 // "required": true, 18323 // "type": "string" 18324 // } 18325 // }, 18326 // "path": "admin/directory/v1/users/{userKey}/tokens", 18327 // "response": { 18328 // "$ref": "Tokens" 18329 // }, 18330 // "scopes": [ 18331 // "https://www.googleapis.com/auth/admin.directory.user.security" 18332 // ] 18333 // } 18334 18335} 18336 18337// method id "directory.twoStepVerification.turnOff": 18338 18339type TwoStepVerificationTurnOffCall struct { 18340 s *Service 18341 userKey string 18342 urlParams_ gensupport.URLParams 18343 ctx_ context.Context 18344 header_ http.Header 18345} 18346 18347// TurnOff: Turn off 2-Step Verification for user. 18348func (r *TwoStepVerificationService) TurnOff(userKey string) *TwoStepVerificationTurnOffCall { 18349 c := &TwoStepVerificationTurnOffCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18350 c.userKey = userKey 18351 return c 18352} 18353 18354// Fields allows partial responses to be retrieved. See 18355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18356// for more information. 18357func (c *TwoStepVerificationTurnOffCall) Fields(s ...googleapi.Field) *TwoStepVerificationTurnOffCall { 18358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18359 return c 18360} 18361 18362// Context sets the context to be used in this call's Do method. Any 18363// pending HTTP request will be aborted if the provided context is 18364// canceled. 18365func (c *TwoStepVerificationTurnOffCall) Context(ctx context.Context) *TwoStepVerificationTurnOffCall { 18366 c.ctx_ = ctx 18367 return c 18368} 18369 18370// Header returns an http.Header that can be modified by the caller to 18371// add HTTP headers to the request. 18372func (c *TwoStepVerificationTurnOffCall) Header() http.Header { 18373 if c.header_ == nil { 18374 c.header_ = make(http.Header) 18375 } 18376 return c.header_ 18377} 18378 18379func (c *TwoStepVerificationTurnOffCall) doRequest(alt string) (*http.Response, error) { 18380 reqHeaders := make(http.Header) 18381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18382 for k, v := range c.header_ { 18383 reqHeaders[k] = v 18384 } 18385 reqHeaders.Set("User-Agent", c.s.userAgent()) 18386 var body io.Reader = nil 18387 c.urlParams_.Set("alt", alt) 18388 c.urlParams_.Set("prettyPrint", "false") 18389 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff") 18390 urls += "?" + c.urlParams_.Encode() 18391 req, err := http.NewRequest("POST", urls, body) 18392 if err != nil { 18393 return nil, err 18394 } 18395 req.Header = reqHeaders 18396 googleapi.Expand(req.URL, map[string]string{ 18397 "userKey": c.userKey, 18398 }) 18399 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18400} 18401 18402// Do executes the "directory.twoStepVerification.turnOff" call. 18403func (c *TwoStepVerificationTurnOffCall) Do(opts ...googleapi.CallOption) error { 18404 gensupport.SetOptions(c.urlParams_, opts...) 18405 res, err := c.doRequest("json") 18406 if err != nil { 18407 return err 18408 } 18409 defer googleapi.CloseBody(res) 18410 if err := googleapi.CheckResponse(res); err != nil { 18411 return err 18412 } 18413 return nil 18414 // { 18415 // "description": "Turn off 2-Step Verification for user.", 18416 // "flatPath": "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff", 18417 // "httpMethod": "POST", 18418 // "id": "directory.twoStepVerification.turnOff", 18419 // "parameterOrder": [ 18420 // "userKey" 18421 // ], 18422 // "parameters": { 18423 // "userKey": { 18424 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18425 // "location": "path", 18426 // "required": true, 18427 // "type": "string" 18428 // } 18429 // }, 18430 // "path": "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff", 18431 // "scopes": [ 18432 // "https://www.googleapis.com/auth/admin.directory.user.security" 18433 // ] 18434 // } 18435 18436} 18437 18438// method id "directory.users.delete": 18439 18440type UsersDeleteCall struct { 18441 s *Service 18442 userKey string 18443 urlParams_ gensupport.URLParams 18444 ctx_ context.Context 18445 header_ http.Header 18446} 18447 18448// Delete: Deletes a user. 18449func (r *UsersService) Delete(userKey string) *UsersDeleteCall { 18450 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18451 c.userKey = userKey 18452 return c 18453} 18454 18455// Fields allows partial responses to be retrieved. See 18456// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18457// for more information. 18458func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 18459 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18460 return c 18461} 18462 18463// Context sets the context to be used in this call's Do method. Any 18464// pending HTTP request will be aborted if the provided context is 18465// canceled. 18466func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 18467 c.ctx_ = ctx 18468 return c 18469} 18470 18471// Header returns an http.Header that can be modified by the caller to 18472// add HTTP headers to the request. 18473func (c *UsersDeleteCall) Header() http.Header { 18474 if c.header_ == nil { 18475 c.header_ = make(http.Header) 18476 } 18477 return c.header_ 18478} 18479 18480func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 18481 reqHeaders := make(http.Header) 18482 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18483 for k, v := range c.header_ { 18484 reqHeaders[k] = v 18485 } 18486 reqHeaders.Set("User-Agent", c.s.userAgent()) 18487 var body io.Reader = nil 18488 c.urlParams_.Set("alt", alt) 18489 c.urlParams_.Set("prettyPrint", "false") 18490 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 18491 urls += "?" + c.urlParams_.Encode() 18492 req, err := http.NewRequest("DELETE", urls, body) 18493 if err != nil { 18494 return nil, err 18495 } 18496 req.Header = reqHeaders 18497 googleapi.Expand(req.URL, map[string]string{ 18498 "userKey": c.userKey, 18499 }) 18500 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18501} 18502 18503// Do executes the "directory.users.delete" call. 18504func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { 18505 gensupport.SetOptions(c.urlParams_, opts...) 18506 res, err := c.doRequest("json") 18507 if err != nil { 18508 return err 18509 } 18510 defer googleapi.CloseBody(res) 18511 if err := googleapi.CheckResponse(res); err != nil { 18512 return err 18513 } 18514 return nil 18515 // { 18516 // "description": "Deletes a user.", 18517 // "flatPath": "admin/directory/v1/users/{userKey}", 18518 // "httpMethod": "DELETE", 18519 // "id": "directory.users.delete", 18520 // "parameterOrder": [ 18521 // "userKey" 18522 // ], 18523 // "parameters": { 18524 // "userKey": { 18525 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18526 // "location": "path", 18527 // "required": true, 18528 // "type": "string" 18529 // } 18530 // }, 18531 // "path": "admin/directory/v1/users/{userKey}", 18532 // "scopes": [ 18533 // "https://www.googleapis.com/auth/admin.directory.user" 18534 // ] 18535 // } 18536 18537} 18538 18539// method id "directory.users.get": 18540 18541type UsersGetCall struct { 18542 s *Service 18543 userKey string 18544 urlParams_ gensupport.URLParams 18545 ifNoneMatch_ string 18546 ctx_ context.Context 18547 header_ http.Header 18548} 18549 18550// Get: Retrieves a user. 18551func (r *UsersService) Get(userKey string) *UsersGetCall { 18552 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18553 c.userKey = userKey 18554 return c 18555} 18556 18557// CustomFieldMask sets the optional parameter "customFieldMask": A 18558// comma-separated list of schema names. All fields from these schemas 18559// are fetched. This should only be set when `projection=custom`. 18560func (c *UsersGetCall) CustomFieldMask(customFieldMask string) *UsersGetCall { 18561 c.urlParams_.Set("customFieldMask", customFieldMask) 18562 return c 18563} 18564 18565// Projection sets the optional parameter "projection": What subset of 18566// fields to fetch for this user. 18567// 18568// Possible values: 18569// "projectionUndefined" 18570// "basic" (default) - Do not include any custom fields for the user. 18571// "custom" - Include custom fields from schemas requested in 18572// `customFieldMask`. 18573// "full" - Include all fields associated with this user. 18574func (c *UsersGetCall) Projection(projection string) *UsersGetCall { 18575 c.urlParams_.Set("projection", projection) 18576 return c 18577} 18578 18579// ViewType sets the optional parameter "viewType": Whether to fetch the 18580// administrator-only or domain-wide public view of the user. For more 18581// information, see [Retrieve a user as a 18582// non-administrator](/admin-sdk/directory/v1/guides/manage-users#retriev 18583// e_users_non_admin). 18584// 18585// Possible values: 18586// "view_type_undefined" 18587// "admin_view" (default) - Results include both administrator-only 18588// and domain-public fields for the user. 18589// "domain_public" - Results only include fields for the user that are 18590// publicly visible to other users in the domain. 18591func (c *UsersGetCall) ViewType(viewType string) *UsersGetCall { 18592 c.urlParams_.Set("viewType", viewType) 18593 return c 18594} 18595 18596// Fields allows partial responses to be retrieved. See 18597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18598// for more information. 18599func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 18600 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18601 return c 18602} 18603 18604// IfNoneMatch sets the optional parameter which makes the operation 18605// fail if the object's ETag matches the given value. This is useful for 18606// getting updates only after the object has changed since the last 18607// request. Use googleapi.IsNotModified to check whether the response 18608// error from Do is the result of In-None-Match. 18609func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 18610 c.ifNoneMatch_ = entityTag 18611 return c 18612} 18613 18614// Context sets the context to be used in this call's Do method. Any 18615// pending HTTP request will be aborted if the provided context is 18616// canceled. 18617func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 18618 c.ctx_ = ctx 18619 return c 18620} 18621 18622// Header returns an http.Header that can be modified by the caller to 18623// add HTTP headers to the request. 18624func (c *UsersGetCall) Header() http.Header { 18625 if c.header_ == nil { 18626 c.header_ = make(http.Header) 18627 } 18628 return c.header_ 18629} 18630 18631func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 18632 reqHeaders := make(http.Header) 18633 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18634 for k, v := range c.header_ { 18635 reqHeaders[k] = v 18636 } 18637 reqHeaders.Set("User-Agent", c.s.userAgent()) 18638 if c.ifNoneMatch_ != "" { 18639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18640 } 18641 var body io.Reader = nil 18642 c.urlParams_.Set("alt", alt) 18643 c.urlParams_.Set("prettyPrint", "false") 18644 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 18645 urls += "?" + c.urlParams_.Encode() 18646 req, err := http.NewRequest("GET", urls, body) 18647 if err != nil { 18648 return nil, err 18649 } 18650 req.Header = reqHeaders 18651 googleapi.Expand(req.URL, map[string]string{ 18652 "userKey": c.userKey, 18653 }) 18654 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18655} 18656 18657// Do executes the "directory.users.get" call. 18658// Exactly one of *User or error will be non-nil. Any non-2xx status 18659// code is an error. Response headers are in either 18660// *User.ServerResponse.Header or (if a response was returned at all) in 18661// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 18662// whether the returned error was because http.StatusNotModified was 18663// returned. 18664func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 18665 gensupport.SetOptions(c.urlParams_, opts...) 18666 res, err := c.doRequest("json") 18667 if res != nil && res.StatusCode == http.StatusNotModified { 18668 if res.Body != nil { 18669 res.Body.Close() 18670 } 18671 return nil, &googleapi.Error{ 18672 Code: res.StatusCode, 18673 Header: res.Header, 18674 } 18675 } 18676 if err != nil { 18677 return nil, err 18678 } 18679 defer googleapi.CloseBody(res) 18680 if err := googleapi.CheckResponse(res); err != nil { 18681 return nil, err 18682 } 18683 ret := &User{ 18684 ServerResponse: googleapi.ServerResponse{ 18685 Header: res.Header, 18686 HTTPStatusCode: res.StatusCode, 18687 }, 18688 } 18689 target := &ret 18690 if err := gensupport.DecodeResponse(target, res); err != nil { 18691 return nil, err 18692 } 18693 return ret, nil 18694 // { 18695 // "description": "Retrieves a user.", 18696 // "flatPath": "admin/directory/v1/users/{userKey}", 18697 // "httpMethod": "GET", 18698 // "id": "directory.users.get", 18699 // "parameterOrder": [ 18700 // "userKey" 18701 // ], 18702 // "parameters": { 18703 // "customFieldMask": { 18704 // "description": "A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.", 18705 // "location": "query", 18706 // "type": "string" 18707 // }, 18708 // "projection": { 18709 // "default": "basic", 18710 // "description": "What subset of fields to fetch for this user.", 18711 // "enum": [ 18712 // "projectionUndefined", 18713 // "basic", 18714 // "custom", 18715 // "full" 18716 // ], 18717 // "enumDescriptions": [ 18718 // "", 18719 // "Do not include any custom fields for the user.", 18720 // "Include custom fields from schemas requested in `customFieldMask`.", 18721 // "Include all fields associated with this user." 18722 // ], 18723 // "location": "query", 18724 // "type": "string" 18725 // }, 18726 // "userKey": { 18727 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 18728 // "location": "path", 18729 // "required": true, 18730 // "type": "string" 18731 // }, 18732 // "viewType": { 18733 // "default": "admin_view", 18734 // "description": "Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).", 18735 // "enum": [ 18736 // "view_type_undefined", 18737 // "admin_view", 18738 // "domain_public" 18739 // ], 18740 // "enumDescriptions": [ 18741 // "", 18742 // "Results include both administrator-only and domain-public fields for the user.", 18743 // "Results only include fields for the user that are publicly visible to other users in the domain." 18744 // ], 18745 // "location": "query", 18746 // "type": "string" 18747 // } 18748 // }, 18749 // "path": "admin/directory/v1/users/{userKey}", 18750 // "response": { 18751 // "$ref": "User" 18752 // }, 18753 // "scopes": [ 18754 // "https://www.googleapis.com/auth/admin.directory.user", 18755 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 18756 // ] 18757 // } 18758 18759} 18760 18761// method id "directory.users.insert": 18762 18763type UsersInsertCall struct { 18764 s *Service 18765 user *User 18766 urlParams_ gensupport.URLParams 18767 ctx_ context.Context 18768 header_ http.Header 18769} 18770 18771// Insert: Creates a user. 18772func (r *UsersService) Insert(user *User) *UsersInsertCall { 18773 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18774 c.user = user 18775 return c 18776} 18777 18778// Fields allows partial responses to be retrieved. See 18779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18780// for more information. 18781func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 18782 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18783 return c 18784} 18785 18786// Context sets the context to be used in this call's Do method. Any 18787// pending HTTP request will be aborted if the provided context is 18788// canceled. 18789func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 18790 c.ctx_ = ctx 18791 return c 18792} 18793 18794// Header returns an http.Header that can be modified by the caller to 18795// add HTTP headers to the request. 18796func (c *UsersInsertCall) Header() http.Header { 18797 if c.header_ == nil { 18798 c.header_ = make(http.Header) 18799 } 18800 return c.header_ 18801} 18802 18803func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 18804 reqHeaders := make(http.Header) 18805 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 18806 for k, v := range c.header_ { 18807 reqHeaders[k] = v 18808 } 18809 reqHeaders.Set("User-Agent", c.s.userAgent()) 18810 var body io.Reader = nil 18811 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 18812 if err != nil { 18813 return nil, err 18814 } 18815 reqHeaders.Set("Content-Type", "application/json") 18816 c.urlParams_.Set("alt", alt) 18817 c.urlParams_.Set("prettyPrint", "false") 18818 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users") 18819 urls += "?" + c.urlParams_.Encode() 18820 req, err := http.NewRequest("POST", urls, body) 18821 if err != nil { 18822 return nil, err 18823 } 18824 req.Header = reqHeaders 18825 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18826} 18827 18828// Do executes the "directory.users.insert" call. 18829// Exactly one of *User or error will be non-nil. Any non-2xx status 18830// code is an error. Response headers are in either 18831// *User.ServerResponse.Header or (if a response was returned at all) in 18832// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 18833// whether the returned error was because http.StatusNotModified was 18834// returned. 18835func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) { 18836 gensupport.SetOptions(c.urlParams_, opts...) 18837 res, err := c.doRequest("json") 18838 if res != nil && res.StatusCode == http.StatusNotModified { 18839 if res.Body != nil { 18840 res.Body.Close() 18841 } 18842 return nil, &googleapi.Error{ 18843 Code: res.StatusCode, 18844 Header: res.Header, 18845 } 18846 } 18847 if err != nil { 18848 return nil, err 18849 } 18850 defer googleapi.CloseBody(res) 18851 if err := googleapi.CheckResponse(res); err != nil { 18852 return nil, err 18853 } 18854 ret := &User{ 18855 ServerResponse: googleapi.ServerResponse{ 18856 Header: res.Header, 18857 HTTPStatusCode: res.StatusCode, 18858 }, 18859 } 18860 target := &ret 18861 if err := gensupport.DecodeResponse(target, res); err != nil { 18862 return nil, err 18863 } 18864 return ret, nil 18865 // { 18866 // "description": "Creates a user.", 18867 // "flatPath": "admin/directory/v1/users", 18868 // "httpMethod": "POST", 18869 // "id": "directory.users.insert", 18870 // "parameterOrder": [], 18871 // "parameters": {}, 18872 // "path": "admin/directory/v1/users", 18873 // "request": { 18874 // "$ref": "User" 18875 // }, 18876 // "response": { 18877 // "$ref": "User" 18878 // }, 18879 // "scopes": [ 18880 // "https://www.googleapis.com/auth/admin.directory.user" 18881 // ] 18882 // } 18883 18884} 18885 18886// method id "directory.users.list": 18887 18888type UsersListCall struct { 18889 s *Service 18890 urlParams_ gensupport.URLParams 18891 ifNoneMatch_ string 18892 ctx_ context.Context 18893 header_ http.Header 18894} 18895 18896// List: Retrieves a paginated list of either deleted users or all users 18897// in a domain. 18898func (r *UsersService) List() *UsersListCall { 18899 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18900 return c 18901} 18902 18903// CustomFieldMask sets the optional parameter "customFieldMask": A 18904// comma-separated list of schema names. All fields from these schemas 18905// are fetched. This should only be set when `projection=custom`. 18906func (c *UsersListCall) CustomFieldMask(customFieldMask string) *UsersListCall { 18907 c.urlParams_.Set("customFieldMask", customFieldMask) 18908 return c 18909} 18910 18911// Customer sets the optional parameter "customer": The unique ID for 18912// the customer's G Suite account. In case of a multi-domain account, to 18913// fetch all groups for a customer, fill this field instead of domain. 18914// You can also use the `my_customer` alias to represent your account's 18915// `customerId`. The `customerId` is also returned as part of the [Users 18916// resource](/admin-sdk/directory/v1/reference/users). Either the 18917// `customer` or the `domain` parameter must be provided. 18918func (c *UsersListCall) Customer(customer string) *UsersListCall { 18919 c.urlParams_.Set("customer", customer) 18920 return c 18921} 18922 18923// Domain sets the optional parameter "domain": The domain name. Use 18924// this field to get fields from only one domain. To return all domains 18925// for a customer account, use the `customer` query parameter instead. 18926// Either the `customer` or the `domain` parameter must be provided. 18927func (c *UsersListCall) Domain(domain string) *UsersListCall { 18928 c.urlParams_.Set("domain", domain) 18929 return c 18930} 18931 18932// MaxResults sets the optional parameter "maxResults": Maximum number 18933// of results to return. 18934func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { 18935 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 18936 return c 18937} 18938 18939// OrderBy sets the optional parameter "orderBy": Property to use for 18940// sorting results. 18941// 18942// Possible values: 18943// "orderByUndefined" 18944// "email" - Primary email of the user. 18945// "familyName" - User's family name. 18946// "givenName" - User's given name. 18947func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { 18948 c.urlParams_.Set("orderBy", orderBy) 18949 return c 18950} 18951 18952// PageToken sets the optional parameter "pageToken": Token to specify 18953// next page in the list 18954func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { 18955 c.urlParams_.Set("pageToken", pageToken) 18956 return c 18957} 18958 18959// Projection sets the optional parameter "projection": What subset of 18960// fields to fetch for this user. 18961// 18962// Possible values: 18963// "projectionUndefined" 18964// "basic" (default) - Do not include any custom fields for the user. 18965// "custom" - Include custom fields from schemas requested in 18966// `customFieldMask`. 18967// "full" - Include all fields associated with this user. 18968func (c *UsersListCall) Projection(projection string) *UsersListCall { 18969 c.urlParams_.Set("projection", projection) 18970 return c 18971} 18972 18973// Query sets the optional parameter "query": Query string for searching 18974// user fields. For more information on constructing user queries, see 18975// [Search for Users](/admin-sdk/directory/v1/guides/search-users). 18976func (c *UsersListCall) Query(query string) *UsersListCall { 18977 c.urlParams_.Set("query", query) 18978 return c 18979} 18980 18981// ShowDeleted sets the optional parameter "showDeleted": If set to 18982// `true`, retrieves the list of deleted users. (Default: `false`) 18983func (c *UsersListCall) ShowDeleted(showDeleted string) *UsersListCall { 18984 c.urlParams_.Set("showDeleted", showDeleted) 18985 return c 18986} 18987 18988// SortOrder sets the optional parameter "sortOrder": Whether to return 18989// results in ascending or descending order. 18990// 18991// Possible values: 18992// "SORT_ORDER_UNDEFINED" 18993// "ASCENDING" - Ascending order. 18994// "DESCENDING" - Descending order. 18995func (c *UsersListCall) SortOrder(sortOrder string) *UsersListCall { 18996 c.urlParams_.Set("sortOrder", sortOrder) 18997 return c 18998} 18999 19000// ViewType sets the optional parameter "viewType": Whether to fetch the 19001// administrator-only or domain-wide public view of the user. For more 19002// information, see [Retrieve a user as a 19003// non-administrator](/admin-sdk/directory/v1/guides/manage-users#retriev 19004// e_users_non_admin). 19005// 19006// Possible values: 19007// "view_type_undefined" 19008// "admin_view" (default) - Results include both administrator-only 19009// and domain-public fields for the user. 19010// "domain_public" - Results only include fields for the user that are 19011// publicly visible to other users in the domain. 19012func (c *UsersListCall) ViewType(viewType string) *UsersListCall { 19013 c.urlParams_.Set("viewType", viewType) 19014 return c 19015} 19016 19017// Fields allows partial responses to be retrieved. See 19018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19019// for more information. 19020func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 19021 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19022 return c 19023} 19024 19025// IfNoneMatch sets the optional parameter which makes the operation 19026// fail if the object's ETag matches the given value. This is useful for 19027// getting updates only after the object has changed since the last 19028// request. Use googleapi.IsNotModified to check whether the response 19029// error from Do is the result of In-None-Match. 19030func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 19031 c.ifNoneMatch_ = entityTag 19032 return c 19033} 19034 19035// Context sets the context to be used in this call's Do method. Any 19036// pending HTTP request will be aborted if the provided context is 19037// canceled. 19038func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 19039 c.ctx_ = ctx 19040 return c 19041} 19042 19043// Header returns an http.Header that can be modified by the caller to 19044// add HTTP headers to the request. 19045func (c *UsersListCall) Header() http.Header { 19046 if c.header_ == nil { 19047 c.header_ = make(http.Header) 19048 } 19049 return c.header_ 19050} 19051 19052func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 19053 reqHeaders := make(http.Header) 19054 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19055 for k, v := range c.header_ { 19056 reqHeaders[k] = v 19057 } 19058 reqHeaders.Set("User-Agent", c.s.userAgent()) 19059 if c.ifNoneMatch_ != "" { 19060 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19061 } 19062 var body io.Reader = nil 19063 c.urlParams_.Set("alt", alt) 19064 c.urlParams_.Set("prettyPrint", "false") 19065 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users") 19066 urls += "?" + c.urlParams_.Encode() 19067 req, err := http.NewRequest("GET", urls, body) 19068 if err != nil { 19069 return nil, err 19070 } 19071 req.Header = reqHeaders 19072 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19073} 19074 19075// Do executes the "directory.users.list" call. 19076// Exactly one of *Users or error will be non-nil. Any non-2xx status 19077// code is an error. Response headers are in either 19078// *Users.ServerResponse.Header or (if a response was returned at all) 19079// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19080// check whether the returned error was because http.StatusNotModified 19081// was returned. 19082func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*Users, error) { 19083 gensupport.SetOptions(c.urlParams_, opts...) 19084 res, err := c.doRequest("json") 19085 if res != nil && res.StatusCode == http.StatusNotModified { 19086 if res.Body != nil { 19087 res.Body.Close() 19088 } 19089 return nil, &googleapi.Error{ 19090 Code: res.StatusCode, 19091 Header: res.Header, 19092 } 19093 } 19094 if err != nil { 19095 return nil, err 19096 } 19097 defer googleapi.CloseBody(res) 19098 if err := googleapi.CheckResponse(res); err != nil { 19099 return nil, err 19100 } 19101 ret := &Users{ 19102 ServerResponse: googleapi.ServerResponse{ 19103 Header: res.Header, 19104 HTTPStatusCode: res.StatusCode, 19105 }, 19106 } 19107 target := &ret 19108 if err := gensupport.DecodeResponse(target, res); err != nil { 19109 return nil, err 19110 } 19111 return ret, nil 19112 // { 19113 // "description": "Retrieves a paginated list of either deleted users or all users in a domain.", 19114 // "flatPath": "admin/directory/v1/users", 19115 // "httpMethod": "GET", 19116 // "id": "directory.users.list", 19117 // "parameterOrder": [], 19118 // "parameters": { 19119 // "customFieldMask": { 19120 // "description": "A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.", 19121 // "location": "query", 19122 // "type": "string" 19123 // }, 19124 // "customer": { 19125 // "description": "The unique ID for the customer's G Suite account. In case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain. You can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](/admin-sdk/directory/v1/reference/users). Either the `customer` or the `domain` parameter must be provided.", 19126 // "location": "query", 19127 // "type": "string" 19128 // }, 19129 // "domain": { 19130 // "description": "The domain name. Use this field to get fields from only one domain. To return all domains for a customer account, use the `customer` query parameter instead. Either the `customer` or the `domain` parameter must be provided.", 19131 // "location": "query", 19132 // "type": "string" 19133 // }, 19134 // "maxResults": { 19135 // "default": "100", 19136 // "description": "Maximum number of results to return.", 19137 // "format": "int32", 19138 // "location": "query", 19139 // "maximum": "500", 19140 // "minimum": "1", 19141 // "type": "integer" 19142 // }, 19143 // "orderBy": { 19144 // "description": "Property to use for sorting results.", 19145 // "enum": [ 19146 // "orderByUndefined", 19147 // "email", 19148 // "familyName", 19149 // "givenName" 19150 // ], 19151 // "enumDescriptions": [ 19152 // "", 19153 // "Primary email of the user.", 19154 // "User's family name.", 19155 // "User's given name." 19156 // ], 19157 // "location": "query", 19158 // "type": "string" 19159 // }, 19160 // "pageToken": { 19161 // "description": "Token to specify next page in the list", 19162 // "location": "query", 19163 // "type": "string" 19164 // }, 19165 // "projection": { 19166 // "default": "basic", 19167 // "description": "What subset of fields to fetch for this user.", 19168 // "enum": [ 19169 // "projectionUndefined", 19170 // "basic", 19171 // "custom", 19172 // "full" 19173 // ], 19174 // "enumDescriptions": [ 19175 // "", 19176 // "Do not include any custom fields for the user.", 19177 // "Include custom fields from schemas requested in `customFieldMask`.", 19178 // "Include all fields associated with this user." 19179 // ], 19180 // "location": "query", 19181 // "type": "string" 19182 // }, 19183 // "query": { 19184 // "description": "Query string for searching user fields. For more information on constructing user queries, see [Search for Users](/admin-sdk/directory/v1/guides/search-users).", 19185 // "location": "query", 19186 // "type": "string" 19187 // }, 19188 // "showDeleted": { 19189 // "description": "If set to `true`, retrieves the list of deleted users. (Default: `false`)", 19190 // "location": "query", 19191 // "type": "string" 19192 // }, 19193 // "sortOrder": { 19194 // "description": "Whether to return results in ascending or descending order.", 19195 // "enum": [ 19196 // "SORT_ORDER_UNDEFINED", 19197 // "ASCENDING", 19198 // "DESCENDING" 19199 // ], 19200 // "enumDescriptions": [ 19201 // "", 19202 // "Ascending order.", 19203 // "Descending order." 19204 // ], 19205 // "location": "query", 19206 // "type": "string" 19207 // }, 19208 // "viewType": { 19209 // "default": "admin_view", 19210 // "description": "Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).", 19211 // "enum": [ 19212 // "view_type_undefined", 19213 // "admin_view", 19214 // "domain_public" 19215 // ], 19216 // "enumDescriptions": [ 19217 // "", 19218 // "Results include both administrator-only and domain-public fields for the user.", 19219 // "Results only include fields for the user that are publicly visible to other users in the domain." 19220 // ], 19221 // "location": "query", 19222 // "type": "string" 19223 // } 19224 // }, 19225 // "path": "admin/directory/v1/users", 19226 // "response": { 19227 // "$ref": "Users" 19228 // }, 19229 // "scopes": [ 19230 // "https://www.googleapis.com/auth/admin.directory.user", 19231 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 19232 // "https://www.googleapis.com/auth/cloud-platform" 19233 // ] 19234 // } 19235 19236} 19237 19238// Pages invokes f for each page of results. 19239// A non-nil error returned from f will halt the iteration. 19240// The provided context supersedes any context provided to the Context method. 19241func (c *UsersListCall) Pages(ctx context.Context, f func(*Users) error) error { 19242 c.ctx_ = ctx 19243 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 19244 for { 19245 x, err := c.Do() 19246 if err != nil { 19247 return err 19248 } 19249 if err := f(x); err != nil { 19250 return err 19251 } 19252 if x.NextPageToken == "" { 19253 return nil 19254 } 19255 c.PageToken(x.NextPageToken) 19256 } 19257} 19258 19259// method id "directory.users.makeAdmin": 19260 19261type UsersMakeAdminCall struct { 19262 s *Service 19263 userKey string 19264 usermakeadmin *UserMakeAdmin 19265 urlParams_ gensupport.URLParams 19266 ctx_ context.Context 19267 header_ http.Header 19268} 19269 19270// MakeAdmin: Makes a user a super administrator. 19271func (r *UsersService) MakeAdmin(userKey string, usermakeadmin *UserMakeAdmin) *UsersMakeAdminCall { 19272 c := &UsersMakeAdminCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19273 c.userKey = userKey 19274 c.usermakeadmin = usermakeadmin 19275 return c 19276} 19277 19278// Fields allows partial responses to be retrieved. See 19279// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19280// for more information. 19281func (c *UsersMakeAdminCall) Fields(s ...googleapi.Field) *UsersMakeAdminCall { 19282 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19283 return c 19284} 19285 19286// Context sets the context to be used in this call's Do method. Any 19287// pending HTTP request will be aborted if the provided context is 19288// canceled. 19289func (c *UsersMakeAdminCall) Context(ctx context.Context) *UsersMakeAdminCall { 19290 c.ctx_ = ctx 19291 return c 19292} 19293 19294// Header returns an http.Header that can be modified by the caller to 19295// add HTTP headers to the request. 19296func (c *UsersMakeAdminCall) Header() http.Header { 19297 if c.header_ == nil { 19298 c.header_ = make(http.Header) 19299 } 19300 return c.header_ 19301} 19302 19303func (c *UsersMakeAdminCall) doRequest(alt string) (*http.Response, error) { 19304 reqHeaders := make(http.Header) 19305 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19306 for k, v := range c.header_ { 19307 reqHeaders[k] = v 19308 } 19309 reqHeaders.Set("User-Agent", c.s.userAgent()) 19310 var body io.Reader = nil 19311 body, err := googleapi.WithoutDataWrapper.JSONReader(c.usermakeadmin) 19312 if err != nil { 19313 return nil, err 19314 } 19315 reqHeaders.Set("Content-Type", "application/json") 19316 c.urlParams_.Set("alt", alt) 19317 c.urlParams_.Set("prettyPrint", "false") 19318 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/makeAdmin") 19319 urls += "?" + c.urlParams_.Encode() 19320 req, err := http.NewRequest("POST", urls, body) 19321 if err != nil { 19322 return nil, err 19323 } 19324 req.Header = reqHeaders 19325 googleapi.Expand(req.URL, map[string]string{ 19326 "userKey": c.userKey, 19327 }) 19328 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19329} 19330 19331// Do executes the "directory.users.makeAdmin" call. 19332func (c *UsersMakeAdminCall) Do(opts ...googleapi.CallOption) error { 19333 gensupport.SetOptions(c.urlParams_, opts...) 19334 res, err := c.doRequest("json") 19335 if err != nil { 19336 return err 19337 } 19338 defer googleapi.CloseBody(res) 19339 if err := googleapi.CheckResponse(res); err != nil { 19340 return err 19341 } 19342 return nil 19343 // { 19344 // "description": "Makes a user a super administrator.", 19345 // "flatPath": "admin/directory/v1/users/{userKey}/makeAdmin", 19346 // "httpMethod": "POST", 19347 // "id": "directory.users.makeAdmin", 19348 // "parameterOrder": [ 19349 // "userKey" 19350 // ], 19351 // "parameters": { 19352 // "userKey": { 19353 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 19354 // "location": "path", 19355 // "required": true, 19356 // "type": "string" 19357 // } 19358 // }, 19359 // "path": "admin/directory/v1/users/{userKey}/makeAdmin", 19360 // "request": { 19361 // "$ref": "UserMakeAdmin" 19362 // }, 19363 // "scopes": [ 19364 // "https://www.googleapis.com/auth/admin.directory.user" 19365 // ] 19366 // } 19367 19368} 19369 19370// method id "directory.users.patch": 19371 19372type UsersPatchCall struct { 19373 s *Service 19374 userKey string 19375 user *User 19376 urlParams_ gensupport.URLParams 19377 ctx_ context.Context 19378 header_ http.Header 19379} 19380 19381// Patch: Updates a user using patch semantics. The update method should 19382// be used instead, since it also supports patch semantics and has 19383// better performance. This method is unable to clear fields that 19384// contain repeated objects (`addresses`, `phones`, etc). Use the update 19385// method instead. 19386func (r *UsersService) Patch(userKey string, user *User) *UsersPatchCall { 19387 c := &UsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19388 c.userKey = userKey 19389 c.user = user 19390 return c 19391} 19392 19393// Fields allows partial responses to be retrieved. See 19394// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19395// for more information. 19396func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall { 19397 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19398 return c 19399} 19400 19401// Context sets the context to be used in this call's Do method. Any 19402// pending HTTP request will be aborted if the provided context is 19403// canceled. 19404func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall { 19405 c.ctx_ = ctx 19406 return c 19407} 19408 19409// Header returns an http.Header that can be modified by the caller to 19410// add HTTP headers to the request. 19411func (c *UsersPatchCall) Header() http.Header { 19412 if c.header_ == nil { 19413 c.header_ = make(http.Header) 19414 } 19415 return c.header_ 19416} 19417 19418func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { 19419 reqHeaders := make(http.Header) 19420 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19421 for k, v := range c.header_ { 19422 reqHeaders[k] = v 19423 } 19424 reqHeaders.Set("User-Agent", c.s.userAgent()) 19425 var body io.Reader = nil 19426 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 19427 if err != nil { 19428 return nil, err 19429 } 19430 reqHeaders.Set("Content-Type", "application/json") 19431 c.urlParams_.Set("alt", alt) 19432 c.urlParams_.Set("prettyPrint", "false") 19433 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 19434 urls += "?" + c.urlParams_.Encode() 19435 req, err := http.NewRequest("PATCH", urls, body) 19436 if err != nil { 19437 return nil, err 19438 } 19439 req.Header = reqHeaders 19440 googleapi.Expand(req.URL, map[string]string{ 19441 "userKey": c.userKey, 19442 }) 19443 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19444} 19445 19446// Do executes the "directory.users.patch" call. 19447// Exactly one of *User or error will be non-nil. Any non-2xx status 19448// code is an error. Response headers are in either 19449// *User.ServerResponse.Header or (if a response was returned at all) in 19450// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 19451// whether the returned error was because http.StatusNotModified was 19452// returned. 19453func (c *UsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) { 19454 gensupport.SetOptions(c.urlParams_, opts...) 19455 res, err := c.doRequest("json") 19456 if res != nil && res.StatusCode == http.StatusNotModified { 19457 if res.Body != nil { 19458 res.Body.Close() 19459 } 19460 return nil, &googleapi.Error{ 19461 Code: res.StatusCode, 19462 Header: res.Header, 19463 } 19464 } 19465 if err != nil { 19466 return nil, err 19467 } 19468 defer googleapi.CloseBody(res) 19469 if err := googleapi.CheckResponse(res); err != nil { 19470 return nil, err 19471 } 19472 ret := &User{ 19473 ServerResponse: googleapi.ServerResponse{ 19474 Header: res.Header, 19475 HTTPStatusCode: res.StatusCode, 19476 }, 19477 } 19478 target := &ret 19479 if err := gensupport.DecodeResponse(target, res); err != nil { 19480 return nil, err 19481 } 19482 return ret, nil 19483 // { 19484 // "description": "Updates a user using patch semantics. The update method should be used instead, since it also supports patch semantics and has better performance. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.", 19485 // "flatPath": "admin/directory/v1/users/{userKey}", 19486 // "httpMethod": "PATCH", 19487 // "id": "directory.users.patch", 19488 // "parameterOrder": [ 19489 // "userKey" 19490 // ], 19491 // "parameters": { 19492 // "userKey": { 19493 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 19494 // "location": "path", 19495 // "required": true, 19496 // "type": "string" 19497 // } 19498 // }, 19499 // "path": "admin/directory/v1/users/{userKey}", 19500 // "request": { 19501 // "$ref": "User" 19502 // }, 19503 // "response": { 19504 // "$ref": "User" 19505 // }, 19506 // "scopes": [ 19507 // "https://www.googleapis.com/auth/admin.directory.user" 19508 // ] 19509 // } 19510 19511} 19512 19513// method id "directory.users.signOut": 19514 19515type UsersSignOutCall struct { 19516 s *Service 19517 userKey string 19518 urlParams_ gensupport.URLParams 19519 ctx_ context.Context 19520 header_ http.Header 19521} 19522 19523// SignOut: Sign a user out of all web and device sessions and reset 19524// their sign-in cookies. User will have to sign in by authenticating 19525// again. 19526func (r *UsersService) SignOut(userKey string) *UsersSignOutCall { 19527 c := &UsersSignOutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19528 c.userKey = userKey 19529 return c 19530} 19531 19532// Fields allows partial responses to be retrieved. See 19533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19534// for more information. 19535func (c *UsersSignOutCall) Fields(s ...googleapi.Field) *UsersSignOutCall { 19536 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19537 return c 19538} 19539 19540// Context sets the context to be used in this call's Do method. Any 19541// pending HTTP request will be aborted if the provided context is 19542// canceled. 19543func (c *UsersSignOutCall) Context(ctx context.Context) *UsersSignOutCall { 19544 c.ctx_ = ctx 19545 return c 19546} 19547 19548// Header returns an http.Header that can be modified by the caller to 19549// add HTTP headers to the request. 19550func (c *UsersSignOutCall) Header() http.Header { 19551 if c.header_ == nil { 19552 c.header_ = make(http.Header) 19553 } 19554 return c.header_ 19555} 19556 19557func (c *UsersSignOutCall) doRequest(alt string) (*http.Response, error) { 19558 reqHeaders := make(http.Header) 19559 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19560 for k, v := range c.header_ { 19561 reqHeaders[k] = v 19562 } 19563 reqHeaders.Set("User-Agent", c.s.userAgent()) 19564 var body io.Reader = nil 19565 c.urlParams_.Set("alt", alt) 19566 c.urlParams_.Set("prettyPrint", "false") 19567 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/signOut") 19568 urls += "?" + c.urlParams_.Encode() 19569 req, err := http.NewRequest("POST", urls, body) 19570 if err != nil { 19571 return nil, err 19572 } 19573 req.Header = reqHeaders 19574 googleapi.Expand(req.URL, map[string]string{ 19575 "userKey": c.userKey, 19576 }) 19577 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19578} 19579 19580// Do executes the "directory.users.signOut" call. 19581func (c *UsersSignOutCall) Do(opts ...googleapi.CallOption) error { 19582 gensupport.SetOptions(c.urlParams_, opts...) 19583 res, err := c.doRequest("json") 19584 if err != nil { 19585 return err 19586 } 19587 defer googleapi.CloseBody(res) 19588 if err := googleapi.CheckResponse(res); err != nil { 19589 return err 19590 } 19591 return nil 19592 // { 19593 // "description": "Sign a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.", 19594 // "flatPath": "admin/directory/v1/users/{userKey}/signOut", 19595 // "httpMethod": "POST", 19596 // "id": "directory.users.signOut", 19597 // "parameterOrder": [ 19598 // "userKey" 19599 // ], 19600 // "parameters": { 19601 // "userKey": { 19602 // "description": "Identifies the target user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 19603 // "location": "path", 19604 // "required": true, 19605 // "type": "string" 19606 // } 19607 // }, 19608 // "path": "admin/directory/v1/users/{userKey}/signOut", 19609 // "scopes": [ 19610 // "https://www.googleapis.com/auth/admin.directory.user.security" 19611 // ] 19612 // } 19613 19614} 19615 19616// method id "directory.users.undelete": 19617 19618type UsersUndeleteCall struct { 19619 s *Service 19620 userKey string 19621 userundelete *UserUndelete 19622 urlParams_ gensupport.URLParams 19623 ctx_ context.Context 19624 header_ http.Header 19625} 19626 19627// Undelete: Undeletes a deleted user. 19628func (r *UsersService) Undelete(userKey string, userundelete *UserUndelete) *UsersUndeleteCall { 19629 c := &UsersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19630 c.userKey = userKey 19631 c.userundelete = userundelete 19632 return c 19633} 19634 19635// Fields allows partial responses to be retrieved. See 19636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19637// for more information. 19638func (c *UsersUndeleteCall) Fields(s ...googleapi.Field) *UsersUndeleteCall { 19639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19640 return c 19641} 19642 19643// Context sets the context to be used in this call's Do method. Any 19644// pending HTTP request will be aborted if the provided context is 19645// canceled. 19646func (c *UsersUndeleteCall) Context(ctx context.Context) *UsersUndeleteCall { 19647 c.ctx_ = ctx 19648 return c 19649} 19650 19651// Header returns an http.Header that can be modified by the caller to 19652// add HTTP headers to the request. 19653func (c *UsersUndeleteCall) Header() http.Header { 19654 if c.header_ == nil { 19655 c.header_ = make(http.Header) 19656 } 19657 return c.header_ 19658} 19659 19660func (c *UsersUndeleteCall) doRequest(alt string) (*http.Response, error) { 19661 reqHeaders := make(http.Header) 19662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19663 for k, v := range c.header_ { 19664 reqHeaders[k] = v 19665 } 19666 reqHeaders.Set("User-Agent", c.s.userAgent()) 19667 var body io.Reader = nil 19668 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userundelete) 19669 if err != nil { 19670 return nil, err 19671 } 19672 reqHeaders.Set("Content-Type", "application/json") 19673 c.urlParams_.Set("alt", alt) 19674 c.urlParams_.Set("prettyPrint", "false") 19675 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/undelete") 19676 urls += "?" + c.urlParams_.Encode() 19677 req, err := http.NewRequest("POST", urls, body) 19678 if err != nil { 19679 return nil, err 19680 } 19681 req.Header = reqHeaders 19682 googleapi.Expand(req.URL, map[string]string{ 19683 "userKey": c.userKey, 19684 }) 19685 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19686} 19687 19688// Do executes the "directory.users.undelete" call. 19689func (c *UsersUndeleteCall) Do(opts ...googleapi.CallOption) error { 19690 gensupport.SetOptions(c.urlParams_, opts...) 19691 res, err := c.doRequest("json") 19692 if err != nil { 19693 return err 19694 } 19695 defer googleapi.CloseBody(res) 19696 if err := googleapi.CheckResponse(res); err != nil { 19697 return err 19698 } 19699 return nil 19700 // { 19701 // "description": "Undeletes a deleted user.", 19702 // "flatPath": "admin/directory/v1/users/{userKey}/undelete", 19703 // "httpMethod": "POST", 19704 // "id": "directory.users.undelete", 19705 // "parameterOrder": [ 19706 // "userKey" 19707 // ], 19708 // "parameters": { 19709 // "userKey": { 19710 // "description": "The immutable id of the user", 19711 // "location": "path", 19712 // "required": true, 19713 // "type": "string" 19714 // } 19715 // }, 19716 // "path": "admin/directory/v1/users/{userKey}/undelete", 19717 // "request": { 19718 // "$ref": "UserUndelete" 19719 // }, 19720 // "scopes": [ 19721 // "https://www.googleapis.com/auth/admin.directory.user" 19722 // ] 19723 // } 19724 19725} 19726 19727// method id "directory.users.update": 19728 19729type UsersUpdateCall struct { 19730 s *Service 19731 userKey string 19732 user *User 19733 urlParams_ gensupport.URLParams 19734 ctx_ context.Context 19735 header_ http.Header 19736} 19737 19738// Update: Updates a user. This method supports patch semantics, meaning 19739// you only need to include the fields you wish to update. Fields that 19740// are not present in the request will be preserved, and fields set to 19741// `null` will be cleared. 19742func (r *UsersService) Update(userKey string, user *User) *UsersUpdateCall { 19743 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19744 c.userKey = userKey 19745 c.user = user 19746 return c 19747} 19748 19749// Fields allows partial responses to be retrieved. See 19750// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19751// for more information. 19752func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 19753 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19754 return c 19755} 19756 19757// Context sets the context to be used in this call's Do method. Any 19758// pending HTTP request will be aborted if the provided context is 19759// canceled. 19760func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 19761 c.ctx_ = ctx 19762 return c 19763} 19764 19765// Header returns an http.Header that can be modified by the caller to 19766// add HTTP headers to the request. 19767func (c *UsersUpdateCall) Header() http.Header { 19768 if c.header_ == nil { 19769 c.header_ = make(http.Header) 19770 } 19771 return c.header_ 19772} 19773 19774func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 19775 reqHeaders := make(http.Header) 19776 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 19777 for k, v := range c.header_ { 19778 reqHeaders[k] = v 19779 } 19780 reqHeaders.Set("User-Agent", c.s.userAgent()) 19781 var body io.Reader = nil 19782 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 19783 if err != nil { 19784 return nil, err 19785 } 19786 reqHeaders.Set("Content-Type", "application/json") 19787 c.urlParams_.Set("alt", alt) 19788 c.urlParams_.Set("prettyPrint", "false") 19789 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 19790 urls += "?" + c.urlParams_.Encode() 19791 req, err := http.NewRequest("PUT", urls, body) 19792 if err != nil { 19793 return nil, err 19794 } 19795 req.Header = reqHeaders 19796 googleapi.Expand(req.URL, map[string]string{ 19797 "userKey": c.userKey, 19798 }) 19799 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19800} 19801 19802// Do executes the "directory.users.update" call. 19803// Exactly one of *User or error will be non-nil. Any non-2xx status 19804// code is an error. Response headers are in either 19805// *User.ServerResponse.Header or (if a response was returned at all) in 19806// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 19807// whether the returned error was because http.StatusNotModified was 19808// returned. 19809func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) { 19810 gensupport.SetOptions(c.urlParams_, opts...) 19811 res, err := c.doRequest("json") 19812 if res != nil && res.StatusCode == http.StatusNotModified { 19813 if res.Body != nil { 19814 res.Body.Close() 19815 } 19816 return nil, &googleapi.Error{ 19817 Code: res.StatusCode, 19818 Header: res.Header, 19819 } 19820 } 19821 if err != nil { 19822 return nil, err 19823 } 19824 defer googleapi.CloseBody(res) 19825 if err := googleapi.CheckResponse(res); err != nil { 19826 return nil, err 19827 } 19828 ret := &User{ 19829 ServerResponse: googleapi.ServerResponse{ 19830 Header: res.Header, 19831 HTTPStatusCode: res.StatusCode, 19832 }, 19833 } 19834 target := &ret 19835 if err := gensupport.DecodeResponse(target, res); err != nil { 19836 return nil, err 19837 } 19838 return ret, nil 19839 // { 19840 // "description": "Updates a user. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared.", 19841 // "flatPath": "admin/directory/v1/users/{userKey}", 19842 // "httpMethod": "PUT", 19843 // "id": "directory.users.update", 19844 // "parameterOrder": [ 19845 // "userKey" 19846 // ], 19847 // "parameters": { 19848 // "userKey": { 19849 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 19850 // "location": "path", 19851 // "required": true, 19852 // "type": "string" 19853 // } 19854 // }, 19855 // "path": "admin/directory/v1/users/{userKey}", 19856 // "request": { 19857 // "$ref": "User" 19858 // }, 19859 // "response": { 19860 // "$ref": "User" 19861 // }, 19862 // "scopes": [ 19863 // "https://www.googleapis.com/auth/admin.directory.user" 19864 // ] 19865 // } 19866 19867} 19868 19869// method id "directory.users.watch": 19870 19871type UsersWatchCall struct { 19872 s *Service 19873 channel *Channel 19874 urlParams_ gensupport.URLParams 19875 ctx_ context.Context 19876 header_ http.Header 19877} 19878 19879// Watch: Watch for changes in users list 19880func (r *UsersService) Watch(channel *Channel) *UsersWatchCall { 19881 c := &UsersWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19882 c.channel = channel 19883 return c 19884} 19885 19886// CustomFieldMask sets the optional parameter "customFieldMask": 19887// Comma-separated list of schema names. All fields from these schemas 19888// are fetched. This should only be set when projection=custom. 19889func (c *UsersWatchCall) CustomFieldMask(customFieldMask string) *UsersWatchCall { 19890 c.urlParams_.Set("customFieldMask", customFieldMask) 19891 return c 19892} 19893 19894// Customer sets the optional parameter "customer": Immutable ID of the 19895// G Suite account. In case of multi-domain, to fetch all users for a 19896// customer, fill this field instead of domain. 19897func (c *UsersWatchCall) Customer(customer string) *UsersWatchCall { 19898 c.urlParams_.Set("customer", customer) 19899 return c 19900} 19901 19902// Domain sets the optional parameter "domain": Name of the domain. Fill 19903// this field to get users from only this domain. To return all users in 19904// a multi-domain fill customer field instead." 19905func (c *UsersWatchCall) Domain(domain string) *UsersWatchCall { 19906 c.urlParams_.Set("domain", domain) 19907 return c 19908} 19909 19910// Event sets the optional parameter "event": Events to watch for. 19911// 19912// Possible values: 19913// "eventTypeUnspecified" 19914// "add" - User Created Event 19915// "delete" - User Deleted Event 19916// "makeAdmin" - User Admin Status Change Event 19917// "undelete" - User Undeleted Event 19918// "update" - User Updated Event 19919func (c *UsersWatchCall) Event(event string) *UsersWatchCall { 19920 c.urlParams_.Set("event", event) 19921 return c 19922} 19923 19924// MaxResults sets the optional parameter "maxResults": Maximum number 19925// of results to return. 19926func (c *UsersWatchCall) MaxResults(maxResults int64) *UsersWatchCall { 19927 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 19928 return c 19929} 19930 19931// OrderBy sets the optional parameter "orderBy": Column to use for 19932// sorting results 19933// 19934// Possible values: 19935// "orderByUnspecified" 19936// "email" - Primary email of the user. 19937// "familyName" - User's family name. 19938// "givenName" - User's given name. 19939func (c *UsersWatchCall) OrderBy(orderBy string) *UsersWatchCall { 19940 c.urlParams_.Set("orderBy", orderBy) 19941 return c 19942} 19943 19944// PageToken sets the optional parameter "pageToken": Token to specify 19945// next page in the list 19946func (c *UsersWatchCall) PageToken(pageToken string) *UsersWatchCall { 19947 c.urlParams_.Set("pageToken", pageToken) 19948 return c 19949} 19950 19951// Projection sets the optional parameter "projection": What subset of 19952// fields to fetch for this user. 19953// 19954// Possible values: 19955// "projectionUnspecified" 19956// "basic" (default) - Do not include any custom fields for the user. 19957// "custom" - Include custom fields from schemas mentioned in 19958// customFieldMask. 19959// "full" - Include all fields associated with this user. 19960func (c *UsersWatchCall) Projection(projection string) *UsersWatchCall { 19961 c.urlParams_.Set("projection", projection) 19962 return c 19963} 19964 19965// Query sets the optional parameter "query": Query string search. 19966// Should be of the form "". Complete documentation is at https: 19967// //developers.google.com/admin-sdk/directory/v1/guides/search-users 19968func (c *UsersWatchCall) Query(query string) *UsersWatchCall { 19969 c.urlParams_.Set("query", query) 19970 return c 19971} 19972 19973// ShowDeleted sets the optional parameter "showDeleted": If set to 19974// true, retrieves the list of deleted users. (Default: false) 19975func (c *UsersWatchCall) ShowDeleted(showDeleted string) *UsersWatchCall { 19976 c.urlParams_.Set("showDeleted", showDeleted) 19977 return c 19978} 19979 19980// SortOrder sets the optional parameter "sortOrder": Whether to return 19981// results in ascending or descending order. 19982// 19983// Possible values: 19984// "sortOrderUnspecified" 19985// "ASCENDING" - Ascending order. 19986// "DESCENDING" - Descending order. 19987func (c *UsersWatchCall) SortOrder(sortOrder string) *UsersWatchCall { 19988 c.urlParams_.Set("sortOrder", sortOrder) 19989 return c 19990} 19991 19992// ViewType sets the optional parameter "viewType": Whether to fetch the 19993// administrator-only or domain-wide public view of the user. For more 19994// information, see [Retrieve a user as a 19995// non-administrator](/admin-sdk/directory/v1/guides/manage-users#retriev 19996// e_users_non_admin). 19997// 19998// Possible values: 19999// "admin_view" (default) - Results include both administrator-only 20000// and domain-public fields. 20001// "domain_public" - Results only include fields for the user that are 20002// publicly visible to other users in the domain. 20003func (c *UsersWatchCall) ViewType(viewType string) *UsersWatchCall { 20004 c.urlParams_.Set("viewType", viewType) 20005 return c 20006} 20007 20008// Fields allows partial responses to be retrieved. See 20009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20010// for more information. 20011func (c *UsersWatchCall) Fields(s ...googleapi.Field) *UsersWatchCall { 20012 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20013 return c 20014} 20015 20016// Context sets the context to be used in this call's Do method. Any 20017// pending HTTP request will be aborted if the provided context is 20018// canceled. 20019func (c *UsersWatchCall) Context(ctx context.Context) *UsersWatchCall { 20020 c.ctx_ = ctx 20021 return c 20022} 20023 20024// Header returns an http.Header that can be modified by the caller to 20025// add HTTP headers to the request. 20026func (c *UsersWatchCall) Header() http.Header { 20027 if c.header_ == nil { 20028 c.header_ = make(http.Header) 20029 } 20030 return c.header_ 20031} 20032 20033func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) { 20034 reqHeaders := make(http.Header) 20035 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20036 for k, v := range c.header_ { 20037 reqHeaders[k] = v 20038 } 20039 reqHeaders.Set("User-Agent", c.s.userAgent()) 20040 var body io.Reader = nil 20041 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 20042 if err != nil { 20043 return nil, err 20044 } 20045 reqHeaders.Set("Content-Type", "application/json") 20046 c.urlParams_.Set("alt", alt) 20047 c.urlParams_.Set("prettyPrint", "false") 20048 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/watch") 20049 urls += "?" + c.urlParams_.Encode() 20050 req, err := http.NewRequest("POST", urls, body) 20051 if err != nil { 20052 return nil, err 20053 } 20054 req.Header = reqHeaders 20055 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20056} 20057 20058// Do executes the "directory.users.watch" call. 20059// Exactly one of *Channel or error will be non-nil. Any non-2xx status 20060// code is an error. Response headers are in either 20061// *Channel.ServerResponse.Header or (if a response was returned at all) 20062// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20063// check whether the returned error was because http.StatusNotModified 20064// was returned. 20065func (c *UsersWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 20066 gensupport.SetOptions(c.urlParams_, opts...) 20067 res, err := c.doRequest("json") 20068 if res != nil && res.StatusCode == http.StatusNotModified { 20069 if res.Body != nil { 20070 res.Body.Close() 20071 } 20072 return nil, &googleapi.Error{ 20073 Code: res.StatusCode, 20074 Header: res.Header, 20075 } 20076 } 20077 if err != nil { 20078 return nil, err 20079 } 20080 defer googleapi.CloseBody(res) 20081 if err := googleapi.CheckResponse(res); err != nil { 20082 return nil, err 20083 } 20084 ret := &Channel{ 20085 ServerResponse: googleapi.ServerResponse{ 20086 Header: res.Header, 20087 HTTPStatusCode: res.StatusCode, 20088 }, 20089 } 20090 target := &ret 20091 if err := gensupport.DecodeResponse(target, res); err != nil { 20092 return nil, err 20093 } 20094 return ret, nil 20095 // { 20096 // "description": "Watch for changes in users list", 20097 // "flatPath": "admin/directory/v1/users/watch", 20098 // "httpMethod": "POST", 20099 // "id": "directory.users.watch", 20100 // "parameterOrder": [], 20101 // "parameters": { 20102 // "customFieldMask": { 20103 // "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", 20104 // "location": "query", 20105 // "type": "string" 20106 // }, 20107 // "customer": { 20108 // "description": "Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", 20109 // "location": "query", 20110 // "type": "string" 20111 // }, 20112 // "domain": { 20113 // "description": "Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.\"", 20114 // "location": "query", 20115 // "type": "string" 20116 // }, 20117 // "event": { 20118 // "description": "Events to watch for.", 20119 // "enum": [ 20120 // "eventTypeUnspecified", 20121 // "add", 20122 // "delete", 20123 // "makeAdmin", 20124 // "undelete", 20125 // "update" 20126 // ], 20127 // "enumDescriptions": [ 20128 // "", 20129 // "User Created Event", 20130 // "User Deleted Event", 20131 // "User Admin Status Change Event", 20132 // "User Undeleted Event", 20133 // "User Updated Event" 20134 // ], 20135 // "location": "query", 20136 // "type": "string" 20137 // }, 20138 // "maxResults": { 20139 // "default": "100", 20140 // "description": "Maximum number of results to return.", 20141 // "format": "int32", 20142 // "location": "query", 20143 // "maximum": "500", 20144 // "minimum": "1", 20145 // "type": "integer" 20146 // }, 20147 // "orderBy": { 20148 // "description": "Column to use for sorting results", 20149 // "enum": [ 20150 // "orderByUnspecified", 20151 // "email", 20152 // "familyName", 20153 // "givenName" 20154 // ], 20155 // "enumDescriptions": [ 20156 // "", 20157 // "Primary email of the user.", 20158 // "User's family name.", 20159 // "User's given name." 20160 // ], 20161 // "location": "query", 20162 // "type": "string" 20163 // }, 20164 // "pageToken": { 20165 // "description": "Token to specify next page in the list", 20166 // "location": "query", 20167 // "type": "string" 20168 // }, 20169 // "projection": { 20170 // "default": "basic", 20171 // "description": "What subset of fields to fetch for this user.", 20172 // "enum": [ 20173 // "projectionUnspecified", 20174 // "basic", 20175 // "custom", 20176 // "full" 20177 // ], 20178 // "enumDescriptions": [ 20179 // "", 20180 // "Do not include any custom fields for the user.", 20181 // "Include custom fields from schemas mentioned in customFieldMask.", 20182 // "Include all fields associated with this user." 20183 // ], 20184 // "location": "query", 20185 // "type": "string" 20186 // }, 20187 // "query": { 20188 // "description": "Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-users", 20189 // "location": "query", 20190 // "type": "string" 20191 // }, 20192 // "showDeleted": { 20193 // "description": "If set to true, retrieves the list of deleted users. (Default: false)", 20194 // "location": "query", 20195 // "type": "string" 20196 // }, 20197 // "sortOrder": { 20198 // "description": "Whether to return results in ascending or descending order.", 20199 // "enum": [ 20200 // "sortOrderUnspecified", 20201 // "ASCENDING", 20202 // "DESCENDING" 20203 // ], 20204 // "enumDescriptions": [ 20205 // "", 20206 // "Ascending order.", 20207 // "Descending order." 20208 // ], 20209 // "location": "query", 20210 // "type": "string" 20211 // }, 20212 // "viewType": { 20213 // "default": "admin_view", 20214 // "description": "Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).", 20215 // "enum": [ 20216 // "admin_view", 20217 // "domain_public" 20218 // ], 20219 // "enumDescriptions": [ 20220 // "Results include both administrator-only and domain-public fields.", 20221 // "Results only include fields for the user that are publicly visible to other users in the domain." 20222 // ], 20223 // "location": "query", 20224 // "type": "string" 20225 // } 20226 // }, 20227 // "path": "admin/directory/v1/users/watch", 20228 // "request": { 20229 // "$ref": "Channel" 20230 // }, 20231 // "response": { 20232 // "$ref": "Channel" 20233 // }, 20234 // "scopes": [ 20235 // "https://www.googleapis.com/auth/admin.directory.user", 20236 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 20237 // "https://www.googleapis.com/auth/cloud-platform" 20238 // ] 20239 // } 20240 20241} 20242 20243// method id "directory.users.aliases.delete": 20244 20245type UsersAliasesDeleteCall struct { 20246 s *Service 20247 userKey string 20248 alias string 20249 urlParams_ gensupport.URLParams 20250 ctx_ context.Context 20251 header_ http.Header 20252} 20253 20254// Delete: Removes an alias. 20255func (r *UsersAliasesService) Delete(userKey string, alias string) *UsersAliasesDeleteCall { 20256 c := &UsersAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20257 c.userKey = userKey 20258 c.alias = alias 20259 return c 20260} 20261 20262// Fields allows partial responses to be retrieved. See 20263// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20264// for more information. 20265func (c *UsersAliasesDeleteCall) Fields(s ...googleapi.Field) *UsersAliasesDeleteCall { 20266 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20267 return c 20268} 20269 20270// Context sets the context to be used in this call's Do method. Any 20271// pending HTTP request will be aborted if the provided context is 20272// canceled. 20273func (c *UsersAliasesDeleteCall) Context(ctx context.Context) *UsersAliasesDeleteCall { 20274 c.ctx_ = ctx 20275 return c 20276} 20277 20278// Header returns an http.Header that can be modified by the caller to 20279// add HTTP headers to the request. 20280func (c *UsersAliasesDeleteCall) Header() http.Header { 20281 if c.header_ == nil { 20282 c.header_ = make(http.Header) 20283 } 20284 return c.header_ 20285} 20286 20287func (c *UsersAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 20288 reqHeaders := make(http.Header) 20289 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20290 for k, v := range c.header_ { 20291 reqHeaders[k] = v 20292 } 20293 reqHeaders.Set("User-Agent", c.s.userAgent()) 20294 var body io.Reader = nil 20295 c.urlParams_.Set("alt", alt) 20296 c.urlParams_.Set("prettyPrint", "false") 20297 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases/{alias}") 20298 urls += "?" + c.urlParams_.Encode() 20299 req, err := http.NewRequest("DELETE", urls, body) 20300 if err != nil { 20301 return nil, err 20302 } 20303 req.Header = reqHeaders 20304 googleapi.Expand(req.URL, map[string]string{ 20305 "userKey": c.userKey, 20306 "alias": c.alias, 20307 }) 20308 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20309} 20310 20311// Do executes the "directory.users.aliases.delete" call. 20312func (c *UsersAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 20313 gensupport.SetOptions(c.urlParams_, opts...) 20314 res, err := c.doRequest("json") 20315 if err != nil { 20316 return err 20317 } 20318 defer googleapi.CloseBody(res) 20319 if err := googleapi.CheckResponse(res); err != nil { 20320 return err 20321 } 20322 return nil 20323 // { 20324 // "description": "Removes an alias.", 20325 // "flatPath": "admin/directory/v1/users/{userKey}/aliases/{alias}", 20326 // "httpMethod": "DELETE", 20327 // "id": "directory.users.aliases.delete", 20328 // "parameterOrder": [ 20329 // "userKey", 20330 // "alias" 20331 // ], 20332 // "parameters": { 20333 // "alias": { 20334 // "description": "The alias to be removed.", 20335 // "location": "path", 20336 // "required": true, 20337 // "type": "string" 20338 // }, 20339 // "userKey": { 20340 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 20341 // "location": "path", 20342 // "required": true, 20343 // "type": "string" 20344 // } 20345 // }, 20346 // "path": "admin/directory/v1/users/{userKey}/aliases/{alias}", 20347 // "scopes": [ 20348 // "https://www.googleapis.com/auth/admin.directory.user", 20349 // "https://www.googleapis.com/auth/admin.directory.user.alias" 20350 // ] 20351 // } 20352 20353} 20354 20355// method id "directory.users.aliases.insert": 20356 20357type UsersAliasesInsertCall struct { 20358 s *Service 20359 userKey string 20360 alias *Alias 20361 urlParams_ gensupport.URLParams 20362 ctx_ context.Context 20363 header_ http.Header 20364} 20365 20366// Insert: Adds an alias. 20367func (r *UsersAliasesService) Insert(userKey string, alias *Alias) *UsersAliasesInsertCall { 20368 c := &UsersAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20369 c.userKey = userKey 20370 c.alias = alias 20371 return c 20372} 20373 20374// Fields allows partial responses to be retrieved. See 20375// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20376// for more information. 20377func (c *UsersAliasesInsertCall) Fields(s ...googleapi.Field) *UsersAliasesInsertCall { 20378 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20379 return c 20380} 20381 20382// Context sets the context to be used in this call's Do method. Any 20383// pending HTTP request will be aborted if the provided context is 20384// canceled. 20385func (c *UsersAliasesInsertCall) Context(ctx context.Context) *UsersAliasesInsertCall { 20386 c.ctx_ = ctx 20387 return c 20388} 20389 20390// Header returns an http.Header that can be modified by the caller to 20391// add HTTP headers to the request. 20392func (c *UsersAliasesInsertCall) Header() http.Header { 20393 if c.header_ == nil { 20394 c.header_ = make(http.Header) 20395 } 20396 return c.header_ 20397} 20398 20399func (c *UsersAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 20400 reqHeaders := make(http.Header) 20401 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20402 for k, v := range c.header_ { 20403 reqHeaders[k] = v 20404 } 20405 reqHeaders.Set("User-Agent", c.s.userAgent()) 20406 var body io.Reader = nil 20407 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) 20408 if err != nil { 20409 return nil, err 20410 } 20411 reqHeaders.Set("Content-Type", "application/json") 20412 c.urlParams_.Set("alt", alt) 20413 c.urlParams_.Set("prettyPrint", "false") 20414 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases") 20415 urls += "?" + c.urlParams_.Encode() 20416 req, err := http.NewRequest("POST", urls, body) 20417 if err != nil { 20418 return nil, err 20419 } 20420 req.Header = reqHeaders 20421 googleapi.Expand(req.URL, map[string]string{ 20422 "userKey": c.userKey, 20423 }) 20424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20425} 20426 20427// Do executes the "directory.users.aliases.insert" call. 20428// Exactly one of *Alias or error will be non-nil. Any non-2xx status 20429// code is an error. Response headers are in either 20430// *Alias.ServerResponse.Header or (if a response was returned at all) 20431// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20432// check whether the returned error was because http.StatusNotModified 20433// was returned. 20434func (c *UsersAliasesInsertCall) Do(opts ...googleapi.CallOption) (*Alias, error) { 20435 gensupport.SetOptions(c.urlParams_, opts...) 20436 res, err := c.doRequest("json") 20437 if res != nil && res.StatusCode == http.StatusNotModified { 20438 if res.Body != nil { 20439 res.Body.Close() 20440 } 20441 return nil, &googleapi.Error{ 20442 Code: res.StatusCode, 20443 Header: res.Header, 20444 } 20445 } 20446 if err != nil { 20447 return nil, err 20448 } 20449 defer googleapi.CloseBody(res) 20450 if err := googleapi.CheckResponse(res); err != nil { 20451 return nil, err 20452 } 20453 ret := &Alias{ 20454 ServerResponse: googleapi.ServerResponse{ 20455 Header: res.Header, 20456 HTTPStatusCode: res.StatusCode, 20457 }, 20458 } 20459 target := &ret 20460 if err := gensupport.DecodeResponse(target, res); err != nil { 20461 return nil, err 20462 } 20463 return ret, nil 20464 // { 20465 // "description": "Adds an alias.", 20466 // "flatPath": "admin/directory/v1/users/{userKey}/aliases", 20467 // "httpMethod": "POST", 20468 // "id": "directory.users.aliases.insert", 20469 // "parameterOrder": [ 20470 // "userKey" 20471 // ], 20472 // "parameters": { 20473 // "userKey": { 20474 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 20475 // "location": "path", 20476 // "required": true, 20477 // "type": "string" 20478 // } 20479 // }, 20480 // "path": "admin/directory/v1/users/{userKey}/aliases", 20481 // "request": { 20482 // "$ref": "Alias" 20483 // }, 20484 // "response": { 20485 // "$ref": "Alias" 20486 // }, 20487 // "scopes": [ 20488 // "https://www.googleapis.com/auth/admin.directory.user", 20489 // "https://www.googleapis.com/auth/admin.directory.user.alias" 20490 // ] 20491 // } 20492 20493} 20494 20495// method id "directory.users.aliases.list": 20496 20497type UsersAliasesListCall struct { 20498 s *Service 20499 userKey string 20500 urlParams_ gensupport.URLParams 20501 ifNoneMatch_ string 20502 ctx_ context.Context 20503 header_ http.Header 20504} 20505 20506// List: Lists all aliases for a user. 20507func (r *UsersAliasesService) List(userKey string) *UsersAliasesListCall { 20508 c := &UsersAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20509 c.userKey = userKey 20510 return c 20511} 20512 20513// Fields allows partial responses to be retrieved. See 20514// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20515// for more information. 20516func (c *UsersAliasesListCall) Fields(s ...googleapi.Field) *UsersAliasesListCall { 20517 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20518 return c 20519} 20520 20521// IfNoneMatch sets the optional parameter which makes the operation 20522// fail if the object's ETag matches the given value. This is useful for 20523// getting updates only after the object has changed since the last 20524// request. Use googleapi.IsNotModified to check whether the response 20525// error from Do is the result of In-None-Match. 20526func (c *UsersAliasesListCall) IfNoneMatch(entityTag string) *UsersAliasesListCall { 20527 c.ifNoneMatch_ = entityTag 20528 return c 20529} 20530 20531// Context sets the context to be used in this call's Do method. Any 20532// pending HTTP request will be aborted if the provided context is 20533// canceled. 20534func (c *UsersAliasesListCall) Context(ctx context.Context) *UsersAliasesListCall { 20535 c.ctx_ = ctx 20536 return c 20537} 20538 20539// Header returns an http.Header that can be modified by the caller to 20540// add HTTP headers to the request. 20541func (c *UsersAliasesListCall) Header() http.Header { 20542 if c.header_ == nil { 20543 c.header_ = make(http.Header) 20544 } 20545 return c.header_ 20546} 20547 20548func (c *UsersAliasesListCall) doRequest(alt string) (*http.Response, error) { 20549 reqHeaders := make(http.Header) 20550 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20551 for k, v := range c.header_ { 20552 reqHeaders[k] = v 20553 } 20554 reqHeaders.Set("User-Agent", c.s.userAgent()) 20555 if c.ifNoneMatch_ != "" { 20556 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 20557 } 20558 var body io.Reader = nil 20559 c.urlParams_.Set("alt", alt) 20560 c.urlParams_.Set("prettyPrint", "false") 20561 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases") 20562 urls += "?" + c.urlParams_.Encode() 20563 req, err := http.NewRequest("GET", urls, body) 20564 if err != nil { 20565 return nil, err 20566 } 20567 req.Header = reqHeaders 20568 googleapi.Expand(req.URL, map[string]string{ 20569 "userKey": c.userKey, 20570 }) 20571 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20572} 20573 20574// Do executes the "directory.users.aliases.list" call. 20575// Exactly one of *Aliases or error will be non-nil. Any non-2xx status 20576// code is an error. Response headers are in either 20577// *Aliases.ServerResponse.Header or (if a response was returned at all) 20578// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20579// check whether the returned error was because http.StatusNotModified 20580// was returned. 20581func (c *UsersAliasesListCall) Do(opts ...googleapi.CallOption) (*Aliases, error) { 20582 gensupport.SetOptions(c.urlParams_, opts...) 20583 res, err := c.doRequest("json") 20584 if res != nil && res.StatusCode == http.StatusNotModified { 20585 if res.Body != nil { 20586 res.Body.Close() 20587 } 20588 return nil, &googleapi.Error{ 20589 Code: res.StatusCode, 20590 Header: res.Header, 20591 } 20592 } 20593 if err != nil { 20594 return nil, err 20595 } 20596 defer googleapi.CloseBody(res) 20597 if err := googleapi.CheckResponse(res); err != nil { 20598 return nil, err 20599 } 20600 ret := &Aliases{ 20601 ServerResponse: googleapi.ServerResponse{ 20602 Header: res.Header, 20603 HTTPStatusCode: res.StatusCode, 20604 }, 20605 } 20606 target := &ret 20607 if err := gensupport.DecodeResponse(target, res); err != nil { 20608 return nil, err 20609 } 20610 return ret, nil 20611 // { 20612 // "description": "Lists all aliases for a user.", 20613 // "flatPath": "admin/directory/v1/users/{userKey}/aliases", 20614 // "httpMethod": "GET", 20615 // "id": "directory.users.aliases.list", 20616 // "parameterOrder": [ 20617 // "userKey" 20618 // ], 20619 // "parameters": { 20620 // "userKey": { 20621 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 20622 // "location": "path", 20623 // "required": true, 20624 // "type": "string" 20625 // } 20626 // }, 20627 // "path": "admin/directory/v1/users/{userKey}/aliases", 20628 // "response": { 20629 // "$ref": "Aliases" 20630 // }, 20631 // "scopes": [ 20632 // "https://www.googleapis.com/auth/admin.directory.user", 20633 // "https://www.googleapis.com/auth/admin.directory.user.alias", 20634 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 20635 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 20636 // ] 20637 // } 20638 20639} 20640 20641// method id "directory.users.aliases.watch": 20642 20643type UsersAliasesWatchCall struct { 20644 s *Service 20645 userKey string 20646 channel *Channel 20647 urlParams_ gensupport.URLParams 20648 ctx_ context.Context 20649 header_ http.Header 20650} 20651 20652// Watch: Watch for changes in users list. 20653func (r *UsersAliasesService) Watch(userKey string, channel *Channel) *UsersAliasesWatchCall { 20654 c := &UsersAliasesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20655 c.userKey = userKey 20656 c.channel = channel 20657 return c 20658} 20659 20660// Event sets the optional parameter "event": Events to watch for. 20661// 20662// Possible values: 20663// "eventUndefined" 20664// "add" - Alias Created Event 20665// "delete" - Alias Deleted Event 20666func (c *UsersAliasesWatchCall) Event(event string) *UsersAliasesWatchCall { 20667 c.urlParams_.Set("event", event) 20668 return c 20669} 20670 20671// Fields allows partial responses to be retrieved. See 20672// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20673// for more information. 20674func (c *UsersAliasesWatchCall) Fields(s ...googleapi.Field) *UsersAliasesWatchCall { 20675 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20676 return c 20677} 20678 20679// Context sets the context to be used in this call's Do method. Any 20680// pending HTTP request will be aborted if the provided context is 20681// canceled. 20682func (c *UsersAliasesWatchCall) Context(ctx context.Context) *UsersAliasesWatchCall { 20683 c.ctx_ = ctx 20684 return c 20685} 20686 20687// Header returns an http.Header that can be modified by the caller to 20688// add HTTP headers to the request. 20689func (c *UsersAliasesWatchCall) Header() http.Header { 20690 if c.header_ == nil { 20691 c.header_ = make(http.Header) 20692 } 20693 return c.header_ 20694} 20695 20696func (c *UsersAliasesWatchCall) doRequest(alt string) (*http.Response, error) { 20697 reqHeaders := make(http.Header) 20698 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20699 for k, v := range c.header_ { 20700 reqHeaders[k] = v 20701 } 20702 reqHeaders.Set("User-Agent", c.s.userAgent()) 20703 var body io.Reader = nil 20704 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 20705 if err != nil { 20706 return nil, err 20707 } 20708 reqHeaders.Set("Content-Type", "application/json") 20709 c.urlParams_.Set("alt", alt) 20710 c.urlParams_.Set("prettyPrint", "false") 20711 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases/watch") 20712 urls += "?" + c.urlParams_.Encode() 20713 req, err := http.NewRequest("POST", urls, body) 20714 if err != nil { 20715 return nil, err 20716 } 20717 req.Header = reqHeaders 20718 googleapi.Expand(req.URL, map[string]string{ 20719 "userKey": c.userKey, 20720 }) 20721 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20722} 20723 20724// Do executes the "directory.users.aliases.watch" call. 20725// Exactly one of *Channel or error will be non-nil. Any non-2xx status 20726// code is an error. Response headers are in either 20727// *Channel.ServerResponse.Header or (if a response was returned at all) 20728// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20729// check whether the returned error was because http.StatusNotModified 20730// was returned. 20731func (c *UsersAliasesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 20732 gensupport.SetOptions(c.urlParams_, opts...) 20733 res, err := c.doRequest("json") 20734 if res != nil && res.StatusCode == http.StatusNotModified { 20735 if res.Body != nil { 20736 res.Body.Close() 20737 } 20738 return nil, &googleapi.Error{ 20739 Code: res.StatusCode, 20740 Header: res.Header, 20741 } 20742 } 20743 if err != nil { 20744 return nil, err 20745 } 20746 defer googleapi.CloseBody(res) 20747 if err := googleapi.CheckResponse(res); err != nil { 20748 return nil, err 20749 } 20750 ret := &Channel{ 20751 ServerResponse: googleapi.ServerResponse{ 20752 Header: res.Header, 20753 HTTPStatusCode: res.StatusCode, 20754 }, 20755 } 20756 target := &ret 20757 if err := gensupport.DecodeResponse(target, res); err != nil { 20758 return nil, err 20759 } 20760 return ret, nil 20761 // { 20762 // "description": "Watch for changes in users list.", 20763 // "flatPath": "admin/directory/v1/users/{userKey}/aliases/watch", 20764 // "httpMethod": "POST", 20765 // "id": "directory.users.aliases.watch", 20766 // "parameterOrder": [ 20767 // "userKey" 20768 // ], 20769 // "parameters": { 20770 // "event": { 20771 // "description": "Events to watch for.", 20772 // "enum": [ 20773 // "eventUndefined", 20774 // "add", 20775 // "delete" 20776 // ], 20777 // "enumDescriptions": [ 20778 // "", 20779 // "Alias Created Event", 20780 // "Alias Deleted Event" 20781 // ], 20782 // "location": "query", 20783 // "type": "string" 20784 // }, 20785 // "userKey": { 20786 // "description": "Email or immutable ID of the user", 20787 // "location": "path", 20788 // "required": true, 20789 // "type": "string" 20790 // } 20791 // }, 20792 // "path": "admin/directory/v1/users/{userKey}/aliases/watch", 20793 // "request": { 20794 // "$ref": "Channel" 20795 // }, 20796 // "response": { 20797 // "$ref": "Channel" 20798 // }, 20799 // "scopes": [ 20800 // "https://www.googleapis.com/auth/admin.directory.user", 20801 // "https://www.googleapis.com/auth/admin.directory.user.alias", 20802 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 20803 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 20804 // ] 20805 // } 20806 20807} 20808 20809// method id "directory.users.photos.delete": 20810 20811type UsersPhotosDeleteCall struct { 20812 s *Service 20813 userKey string 20814 urlParams_ gensupport.URLParams 20815 ctx_ context.Context 20816 header_ http.Header 20817} 20818 20819// Delete: Removes the user's photo. 20820func (r *UsersPhotosService) Delete(userKey string) *UsersPhotosDeleteCall { 20821 c := &UsersPhotosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20822 c.userKey = userKey 20823 return c 20824} 20825 20826// Fields allows partial responses to be retrieved. See 20827// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20828// for more information. 20829func (c *UsersPhotosDeleteCall) Fields(s ...googleapi.Field) *UsersPhotosDeleteCall { 20830 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20831 return c 20832} 20833 20834// Context sets the context to be used in this call's Do method. Any 20835// pending HTTP request will be aborted if the provided context is 20836// canceled. 20837func (c *UsersPhotosDeleteCall) Context(ctx context.Context) *UsersPhotosDeleteCall { 20838 c.ctx_ = ctx 20839 return c 20840} 20841 20842// Header returns an http.Header that can be modified by the caller to 20843// add HTTP headers to the request. 20844func (c *UsersPhotosDeleteCall) Header() http.Header { 20845 if c.header_ == nil { 20846 c.header_ = make(http.Header) 20847 } 20848 return c.header_ 20849} 20850 20851func (c *UsersPhotosDeleteCall) doRequest(alt string) (*http.Response, error) { 20852 reqHeaders := make(http.Header) 20853 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20854 for k, v := range c.header_ { 20855 reqHeaders[k] = v 20856 } 20857 reqHeaders.Set("User-Agent", c.s.userAgent()) 20858 var body io.Reader = nil 20859 c.urlParams_.Set("alt", alt) 20860 c.urlParams_.Set("prettyPrint", "false") 20861 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 20862 urls += "?" + c.urlParams_.Encode() 20863 req, err := http.NewRequest("DELETE", urls, body) 20864 if err != nil { 20865 return nil, err 20866 } 20867 req.Header = reqHeaders 20868 googleapi.Expand(req.URL, map[string]string{ 20869 "userKey": c.userKey, 20870 }) 20871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20872} 20873 20874// Do executes the "directory.users.photos.delete" call. 20875func (c *UsersPhotosDeleteCall) Do(opts ...googleapi.CallOption) error { 20876 gensupport.SetOptions(c.urlParams_, opts...) 20877 res, err := c.doRequest("json") 20878 if err != nil { 20879 return err 20880 } 20881 defer googleapi.CloseBody(res) 20882 if err := googleapi.CheckResponse(res); err != nil { 20883 return err 20884 } 20885 return nil 20886 // { 20887 // "description": "Removes the user's photo.", 20888 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 20889 // "httpMethod": "DELETE", 20890 // "id": "directory.users.photos.delete", 20891 // "parameterOrder": [ 20892 // "userKey" 20893 // ], 20894 // "parameters": { 20895 // "userKey": { 20896 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 20897 // "location": "path", 20898 // "required": true, 20899 // "type": "string" 20900 // } 20901 // }, 20902 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 20903 // "scopes": [ 20904 // "https://www.googleapis.com/auth/admin.directory.user" 20905 // ] 20906 // } 20907 20908} 20909 20910// method id "directory.users.photos.get": 20911 20912type UsersPhotosGetCall struct { 20913 s *Service 20914 userKey string 20915 urlParams_ gensupport.URLParams 20916 ifNoneMatch_ string 20917 ctx_ context.Context 20918 header_ http.Header 20919} 20920 20921// Get: Retrieves the user's photo. 20922func (r *UsersPhotosService) Get(userKey string) *UsersPhotosGetCall { 20923 c := &UsersPhotosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20924 c.userKey = userKey 20925 return c 20926} 20927 20928// Fields allows partial responses to be retrieved. See 20929// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20930// for more information. 20931func (c *UsersPhotosGetCall) Fields(s ...googleapi.Field) *UsersPhotosGetCall { 20932 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20933 return c 20934} 20935 20936// IfNoneMatch sets the optional parameter which makes the operation 20937// fail if the object's ETag matches the given value. This is useful for 20938// getting updates only after the object has changed since the last 20939// request. Use googleapi.IsNotModified to check whether the response 20940// error from Do is the result of In-None-Match. 20941func (c *UsersPhotosGetCall) IfNoneMatch(entityTag string) *UsersPhotosGetCall { 20942 c.ifNoneMatch_ = entityTag 20943 return c 20944} 20945 20946// Context sets the context to be used in this call's Do method. Any 20947// pending HTTP request will be aborted if the provided context is 20948// canceled. 20949func (c *UsersPhotosGetCall) Context(ctx context.Context) *UsersPhotosGetCall { 20950 c.ctx_ = ctx 20951 return c 20952} 20953 20954// Header returns an http.Header that can be modified by the caller to 20955// add HTTP headers to the request. 20956func (c *UsersPhotosGetCall) Header() http.Header { 20957 if c.header_ == nil { 20958 c.header_ = make(http.Header) 20959 } 20960 return c.header_ 20961} 20962 20963func (c *UsersPhotosGetCall) doRequest(alt string) (*http.Response, error) { 20964 reqHeaders := make(http.Header) 20965 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 20966 for k, v := range c.header_ { 20967 reqHeaders[k] = v 20968 } 20969 reqHeaders.Set("User-Agent", c.s.userAgent()) 20970 if c.ifNoneMatch_ != "" { 20971 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 20972 } 20973 var body io.Reader = nil 20974 c.urlParams_.Set("alt", alt) 20975 c.urlParams_.Set("prettyPrint", "false") 20976 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 20977 urls += "?" + c.urlParams_.Encode() 20978 req, err := http.NewRequest("GET", urls, body) 20979 if err != nil { 20980 return nil, err 20981 } 20982 req.Header = reqHeaders 20983 googleapi.Expand(req.URL, map[string]string{ 20984 "userKey": c.userKey, 20985 }) 20986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20987} 20988 20989// Do executes the "directory.users.photos.get" call. 20990// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 20991// status code is an error. Response headers are in either 20992// *UserPhoto.ServerResponse.Header or (if a response was returned at 20993// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 20994// to check whether the returned error was because 20995// http.StatusNotModified was returned. 20996func (c *UsersPhotosGetCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 20997 gensupport.SetOptions(c.urlParams_, opts...) 20998 res, err := c.doRequest("json") 20999 if res != nil && res.StatusCode == http.StatusNotModified { 21000 if res.Body != nil { 21001 res.Body.Close() 21002 } 21003 return nil, &googleapi.Error{ 21004 Code: res.StatusCode, 21005 Header: res.Header, 21006 } 21007 } 21008 if err != nil { 21009 return nil, err 21010 } 21011 defer googleapi.CloseBody(res) 21012 if err := googleapi.CheckResponse(res); err != nil { 21013 return nil, err 21014 } 21015 ret := &UserPhoto{ 21016 ServerResponse: googleapi.ServerResponse{ 21017 Header: res.Header, 21018 HTTPStatusCode: res.StatusCode, 21019 }, 21020 } 21021 target := &ret 21022 if err := gensupport.DecodeResponse(target, res); err != nil { 21023 return nil, err 21024 } 21025 return ret, nil 21026 // { 21027 // "description": "Retrieves the user's photo.", 21028 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21029 // "httpMethod": "GET", 21030 // "id": "directory.users.photos.get", 21031 // "parameterOrder": [ 21032 // "userKey" 21033 // ], 21034 // "parameters": { 21035 // "userKey": { 21036 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 21037 // "location": "path", 21038 // "required": true, 21039 // "type": "string" 21040 // } 21041 // }, 21042 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21043 // "response": { 21044 // "$ref": "UserPhoto" 21045 // }, 21046 // "scopes": [ 21047 // "https://www.googleapis.com/auth/admin.directory.user", 21048 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 21049 // ] 21050 // } 21051 21052} 21053 21054// method id "directory.users.photos.patch": 21055 21056type UsersPhotosPatchCall struct { 21057 s *Service 21058 userKey string 21059 userphoto *UserPhoto 21060 urlParams_ gensupport.URLParams 21061 ctx_ context.Context 21062 header_ http.Header 21063} 21064 21065// Patch: Adds a photo for the user. This method supports [patch 21066// semantics](/admin-sdk/directory/v1/guides/performance#patch). 21067func (r *UsersPhotosService) Patch(userKey string, userphoto *UserPhoto) *UsersPhotosPatchCall { 21068 c := &UsersPhotosPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21069 c.userKey = userKey 21070 c.userphoto = userphoto 21071 return c 21072} 21073 21074// Fields allows partial responses to be retrieved. See 21075// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21076// for more information. 21077func (c *UsersPhotosPatchCall) Fields(s ...googleapi.Field) *UsersPhotosPatchCall { 21078 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21079 return c 21080} 21081 21082// Context sets the context to be used in this call's Do method. Any 21083// pending HTTP request will be aborted if the provided context is 21084// canceled. 21085func (c *UsersPhotosPatchCall) Context(ctx context.Context) *UsersPhotosPatchCall { 21086 c.ctx_ = ctx 21087 return c 21088} 21089 21090// Header returns an http.Header that can be modified by the caller to 21091// add HTTP headers to the request. 21092func (c *UsersPhotosPatchCall) Header() http.Header { 21093 if c.header_ == nil { 21094 c.header_ = make(http.Header) 21095 } 21096 return c.header_ 21097} 21098 21099func (c *UsersPhotosPatchCall) doRequest(alt string) (*http.Response, error) { 21100 reqHeaders := make(http.Header) 21101 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 21102 for k, v := range c.header_ { 21103 reqHeaders[k] = v 21104 } 21105 reqHeaders.Set("User-Agent", c.s.userAgent()) 21106 var body io.Reader = nil 21107 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) 21108 if err != nil { 21109 return nil, err 21110 } 21111 reqHeaders.Set("Content-Type", "application/json") 21112 c.urlParams_.Set("alt", alt) 21113 c.urlParams_.Set("prettyPrint", "false") 21114 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 21115 urls += "?" + c.urlParams_.Encode() 21116 req, err := http.NewRequest("PATCH", urls, body) 21117 if err != nil { 21118 return nil, err 21119 } 21120 req.Header = reqHeaders 21121 googleapi.Expand(req.URL, map[string]string{ 21122 "userKey": c.userKey, 21123 }) 21124 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21125} 21126 21127// Do executes the "directory.users.photos.patch" call. 21128// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 21129// status code is an error. Response headers are in either 21130// *UserPhoto.ServerResponse.Header or (if a response was returned at 21131// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 21132// to check whether the returned error was because 21133// http.StatusNotModified was returned. 21134func (c *UsersPhotosPatchCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 21135 gensupport.SetOptions(c.urlParams_, opts...) 21136 res, err := c.doRequest("json") 21137 if res != nil && res.StatusCode == http.StatusNotModified { 21138 if res.Body != nil { 21139 res.Body.Close() 21140 } 21141 return nil, &googleapi.Error{ 21142 Code: res.StatusCode, 21143 Header: res.Header, 21144 } 21145 } 21146 if err != nil { 21147 return nil, err 21148 } 21149 defer googleapi.CloseBody(res) 21150 if err := googleapi.CheckResponse(res); err != nil { 21151 return nil, err 21152 } 21153 ret := &UserPhoto{ 21154 ServerResponse: googleapi.ServerResponse{ 21155 Header: res.Header, 21156 HTTPStatusCode: res.StatusCode, 21157 }, 21158 } 21159 target := &ret 21160 if err := gensupport.DecodeResponse(target, res); err != nil { 21161 return nil, err 21162 } 21163 return ret, nil 21164 // { 21165 // "description": "Adds a photo for the user. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 21166 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21167 // "httpMethod": "PATCH", 21168 // "id": "directory.users.photos.patch", 21169 // "parameterOrder": [ 21170 // "userKey" 21171 // ], 21172 // "parameters": { 21173 // "userKey": { 21174 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 21175 // "location": "path", 21176 // "required": true, 21177 // "type": "string" 21178 // } 21179 // }, 21180 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21181 // "request": { 21182 // "$ref": "UserPhoto" 21183 // }, 21184 // "response": { 21185 // "$ref": "UserPhoto" 21186 // }, 21187 // "scopes": [ 21188 // "https://www.googleapis.com/auth/admin.directory.user" 21189 // ] 21190 // } 21191 21192} 21193 21194// method id "directory.users.photos.update": 21195 21196type UsersPhotosUpdateCall struct { 21197 s *Service 21198 userKey string 21199 userphoto *UserPhoto 21200 urlParams_ gensupport.URLParams 21201 ctx_ context.Context 21202 header_ http.Header 21203} 21204 21205// Update: Adds a photo for the user. 21206func (r *UsersPhotosService) Update(userKey string, userphoto *UserPhoto) *UsersPhotosUpdateCall { 21207 c := &UsersPhotosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21208 c.userKey = userKey 21209 c.userphoto = userphoto 21210 return c 21211} 21212 21213// Fields allows partial responses to be retrieved. See 21214// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21215// for more information. 21216func (c *UsersPhotosUpdateCall) Fields(s ...googleapi.Field) *UsersPhotosUpdateCall { 21217 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21218 return c 21219} 21220 21221// Context sets the context to be used in this call's Do method. Any 21222// pending HTTP request will be aborted if the provided context is 21223// canceled. 21224func (c *UsersPhotosUpdateCall) Context(ctx context.Context) *UsersPhotosUpdateCall { 21225 c.ctx_ = ctx 21226 return c 21227} 21228 21229// Header returns an http.Header that can be modified by the caller to 21230// add HTTP headers to the request. 21231func (c *UsersPhotosUpdateCall) Header() http.Header { 21232 if c.header_ == nil { 21233 c.header_ = make(http.Header) 21234 } 21235 return c.header_ 21236} 21237 21238func (c *UsersPhotosUpdateCall) doRequest(alt string) (*http.Response, error) { 21239 reqHeaders := make(http.Header) 21240 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 21241 for k, v := range c.header_ { 21242 reqHeaders[k] = v 21243 } 21244 reqHeaders.Set("User-Agent", c.s.userAgent()) 21245 var body io.Reader = nil 21246 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) 21247 if err != nil { 21248 return nil, err 21249 } 21250 reqHeaders.Set("Content-Type", "application/json") 21251 c.urlParams_.Set("alt", alt) 21252 c.urlParams_.Set("prettyPrint", "false") 21253 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 21254 urls += "?" + c.urlParams_.Encode() 21255 req, err := http.NewRequest("PUT", urls, body) 21256 if err != nil { 21257 return nil, err 21258 } 21259 req.Header = reqHeaders 21260 googleapi.Expand(req.URL, map[string]string{ 21261 "userKey": c.userKey, 21262 }) 21263 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21264} 21265 21266// Do executes the "directory.users.photos.update" call. 21267// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 21268// status code is an error. Response headers are in either 21269// *UserPhoto.ServerResponse.Header or (if a response was returned at 21270// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 21271// to check whether the returned error was because 21272// http.StatusNotModified was returned. 21273func (c *UsersPhotosUpdateCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 21274 gensupport.SetOptions(c.urlParams_, opts...) 21275 res, err := c.doRequest("json") 21276 if res != nil && res.StatusCode == http.StatusNotModified { 21277 if res.Body != nil { 21278 res.Body.Close() 21279 } 21280 return nil, &googleapi.Error{ 21281 Code: res.StatusCode, 21282 Header: res.Header, 21283 } 21284 } 21285 if err != nil { 21286 return nil, err 21287 } 21288 defer googleapi.CloseBody(res) 21289 if err := googleapi.CheckResponse(res); err != nil { 21290 return nil, err 21291 } 21292 ret := &UserPhoto{ 21293 ServerResponse: googleapi.ServerResponse{ 21294 Header: res.Header, 21295 HTTPStatusCode: res.StatusCode, 21296 }, 21297 } 21298 target := &ret 21299 if err := gensupport.DecodeResponse(target, res); err != nil { 21300 return nil, err 21301 } 21302 return ret, nil 21303 // { 21304 // "description": "Adds a photo for the user.", 21305 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21306 // "httpMethod": "PUT", 21307 // "id": "directory.users.photos.update", 21308 // "parameterOrder": [ 21309 // "userKey" 21310 // ], 21311 // "parameters": { 21312 // "userKey": { 21313 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 21314 // "location": "path", 21315 // "required": true, 21316 // "type": "string" 21317 // } 21318 // }, 21319 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 21320 // "request": { 21321 // "$ref": "UserPhoto" 21322 // }, 21323 // "response": { 21324 // "$ref": "UserPhoto" 21325 // }, 21326 // "scopes": [ 21327 // "https://www.googleapis.com/auth/admin.directory.user" 21328 // ] 21329 // } 21330 21331} 21332 21333// method id "directory.verificationCodes.generate": 21334 21335type VerificationCodesGenerateCall struct { 21336 s *Service 21337 userKey string 21338 urlParams_ gensupport.URLParams 21339 ctx_ context.Context 21340 header_ http.Header 21341} 21342 21343// Generate: Generate new backup verification codes for the user. 21344func (r *VerificationCodesService) Generate(userKey string) *VerificationCodesGenerateCall { 21345 c := &VerificationCodesGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21346 c.userKey = userKey 21347 return c 21348} 21349 21350// Fields allows partial responses to be retrieved. See 21351// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21352// for more information. 21353func (c *VerificationCodesGenerateCall) Fields(s ...googleapi.Field) *VerificationCodesGenerateCall { 21354 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21355 return c 21356} 21357 21358// Context sets the context to be used in this call's Do method. Any 21359// pending HTTP request will be aborted if the provided context is 21360// canceled. 21361func (c *VerificationCodesGenerateCall) Context(ctx context.Context) *VerificationCodesGenerateCall { 21362 c.ctx_ = ctx 21363 return c 21364} 21365 21366// Header returns an http.Header that can be modified by the caller to 21367// add HTTP headers to the request. 21368func (c *VerificationCodesGenerateCall) Header() http.Header { 21369 if c.header_ == nil { 21370 c.header_ = make(http.Header) 21371 } 21372 return c.header_ 21373} 21374 21375func (c *VerificationCodesGenerateCall) doRequest(alt string) (*http.Response, error) { 21376 reqHeaders := make(http.Header) 21377 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 21378 for k, v := range c.header_ { 21379 reqHeaders[k] = v 21380 } 21381 reqHeaders.Set("User-Agent", c.s.userAgent()) 21382 var body io.Reader = nil 21383 c.urlParams_.Set("alt", alt) 21384 c.urlParams_.Set("prettyPrint", "false") 21385 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/generate") 21386 urls += "?" + c.urlParams_.Encode() 21387 req, err := http.NewRequest("POST", urls, body) 21388 if err != nil { 21389 return nil, err 21390 } 21391 req.Header = reqHeaders 21392 googleapi.Expand(req.URL, map[string]string{ 21393 "userKey": c.userKey, 21394 }) 21395 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21396} 21397 21398// Do executes the "directory.verificationCodes.generate" call. 21399func (c *VerificationCodesGenerateCall) Do(opts ...googleapi.CallOption) error { 21400 gensupport.SetOptions(c.urlParams_, opts...) 21401 res, err := c.doRequest("json") 21402 if err != nil { 21403 return err 21404 } 21405 defer googleapi.CloseBody(res) 21406 if err := googleapi.CheckResponse(res); err != nil { 21407 return err 21408 } 21409 return nil 21410 // { 21411 // "description": "Generate new backup verification codes for the user.", 21412 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes/generate", 21413 // "httpMethod": "POST", 21414 // "id": "directory.verificationCodes.generate", 21415 // "parameterOrder": [ 21416 // "userKey" 21417 // ], 21418 // "parameters": { 21419 // "userKey": { 21420 // "description": "Email or immutable ID of the user", 21421 // "location": "path", 21422 // "required": true, 21423 // "type": "string" 21424 // } 21425 // }, 21426 // "path": "admin/directory/v1/users/{userKey}/verificationCodes/generate", 21427 // "scopes": [ 21428 // "https://www.googleapis.com/auth/admin.directory.user.security" 21429 // ] 21430 // } 21431 21432} 21433 21434// method id "directory.verificationCodes.invalidate": 21435 21436type VerificationCodesInvalidateCall struct { 21437 s *Service 21438 userKey string 21439 urlParams_ gensupport.URLParams 21440 ctx_ context.Context 21441 header_ http.Header 21442} 21443 21444// Invalidate: Invalidate the current backup verification codes for the 21445// user. 21446func (r *VerificationCodesService) Invalidate(userKey string) *VerificationCodesInvalidateCall { 21447 c := &VerificationCodesInvalidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21448 c.userKey = userKey 21449 return c 21450} 21451 21452// Fields allows partial responses to be retrieved. See 21453// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21454// for more information. 21455func (c *VerificationCodesInvalidateCall) Fields(s ...googleapi.Field) *VerificationCodesInvalidateCall { 21456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21457 return c 21458} 21459 21460// Context sets the context to be used in this call's Do method. Any 21461// pending HTTP request will be aborted if the provided context is 21462// canceled. 21463func (c *VerificationCodesInvalidateCall) Context(ctx context.Context) *VerificationCodesInvalidateCall { 21464 c.ctx_ = ctx 21465 return c 21466} 21467 21468// Header returns an http.Header that can be modified by the caller to 21469// add HTTP headers to the request. 21470func (c *VerificationCodesInvalidateCall) Header() http.Header { 21471 if c.header_ == nil { 21472 c.header_ = make(http.Header) 21473 } 21474 return c.header_ 21475} 21476 21477func (c *VerificationCodesInvalidateCall) doRequest(alt string) (*http.Response, error) { 21478 reqHeaders := make(http.Header) 21479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 21480 for k, v := range c.header_ { 21481 reqHeaders[k] = v 21482 } 21483 reqHeaders.Set("User-Agent", c.s.userAgent()) 21484 var body io.Reader = nil 21485 c.urlParams_.Set("alt", alt) 21486 c.urlParams_.Set("prettyPrint", "false") 21487 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/invalidate") 21488 urls += "?" + c.urlParams_.Encode() 21489 req, err := http.NewRequest("POST", urls, body) 21490 if err != nil { 21491 return nil, err 21492 } 21493 req.Header = reqHeaders 21494 googleapi.Expand(req.URL, map[string]string{ 21495 "userKey": c.userKey, 21496 }) 21497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21498} 21499 21500// Do executes the "directory.verificationCodes.invalidate" call. 21501func (c *VerificationCodesInvalidateCall) Do(opts ...googleapi.CallOption) error { 21502 gensupport.SetOptions(c.urlParams_, opts...) 21503 res, err := c.doRequest("json") 21504 if err != nil { 21505 return err 21506 } 21507 defer googleapi.CloseBody(res) 21508 if err := googleapi.CheckResponse(res); err != nil { 21509 return err 21510 } 21511 return nil 21512 // { 21513 // "description": "Invalidate the current backup verification codes for the user.", 21514 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes/invalidate", 21515 // "httpMethod": "POST", 21516 // "id": "directory.verificationCodes.invalidate", 21517 // "parameterOrder": [ 21518 // "userKey" 21519 // ], 21520 // "parameters": { 21521 // "userKey": { 21522 // "description": "Email or immutable ID of the user", 21523 // "location": "path", 21524 // "required": true, 21525 // "type": "string" 21526 // } 21527 // }, 21528 // "path": "admin/directory/v1/users/{userKey}/verificationCodes/invalidate", 21529 // "scopes": [ 21530 // "https://www.googleapis.com/auth/admin.directory.user.security" 21531 // ] 21532 // } 21533 21534} 21535 21536// method id "directory.verificationCodes.list": 21537 21538type VerificationCodesListCall struct { 21539 s *Service 21540 userKey string 21541 urlParams_ gensupport.URLParams 21542 ifNoneMatch_ string 21543 ctx_ context.Context 21544 header_ http.Header 21545} 21546 21547// List: Returns the current set of valid backup verification codes for 21548// the specified user. 21549func (r *VerificationCodesService) List(userKey string) *VerificationCodesListCall { 21550 c := &VerificationCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21551 c.userKey = userKey 21552 return c 21553} 21554 21555// Fields allows partial responses to be retrieved. See 21556// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21557// for more information. 21558func (c *VerificationCodesListCall) Fields(s ...googleapi.Field) *VerificationCodesListCall { 21559 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21560 return c 21561} 21562 21563// IfNoneMatch sets the optional parameter which makes the operation 21564// fail if the object's ETag matches the given value. This is useful for 21565// getting updates only after the object has changed since the last 21566// request. Use googleapi.IsNotModified to check whether the response 21567// error from Do is the result of In-None-Match. 21568func (c *VerificationCodesListCall) IfNoneMatch(entityTag string) *VerificationCodesListCall { 21569 c.ifNoneMatch_ = entityTag 21570 return c 21571} 21572 21573// Context sets the context to be used in this call's Do method. Any 21574// pending HTTP request will be aborted if the provided context is 21575// canceled. 21576func (c *VerificationCodesListCall) Context(ctx context.Context) *VerificationCodesListCall { 21577 c.ctx_ = ctx 21578 return c 21579} 21580 21581// Header returns an http.Header that can be modified by the caller to 21582// add HTTP headers to the request. 21583func (c *VerificationCodesListCall) Header() http.Header { 21584 if c.header_ == nil { 21585 c.header_ = make(http.Header) 21586 } 21587 return c.header_ 21588} 21589 21590func (c *VerificationCodesListCall) doRequest(alt string) (*http.Response, error) { 21591 reqHeaders := make(http.Header) 21592 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 21593 for k, v := range c.header_ { 21594 reqHeaders[k] = v 21595 } 21596 reqHeaders.Set("User-Agent", c.s.userAgent()) 21597 if c.ifNoneMatch_ != "" { 21598 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 21599 } 21600 var body io.Reader = nil 21601 c.urlParams_.Set("alt", alt) 21602 c.urlParams_.Set("prettyPrint", "false") 21603 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes") 21604 urls += "?" + c.urlParams_.Encode() 21605 req, err := http.NewRequest("GET", urls, body) 21606 if err != nil { 21607 return nil, err 21608 } 21609 req.Header = reqHeaders 21610 googleapi.Expand(req.URL, map[string]string{ 21611 "userKey": c.userKey, 21612 }) 21613 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21614} 21615 21616// Do executes the "directory.verificationCodes.list" call. 21617// Exactly one of *VerificationCodes or error will be non-nil. Any 21618// non-2xx status code is an error. Response headers are in either 21619// *VerificationCodes.ServerResponse.Header or (if a response was 21620// returned at all) in error.(*googleapi.Error).Header. Use 21621// googleapi.IsNotModified to check whether the returned error was 21622// because http.StatusNotModified was returned. 21623func (c *VerificationCodesListCall) Do(opts ...googleapi.CallOption) (*VerificationCodes, error) { 21624 gensupport.SetOptions(c.urlParams_, opts...) 21625 res, err := c.doRequest("json") 21626 if res != nil && res.StatusCode == http.StatusNotModified { 21627 if res.Body != nil { 21628 res.Body.Close() 21629 } 21630 return nil, &googleapi.Error{ 21631 Code: res.StatusCode, 21632 Header: res.Header, 21633 } 21634 } 21635 if err != nil { 21636 return nil, err 21637 } 21638 defer googleapi.CloseBody(res) 21639 if err := googleapi.CheckResponse(res); err != nil { 21640 return nil, err 21641 } 21642 ret := &VerificationCodes{ 21643 ServerResponse: googleapi.ServerResponse{ 21644 Header: res.Header, 21645 HTTPStatusCode: res.StatusCode, 21646 }, 21647 } 21648 target := &ret 21649 if err := gensupport.DecodeResponse(target, res); err != nil { 21650 return nil, err 21651 } 21652 return ret, nil 21653 // { 21654 // "description": "Returns the current set of valid backup verification codes for the specified user.", 21655 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes", 21656 // "httpMethod": "GET", 21657 // "id": "directory.verificationCodes.list", 21658 // "parameterOrder": [ 21659 // "userKey" 21660 // ], 21661 // "parameters": { 21662 // "userKey": { 21663 // "description": "Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID.", 21664 // "location": "path", 21665 // "required": true, 21666 // "type": "string" 21667 // } 21668 // }, 21669 // "path": "admin/directory/v1/users/{userKey}/verificationCodes", 21670 // "response": { 21671 // "$ref": "VerificationCodes" 21672 // }, 21673 // "scopes": [ 21674 // "https://www.googleapis.com/auth/admin.directory.user.security" 21675 // ] 21676 // } 21677 21678} 21679