1// Copyright 2021 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: https://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 // See, add, edit, and permanently delete the printers that your 87 // organization can use with Chrome 88 AdminChromePrintersScope = "https://www.googleapis.com/auth/admin.chrome.printers" 89 90 // See the printers that your organization can use with Chrome 91 AdminChromePrintersReadonlyScope = "https://www.googleapis.com/auth/admin.chrome.printers.readonly" 92 93 // View and manage customer related information 94 AdminDirectoryCustomerScope = "https://www.googleapis.com/auth/admin.directory.customer" 95 96 // View customer related information 97 AdminDirectoryCustomerReadonlyScope = "https://www.googleapis.com/auth/admin.directory.customer.readonly" 98 99 // View and manage your Chrome OS devices' metadata 100 AdminDirectoryDeviceChromeosScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos" 101 102 // View your Chrome OS devices' metadata 103 AdminDirectoryDeviceChromeosReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 104 105 // View and manage your mobile devices' metadata 106 AdminDirectoryDeviceMobileScope = "https://www.googleapis.com/auth/admin.directory.device.mobile" 107 108 // Manage your mobile devices by performing administrative tasks 109 AdminDirectoryDeviceMobileActionScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.action" 110 111 // View your mobile devices' metadata 112 AdminDirectoryDeviceMobileReadonlyScope = "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 113 114 // View and manage the provisioning of domains for your customers 115 AdminDirectoryDomainScope = "https://www.googleapis.com/auth/admin.directory.domain" 116 117 // View domains related to your customers 118 AdminDirectoryDomainReadonlyScope = "https://www.googleapis.com/auth/admin.directory.domain.readonly" 119 120 // View and manage the provisioning of groups on your domain 121 AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group" 122 123 // View and manage group subscriptions on your domain 124 AdminDirectoryGroupMemberScope = "https://www.googleapis.com/auth/admin.directory.group.member" 125 126 // View group subscriptions on your domain 127 AdminDirectoryGroupMemberReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.member.readonly" 128 129 // View groups on your domain 130 AdminDirectoryGroupReadonlyScope = "https://www.googleapis.com/auth/admin.directory.group.readonly" 131 132 // View and manage organization units on your domain 133 AdminDirectoryOrgunitScope = "https://www.googleapis.com/auth/admin.directory.orgunit" 134 135 // View organization units on your domain 136 AdminDirectoryOrgunitReadonlyScope = "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 137 138 // View and manage the provisioning of calendar resources on your domain 139 AdminDirectoryResourceCalendarScope = "https://www.googleapis.com/auth/admin.directory.resource.calendar" 140 141 // View calendar resources on your domain 142 AdminDirectoryResourceCalendarReadonlyScope = "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 143 144 // Manage delegated admin roles for your domain 145 AdminDirectoryRolemanagementScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement" 146 147 // View delegated admin roles for your domain 148 AdminDirectoryRolemanagementReadonlyScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 149 150 // View and manage the provisioning of users on your domain 151 AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user" 152 153 // View and manage user aliases on your domain 154 AdminDirectoryUserAliasScope = "https://www.googleapis.com/auth/admin.directory.user.alias" 155 156 // View user aliases on your domain 157 AdminDirectoryUserAliasReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.alias.readonly" 158 159 // See info about users on your domain 160 AdminDirectoryUserReadonlyScope = "https://www.googleapis.com/auth/admin.directory.user.readonly" 161 162 // Manage data access permissions for users on your domain 163 AdminDirectoryUserSecurityScope = "https://www.googleapis.com/auth/admin.directory.user.security" 164 165 // View and manage the provisioning of user schemas on your domain 166 AdminDirectoryUserschemaScope = "https://www.googleapis.com/auth/admin.directory.userschema" 167 168 // View user schemas on your domain 169 AdminDirectoryUserschemaReadonlyScope = "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 170 171 // See, edit, configure, and delete your Google Cloud data and see the 172 // email address for your Google Account. 173 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 174) 175 176// NewService creates a new Service. 177func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 178 scopesOption := option.WithScopes( 179 "https://www.googleapis.com/auth/admin.chrome.printers", 180 "https://www.googleapis.com/auth/admin.chrome.printers.readonly", 181 "https://www.googleapis.com/auth/admin.directory.customer", 182 "https://www.googleapis.com/auth/admin.directory.customer.readonly", 183 "https://www.googleapis.com/auth/admin.directory.device.chromeos", 184 "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly", 185 "https://www.googleapis.com/auth/admin.directory.device.mobile", 186 "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 187 "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly", 188 "https://www.googleapis.com/auth/admin.directory.domain", 189 "https://www.googleapis.com/auth/admin.directory.domain.readonly", 190 "https://www.googleapis.com/auth/admin.directory.group", 191 "https://www.googleapis.com/auth/admin.directory.group.member", 192 "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 193 "https://www.googleapis.com/auth/admin.directory.group.readonly", 194 "https://www.googleapis.com/auth/admin.directory.orgunit", 195 "https://www.googleapis.com/auth/admin.directory.orgunit.readonly", 196 "https://www.googleapis.com/auth/admin.directory.resource.calendar", 197 "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly", 198 "https://www.googleapis.com/auth/admin.directory.rolemanagement", 199 "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly", 200 "https://www.googleapis.com/auth/admin.directory.user", 201 "https://www.googleapis.com/auth/admin.directory.user.alias", 202 "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 203 "https://www.googleapis.com/auth/admin.directory.user.readonly", 204 "https://www.googleapis.com/auth/admin.directory.user.security", 205 "https://www.googleapis.com/auth/admin.directory.userschema", 206 "https://www.googleapis.com/auth/admin.directory.userschema.readonly", 207 "https://www.googleapis.com/auth/cloud-platform", 208 ) 209 // NOTE: prepend, so we don't override user-specified scopes. 210 opts = append([]option.ClientOption{scopesOption}, opts...) 211 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 212 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 213 client, endpoint, err := htransport.NewClient(ctx, opts...) 214 if err != nil { 215 return nil, err 216 } 217 s, err := New(client) 218 if err != nil { 219 return nil, err 220 } 221 if endpoint != "" { 222 s.BasePath = endpoint 223 } 224 return s, nil 225} 226 227// New creates a new Service. It uses the provided http.Client for requests. 228// 229// Deprecated: please use NewService instead. 230// To provide a custom HTTP client, use option.WithHTTPClient. 231// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 232func New(client *http.Client) (*Service, error) { 233 if client == nil { 234 return nil, errors.New("client is nil") 235 } 236 s := &Service{client: client, BasePath: basePath} 237 s.Asps = NewAspsService(s) 238 s.Channels = NewChannelsService(s) 239 s.Chromeosdevices = NewChromeosdevicesService(s) 240 s.Customer = NewCustomerService(s) 241 s.Customers = NewCustomersService(s) 242 s.DomainAliases = NewDomainAliasesService(s) 243 s.Domains = NewDomainsService(s) 244 s.Groups = NewGroupsService(s) 245 s.Members = NewMembersService(s) 246 s.Mobiledevices = NewMobiledevicesService(s) 247 s.Orgunits = NewOrgunitsService(s) 248 s.Privileges = NewPrivilegesService(s) 249 s.Resources = NewResourcesService(s) 250 s.RoleAssignments = NewRoleAssignmentsService(s) 251 s.Roles = NewRolesService(s) 252 s.Schemas = NewSchemasService(s) 253 s.Tokens = NewTokensService(s) 254 s.TwoStepVerification = NewTwoStepVerificationService(s) 255 s.Users = NewUsersService(s) 256 s.VerificationCodes = NewVerificationCodesService(s) 257 return s, nil 258} 259 260type Service struct { 261 client *http.Client 262 BasePath string // API endpoint base URL 263 UserAgent string // optional additional User-Agent fragment 264 265 Asps *AspsService 266 267 Channels *ChannelsService 268 269 Chromeosdevices *ChromeosdevicesService 270 271 Customer *CustomerService 272 273 Customers *CustomersService 274 275 DomainAliases *DomainAliasesService 276 277 Domains *DomainsService 278 279 Groups *GroupsService 280 281 Members *MembersService 282 283 Mobiledevices *MobiledevicesService 284 285 Orgunits *OrgunitsService 286 287 Privileges *PrivilegesService 288 289 Resources *ResourcesService 290 291 RoleAssignments *RoleAssignmentsService 292 293 Roles *RolesService 294 295 Schemas *SchemasService 296 297 Tokens *TokensService 298 299 TwoStepVerification *TwoStepVerificationService 300 301 Users *UsersService 302 303 VerificationCodes *VerificationCodesService 304} 305 306func (s *Service) userAgent() string { 307 if s.UserAgent == "" { 308 return googleapi.UserAgent 309 } 310 return googleapi.UserAgent + " " + s.UserAgent 311} 312 313func NewAspsService(s *Service) *AspsService { 314 rs := &AspsService{s: s} 315 return rs 316} 317 318type AspsService struct { 319 s *Service 320} 321 322func NewChannelsService(s *Service) *ChannelsService { 323 rs := &ChannelsService{s: s} 324 return rs 325} 326 327type ChannelsService struct { 328 s *Service 329} 330 331func NewChromeosdevicesService(s *Service) *ChromeosdevicesService { 332 rs := &ChromeosdevicesService{s: s} 333 return rs 334} 335 336type ChromeosdevicesService struct { 337 s *Service 338} 339 340func NewCustomerService(s *Service) *CustomerService { 341 rs := &CustomerService{s: s} 342 rs.Devices = NewCustomerDevicesService(s) 343 return rs 344} 345 346type CustomerService struct { 347 s *Service 348 349 Devices *CustomerDevicesService 350} 351 352func NewCustomerDevicesService(s *Service) *CustomerDevicesService { 353 rs := &CustomerDevicesService{s: s} 354 rs.Chromeos = NewCustomerDevicesChromeosService(s) 355 return rs 356} 357 358type CustomerDevicesService struct { 359 s *Service 360 361 Chromeos *CustomerDevicesChromeosService 362} 363 364func NewCustomerDevicesChromeosService(s *Service) *CustomerDevicesChromeosService { 365 rs := &CustomerDevicesChromeosService{s: s} 366 rs.Commands = NewCustomerDevicesChromeosCommandsService(s) 367 return rs 368} 369 370type CustomerDevicesChromeosService struct { 371 s *Service 372 373 Commands *CustomerDevicesChromeosCommandsService 374} 375 376func NewCustomerDevicesChromeosCommandsService(s *Service) *CustomerDevicesChromeosCommandsService { 377 rs := &CustomerDevicesChromeosCommandsService{s: s} 378 return rs 379} 380 381type CustomerDevicesChromeosCommandsService struct { 382 s *Service 383} 384 385func NewCustomersService(s *Service) *CustomersService { 386 rs := &CustomersService{s: s} 387 rs.Chrome = NewCustomersChromeService(s) 388 return rs 389} 390 391type CustomersService struct { 392 s *Service 393 394 Chrome *CustomersChromeService 395} 396 397func NewCustomersChromeService(s *Service) *CustomersChromeService { 398 rs := &CustomersChromeService{s: s} 399 rs.Printers = NewCustomersChromePrintersService(s) 400 return rs 401} 402 403type CustomersChromeService struct { 404 s *Service 405 406 Printers *CustomersChromePrintersService 407} 408 409func NewCustomersChromePrintersService(s *Service) *CustomersChromePrintersService { 410 rs := &CustomersChromePrintersService{s: s} 411 return rs 412} 413 414type CustomersChromePrintersService struct { 415 s *Service 416} 417 418func NewDomainAliasesService(s *Service) *DomainAliasesService { 419 rs := &DomainAliasesService{s: s} 420 return rs 421} 422 423type DomainAliasesService struct { 424 s *Service 425} 426 427func NewDomainsService(s *Service) *DomainsService { 428 rs := &DomainsService{s: s} 429 return rs 430} 431 432type DomainsService struct { 433 s *Service 434} 435 436func NewGroupsService(s *Service) *GroupsService { 437 rs := &GroupsService{s: s} 438 rs.Aliases = NewGroupsAliasesService(s) 439 return rs 440} 441 442type GroupsService struct { 443 s *Service 444 445 Aliases *GroupsAliasesService 446} 447 448func NewGroupsAliasesService(s *Service) *GroupsAliasesService { 449 rs := &GroupsAliasesService{s: s} 450 return rs 451} 452 453type GroupsAliasesService struct { 454 s *Service 455} 456 457func NewMembersService(s *Service) *MembersService { 458 rs := &MembersService{s: s} 459 return rs 460} 461 462type MembersService struct { 463 s *Service 464} 465 466func NewMobiledevicesService(s *Service) *MobiledevicesService { 467 rs := &MobiledevicesService{s: s} 468 return rs 469} 470 471type MobiledevicesService struct { 472 s *Service 473} 474 475func NewOrgunitsService(s *Service) *OrgunitsService { 476 rs := &OrgunitsService{s: s} 477 return rs 478} 479 480type OrgunitsService struct { 481 s *Service 482} 483 484func NewPrivilegesService(s *Service) *PrivilegesService { 485 rs := &PrivilegesService{s: s} 486 return rs 487} 488 489type PrivilegesService struct { 490 s *Service 491} 492 493func NewResourcesService(s *Service) *ResourcesService { 494 rs := &ResourcesService{s: s} 495 rs.Buildings = NewResourcesBuildingsService(s) 496 rs.Calendars = NewResourcesCalendarsService(s) 497 rs.Features = NewResourcesFeaturesService(s) 498 return rs 499} 500 501type ResourcesService struct { 502 s *Service 503 504 Buildings *ResourcesBuildingsService 505 506 Calendars *ResourcesCalendarsService 507 508 Features *ResourcesFeaturesService 509} 510 511func NewResourcesBuildingsService(s *Service) *ResourcesBuildingsService { 512 rs := &ResourcesBuildingsService{s: s} 513 return rs 514} 515 516type ResourcesBuildingsService struct { 517 s *Service 518} 519 520func NewResourcesCalendarsService(s *Service) *ResourcesCalendarsService { 521 rs := &ResourcesCalendarsService{s: s} 522 return rs 523} 524 525type ResourcesCalendarsService struct { 526 s *Service 527} 528 529func NewResourcesFeaturesService(s *Service) *ResourcesFeaturesService { 530 rs := &ResourcesFeaturesService{s: s} 531 return rs 532} 533 534type ResourcesFeaturesService struct { 535 s *Service 536} 537 538func NewRoleAssignmentsService(s *Service) *RoleAssignmentsService { 539 rs := &RoleAssignmentsService{s: s} 540 return rs 541} 542 543type RoleAssignmentsService struct { 544 s *Service 545} 546 547func NewRolesService(s *Service) *RolesService { 548 rs := &RolesService{s: s} 549 return rs 550} 551 552type RolesService struct { 553 s *Service 554} 555 556func NewSchemasService(s *Service) *SchemasService { 557 rs := &SchemasService{s: s} 558 return rs 559} 560 561type SchemasService struct { 562 s *Service 563} 564 565func NewTokensService(s *Service) *TokensService { 566 rs := &TokensService{s: s} 567 return rs 568} 569 570type TokensService struct { 571 s *Service 572} 573 574func NewTwoStepVerificationService(s *Service) *TwoStepVerificationService { 575 rs := &TwoStepVerificationService{s: s} 576 return rs 577} 578 579type TwoStepVerificationService struct { 580 s *Service 581} 582 583func NewUsersService(s *Service) *UsersService { 584 rs := &UsersService{s: s} 585 rs.Aliases = NewUsersAliasesService(s) 586 rs.Photos = NewUsersPhotosService(s) 587 return rs 588} 589 590type UsersService struct { 591 s *Service 592 593 Aliases *UsersAliasesService 594 595 Photos *UsersPhotosService 596} 597 598func NewUsersAliasesService(s *Service) *UsersAliasesService { 599 rs := &UsersAliasesService{s: s} 600 return rs 601} 602 603type UsersAliasesService struct { 604 s *Service 605} 606 607func NewUsersPhotosService(s *Service) *UsersPhotosService { 608 rs := &UsersPhotosService{s: s} 609 return rs 610} 611 612type UsersPhotosService struct { 613 s *Service 614} 615 616func NewVerificationCodesService(s *Service) *VerificationCodesService { 617 rs := &VerificationCodesService{s: s} 618 return rs 619} 620 621type VerificationCodesService struct { 622 s *Service 623} 624 625// Alias: JSON template for Alias object in Directory API. 626type Alias struct { 627 Alias string `json:"alias,omitempty"` 628 629 Etag string `json:"etag,omitempty"` 630 631 Id string `json:"id,omitempty"` 632 633 Kind string `json:"kind,omitempty"` 634 635 PrimaryEmail string `json:"primaryEmail,omitempty"` 636 637 // ServerResponse contains the HTTP response code and headers from the 638 // server. 639 googleapi.ServerResponse `json:"-"` 640 641 // ForceSendFields is a list of field names (e.g. "Alias") to 642 // unconditionally include in API requests. By default, fields with 643 // empty or default values are omitted from API requests. However, any 644 // non-pointer, non-interface field appearing in ForceSendFields will be 645 // sent to the server regardless of whether the field is empty or not. 646 // This may be used to include empty fields in Patch requests. 647 ForceSendFields []string `json:"-"` 648 649 // NullFields is a list of field names (e.g. "Alias") to include in API 650 // requests with the JSON null value. By default, fields with empty 651 // values are omitted from API requests. However, any field with an 652 // empty value appearing in NullFields will be sent to the server as 653 // null. It is an error if a field in this list has a non-empty value. 654 // This may be used to include null fields in Patch requests. 655 NullFields []string `json:"-"` 656} 657 658func (s *Alias) MarshalJSON() ([]byte, error) { 659 type NoMethod Alias 660 raw := NoMethod(*s) 661 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 662} 663 664// Aliases: JSON response template to list aliases in Directory API. 665type Aliases struct { 666 Aliases []interface{} `json:"aliases,omitempty"` 667 668 Etag string `json:"etag,omitempty"` 669 670 Kind string `json:"kind,omitempty"` 671 672 // ServerResponse contains the HTTP response code and headers from the 673 // server. 674 googleapi.ServerResponse `json:"-"` 675 676 // ForceSendFields is a list of field names (e.g. "Aliases") to 677 // unconditionally include in API requests. By default, fields with 678 // empty or default values are omitted from API requests. However, any 679 // non-pointer, non-interface field appearing in ForceSendFields will be 680 // sent to the server regardless of whether the field is empty or not. 681 // This may be used to include empty fields in Patch requests. 682 ForceSendFields []string `json:"-"` 683 684 // NullFields is a list of field names (e.g. "Aliases") to include in 685 // API requests with the JSON null value. By default, fields with empty 686 // values are omitted from API requests. However, any field with an 687 // empty value appearing in NullFields will be sent to the server as 688 // null. It is an error if a field in this list has a non-empty value. 689 // This may be used to include null fields in Patch requests. 690 NullFields []string `json:"-"` 691} 692 693func (s *Aliases) MarshalJSON() ([]byte, error) { 694 type NoMethod Aliases 695 raw := NoMethod(*s) 696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 697} 698 699// Asp: An application-specific password (ASP) is used with applications 700// that do not accept a verification code when logging into the 701// application on certain devices. The ASP access code is used instead 702// of the login and password you commonly use when accessing an 703// application through a browser. For more information about ASPs and 704// how to create one, see the help center 705// (https://support.google.com/a/answer/2537800#asp). 706type Asp struct { 707 // CodeId: The unique ID of the ASP. 708 CodeId int64 `json:"codeId,omitempty"` 709 710 // CreationTime: The time when the ASP was created. Expressed in Unix 711 // time (https://en.wikipedia.org/wiki/Epoch_time) format. 712 CreationTime int64 `json:"creationTime,omitempty,string"` 713 714 // Etag: ETag of the ASP. 715 Etag string `json:"etag,omitempty"` 716 717 // Kind: The type of the API resource. This is always 718 // `admin#directory#asp`. 719 Kind string `json:"kind,omitempty"` 720 721 // LastTimeUsed: The time when the ASP was last used. Expressed in Unix 722 // time (https://en.wikipedia.org/wiki/Epoch_time) format. 723 LastTimeUsed int64 `json:"lastTimeUsed,omitempty,string"` 724 725 // Name: The name of the application that the user, represented by their 726 // `userId`, entered when the ASP was created. 727 Name string `json:"name,omitempty"` 728 729 // UserKey: The unique ID of the user who issued the ASP. 730 UserKey string `json:"userKey,omitempty"` 731 732 // ServerResponse contains the HTTP response code and headers from the 733 // server. 734 googleapi.ServerResponse `json:"-"` 735 736 // ForceSendFields is a list of field names (e.g. "CodeId") to 737 // unconditionally include in API requests. By default, fields with 738 // empty or default values are omitted from API requests. However, any 739 // non-pointer, non-interface field appearing in ForceSendFields will be 740 // sent to the server regardless of whether the field is empty or not. 741 // This may be used to include empty fields in Patch requests. 742 ForceSendFields []string `json:"-"` 743 744 // NullFields is a list of field names (e.g. "CodeId") to include in API 745 // requests with the JSON null value. By default, fields with empty 746 // values are omitted from API requests. However, any field with an 747 // empty value appearing in NullFields will be sent to the server as 748 // null. It is an error if a field in this list has a non-empty value. 749 // This may be used to include null fields in Patch requests. 750 NullFields []string `json:"-"` 751} 752 753func (s *Asp) MarshalJSON() ([]byte, error) { 754 type NoMethod Asp 755 raw := NoMethod(*s) 756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 757} 758 759type Asps struct { 760 // Etag: ETag of the resource. 761 Etag string `json:"etag,omitempty"` 762 763 // Items: A list of ASP resources. 764 Items []*Asp `json:"items,omitempty"` 765 766 // Kind: The type of the API resource. This is always 767 // `admin#directory#aspList`. 768 Kind string `json:"kind,omitempty"` 769 770 // ServerResponse contains the HTTP response code and headers from the 771 // server. 772 googleapi.ServerResponse `json:"-"` 773 774 // ForceSendFields is a list of field names (e.g. "Etag") to 775 // unconditionally include in API requests. By default, fields with 776 // empty or default values are omitted from API requests. However, any 777 // non-pointer, non-interface field appearing in ForceSendFields will be 778 // sent to the server regardless of whether the field is empty or not. 779 // This may be used to include empty fields in Patch requests. 780 ForceSendFields []string `json:"-"` 781 782 // NullFields is a list of field names (e.g. "Etag") to include in API 783 // requests with the JSON null value. By default, fields with empty 784 // values are omitted from API requests. However, any field with an 785 // empty value appearing in NullFields will be sent to the server as 786 // null. It is an error if a field in this list has a non-empty value. 787 // This may be used to include null fields in Patch requests. 788 NullFields []string `json:"-"` 789} 790 791func (s *Asps) MarshalJSON() ([]byte, error) { 792 type NoMethod Asps 793 raw := NoMethod(*s) 794 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 795} 796 797// AuxiliaryMessage: Auxiliary message about issues with printers or 798// settings. Example: {message_type:AUXILIARY_MESSAGE_WARNING, 799// field_mask:make_and_model, message:"Given printer is invalid or no 800// longer supported."} 801type AuxiliaryMessage struct { 802 // AuxiliaryMessage: Human readable message in English. Example: "Given 803 // printer is invalid or no longer supported." 804 AuxiliaryMessage string `json:"auxiliaryMessage,omitempty"` 805 806 // FieldMask: Field that this message concerns. 807 FieldMask string `json:"fieldMask,omitempty"` 808 809 // Severity: Message severity 810 // 811 // Possible values: 812 // "SEVERITY_UNSPECIFIED" - Message type unspecified. 813 // "SEVERITY_INFO" - Message of severity: info. 814 // "SEVERITY_WARNING" - Message of severity: warning. 815 // "SEVERITY_ERROR" - Message of severity: error. 816 Severity string `json:"severity,omitempty"` 817 818 // ForceSendFields is a list of field names (e.g. "AuxiliaryMessage") to 819 // unconditionally include in API requests. By default, fields with 820 // empty or default values are omitted from API requests. However, any 821 // non-pointer, non-interface field appearing in ForceSendFields will be 822 // sent to the server regardless of whether the field is empty or not. 823 // This may be used to include empty fields in Patch requests. 824 ForceSendFields []string `json:"-"` 825 826 // NullFields is a list of field names (e.g. "AuxiliaryMessage") to 827 // include in API requests with the JSON null value. By default, fields 828 // with empty values are omitted from API requests. However, any field 829 // with an empty value appearing in NullFields will be sent to the 830 // server as null. It is an error if a field in this list has a 831 // non-empty value. This may be used to include null fields in Patch 832 // requests. 833 NullFields []string `json:"-"` 834} 835 836func (s *AuxiliaryMessage) MarshalJSON() ([]byte, error) { 837 type NoMethod AuxiliaryMessage 838 raw := NoMethod(*s) 839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 840} 841 842// BatchCreatePrintersRequest: Request for adding new printers in batch. 843type BatchCreatePrintersRequest struct { 844 // Requests: A list of Printers to be created. Max 50 at a time. 845 Requests []*CreatePrinterRequest `json:"requests,omitempty"` 846 847 // ForceSendFields is a list of field names (e.g. "Requests") to 848 // unconditionally include in API requests. By default, fields with 849 // empty or default values are omitted from API requests. However, any 850 // non-pointer, non-interface field appearing in ForceSendFields will be 851 // sent to the server regardless of whether the field is empty or not. 852 // This may be used to include empty fields in Patch requests. 853 ForceSendFields []string `json:"-"` 854 855 // NullFields is a list of field names (e.g. "Requests") to include in 856 // API requests with the JSON null value. By default, fields with empty 857 // values are omitted from API requests. However, any field with an 858 // empty value appearing in NullFields will be sent to the server as 859 // null. It is an error if a field in this list has a non-empty value. 860 // This may be used to include null fields in Patch requests. 861 NullFields []string `json:"-"` 862} 863 864func (s *BatchCreatePrintersRequest) MarshalJSON() ([]byte, error) { 865 type NoMethod BatchCreatePrintersRequest 866 raw := NoMethod(*s) 867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 868} 869 870// BatchCreatePrintersResponse: Response for adding new printers in 871// batch. 872type BatchCreatePrintersResponse struct { 873 // Failures: A list of create failures. Printer IDs are not populated, 874 // as printer were not created. 875 Failures []*FailureInfo `json:"failures,omitempty"` 876 877 // Printers: A list of successfully created printers with their IDs 878 // populated. 879 Printers []*Printer `json:"printers,omitempty"` 880 881 // ServerResponse contains the HTTP response code and headers from the 882 // server. 883 googleapi.ServerResponse `json:"-"` 884 885 // ForceSendFields is a list of field names (e.g. "Failures") to 886 // unconditionally include in API requests. By default, fields with 887 // empty or default values are omitted from API requests. However, any 888 // non-pointer, non-interface field appearing in ForceSendFields will be 889 // sent to the server regardless of whether the field is empty or not. 890 // This may be used to include empty fields in Patch requests. 891 ForceSendFields []string `json:"-"` 892 893 // NullFields is a list of field names (e.g. "Failures") to include in 894 // API requests with the JSON null value. By default, fields with empty 895 // values are omitted from API requests. However, any field with an 896 // empty value appearing in NullFields will be sent to the server as 897 // null. It is an error if a field in this list has a non-empty value. 898 // This may be used to include null fields in Patch requests. 899 NullFields []string `json:"-"` 900} 901 902func (s *BatchCreatePrintersResponse) MarshalJSON() ([]byte, error) { 903 type NoMethod BatchCreatePrintersResponse 904 raw := NoMethod(*s) 905 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 906} 907 908// BatchDeletePrintersRequest: Request for deleting existing printers in 909// batch. 910type BatchDeletePrintersRequest struct { 911 // PrinterIds: A list of Printer.id that should be deleted. Max 100 at a 912 // time. 913 PrinterIds []string `json:"printerIds,omitempty"` 914 915 // ForceSendFields is a list of field names (e.g. "PrinterIds") to 916 // unconditionally include in API requests. By default, fields with 917 // empty or default values are omitted from API requests. However, any 918 // non-pointer, non-interface field appearing in ForceSendFields will be 919 // sent to the server regardless of whether the field is empty or not. 920 // This may be used to include empty fields in Patch requests. 921 ForceSendFields []string `json:"-"` 922 923 // NullFields is a list of field names (e.g. "PrinterIds") to include in 924 // API requests with the JSON null value. By default, fields with empty 925 // values are omitted from API requests. However, any field with an 926 // empty value appearing in NullFields will be sent to the server as 927 // null. It is an error if a field in this list has a non-empty value. 928 // This may be used to include null fields in Patch requests. 929 NullFields []string `json:"-"` 930} 931 932func (s *BatchDeletePrintersRequest) MarshalJSON() ([]byte, error) { 933 type NoMethod BatchDeletePrintersRequest 934 raw := NoMethod(*s) 935 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 936} 937 938// BatchDeletePrintersResponse: Response for deleting existing printers 939// in batch. 940type BatchDeletePrintersResponse struct { 941 // FailedPrinters: A list of update failures. 942 FailedPrinters []*FailureInfo `json:"failedPrinters,omitempty"` 943 944 // PrinterIds: A list of Printer.id that were successfully deleted. 945 PrinterIds []string `json:"printerIds,omitempty"` 946 947 // ServerResponse contains the HTTP response code and headers from the 948 // server. 949 googleapi.ServerResponse `json:"-"` 950 951 // ForceSendFields is a list of field names (e.g. "FailedPrinters") to 952 // unconditionally include in API requests. By default, fields with 953 // empty or default values are omitted from API requests. However, any 954 // non-pointer, non-interface field appearing in ForceSendFields will be 955 // sent to the server regardless of whether the field is empty or not. 956 // This may be used to include empty fields in Patch requests. 957 ForceSendFields []string `json:"-"` 958 959 // NullFields is a list of field names (e.g. "FailedPrinters") to 960 // include in API requests with the JSON null value. By default, fields 961 // with empty values are omitted from API requests. However, any field 962 // with an empty value appearing in NullFields will be sent to the 963 // server as null. It is an error if a field in this list has a 964 // non-empty value. This may be used to include null fields in Patch 965 // requests. 966 NullFields []string `json:"-"` 967} 968 969func (s *BatchDeletePrintersResponse) MarshalJSON() ([]byte, error) { 970 type NoMethod BatchDeletePrintersResponse 971 raw := NoMethod(*s) 972 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 973} 974 975// Building: Public API: Resources.buildings 976type Building struct { 977 // Address: The postal address of the building. See `PostalAddress` 978 // (/my-business/reference/rest/v4/PostalAddress) for details. Note that 979 // only a single address line and region code are required. 980 Address *BuildingAddress `json:"address,omitempty"` 981 982 // BuildingId: Unique identifier for the building. The maximum length is 983 // 100 characters. 984 BuildingId string `json:"buildingId,omitempty"` 985 986 // BuildingName: The building name as seen by users in Calendar. Must be 987 // unique for the customer. For example, "NYC-CHEL". The maximum length 988 // is 100 characters. 989 BuildingName string `json:"buildingName,omitempty"` 990 991 // Coordinates: The geographic coordinates of the center of the 992 // building, expressed as latitude and longitude in decimal degrees. 993 Coordinates *BuildingCoordinates `json:"coordinates,omitempty"` 994 995 // Description: A brief description of the building. For example, 996 // "Chelsea Market". 997 Description string `json:"description,omitempty"` 998 999 // Etags: ETag of the resource. 1000 Etags string `json:"etags,omitempty"` 1001 1002 // FloorNames: The display names for all floors in this building. The 1003 // floors are expected to be sorted in ascending order, from lowest 1004 // floor to highest floor. For example, ["B2", "B1", "L", "1", "2", 1005 // "2M", "3", "PH"] Must contain at least one entry. 1006 FloorNames []string `json:"floorNames,omitempty"` 1007 1008 // Kind: Kind of resource this is. 1009 Kind string `json:"kind,omitempty"` 1010 1011 // ServerResponse contains the HTTP response code and headers from the 1012 // server. 1013 googleapi.ServerResponse `json:"-"` 1014 1015 // ForceSendFields is a list of field names (e.g. "Address") to 1016 // unconditionally include in API requests. By default, fields with 1017 // empty or default values are omitted from API requests. However, any 1018 // non-pointer, non-interface field appearing in ForceSendFields will be 1019 // sent to the server regardless of whether the field is empty or not. 1020 // This may be used to include empty fields in Patch requests. 1021 ForceSendFields []string `json:"-"` 1022 1023 // NullFields is a list of field names (e.g. "Address") to include in 1024 // API requests with the JSON null value. By default, fields with empty 1025 // values are omitted from API requests. However, any field with an 1026 // empty value appearing in NullFields will be sent to the server as 1027 // null. It is an error if a field in this list has a non-empty value. 1028 // This may be used to include null fields in Patch requests. 1029 NullFields []string `json:"-"` 1030} 1031 1032func (s *Building) MarshalJSON() ([]byte, error) { 1033 type NoMethod Building 1034 raw := NoMethod(*s) 1035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1036} 1037 1038// BuildingAddress: Public API: Resources.buildings 1039type BuildingAddress struct { 1040 // AddressLines: Unstructured address lines describing the lower levels 1041 // of an address. 1042 AddressLines []string `json:"addressLines,omitempty"` 1043 1044 // AdministrativeArea: Optional. Highest administrative subdivision 1045 // which is used for postal addresses of a country or region. 1046 AdministrativeArea string `json:"administrativeArea,omitempty"` 1047 1048 // LanguageCode: Optional. BCP-47 language code of the contents of this 1049 // address (if known). 1050 LanguageCode string `json:"languageCode,omitempty"` 1051 1052 // Locality: Optional. Generally refers to the city/town portion of the 1053 // address. Examples: US city, IT comune, UK post town. In regions of 1054 // the world where localities are not well defined or do not fit into 1055 // this structure well, leave locality empty and use addressLines. 1056 Locality string `json:"locality,omitempty"` 1057 1058 // PostalCode: Optional. Postal code of the address. 1059 PostalCode string `json:"postalCode,omitempty"` 1060 1061 // RegionCode: Required. CLDR region code of the country/region of the 1062 // address. 1063 RegionCode string `json:"regionCode,omitempty"` 1064 1065 // Sublocality: Optional. Sublocality of the address. 1066 Sublocality string `json:"sublocality,omitempty"` 1067 1068 // ForceSendFields is a list of field names (e.g. "AddressLines") to 1069 // unconditionally include in API requests. By default, fields with 1070 // empty or default values are omitted from API requests. However, any 1071 // non-pointer, non-interface field appearing in ForceSendFields will be 1072 // sent to the server regardless of whether the field is empty or not. 1073 // This may be used to include empty fields in Patch requests. 1074 ForceSendFields []string `json:"-"` 1075 1076 // NullFields is a list of field names (e.g. "AddressLines") to include 1077 // in API requests with the JSON null value. By default, fields with 1078 // empty values are omitted from API requests. However, any field with 1079 // an empty value appearing in NullFields will be sent to the server as 1080 // null. It is an error if a field in this list has a non-empty value. 1081 // This may be used to include null fields in Patch requests. 1082 NullFields []string `json:"-"` 1083} 1084 1085func (s *BuildingAddress) MarshalJSON() ([]byte, error) { 1086 type NoMethod BuildingAddress 1087 raw := NoMethod(*s) 1088 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1089} 1090 1091// BuildingCoordinates: Public API: Resources.buildings 1092type BuildingCoordinates struct { 1093 // Latitude: Latitude in decimal degrees. 1094 Latitude float64 `json:"latitude,omitempty"` 1095 1096 // Longitude: Longitude in decimal degrees. 1097 Longitude float64 `json:"longitude,omitempty"` 1098 1099 // ForceSendFields is a list of field names (e.g. "Latitude") to 1100 // unconditionally include in API requests. By default, fields with 1101 // empty or default values are omitted from API requests. However, any 1102 // non-pointer, non-interface field appearing in ForceSendFields will be 1103 // sent to the server regardless of whether the field is empty or not. 1104 // This may be used to include empty fields in Patch requests. 1105 ForceSendFields []string `json:"-"` 1106 1107 // NullFields is a list of field names (e.g. "Latitude") to include in 1108 // API requests with the JSON null value. By default, fields with empty 1109 // values are omitted from API requests. However, any field with an 1110 // empty value appearing in NullFields will be sent to the server as 1111 // null. It is an error if a field in this list has a non-empty value. 1112 // This may be used to include null fields in Patch requests. 1113 NullFields []string `json:"-"` 1114} 1115 1116func (s *BuildingCoordinates) MarshalJSON() ([]byte, error) { 1117 type NoMethod BuildingCoordinates 1118 raw := NoMethod(*s) 1119 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1120} 1121 1122func (s *BuildingCoordinates) UnmarshalJSON(data []byte) error { 1123 type NoMethod BuildingCoordinates 1124 var s1 struct { 1125 Latitude gensupport.JSONFloat64 `json:"latitude"` 1126 Longitude gensupport.JSONFloat64 `json:"longitude"` 1127 *NoMethod 1128 } 1129 s1.NoMethod = (*NoMethod)(s) 1130 if err := json.Unmarshal(data, &s1); err != nil { 1131 return err 1132 } 1133 s.Latitude = float64(s1.Latitude) 1134 s.Longitude = float64(s1.Longitude) 1135 return nil 1136} 1137 1138// Buildings: Public API: Resources.buildings 1139type Buildings struct { 1140 // Buildings: The Buildings in this page of results. 1141 Buildings []*Building `json:"buildings,omitempty"` 1142 1143 // Etag: ETag of the resource. 1144 Etag string `json:"etag,omitempty"` 1145 1146 // Kind: Kind of resource this is. 1147 Kind string `json:"kind,omitempty"` 1148 1149 // NextPageToken: The continuation token, used to page through large 1150 // result sets. Provide this value in a subsequent request to return the 1151 // next page of results. 1152 NextPageToken string `json:"nextPageToken,omitempty"` 1153 1154 // ServerResponse contains the HTTP response code and headers from the 1155 // server. 1156 googleapi.ServerResponse `json:"-"` 1157 1158 // ForceSendFields is a list of field names (e.g. "Buildings") to 1159 // unconditionally include in API requests. By default, fields with 1160 // empty or default values are omitted from API requests. However, any 1161 // non-pointer, non-interface field appearing in ForceSendFields will be 1162 // sent to the server regardless of whether the field is empty or not. 1163 // This may be used to include empty fields in Patch requests. 1164 ForceSendFields []string `json:"-"` 1165 1166 // NullFields is a list of field names (e.g. "Buildings") to include in 1167 // API requests with the JSON null value. By default, fields with empty 1168 // values are omitted from API requests. However, any field with an 1169 // empty value appearing in NullFields will be sent to the server as 1170 // null. It is an error if a field in this list has a non-empty value. 1171 // This may be used to include null fields in Patch requests. 1172 NullFields []string `json:"-"` 1173} 1174 1175func (s *Buildings) MarshalJSON() ([]byte, error) { 1176 type NoMethod Buildings 1177 raw := NoMethod(*s) 1178 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1179} 1180 1181// CalendarResource: Public API: Resources.calendars 1182type CalendarResource struct { 1183 // BuildingId: Unique ID for the building a resource is located in. 1184 BuildingId string `json:"buildingId,omitempty"` 1185 1186 // Capacity: Capacity of a resource, number of seats in a room. 1187 Capacity int64 `json:"capacity,omitempty"` 1188 1189 // Etags: ETag of the resource. 1190 Etags string `json:"etags,omitempty"` 1191 1192 // FeatureInstances: Instances of features for the calendar resource. 1193 FeatureInstances interface{} `json:"featureInstances,omitempty"` 1194 1195 // FloorName: Name of the floor a resource is located on. 1196 FloorName string `json:"floorName,omitempty"` 1197 1198 // FloorSection: Name of the section within a floor a resource is 1199 // located in. 1200 FloorSection string `json:"floorSection,omitempty"` 1201 1202 // GeneratedResourceName: The read-only auto-generated name of the 1203 // calendar resource which includes metadata about the resource such as 1204 // building name, floor, capacity, etc. For example, "NYC-2-Training 1205 // Room 1A (16)". 1206 GeneratedResourceName string `json:"generatedResourceName,omitempty"` 1207 1208 // Kind: The type of the resource. For calendar resources, the value is 1209 // `admin#directory#resources#calendars#CalendarResource`. 1210 Kind string `json:"kind,omitempty"` 1211 1212 // ResourceCategory: The category of the calendar resource. Either 1213 // CONFERENCE_ROOM or OTHER. Legacy data is set to CATEGORY_UNKNOWN. 1214 ResourceCategory string `json:"resourceCategory,omitempty"` 1215 1216 // ResourceDescription: Description of the resource, visible only to 1217 // admins. 1218 ResourceDescription string `json:"resourceDescription,omitempty"` 1219 1220 // ResourceEmail: The read-only email for the calendar resource. 1221 // Generated as part of creating a new calendar resource. 1222 ResourceEmail string `json:"resourceEmail,omitempty"` 1223 1224 // ResourceId: The unique ID for the calendar resource. 1225 ResourceId string `json:"resourceId,omitempty"` 1226 1227 // ResourceName: The name of the calendar resource. For example, 1228 // "Training Room 1A". 1229 ResourceName string `json:"resourceName,omitempty"` 1230 1231 // ResourceType: The type of the calendar resource, intended for 1232 // non-room resources. 1233 ResourceType string `json:"resourceType,omitempty"` 1234 1235 // UserVisibleDescription: Description of the resource, visible to users 1236 // and admins. 1237 UserVisibleDescription string `json:"userVisibleDescription,omitempty"` 1238 1239 // ServerResponse contains the HTTP response code and headers from the 1240 // server. 1241 googleapi.ServerResponse `json:"-"` 1242 1243 // ForceSendFields is a list of field names (e.g. "BuildingId") to 1244 // unconditionally include in API requests. By default, fields with 1245 // empty or default values are omitted from API requests. However, any 1246 // non-pointer, non-interface field appearing in ForceSendFields will be 1247 // sent to the server regardless of whether the field is empty or not. 1248 // This may be used to include empty fields in Patch requests. 1249 ForceSendFields []string `json:"-"` 1250 1251 // NullFields is a list of field names (e.g. "BuildingId") to include in 1252 // API requests with the JSON null value. By default, fields with empty 1253 // values are omitted from API requests. However, any field with an 1254 // empty value appearing in NullFields will be sent to the server as 1255 // null. It is an error if a field in this list has a non-empty value. 1256 // This may be used to include null fields in Patch requests. 1257 NullFields []string `json:"-"` 1258} 1259 1260func (s *CalendarResource) MarshalJSON() ([]byte, error) { 1261 type NoMethod CalendarResource 1262 raw := NoMethod(*s) 1263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1264} 1265 1266// CalendarResources: Public API: Resources.calendars 1267type CalendarResources struct { 1268 // Etag: ETag of the resource. 1269 Etag string `json:"etag,omitempty"` 1270 1271 // Items: The CalendarResources in this page of results. 1272 Items []*CalendarResource `json:"items,omitempty"` 1273 1274 // Kind: Identifies this as a collection of CalendarResources. This is 1275 // always `admin#directory#resources#calendars#calendarResourcesList`. 1276 Kind string `json:"kind,omitempty"` 1277 1278 // NextPageToken: The continuation token, used to page through large 1279 // result sets. Provide this value in a subsequent request to return the 1280 // next page of results. 1281 NextPageToken string `json:"nextPageToken,omitempty"` 1282 1283 // ServerResponse contains the HTTP response code and headers from the 1284 // server. 1285 googleapi.ServerResponse `json:"-"` 1286 1287 // ForceSendFields is a list of field names (e.g. "Etag") to 1288 // unconditionally include in API requests. By default, fields with 1289 // empty or default values are omitted from API requests. However, any 1290 // non-pointer, non-interface field appearing in ForceSendFields will be 1291 // sent to the server regardless of whether the field is empty or not. 1292 // This may be used to include empty fields in Patch requests. 1293 ForceSendFields []string `json:"-"` 1294 1295 // NullFields is a list of field names (e.g. "Etag") to include in API 1296 // requests with the JSON null value. By default, fields with empty 1297 // values are omitted from API requests. However, any field with an 1298 // empty value appearing in NullFields will be sent to the server as 1299 // null. It is an error if a field in this list has a non-empty value. 1300 // This may be used to include null fields in Patch requests. 1301 NullFields []string `json:"-"` 1302} 1303 1304func (s *CalendarResources) MarshalJSON() ([]byte, error) { 1305 type NoMethod CalendarResources 1306 raw := NoMethod(*s) 1307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1308} 1309 1310// Channel: An notification channel used to watch for resource changes. 1311type Channel struct { 1312 // Address: The address where notifications are delivered for this 1313 // channel. 1314 Address string `json:"address,omitempty"` 1315 1316 // Expiration: Date and time of notification channel expiration, 1317 // expressed as a Unix timestamp, in milliseconds. Optional. 1318 Expiration int64 `json:"expiration,omitempty,string"` 1319 1320 // Id: A UUID or similar unique string that identifies this channel. 1321 Id string `json:"id,omitempty"` 1322 1323 // Kind: Identifies this as a notification channel used to watch for 1324 // changes to a resource, which is `api#channel`. 1325 Kind string `json:"kind,omitempty"` 1326 1327 // Params: Additional parameters controlling delivery channel behavior. 1328 // Optional. 1329 Params map[string]string `json:"params,omitempty"` 1330 1331 // Payload: A Boolean value to indicate whether payload is wanted. 1332 // Optional. 1333 Payload bool `json:"payload,omitempty"` 1334 1335 // ResourceId: An opaque ID that identifies the resource being watched 1336 // on this channel. Stable across different API versions. 1337 ResourceId string `json:"resourceId,omitempty"` 1338 1339 // ResourceUri: A version-specific identifier for the watched resource. 1340 ResourceUri string `json:"resourceUri,omitempty"` 1341 1342 // Token: An arbitrary string delivered to the target address with each 1343 // notification delivered over this channel. Optional. 1344 Token string `json:"token,omitempty"` 1345 1346 // Type: The type of delivery mechanism used for this channel. 1347 Type string `json:"type,omitempty"` 1348 1349 // ServerResponse contains the HTTP response code and headers from the 1350 // server. 1351 googleapi.ServerResponse `json:"-"` 1352 1353 // ForceSendFields is a list of field names (e.g. "Address") to 1354 // unconditionally include in API requests. By default, fields with 1355 // empty or default values are omitted from API requests. However, any 1356 // non-pointer, non-interface field appearing in ForceSendFields will be 1357 // sent to the server regardless of whether the field is empty or not. 1358 // This may be used to include empty fields in Patch requests. 1359 ForceSendFields []string `json:"-"` 1360 1361 // NullFields is a list of field names (e.g. "Address") to include in 1362 // API requests with the JSON null value. By default, fields with empty 1363 // values are omitted from API requests. However, any field with an 1364 // empty value appearing in NullFields will be sent to the server as 1365 // null. It is an error if a field in this list has a non-empty value. 1366 // This may be used to include null fields in Patch requests. 1367 NullFields []string `json:"-"` 1368} 1369 1370func (s *Channel) MarshalJSON() ([]byte, error) { 1371 type NoMethod Channel 1372 raw := NoMethod(*s) 1373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1374} 1375 1376// ChromeOsDevice: Google Chrome devices run on the Chrome OS 1377// (https://support.google.com/chromeos). For more information about 1378// common API tasks, see the Developer's Guide 1379// (/admin-sdk/directory/v1/guides/manage-chrome-devices). 1380type ChromeOsDevice struct { 1381 // ActiveTimeRanges: List of active time ranges (Read-only). 1382 ActiveTimeRanges []*ChromeOsDeviceActiveTimeRanges `json:"activeTimeRanges,omitempty"` 1383 1384 // AnnotatedAssetId: The asset identifier as noted by an administrator 1385 // or specified during enrollment. 1386 AnnotatedAssetId string `json:"annotatedAssetId,omitempty"` 1387 1388 // AnnotatedLocation: The address or location of the device as noted by 1389 // the administrator. Maximum length is `200` characters. Empty values 1390 // are allowed. 1391 AnnotatedLocation string `json:"annotatedLocation,omitempty"` 1392 1393 // AnnotatedUser: The user of the device as noted by the administrator. 1394 // Maximum length is 100 characters. Empty values are allowed. 1395 AnnotatedUser string `json:"annotatedUser,omitempty"` 1396 1397 // AutoUpdateExpiration: (Read-only) The timestamp after which the 1398 // device will stop receiving Chrome updates or support 1399 AutoUpdateExpiration int64 `json:"autoUpdateExpiration,omitempty,string"` 1400 1401 // BootMode: The boot mode for the device. The possible values are: * 1402 // `Verified`: The device is running a valid version of the Chrome OS. * 1403 // `Dev`: The devices's developer hardware switch is enabled. When 1404 // booted, the device has a command line shell. For an example of a 1405 // developer switch, see the Chromebook developer information 1406 // (https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-series-5-chromebook#TOC-Developer-switch). 1407 BootMode string `json:"bootMode,omitempty"` 1408 1409 // CpuInfo: Information regarding CPU specs in the device. 1410 CpuInfo []*ChromeOsDeviceCpuInfo `json:"cpuInfo,omitempty"` 1411 1412 // CpuStatusReports: Reports of CPU utilization and temperature 1413 // (Read-only) 1414 CpuStatusReports []*ChromeOsDeviceCpuStatusReports `json:"cpuStatusReports,omitempty"` 1415 1416 // DeviceFiles: List of device files to download (Read-only) 1417 DeviceFiles []*ChromeOsDeviceDeviceFiles `json:"deviceFiles,omitempty"` 1418 1419 // DeviceId: The unique ID of the Chrome device. 1420 DeviceId string `json:"deviceId,omitempty"` 1421 1422 // DiskVolumeReports: Reports of disk space and other info about 1423 // mounted/connected volumes. 1424 DiskVolumeReports []*ChromeOsDeviceDiskVolumeReports `json:"diskVolumeReports,omitempty"` 1425 1426 // DockMacAddress: (Read-only) Built-in MAC address for the docking 1427 // station that the device connected to. Factory sets Media access 1428 // control address (MAC address) assigned for use by a dock. It is 1429 // reserved specifically for MAC pass through device policy. The format 1430 // is twelve (12) hexadecimal digits without any delimiter (uppercase 1431 // letters). This is only relevant for some devices. 1432 DockMacAddress string `json:"dockMacAddress,omitempty"` 1433 1434 // Etag: ETag of the resource. 1435 Etag string `json:"etag,omitempty"` 1436 1437 // EthernetMacAddress: The device's MAC address on the ethernet network 1438 // interface. 1439 EthernetMacAddress string `json:"ethernetMacAddress,omitempty"` 1440 1441 // EthernetMacAddress0: (Read-only) MAC address used by the 1442 // Chromebook’s internal ethernet port, and for onboard network 1443 // (ethernet) interface. The format is twelve (12) hexadecimal digits 1444 // without any delimiter (uppercase letters). This is only relevant for 1445 // some devices. 1446 EthernetMacAddress0 string `json:"ethernetMacAddress0,omitempty"` 1447 1448 // FirmwareVersion: The Chrome device's firmware version. 1449 FirmwareVersion string `json:"firmwareVersion,omitempty"` 1450 1451 // Kind: The type of resource. For the Chromeosdevices resource, the 1452 // value is `admin#directory#chromeosdevice`. 1453 Kind string `json:"kind,omitempty"` 1454 1455 // LastEnrollmentTime: Date and time the device was last enrolled 1456 // (Read-only) 1457 LastEnrollmentTime string `json:"lastEnrollmentTime,omitempty"` 1458 1459 // LastKnownNetwork: Contains last known network (Read-only) 1460 LastKnownNetwork []*ChromeOsDeviceLastKnownNetwork `json:"lastKnownNetwork,omitempty"` 1461 1462 // LastSync: Date and time the device was last synchronized with the 1463 // policy settings in the G Suite administrator control panel 1464 // (Read-only) 1465 LastSync string `json:"lastSync,omitempty"` 1466 1467 // MacAddress: The device's wireless MAC address. If the device does not 1468 // have this information, it is not included in the response. 1469 MacAddress string `json:"macAddress,omitempty"` 1470 1471 // ManufactureDate: (Read-only) The date the device was manufactured in 1472 // yyyy-mm-dd format. 1473 ManufactureDate string `json:"manufactureDate,omitempty"` 1474 1475 // Meid: The Mobile Equipment Identifier (MEID) or the International 1476 // Mobile Equipment Identity (IMEI) for the 3G mobile card in a mobile 1477 // device. A MEID/IMEI is typically used when adding a device to a 1478 // wireless carrier's post-pay service plan. If the device does not have 1479 // this information, this property is not included in the response. For 1480 // more information on how to export a MEID/IMEI list, see the 1481 // Developer's Guide 1482 // (/admin-sdk/directory/v1/guides/manage-chrome-devices.html#export_meid 1483 // ). 1484 Meid string `json:"meid,omitempty"` 1485 1486 // Model: The device's model information. If the device does not have 1487 // this information, this property is not included in the response. 1488 Model string `json:"model,omitempty"` 1489 1490 // Notes: Notes about this device added by the administrator. This 1491 // property can be searched 1492 // (https://support.google.com/chrome/a/answer/1698333) with the list 1493 // (/admin-sdk/directory/v1/reference/chromeosdevices/list) method's 1494 // `query` parameter. Maximum length is 500 characters. Empty values are 1495 // allowed. 1496 Notes string `json:"notes,omitempty"` 1497 1498 // OrderNumber: The device's order number. Only devices directly 1499 // purchased from Google have an order number. 1500 OrderNumber string `json:"orderNumber,omitempty"` 1501 1502 // OrgUnitPath: The full parent path with the organizational unit's name 1503 // associated with the device. Path names are case insensitive. If the 1504 // parent organizational unit is the top-level organization, it is 1505 // represented as a forward slash, `/`. This property can be updated 1506 // (/admin-sdk/directory/v1/guides/manage-chrome-devices#update_chrome_de 1507 // vice) using the API. For more information about how to create an 1508 // organizational structure for your device, see the administration help 1509 // center (https://support.google.com/a/answer/182433). 1510 OrgUnitPath string `json:"orgUnitPath,omitempty"` 1511 1512 // OsVersion: The Chrome device's operating system version. 1513 OsVersion string `json:"osVersion,omitempty"` 1514 1515 // PlatformVersion: The Chrome device's platform version. 1516 PlatformVersion string `json:"platformVersion,omitempty"` 1517 1518 // RecentUsers: List of recent device users, in descending order, by 1519 // last login time. 1520 RecentUsers []*ChromeOsDeviceRecentUsers `json:"recentUsers,omitempty"` 1521 1522 // ScreenshotFiles: List of screenshot files to download. Type is always 1523 // "SCREENSHOT_FILE". (Read-only) 1524 ScreenshotFiles []*ChromeOsDeviceScreenshotFiles `json:"screenshotFiles,omitempty"` 1525 1526 // SerialNumber: The Chrome device serial number entered when the device 1527 // was enabled. This value is the same as the Admin console's *Serial 1528 // Number* in the *Chrome OS Devices* tab. 1529 SerialNumber string `json:"serialNumber,omitempty"` 1530 1531 // Status: The status of the device. 1532 Status string `json:"status,omitempty"` 1533 1534 // SupportEndDate: Final date the device will be supported (Read-only) 1535 SupportEndDate string `json:"supportEndDate,omitempty"` 1536 1537 // SystemRamFreeReports: Reports of amounts of available RAM memory 1538 // (Read-only) 1539 SystemRamFreeReports []*ChromeOsDeviceSystemRamFreeReports `json:"systemRamFreeReports,omitempty"` 1540 1541 // SystemRamTotal: Total RAM on the device [in bytes] (Read-only) 1542 SystemRamTotal int64 `json:"systemRamTotal,omitempty,string"` 1543 1544 // TpmVersionInfo: Trusted Platform Module (TPM) (Read-only) 1545 TpmVersionInfo *ChromeOsDeviceTpmVersionInfo `json:"tpmVersionInfo,omitempty"` 1546 1547 // WillAutoRenew: Determines if the device will auto renew its support 1548 // after the support end date. This is a read-only property. 1549 WillAutoRenew bool `json:"willAutoRenew,omitempty"` 1550 1551 // ServerResponse contains the HTTP response code and headers from the 1552 // server. 1553 googleapi.ServerResponse `json:"-"` 1554 1555 // ForceSendFields is a list of field names (e.g. "ActiveTimeRanges") to 1556 // unconditionally include in API requests. By default, fields with 1557 // empty or default values are omitted from API requests. However, any 1558 // non-pointer, non-interface field appearing in ForceSendFields will be 1559 // sent to the server regardless of whether the field is empty or not. 1560 // This may be used to include empty fields in Patch requests. 1561 ForceSendFields []string `json:"-"` 1562 1563 // NullFields is a list of field names (e.g. "ActiveTimeRanges") to 1564 // include in API requests with the JSON null value. By default, fields 1565 // with empty values are omitted from API requests. However, any field 1566 // with an empty value appearing in NullFields will be sent to the 1567 // server as null. It is an error if a field in this list has a 1568 // non-empty value. This may be used to include null fields in Patch 1569 // requests. 1570 NullFields []string `json:"-"` 1571} 1572 1573func (s *ChromeOsDevice) MarshalJSON() ([]byte, error) { 1574 type NoMethod ChromeOsDevice 1575 raw := NoMethod(*s) 1576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1577} 1578 1579type ChromeOsDeviceActiveTimeRanges struct { 1580 // ActiveTime: Duration of usage in milliseconds. 1581 ActiveTime int64 `json:"activeTime,omitempty"` 1582 1583 // Date: Date of usage 1584 Date string `json:"date,omitempty"` 1585 1586 // ForceSendFields is a list of field names (e.g. "ActiveTime") to 1587 // unconditionally include in API requests. By default, fields with 1588 // empty or default values are omitted from API requests. However, any 1589 // non-pointer, non-interface field appearing in ForceSendFields will be 1590 // sent to the server regardless of whether the field is empty or not. 1591 // This may be used to include empty fields in Patch requests. 1592 ForceSendFields []string `json:"-"` 1593 1594 // NullFields is a list of field names (e.g. "ActiveTime") to include in 1595 // API requests with the JSON null value. By default, fields with empty 1596 // values are omitted from API requests. However, any field with an 1597 // empty value appearing in NullFields will be sent to the server as 1598 // null. It is an error if a field in this list has a non-empty value. 1599 // This may be used to include null fields in Patch requests. 1600 NullFields []string `json:"-"` 1601} 1602 1603func (s *ChromeOsDeviceActiveTimeRanges) MarshalJSON() ([]byte, error) { 1604 type NoMethod ChromeOsDeviceActiveTimeRanges 1605 raw := NoMethod(*s) 1606 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1607} 1608 1609// ChromeOsDeviceCpuInfo: CPU specs for a CPU. 1610type ChromeOsDeviceCpuInfo struct { 1611 // Architecture: The CPU architecture. 1612 Architecture string `json:"architecture,omitempty"` 1613 1614 // LogicalCpus: Information for the Logical CPUs 1615 LogicalCpus []*ChromeOsDeviceCpuInfoLogicalCpus `json:"logicalCpus,omitempty"` 1616 1617 // MaxClockSpeedKhz: The max CPU clock speed in kHz. 1618 MaxClockSpeedKhz int64 `json:"maxClockSpeedKhz,omitempty"` 1619 1620 // Model: The CPU model name. 1621 Model string `json:"model,omitempty"` 1622 1623 // ForceSendFields is a list of field names (e.g. "Architecture") to 1624 // unconditionally include in API requests. By default, fields with 1625 // empty or default values are omitted from API requests. However, any 1626 // non-pointer, non-interface field appearing in ForceSendFields will be 1627 // sent to the server regardless of whether the field is empty or not. 1628 // This may be used to include empty fields in Patch requests. 1629 ForceSendFields []string `json:"-"` 1630 1631 // NullFields is a list of field names (e.g. "Architecture") to include 1632 // in API requests with the JSON null value. By default, fields with 1633 // empty values are omitted from API requests. However, any field with 1634 // an empty value appearing in NullFields will be sent to the server as 1635 // null. It is an error if a field in this list has a non-empty value. 1636 // This may be used to include null fields in Patch requests. 1637 NullFields []string `json:"-"` 1638} 1639 1640func (s *ChromeOsDeviceCpuInfo) MarshalJSON() ([]byte, error) { 1641 type NoMethod ChromeOsDeviceCpuInfo 1642 raw := NoMethod(*s) 1643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1644} 1645 1646// ChromeOsDeviceCpuInfoLogicalCpus: Status of a single logical CPU. 1647type ChromeOsDeviceCpuInfoLogicalCpus struct { 1648 // CStates: C-States indicate the power consumption state of the CPU. 1649 // For more information look at documentation published by the CPU 1650 // maker. 1651 CStates []*ChromeOsDeviceCpuInfoLogicalCpusCStates `json:"cStates,omitempty"` 1652 1653 // CurrentScalingFrequencyKhz: Current frequency the CPU is running at. 1654 CurrentScalingFrequencyKhz int64 `json:"currentScalingFrequencyKhz,omitempty"` 1655 1656 // IdleDuration: Idle time since last boot. 1657 IdleDuration string `json:"idleDuration,omitempty"` 1658 1659 // MaxScalingFrequencyKhz: Maximum frequency the CPU is allowed to run 1660 // at, by policy. 1661 MaxScalingFrequencyKhz int64 `json:"maxScalingFrequencyKhz,omitempty"` 1662 1663 // ForceSendFields is a list of field names (e.g. "CStates") to 1664 // unconditionally include in API requests. By default, fields with 1665 // empty or default values are omitted from API requests. However, any 1666 // non-pointer, non-interface field appearing in ForceSendFields will be 1667 // sent to the server regardless of whether the field is empty or not. 1668 // This may be used to include empty fields in Patch requests. 1669 ForceSendFields []string `json:"-"` 1670 1671 // NullFields is a list of field names (e.g. "CStates") to include in 1672 // API requests with the JSON null value. By default, fields with empty 1673 // values are omitted from API requests. However, any field with an 1674 // empty value appearing in NullFields will be sent to the server as 1675 // null. It is an error if a field in this list has a non-empty value. 1676 // This may be used to include null fields in Patch requests. 1677 NullFields []string `json:"-"` 1678} 1679 1680func (s *ChromeOsDeviceCpuInfoLogicalCpus) MarshalJSON() ([]byte, error) { 1681 type NoMethod ChromeOsDeviceCpuInfoLogicalCpus 1682 raw := NoMethod(*s) 1683 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1684} 1685 1686// ChromeOsDeviceCpuInfoLogicalCpusCStates: Status of a single C-state. 1687// C-states are various modes the CPU can transition to in order to use 1688// more or less power. 1689type ChromeOsDeviceCpuInfoLogicalCpusCStates struct { 1690 // DisplayName: Name of the state. 1691 DisplayName string `json:"displayName,omitempty"` 1692 1693 // SessionDuration: Time spent in the state since the last reboot. 1694 SessionDuration string `json:"sessionDuration,omitempty"` 1695 1696 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1697 // unconditionally include in API requests. By default, fields with 1698 // empty or default values are omitted from API requests. However, any 1699 // non-pointer, non-interface field appearing in ForceSendFields will be 1700 // sent to the server regardless of whether the field is empty or not. 1701 // This may be used to include empty fields in Patch requests. 1702 ForceSendFields []string `json:"-"` 1703 1704 // NullFields is a list of field names (e.g. "DisplayName") to include 1705 // in API requests with the JSON null value. By default, fields with 1706 // empty values are omitted from API requests. However, any field with 1707 // an empty value appearing in NullFields will be sent to the server as 1708 // null. It is an error if a field in this list has a non-empty value. 1709 // This may be used to include null fields in Patch requests. 1710 NullFields []string `json:"-"` 1711} 1712 1713func (s *ChromeOsDeviceCpuInfoLogicalCpusCStates) MarshalJSON() ([]byte, error) { 1714 type NoMethod ChromeOsDeviceCpuInfoLogicalCpusCStates 1715 raw := NoMethod(*s) 1716 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1717} 1718 1719type ChromeOsDeviceCpuStatusReports struct { 1720 // CpuTemperatureInfo: List of CPU temperature samples. 1721 CpuTemperatureInfo []*ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo `json:"cpuTemperatureInfo,omitempty"` 1722 1723 CpuUtilizationPercentageInfo []int64 `json:"cpuUtilizationPercentageInfo,omitempty"` 1724 1725 // ReportTime: Date and time the report was received. 1726 ReportTime string `json:"reportTime,omitempty"` 1727 1728 // ForceSendFields is a list of field names (e.g. "CpuTemperatureInfo") 1729 // to unconditionally include in API requests. By default, fields with 1730 // empty or default values are omitted from API requests. However, any 1731 // non-pointer, non-interface field appearing in ForceSendFields will be 1732 // sent to the server regardless of whether the field is empty or not. 1733 // This may be used to include empty fields in Patch requests. 1734 ForceSendFields []string `json:"-"` 1735 1736 // NullFields is a list of field names (e.g. "CpuTemperatureInfo") to 1737 // include in API requests with the JSON null value. By default, fields 1738 // with empty values are omitted from API requests. However, any field 1739 // with an empty value appearing in NullFields will be sent to the 1740 // server as null. It is an error if a field in this list has a 1741 // non-empty value. This may be used to include null fields in Patch 1742 // requests. 1743 NullFields []string `json:"-"` 1744} 1745 1746func (s *ChromeOsDeviceCpuStatusReports) MarshalJSON() ([]byte, error) { 1747 type NoMethod ChromeOsDeviceCpuStatusReports 1748 raw := NoMethod(*s) 1749 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1750} 1751 1752type ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo struct { 1753 // Label: CPU label 1754 Label string `json:"label,omitempty"` 1755 1756 // Temperature: Temperature in Celsius degrees. 1757 Temperature int64 `json:"temperature,omitempty"` 1758 1759 // ForceSendFields is a list of field names (e.g. "Label") to 1760 // unconditionally include in API requests. By default, fields with 1761 // empty or default values are omitted from API requests. However, any 1762 // non-pointer, non-interface field appearing in ForceSendFields will be 1763 // sent to the server regardless of whether the field is empty or not. 1764 // This may be used to include empty fields in Patch requests. 1765 ForceSendFields []string `json:"-"` 1766 1767 // NullFields is a list of field names (e.g. "Label") to include in API 1768 // requests with the JSON null value. By default, fields with empty 1769 // values are omitted from API requests. However, any field with an 1770 // empty value appearing in NullFields will be sent to the server as 1771 // null. It is an error if a field in this list has a non-empty value. 1772 // This may be used to include null fields in Patch requests. 1773 NullFields []string `json:"-"` 1774} 1775 1776func (s *ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo) MarshalJSON() ([]byte, error) { 1777 type NoMethod ChromeOsDeviceCpuStatusReportsCpuTemperatureInfo 1778 raw := NoMethod(*s) 1779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1780} 1781 1782type ChromeOsDeviceDeviceFiles struct { 1783 // CreateTime: Date and time the file was created 1784 CreateTime string `json:"createTime,omitempty"` 1785 1786 // DownloadUrl: File download URL 1787 DownloadUrl string `json:"downloadUrl,omitempty"` 1788 1789 // Name: File name 1790 Name string `json:"name,omitempty"` 1791 1792 // Type: File type 1793 Type string `json:"type,omitempty"` 1794 1795 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1796 // unconditionally include in API requests. By default, fields with 1797 // empty or default values are omitted from API requests. However, any 1798 // non-pointer, non-interface field appearing in ForceSendFields will be 1799 // sent to the server regardless of whether the field is empty or not. 1800 // This may be used to include empty fields in Patch requests. 1801 ForceSendFields []string `json:"-"` 1802 1803 // NullFields is a list of field names (e.g. "CreateTime") to include in 1804 // API requests with the JSON null value. By default, fields with empty 1805 // values are omitted from API requests. However, any field with an 1806 // empty value appearing in NullFields will be sent to the server as 1807 // null. It is an error if a field in this list has a non-empty value. 1808 // This may be used to include null fields in Patch requests. 1809 NullFields []string `json:"-"` 1810} 1811 1812func (s *ChromeOsDeviceDeviceFiles) MarshalJSON() ([]byte, error) { 1813 type NoMethod ChromeOsDeviceDeviceFiles 1814 raw := NoMethod(*s) 1815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1816} 1817 1818type ChromeOsDeviceDiskVolumeReports struct { 1819 // VolumeInfo: Disk volumes 1820 VolumeInfo []*ChromeOsDeviceDiskVolumeReportsVolumeInfo `json:"volumeInfo,omitempty"` 1821 1822 // ForceSendFields is a list of field names (e.g. "VolumeInfo") to 1823 // unconditionally include in API requests. By default, fields with 1824 // empty or default values are omitted from API requests. However, any 1825 // non-pointer, non-interface field appearing in ForceSendFields will be 1826 // sent to the server regardless of whether the field is empty or not. 1827 // This may be used to include empty fields in Patch requests. 1828 ForceSendFields []string `json:"-"` 1829 1830 // NullFields is a list of field names (e.g. "VolumeInfo") to include in 1831 // API requests with the JSON null value. By default, fields with empty 1832 // values are omitted from API requests. However, any field with an 1833 // empty value appearing in NullFields will be sent to the server as 1834 // null. It is an error if a field in this list has a non-empty value. 1835 // This may be used to include null fields in Patch requests. 1836 NullFields []string `json:"-"` 1837} 1838 1839func (s *ChromeOsDeviceDiskVolumeReports) MarshalJSON() ([]byte, error) { 1840 type NoMethod ChromeOsDeviceDiskVolumeReports 1841 raw := NoMethod(*s) 1842 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1843} 1844 1845type ChromeOsDeviceDiskVolumeReportsVolumeInfo struct { 1846 // StorageFree: Free disk space [in bytes] 1847 StorageFree int64 `json:"storageFree,omitempty,string"` 1848 1849 // StorageTotal: Total disk space [in bytes] 1850 StorageTotal int64 `json:"storageTotal,omitempty,string"` 1851 1852 // VolumeId: Volume id 1853 VolumeId string `json:"volumeId,omitempty"` 1854 1855 // ForceSendFields is a list of field names (e.g. "StorageFree") to 1856 // unconditionally include in API requests. By default, fields with 1857 // empty or default values are omitted from API requests. However, any 1858 // non-pointer, non-interface field appearing in ForceSendFields will be 1859 // sent to the server regardless of whether the field is empty or not. 1860 // This may be used to include empty fields in Patch requests. 1861 ForceSendFields []string `json:"-"` 1862 1863 // NullFields is a list of field names (e.g. "StorageFree") to include 1864 // in API requests with the JSON null value. By default, fields with 1865 // empty values are omitted from API requests. However, any field with 1866 // an empty value appearing in NullFields will be sent to the server as 1867 // null. It is an error if a field in this list has a non-empty value. 1868 // This may be used to include null fields in Patch requests. 1869 NullFields []string `json:"-"` 1870} 1871 1872func (s *ChromeOsDeviceDiskVolumeReportsVolumeInfo) MarshalJSON() ([]byte, error) { 1873 type NoMethod ChromeOsDeviceDiskVolumeReportsVolumeInfo 1874 raw := NoMethod(*s) 1875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1876} 1877 1878// ChromeOsDeviceLastKnownNetwork: Information for an ip address. 1879type ChromeOsDeviceLastKnownNetwork struct { 1880 // IpAddress: The IP address. 1881 IpAddress string `json:"ipAddress,omitempty"` 1882 1883 // WanIpAddress: The WAN IP address. 1884 WanIpAddress string `json:"wanIpAddress,omitempty"` 1885 1886 // ForceSendFields is a list of field names (e.g. "IpAddress") to 1887 // unconditionally include in API requests. By default, fields with 1888 // empty or default values are omitted from API requests. However, any 1889 // non-pointer, non-interface field appearing in ForceSendFields will be 1890 // sent to the server regardless of whether the field is empty or not. 1891 // This may be used to include empty fields in Patch requests. 1892 ForceSendFields []string `json:"-"` 1893 1894 // NullFields is a list of field names (e.g. "IpAddress") to include in 1895 // API requests with the JSON null value. By default, fields with empty 1896 // values are omitted from API requests. However, any field with an 1897 // empty value appearing in NullFields will be sent to the server as 1898 // null. It is an error if a field in this list has a non-empty value. 1899 // This may be used to include null fields in Patch requests. 1900 NullFields []string `json:"-"` 1901} 1902 1903func (s *ChromeOsDeviceLastKnownNetwork) MarshalJSON() ([]byte, error) { 1904 type NoMethod ChromeOsDeviceLastKnownNetwork 1905 raw := NoMethod(*s) 1906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1907} 1908 1909// ChromeOsDeviceRecentUsers: List of recent device users, in descending 1910// order, by last login time. 1911type ChromeOsDeviceRecentUsers struct { 1912 // Email: The user's email address. This is only present if the user 1913 // type is `USER_TYPE_MANAGED`. 1914 Email string `json:"email,omitempty"` 1915 1916 // Type: The type of the user. 1917 Type string `json:"type,omitempty"` 1918 1919 // ForceSendFields is a list of field names (e.g. "Email") to 1920 // unconditionally include in API requests. By default, fields with 1921 // empty or default values are omitted from API requests. However, any 1922 // non-pointer, non-interface field appearing in ForceSendFields will be 1923 // sent to the server regardless of whether the field is empty or not. 1924 // This may be used to include empty fields in Patch requests. 1925 ForceSendFields []string `json:"-"` 1926 1927 // NullFields is a list of field names (e.g. "Email") to include in API 1928 // requests with the JSON null value. By default, fields with empty 1929 // values are omitted from API requests. However, any field with an 1930 // empty value appearing in NullFields will be sent to the server as 1931 // null. It is an error if a field in this list has a non-empty value. 1932 // This may be used to include null fields in Patch requests. 1933 NullFields []string `json:"-"` 1934} 1935 1936func (s *ChromeOsDeviceRecentUsers) MarshalJSON() ([]byte, error) { 1937 type NoMethod ChromeOsDeviceRecentUsers 1938 raw := NoMethod(*s) 1939 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1940} 1941 1942type ChromeOsDeviceScreenshotFiles struct { 1943 // CreateTime: Date and time the file was created 1944 CreateTime string `json:"createTime,omitempty"` 1945 1946 // DownloadUrl: File download URL 1947 DownloadUrl string `json:"downloadUrl,omitempty"` 1948 1949 // Name: File name 1950 Name string `json:"name,omitempty"` 1951 1952 // Type: File type 1953 Type string `json:"type,omitempty"` 1954 1955 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1956 // unconditionally include in API requests. By default, fields with 1957 // empty or default values are omitted from API requests. However, any 1958 // non-pointer, non-interface field appearing in ForceSendFields will be 1959 // sent to the server regardless of whether the field is empty or not. 1960 // This may be used to include empty fields in Patch requests. 1961 ForceSendFields []string `json:"-"` 1962 1963 // NullFields is a list of field names (e.g. "CreateTime") to include in 1964 // API requests with the JSON null value. By default, fields with empty 1965 // values are omitted from API requests. However, any field with an 1966 // empty value appearing in NullFields will be sent to the server as 1967 // null. It is an error if a field in this list has a non-empty value. 1968 // This may be used to include null fields in Patch requests. 1969 NullFields []string `json:"-"` 1970} 1971 1972func (s *ChromeOsDeviceScreenshotFiles) MarshalJSON() ([]byte, error) { 1973 type NoMethod ChromeOsDeviceScreenshotFiles 1974 raw := NoMethod(*s) 1975 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1976} 1977 1978type ChromeOsDeviceSystemRamFreeReports struct { 1979 // ReportTime: Date and time the report was received. 1980 ReportTime string `json:"reportTime,omitempty"` 1981 1982 SystemRamFreeInfo googleapi.Int64s `json:"systemRamFreeInfo,omitempty"` 1983 1984 // ForceSendFields is a list of field names (e.g. "ReportTime") to 1985 // unconditionally include in API requests. By default, fields with 1986 // empty or default values are omitted from API requests. However, any 1987 // non-pointer, non-interface field appearing in ForceSendFields will be 1988 // sent to the server regardless of whether the field is empty or not. 1989 // This may be used to include empty fields in Patch requests. 1990 ForceSendFields []string `json:"-"` 1991 1992 // NullFields is a list of field names (e.g. "ReportTime") to include in 1993 // API requests with the JSON null value. By default, fields with empty 1994 // values are omitted from API requests. However, any field with an 1995 // empty value appearing in NullFields will be sent to the server as 1996 // null. It is an error if a field in this list has a non-empty value. 1997 // This may be used to include null fields in Patch requests. 1998 NullFields []string `json:"-"` 1999} 2000 2001func (s *ChromeOsDeviceSystemRamFreeReports) MarshalJSON() ([]byte, error) { 2002 type NoMethod ChromeOsDeviceSystemRamFreeReports 2003 raw := NoMethod(*s) 2004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2005} 2006 2007// ChromeOsDeviceTpmVersionInfo: Trusted Platform Module (TPM) 2008// (Read-only) 2009type ChromeOsDeviceTpmVersionInfo struct { 2010 // Family: TPM family. We use the TPM 2.0 style encoding, e.g.: TPM 1.2: 2011 // "1.2" -> 312e3200 TPM 2.0: "2.0" -> 322e3000 2012 Family string `json:"family,omitempty"` 2013 2014 // FirmwareVersion: TPM firmware version. 2015 FirmwareVersion string `json:"firmwareVersion,omitempty"` 2016 2017 // Manufacturer: TPM manufacturer code. 2018 Manufacturer string `json:"manufacturer,omitempty"` 2019 2020 // SpecLevel: TPM specification level. See Library Specification for TPM 2021 // 2.0 and Main Specification for TPM 1.2. 2022 SpecLevel string `json:"specLevel,omitempty"` 2023 2024 // TpmModel: TPM model number. 2025 TpmModel string `json:"tpmModel,omitempty"` 2026 2027 // VendorSpecific: Vendor-specific information such as Vendor ID. 2028 VendorSpecific string `json:"vendorSpecific,omitempty"` 2029 2030 // ForceSendFields is a list of field names (e.g. "Family") to 2031 // unconditionally include in API requests. By default, fields with 2032 // empty or default values are omitted from API requests. However, any 2033 // non-pointer, non-interface field appearing in ForceSendFields will be 2034 // sent to the server regardless of whether the field is empty or not. 2035 // This may be used to include empty fields in Patch requests. 2036 ForceSendFields []string `json:"-"` 2037 2038 // NullFields is a list of field names (e.g. "Family") to include in API 2039 // requests with the JSON null value. By default, fields with empty 2040 // values are omitted from API requests. However, any field with an 2041 // empty value appearing in NullFields will be sent to the server as 2042 // null. It is an error if a field in this list has a non-empty value. 2043 // This may be used to include null fields in Patch requests. 2044 NullFields []string `json:"-"` 2045} 2046 2047func (s *ChromeOsDeviceTpmVersionInfo) MarshalJSON() ([]byte, error) { 2048 type NoMethod ChromeOsDeviceTpmVersionInfo 2049 raw := NoMethod(*s) 2050 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2051} 2052 2053type ChromeOsDeviceAction struct { 2054 // Action: Action to be taken on the Chrome OS device. 2055 Action string `json:"action,omitempty"` 2056 2057 // DeprovisionReason: Only used when the action is `deprovision`. With 2058 // the `deprovision` action, this field is required. *Note*: The 2059 // deprovision reason is audited because it might have implications on 2060 // licenses for perpetual subscription customers. 2061 DeprovisionReason string `json:"deprovisionReason,omitempty"` 2062 2063 // ForceSendFields is a list of field names (e.g. "Action") to 2064 // unconditionally include in API requests. By default, fields with 2065 // empty or default values are omitted from API requests. However, any 2066 // non-pointer, non-interface field appearing in ForceSendFields will be 2067 // sent to the server regardless of whether the field is empty or not. 2068 // This may be used to include empty fields in Patch requests. 2069 ForceSendFields []string `json:"-"` 2070 2071 // NullFields is a list of field names (e.g. "Action") to include in API 2072 // requests with the JSON null value. By default, fields with empty 2073 // values are omitted from API requests. However, any field with an 2074 // empty value appearing in NullFields will be sent to the server as 2075 // null. It is an error if a field in this list has a non-empty value. 2076 // This may be used to include null fields in Patch requests. 2077 NullFields []string `json:"-"` 2078} 2079 2080func (s *ChromeOsDeviceAction) MarshalJSON() ([]byte, error) { 2081 type NoMethod ChromeOsDeviceAction 2082 raw := NoMethod(*s) 2083 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2084} 2085 2086type ChromeOsDevices struct { 2087 // Chromeosdevices: List of Chrome OS Device objects. 2088 Chromeosdevices []*ChromeOsDevice `json:"chromeosdevices,omitempty"` 2089 2090 // Etag: ETag of the resource. 2091 Etag string `json:"etag,omitempty"` 2092 2093 // Kind: Kind of resource this is. 2094 Kind string `json:"kind,omitempty"` 2095 2096 // NextPageToken: Token used to access the next page of this result. To 2097 // access the next page, use this token's value in the `pageToken` query 2098 // string of this request. 2099 NextPageToken string `json:"nextPageToken,omitempty"` 2100 2101 // ServerResponse contains the HTTP response code and headers from the 2102 // server. 2103 googleapi.ServerResponse `json:"-"` 2104 2105 // ForceSendFields is a list of field names (e.g. "Chromeosdevices") to 2106 // unconditionally include in API requests. By default, fields with 2107 // empty or default values are omitted from API requests. However, any 2108 // non-pointer, non-interface field appearing in ForceSendFields will be 2109 // sent to the server regardless of whether the field is empty or not. 2110 // This may be used to include empty fields in Patch requests. 2111 ForceSendFields []string `json:"-"` 2112 2113 // NullFields is a list of field names (e.g. "Chromeosdevices") to 2114 // include in API requests with the JSON null value. By default, fields 2115 // with empty values are omitted from API requests. However, any field 2116 // with an empty value appearing in NullFields will be sent to the 2117 // server as null. It is an error if a field in this list has a 2118 // non-empty value. This may be used to include null fields in Patch 2119 // requests. 2120 NullFields []string `json:"-"` 2121} 2122 2123func (s *ChromeOsDevices) MarshalJSON() ([]byte, error) { 2124 type NoMethod ChromeOsDevices 2125 raw := NoMethod(*s) 2126 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2127} 2128 2129type ChromeOsMoveDevicesToOu struct { 2130 // DeviceIds: Chrome OS devices to be moved to OU 2131 DeviceIds []string `json:"deviceIds,omitempty"` 2132 2133 // ForceSendFields is a list of field names (e.g. "DeviceIds") to 2134 // unconditionally include in API requests. By default, fields with 2135 // empty or default values are omitted from API requests. However, any 2136 // non-pointer, non-interface field appearing in ForceSendFields will be 2137 // sent to the server regardless of whether the field is empty or not. 2138 // This may be used to include empty fields in Patch requests. 2139 ForceSendFields []string `json:"-"` 2140 2141 // NullFields is a list of field names (e.g. "DeviceIds") to include in 2142 // API requests with the JSON null value. By default, fields with empty 2143 // values are omitted from API requests. However, any field with an 2144 // empty value appearing in NullFields will be sent to the server as 2145 // null. It is an error if a field in this list has a non-empty value. 2146 // This may be used to include null fields in Patch requests. 2147 NullFields []string `json:"-"` 2148} 2149 2150func (s *ChromeOsMoveDevicesToOu) MarshalJSON() ([]byte, error) { 2151 type NoMethod ChromeOsMoveDevicesToOu 2152 raw := NoMethod(*s) 2153 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2154} 2155 2156// CreatePrinterRequest: Request for adding a new printer. 2157type CreatePrinterRequest struct { 2158 // Parent: Required. The name of the customer. Format: 2159 // customers/{customer_id} 2160 Parent string `json:"parent,omitempty"` 2161 2162 // Printer: Required. A printer to create. If you want to place the 2163 // printer under particular OU then populate printer.org_unit_id filed. 2164 // Otherwise the printer will be placed under root OU. 2165 Printer *Printer `json:"printer,omitempty"` 2166 2167 // ForceSendFields is a list of field names (e.g. "Parent") to 2168 // unconditionally include in API requests. By default, fields with 2169 // empty or default values are omitted from API requests. However, any 2170 // non-pointer, non-interface field appearing in ForceSendFields will be 2171 // sent to the server regardless of whether the field is empty or not. 2172 // This may be used to include empty fields in Patch requests. 2173 ForceSendFields []string `json:"-"` 2174 2175 // NullFields is a list of field names (e.g. "Parent") to include in API 2176 // requests with the JSON null value. By default, fields with empty 2177 // values are omitted from API requests. However, any field with an 2178 // empty value appearing in NullFields will be sent to the server as 2179 // null. It is an error if a field in this list has a non-empty value. 2180 // This may be used to include null fields in Patch requests. 2181 NullFields []string `json:"-"` 2182} 2183 2184func (s *CreatePrinterRequest) MarshalJSON() ([]byte, error) { 2185 type NoMethod CreatePrinterRequest 2186 raw := NoMethod(*s) 2187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2188} 2189 2190type Customer struct { 2191 // AlternateEmail: The customer's secondary contact email address. This 2192 // email address cannot be on the same domain as the `customerDomain` 2193 AlternateEmail string `json:"alternateEmail,omitempty"` 2194 2195 // CustomerCreationTime: The customer's creation time (Readonly) 2196 CustomerCreationTime string `json:"customerCreationTime,omitempty"` 2197 2198 // CustomerDomain: The customer's primary domain name string. Do not 2199 // include the `www` prefix when creating a new customer. 2200 CustomerDomain string `json:"customerDomain,omitempty"` 2201 2202 // Etag: ETag of the resource. 2203 Etag string `json:"etag,omitempty"` 2204 2205 // Id: The unique ID for the customer's Google Workspace account. 2206 // (Readonly) 2207 Id string `json:"id,omitempty"` 2208 2209 // Kind: Identifies the resource as a customer. Value: 2210 // `admin#directory#customer` 2211 Kind string `json:"kind,omitempty"` 2212 2213 // Language: The customer's ISO 639-2 language code. See the Language 2214 // Codes (/admin-sdk/directory/v1/languages) page for the list of 2215 // supported codes. Valid language codes outside the supported set will 2216 // be accepted by the API but may lead to unexpected behavior. The 2217 // default value is `en`. 2218 Language string `json:"language,omitempty"` 2219 2220 // PhoneNumber: The customer's contact phone number in E.164 2221 // (https://en.wikipedia.org/wiki/E.164) format. 2222 PhoneNumber string `json:"phoneNumber,omitempty"` 2223 2224 // PostalAddress: The customer's postal address information. 2225 PostalAddress *CustomerPostalAddress `json:"postalAddress,omitempty"` 2226 2227 // ServerResponse contains the HTTP response code and headers from the 2228 // server. 2229 googleapi.ServerResponse `json:"-"` 2230 2231 // ForceSendFields is a list of field names (e.g. "AlternateEmail") to 2232 // unconditionally include in API requests. By default, fields with 2233 // empty or default values are omitted from API requests. However, any 2234 // non-pointer, non-interface field appearing in ForceSendFields will be 2235 // sent to the server regardless of whether the field is empty or not. 2236 // This may be used to include empty fields in Patch requests. 2237 ForceSendFields []string `json:"-"` 2238 2239 // NullFields is a list of field names (e.g. "AlternateEmail") to 2240 // include in API requests with the JSON null value. By default, fields 2241 // with empty values are omitted from API requests. However, any field 2242 // with an empty value appearing in NullFields will be sent to the 2243 // server as null. It is an error if a field in this list has a 2244 // non-empty value. This may be used to include null fields in Patch 2245 // requests. 2246 NullFields []string `json:"-"` 2247} 2248 2249func (s *Customer) MarshalJSON() ([]byte, error) { 2250 type NoMethod Customer 2251 raw := NoMethod(*s) 2252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2253} 2254 2255type CustomerPostalAddress struct { 2256 // AddressLine1: A customer's physical address. The address can be 2257 // composed of one to three lines. 2258 AddressLine1 string `json:"addressLine1,omitempty"` 2259 2260 // AddressLine2: Address line 2 of the address. 2261 AddressLine2 string `json:"addressLine2,omitempty"` 2262 2263 // AddressLine3: Address line 3 of the address. 2264 AddressLine3 string `json:"addressLine3,omitempty"` 2265 2266 // ContactName: The customer contact's name. 2267 ContactName string `json:"contactName,omitempty"` 2268 2269 // CountryCode: This is a required property. For `countryCode` 2270 // information see the ISO 3166 country code elements 2271 // (https://www.iso.org/iso/country_codes.htm). 2272 CountryCode string `json:"countryCode,omitempty"` 2273 2274 // Locality: Name of the locality. An example of a locality value is the 2275 // city of `San Francisco`. 2276 Locality string `json:"locality,omitempty"` 2277 2278 // OrganizationName: The company or company division name. 2279 OrganizationName string `json:"organizationName,omitempty"` 2280 2281 // PostalCode: The postal code. A postalCode example is a postal zip 2282 // code such as `10009`. This is in accordance with - http: 2283 // //portablecontacts.net/draft-spec.html#address_element. 2284 PostalCode string `json:"postalCode,omitempty"` 2285 2286 // Region: Name of the region. An example of a region value is `NY` for 2287 // the state of New York. 2288 Region string `json:"region,omitempty"` 2289 2290 // ForceSendFields is a list of field names (e.g. "AddressLine1") to 2291 // unconditionally include in API requests. By default, fields with 2292 // empty or default values are omitted from API requests. However, any 2293 // non-pointer, non-interface field appearing in ForceSendFields will be 2294 // sent to the server regardless of whether the field is empty or not. 2295 // This may be used to include empty fields in Patch requests. 2296 ForceSendFields []string `json:"-"` 2297 2298 // NullFields is a list of field names (e.g. "AddressLine1") to include 2299 // in API requests with the JSON null value. By default, fields with 2300 // empty values are omitted from API requests. However, any field with 2301 // an empty value appearing in NullFields will be sent to the server as 2302 // null. It is an error if a field in this list has a non-empty value. 2303 // This may be used to include null fields in Patch requests. 2304 NullFields []string `json:"-"` 2305} 2306 2307func (s *CustomerPostalAddress) MarshalJSON() ([]byte, error) { 2308 type NoMethod CustomerPostalAddress 2309 raw := NoMethod(*s) 2310 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2311} 2312 2313// DirectoryChromeosdevicesCommand: Information regarding a command that 2314// was issued to a device. 2315type DirectoryChromeosdevicesCommand struct { 2316 // CommandExpireTime: The time at which the command will expire. If the 2317 // device doesn't execute the command within this time the command will 2318 // become expired. 2319 CommandExpireTime string `json:"commandExpireTime,omitempty"` 2320 2321 // CommandId: Unique ID of a device command. 2322 CommandId int64 `json:"commandId,omitempty,string"` 2323 2324 // CommandResult: The result of the command execution. 2325 CommandResult *DirectoryChromeosdevicesCommandResult `json:"commandResult,omitempty"` 2326 2327 // IssueTime: The timestamp when the command was issued by the admin. 2328 IssueTime string `json:"issueTime,omitempty"` 2329 2330 // Payload: The payload that the command specified, if any. 2331 Payload string `json:"payload,omitempty"` 2332 2333 // State: Indicates the command state. 2334 // 2335 // Possible values: 2336 // "STATE_UNSPECIFIED" - The command status was unspecified. 2337 // "PENDING" - An unexpired command not yet sent to the client. 2338 // "EXPIRED" - The command didn't get executed by the client within 2339 // the expected time. 2340 // "CANCELLED" - The command is cancelled by admin while in PENDING. 2341 // "SENT_TO_CLIENT" - The command has been sent to the client. 2342 // "ACKED_BY_CLIENT" - The client has responded that it received the 2343 // command. 2344 // "EXECUTED_BY_CLIENT" - The client has (un)successfully executed the 2345 // command. 2346 State string `json:"state,omitempty"` 2347 2348 // Type: The type of the command. 2349 // 2350 // Possible values: 2351 // "COMMAND_TYPE_UNSPECIFIED" - The command type was unspecified. 2352 // "REBOOT" - Reboot the device. Can only be issued to Kiosk and 2353 // managed guest session devices. 2354 // "TAKE_A_SCREENSHOT" - Take a screenshot of the device. Only 2355 // available if the device is in Kiosk Mode. 2356 // "SET_VOLUME" - Set the volume of the device. Can only be issued to 2357 // Kiosk and managed guest session devices. 2358 // "WIPE_USERS" - Wipe all the users off of the device. Executing this 2359 // command in the device will remove all user profile data, but it will 2360 // keep device policy and enrollment. 2361 // "REMOTE_POWERWASH" - Wipes the device by performing a power wash. 2362 // Executing this command in the device will remove all data including 2363 // user policies, device policies and enrollment policies. Warning: This 2364 // will revert the device back to a factory state with no enrollment 2365 // unless the device is subject to forced or auto enrollment. Use with 2366 // caution, as this is an irreversible action! 2367 Type string `json:"type,omitempty"` 2368 2369 // ServerResponse contains the HTTP response code and headers from the 2370 // server. 2371 googleapi.ServerResponse `json:"-"` 2372 2373 // ForceSendFields is a list of field names (e.g. "CommandExpireTime") 2374 // to unconditionally include in API requests. By default, fields with 2375 // empty or default values are omitted from API requests. However, any 2376 // non-pointer, non-interface field appearing in ForceSendFields will be 2377 // sent to the server regardless of whether the field is empty or not. 2378 // This may be used to include empty fields in Patch requests. 2379 ForceSendFields []string `json:"-"` 2380 2381 // NullFields is a list of field names (e.g. "CommandExpireTime") to 2382 // include in API requests with the JSON null value. By default, fields 2383 // with empty values are omitted from API requests. However, any field 2384 // with an empty value appearing in NullFields will be sent to the 2385 // server as null. It is an error if a field in this list has a 2386 // non-empty value. This may be used to include null fields in Patch 2387 // requests. 2388 NullFields []string `json:"-"` 2389} 2390 2391func (s *DirectoryChromeosdevicesCommand) MarshalJSON() ([]byte, error) { 2392 type NoMethod DirectoryChromeosdevicesCommand 2393 raw := NoMethod(*s) 2394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2395} 2396 2397// DirectoryChromeosdevicesCommandResult: The result of executing a 2398// command. 2399type DirectoryChromeosdevicesCommandResult struct { 2400 // ErrorMessage: The error message with a short explanation as to why 2401 // the command failed. Only present if the command failed. 2402 ErrorMessage string `json:"errorMessage,omitempty"` 2403 2404 // ExecuteTime: The time at which the command was executed or failed to 2405 // execute. 2406 ExecuteTime string `json:"executeTime,omitempty"` 2407 2408 // Result: The result of the command. 2409 // 2410 // Possible values: 2411 // "COMMAND_RESULT_TYPE_UNSPECIFIED" - The command result was 2412 // unspecified. 2413 // "IGNORED" - The command was ignored as obsolete. 2414 // "FAILURE" - The command could not be executed successfully. 2415 // "SUCCESS" - The command was successfully executed. 2416 Result string `json:"result,omitempty"` 2417 2418 // ForceSendFields is a list of field names (e.g. "ErrorMessage") to 2419 // unconditionally include in API requests. By default, fields with 2420 // empty or default values are omitted from API requests. However, any 2421 // non-pointer, non-interface field appearing in ForceSendFields will be 2422 // sent to the server regardless of whether the field is empty or not. 2423 // This may be used to include empty fields in Patch requests. 2424 ForceSendFields []string `json:"-"` 2425 2426 // NullFields is a list of field names (e.g. "ErrorMessage") to include 2427 // in API requests with the JSON null value. By default, fields with 2428 // empty values are omitted from API requests. However, any field with 2429 // an empty value appearing in NullFields will be sent to the server as 2430 // null. It is an error if a field in this list has a non-empty value. 2431 // This may be used to include null fields in Patch requests. 2432 NullFields []string `json:"-"` 2433} 2434 2435func (s *DirectoryChromeosdevicesCommandResult) MarshalJSON() ([]byte, error) { 2436 type NoMethod DirectoryChromeosdevicesCommandResult 2437 raw := NoMethod(*s) 2438 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2439} 2440 2441// DirectoryChromeosdevicesIssueCommandRequest: A request for issuing a 2442// command. 2443type DirectoryChromeosdevicesIssueCommandRequest struct { 2444 // CommandType: The type of command. 2445 // 2446 // Possible values: 2447 // "COMMAND_TYPE_UNSPECIFIED" - The command type was unspecified. 2448 // "REBOOT" - Reboot the device. Can only be issued to Kiosk and 2449 // managed guest session devices. 2450 // "TAKE_A_SCREENSHOT" - Take a screenshot of the device. Only 2451 // available if the device is in Kiosk Mode. 2452 // "SET_VOLUME" - Set the volume of the device. Can only be issued to 2453 // Kiosk and managed guest session devices. 2454 // "WIPE_USERS" - Wipe all the users off of the device. Executing this 2455 // command in the device will remove all user profile data, but it will 2456 // keep device policy and enrollment. 2457 // "REMOTE_POWERWASH" - Wipes the device by performing a power wash. 2458 // Executing this command in the device will remove all data including 2459 // user policies, device policies and enrollment policies. Warning: This 2460 // will revert the device back to a factory state with no enrollment 2461 // unless the device is subject to forced or auto enrollment. Use with 2462 // caution, as this is an irreversible action! 2463 CommandType string `json:"commandType,omitempty"` 2464 2465 // Payload: The payload for the command, provide it only if command 2466 // supports it. The following commands support adding payload: - 2467 // SET_VOLUME: Payload is a stringified JSON object in the form: { 2468 // "volume": 50 }. The volume has to be an integer in the range [0,100]. 2469 Payload string `json:"payload,omitempty"` 2470 2471 // ForceSendFields is a list of field names (e.g. "CommandType") to 2472 // unconditionally include in API requests. By default, fields with 2473 // empty or default values are omitted from API requests. However, any 2474 // non-pointer, non-interface field appearing in ForceSendFields will be 2475 // sent to the server regardless of whether the field is empty or not. 2476 // This may be used to include empty fields in Patch requests. 2477 ForceSendFields []string `json:"-"` 2478 2479 // NullFields is a list of field names (e.g. "CommandType") 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 *DirectoryChromeosdevicesIssueCommandRequest) MarshalJSON() ([]byte, error) { 2489 type NoMethod DirectoryChromeosdevicesIssueCommandRequest 2490 raw := NoMethod(*s) 2491 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2492} 2493 2494// DirectoryChromeosdevicesIssueCommandResponse: A response for issuing 2495// a command. 2496type DirectoryChromeosdevicesIssueCommandResponse struct { 2497 // CommandId: The unique ID of the issued command, used to retrieve the 2498 // command status. 2499 CommandId int64 `json:"commandId,omitempty,string"` 2500 2501 // ServerResponse contains the HTTP response code and headers from the 2502 // server. 2503 googleapi.ServerResponse `json:"-"` 2504 2505 // ForceSendFields is a list of field names (e.g. "CommandId") to 2506 // unconditionally include in API requests. By default, fields with 2507 // empty or default values are omitted from API requests. However, any 2508 // non-pointer, non-interface field appearing in ForceSendFields will be 2509 // sent to the server regardless of whether the field is empty or not. 2510 // This may be used to include empty fields in Patch requests. 2511 ForceSendFields []string `json:"-"` 2512 2513 // NullFields is a list of field names (e.g. "CommandId") to include in 2514 // API requests with the JSON null value. By default, fields with empty 2515 // values are omitted from API requests. However, any field with an 2516 // empty value appearing in NullFields will be sent to the server as 2517 // null. It is an error if a field in this list has a non-empty value. 2518 // This may be used to include null fields in Patch requests. 2519 NullFields []string `json:"-"` 2520} 2521 2522func (s *DirectoryChromeosdevicesIssueCommandResponse) MarshalJSON() ([]byte, error) { 2523 type NoMethod DirectoryChromeosdevicesIssueCommandResponse 2524 raw := NoMethod(*s) 2525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2526} 2527 2528type DomainAlias struct { 2529 // CreationTime: The creation time of the domain alias. (Read-only). 2530 CreationTime int64 `json:"creationTime,omitempty,string"` 2531 2532 // DomainAliasName: The domain alias name. 2533 DomainAliasName string `json:"domainAliasName,omitempty"` 2534 2535 // Etag: ETag of the resource. 2536 Etag string `json:"etag,omitempty"` 2537 2538 // Kind: Kind of resource this is. 2539 Kind string `json:"kind,omitempty"` 2540 2541 // ParentDomainName: The parent domain name that the domain alias is 2542 // associated with. This can either be a primary or secondary domain 2543 // name within a customer. 2544 ParentDomainName string `json:"parentDomainName,omitempty"` 2545 2546 // Verified: Indicates the verification state of a domain alias. 2547 // (Read-only) 2548 Verified bool `json:"verified,omitempty"` 2549 2550 // ServerResponse contains the HTTP response code and headers from the 2551 // server. 2552 googleapi.ServerResponse `json:"-"` 2553 2554 // ForceSendFields is a list of field names (e.g. "CreationTime") to 2555 // unconditionally include in API requests. By default, fields with 2556 // empty or default values are omitted from API requests. However, any 2557 // non-pointer, non-interface field appearing in ForceSendFields will be 2558 // sent to the server regardless of whether the field is empty or not. 2559 // This may be used to include empty fields in Patch requests. 2560 ForceSendFields []string `json:"-"` 2561 2562 // NullFields is a list of field names (e.g. "CreationTime") to include 2563 // in API requests with the JSON null value. By default, fields with 2564 // empty values are omitted from API requests. However, any field with 2565 // an empty value appearing in NullFields will be sent to the server as 2566 // null. It is an error if a field in this list has a non-empty value. 2567 // This may be used to include null fields in Patch requests. 2568 NullFields []string `json:"-"` 2569} 2570 2571func (s *DomainAlias) MarshalJSON() ([]byte, error) { 2572 type NoMethod DomainAlias 2573 raw := NoMethod(*s) 2574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2575} 2576 2577type DomainAliases struct { 2578 // DomainAliases: List of domain alias objects. 2579 DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` 2580 2581 // Etag: ETag of the resource. 2582 Etag string `json:"etag,omitempty"` 2583 2584 // Kind: Kind of resource this is. 2585 Kind string `json:"kind,omitempty"` 2586 2587 // ServerResponse contains the HTTP response code and headers from the 2588 // server. 2589 googleapi.ServerResponse `json:"-"` 2590 2591 // ForceSendFields is a list of field names (e.g. "DomainAliases") to 2592 // unconditionally include in API requests. By default, fields with 2593 // empty or default values are omitted from API requests. However, any 2594 // non-pointer, non-interface field appearing in ForceSendFields will be 2595 // sent to the server regardless of whether the field is empty or not. 2596 // This may be used to include empty fields in Patch requests. 2597 ForceSendFields []string `json:"-"` 2598 2599 // NullFields is a list of field names (e.g. "DomainAliases") to include 2600 // in API requests with the JSON null value. By default, fields with 2601 // empty values are omitted from API requests. However, any field with 2602 // an empty value appearing in NullFields will be sent to the server as 2603 // null. It is an error if a field in this list has a non-empty value. 2604 // This may be used to include null fields in Patch requests. 2605 NullFields []string `json:"-"` 2606} 2607 2608func (s *DomainAliases) MarshalJSON() ([]byte, error) { 2609 type NoMethod DomainAliases 2610 raw := NoMethod(*s) 2611 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2612} 2613 2614type Domains struct { 2615 // CreationTime: Creation time of the domain. Expressed in Unix time 2616 // (https://en.wikipedia.org/wiki/Epoch_time) format. (Read-only). 2617 CreationTime int64 `json:"creationTime,omitempty,string"` 2618 2619 // DomainAliases: List of domain alias objects. (Read-only) 2620 DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` 2621 2622 // DomainName: The domain name of the customer. 2623 DomainName string `json:"domainName,omitempty"` 2624 2625 // Etag: ETag of the resource. 2626 Etag string `json:"etag,omitempty"` 2627 2628 // IsPrimary: Indicates if the domain is a primary domain (Read-only). 2629 IsPrimary bool `json:"isPrimary,omitempty"` 2630 2631 // Kind: Kind of resource this is. 2632 Kind string `json:"kind,omitempty"` 2633 2634 // Verified: Indicates the verification state of a domain. (Read-only). 2635 Verified bool `json:"verified,omitempty"` 2636 2637 // ServerResponse contains the HTTP response code and headers from the 2638 // server. 2639 googleapi.ServerResponse `json:"-"` 2640 2641 // ForceSendFields is a list of field names (e.g. "CreationTime") to 2642 // unconditionally include in API requests. By default, fields with 2643 // empty or default values are omitted from API requests. However, any 2644 // non-pointer, non-interface field appearing in ForceSendFields will be 2645 // sent to the server regardless of whether the field is empty or not. 2646 // This may be used to include empty fields in Patch requests. 2647 ForceSendFields []string `json:"-"` 2648 2649 // NullFields is a list of field names (e.g. "CreationTime") to include 2650 // in API requests with the JSON null value. By default, fields with 2651 // empty values are omitted from API requests. However, any field with 2652 // an empty value appearing in NullFields will be sent to the server as 2653 // null. It is an error if a field in this list has a non-empty value. 2654 // This may be used to include null fields in Patch requests. 2655 NullFields []string `json:"-"` 2656} 2657 2658func (s *Domains) MarshalJSON() ([]byte, error) { 2659 type NoMethod Domains 2660 raw := NoMethod(*s) 2661 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2662} 2663 2664type Domains2 struct { 2665 // Domains: List of domain objects. 2666 Domains []*Domains `json:"domains,omitempty"` 2667 2668 // Etag: ETag of the resource. 2669 Etag string `json:"etag,omitempty"` 2670 2671 // Kind: Kind of resource this is. 2672 Kind string `json:"kind,omitempty"` 2673 2674 // ServerResponse contains the HTTP response code and headers from the 2675 // server. 2676 googleapi.ServerResponse `json:"-"` 2677 2678 // ForceSendFields is a list of field names (e.g. "Domains") to 2679 // unconditionally include in API requests. By default, fields with 2680 // empty or default values are omitted from API requests. However, any 2681 // non-pointer, non-interface field appearing in ForceSendFields will be 2682 // sent to the server regardless of whether the field is empty or not. 2683 // This may be used to include empty fields in Patch requests. 2684 ForceSendFields []string `json:"-"` 2685 2686 // NullFields is a list of field names (e.g. "Domains") to include in 2687 // API requests with the JSON null value. By default, fields with empty 2688 // values are omitted from API requests. However, any field with an 2689 // empty value appearing in NullFields will be sent to the server as 2690 // null. It is an error if a field in this list has a non-empty value. 2691 // This may be used to include null fields in Patch requests. 2692 NullFields []string `json:"-"` 2693} 2694 2695func (s *Domains2) MarshalJSON() ([]byte, error) { 2696 type NoMethod Domains2 2697 raw := NoMethod(*s) 2698 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2699} 2700 2701// Empty: A generic empty message that you can re-use to avoid defining 2702// duplicated empty messages in your APIs. A typical example is to use 2703// it as the request or the response type of an API method. For 2704// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 2705// (google.protobuf.Empty); } The JSON representation for `Empty` is 2706// empty JSON object `{}`. 2707type Empty struct { 2708 // ServerResponse contains the HTTP response code and headers from the 2709 // server. 2710 googleapi.ServerResponse `json:"-"` 2711} 2712 2713// FailureInfo: Info about failures 2714type FailureInfo struct { 2715 // ErrorCode: Canonical code for why the update failed to apply. 2716 // 2717 // Possible values: 2718 // "OK" - Not an error; returned on success HTTP Mapping: 200 OK 2719 // "CANCELLED" - The operation was cancelled, typically by the caller. 2720 // HTTP Mapping: 499 Client Closed Request 2721 // "UNKNOWN" - Unknown error. For example, this error may be returned 2722 // when a `Status` value received from another address space belongs to 2723 // an error space that is not known in this address space. Also errors 2724 // raised by APIs that do not return enough error information may be 2725 // converted to this error. HTTP Mapping: 500 Internal Server Error 2726 // "INVALID_ARGUMENT" - The client specified an invalid argument. Note 2727 // that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` 2728 // indicates arguments that are problematic regardless of the state of 2729 // the system (e.g., a malformed file name). HTTP Mapping: 400 Bad 2730 // Request 2731 // "DEADLINE_EXCEEDED" - The deadline expired before the operation 2732 // could complete. For operations that change the state of the system, 2733 // this error may be returned even if the operation has completed 2734 // successfully. For example, a successful response from a server could 2735 // have been delayed long enough for the deadline to expire. HTTP 2736 // Mapping: 504 Gateway Timeout 2737 // "NOT_FOUND" - Some requested entity (e.g., file or directory) was 2738 // not found. Note to server developers: if a request is denied for an 2739 // entire class of users, such as gradual feature rollout or 2740 // undocumented allowlist, `NOT_FOUND` may be used. If a request is 2741 // denied for some users within a class of users, such as user-based 2742 // access control, `PERMISSION_DENIED` must be used. HTTP Mapping: 404 2743 // Not Found 2744 // "ALREADY_EXISTS" - The entity that a client attempted to create 2745 // (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict 2746 // "PERMISSION_DENIED" - The caller does not have permission to 2747 // execute the specified operation. `PERMISSION_DENIED` must not be used 2748 // for rejections caused by exhausting some resource (use 2749 // `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED` 2750 // must not be used if the caller can not be identified (use 2751 // `UNAUTHENTICATED` instead for those errors). This error code does not 2752 // imply the request is valid or the requested entity exists or 2753 // satisfies other pre-conditions. HTTP Mapping: 403 Forbidden 2754 // "UNAUTHENTICATED" - The request does not have valid authentication 2755 // credentials for the operation. HTTP Mapping: 401 Unauthorized 2756 // "RESOURCE_EXHAUSTED" - Some resource has been exhausted, perhaps a 2757 // per-user quota, or perhaps the entire file system is out of space. 2758 // HTTP Mapping: 429 Too Many Requests 2759 // "FAILED_PRECONDITION" - The operation was rejected because the 2760 // system is not in a state required for the operation's execution. For 2761 // example, the directory to be deleted is non-empty, an rmdir operation 2762 // is applied to a non-directory, etc. Service implementors can use the 2763 // following guidelines to decide between `FAILED_PRECONDITION`, 2764 // `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can 2765 // retry just the failing call. (b) Use `ABORTED` if the client should 2766 // retry at a higher level. For example, when a client-specified 2767 // test-and-set fails, indicating the client should restart a 2768 // read-modify-write sequence. (c) Use `FAILED_PRECONDITION` if the 2769 // client should not retry until the system state has been explicitly 2770 // fixed. For example, if an "rmdir" fails because the directory is 2771 // non-empty, `FAILED_PRECONDITION` should be returned since the client 2772 // should not retry unless the files are deleted from the directory. 2773 // HTTP Mapping: 400 Bad Request 2774 // "ABORTED" - The operation was aborted, typically due to a 2775 // concurrency issue such as a sequencer check failure or transaction 2776 // abort. See the guidelines above for deciding between 2777 // `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 2778 // 409 Conflict 2779 // "OUT_OF_RANGE" - The operation was attempted past the valid range. 2780 // E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, 2781 // this error indicates a problem that may be fixed if the system state 2782 // changes. For example, a 32-bit file system will generate 2783 // `INVALID_ARGUMENT` if asked to read at an offset that is not in the 2784 // range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to 2785 // read from an offset past the current file size. There is a fair bit 2786 // of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We 2787 // recommend using `OUT_OF_RANGE` (the more specific error) when it 2788 // applies so that callers who are iterating through a space can easily 2789 // look for an `OUT_OF_RANGE` error to detect when they are done. HTTP 2790 // Mapping: 400 Bad Request 2791 // "UNIMPLEMENTED" - The operation is not implemented or is not 2792 // supported/enabled in this service. HTTP Mapping: 501 Not Implemented 2793 // "INTERNAL" - Internal errors. This means that some invariants 2794 // expected by the underlying system have been broken. This error code 2795 // is reserved for serious errors. HTTP Mapping: 500 Internal Server 2796 // Error 2797 // "UNAVAILABLE" - The service is currently unavailable. This is most 2798 // likely a transient condition, which can be corrected by retrying with 2799 // a backoff. Note that it is not always safe to retry non-idempotent 2800 // operations. See the guidelines above for deciding between 2801 // `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. HTTP Mapping: 2802 // 503 Service Unavailable 2803 // "DATA_LOSS" - Unrecoverable data loss or corruption. HTTP Mapping: 2804 // 500 Internal Server Error 2805 ErrorCode string `json:"errorCode,omitempty"` 2806 2807 // ErrorMessage: Failure reason message. 2808 ErrorMessage string `json:"errorMessage,omitempty"` 2809 2810 // Printer: Failed printer. 2811 Printer *Printer `json:"printer,omitempty"` 2812 2813 // PrinterId: Id of a failed printer. 2814 PrinterId string `json:"printerId,omitempty"` 2815 2816 // ForceSendFields is a list of field names (e.g. "ErrorCode") to 2817 // unconditionally include in API requests. By default, fields with 2818 // empty or default values are omitted from API requests. However, any 2819 // non-pointer, non-interface field appearing in ForceSendFields will be 2820 // sent to the server regardless of whether the field is empty or not. 2821 // This may be used to include empty fields in Patch requests. 2822 ForceSendFields []string `json:"-"` 2823 2824 // NullFields is a list of field names (e.g. "ErrorCode") to include in 2825 // API requests with the JSON null value. By default, fields with empty 2826 // values are omitted from API requests. However, any field with an 2827 // empty value appearing in NullFields will be sent to the server as 2828 // null. It is an error if a field in this list has a non-empty value. 2829 // This may be used to include null fields in Patch requests. 2830 NullFields []string `json:"-"` 2831} 2832 2833func (s *FailureInfo) MarshalJSON() ([]byte, error) { 2834 type NoMethod FailureInfo 2835 raw := NoMethod(*s) 2836 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2837} 2838 2839// Feature: JSON template for Feature object in Directory API. 2840type Feature struct { 2841 // Etags: ETag of the resource. 2842 Etags string `json:"etags,omitempty"` 2843 2844 // Kind: Kind of resource this is. 2845 Kind string `json:"kind,omitempty"` 2846 2847 // Name: The name of the feature. 2848 Name string `json:"name,omitempty"` 2849 2850 // ServerResponse contains the HTTP response code and headers from the 2851 // server. 2852 googleapi.ServerResponse `json:"-"` 2853 2854 // ForceSendFields is a list of field names (e.g. "Etags") to 2855 // unconditionally include in API requests. By default, fields with 2856 // empty or default values are omitted from API requests. However, any 2857 // non-pointer, non-interface field appearing in ForceSendFields will be 2858 // sent to the server regardless of whether the field is empty or not. 2859 // This may be used to include empty fields in Patch requests. 2860 ForceSendFields []string `json:"-"` 2861 2862 // NullFields is a list of field names (e.g. "Etags") to include in API 2863 // requests with the JSON null value. By default, fields with empty 2864 // values are omitted from API requests. However, any field with an 2865 // empty value appearing in NullFields will be sent to the server as 2866 // null. It is an error if a field in this list has a non-empty value. 2867 // This may be used to include null fields in Patch requests. 2868 NullFields []string `json:"-"` 2869} 2870 2871func (s *Feature) MarshalJSON() ([]byte, error) { 2872 type NoMethod Feature 2873 raw := NoMethod(*s) 2874 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2875} 2876 2877// FeatureInstance: JSON template for a feature instance. 2878type FeatureInstance struct { 2879 // Feature: The feature that this is an instance of. A calendar resource 2880 // may have multiple instances of a feature. 2881 Feature *Feature `json:"feature,omitempty"` 2882 2883 // ForceSendFields is a list of field names (e.g. "Feature") to 2884 // unconditionally include in API requests. By default, fields with 2885 // empty or default values are omitted from API requests. However, any 2886 // non-pointer, non-interface field appearing in ForceSendFields will be 2887 // sent to the server regardless of whether the field is empty or not. 2888 // This may be used to include empty fields in Patch requests. 2889 ForceSendFields []string `json:"-"` 2890 2891 // NullFields is a list of field names (e.g. "Feature") to include in 2892 // API requests with the JSON null value. By default, fields with empty 2893 // values are omitted from API requests. However, any field with an 2894 // empty value appearing in NullFields will be sent to the server as 2895 // null. It is an error if a field in this list has a non-empty value. 2896 // This may be used to include null fields in Patch requests. 2897 NullFields []string `json:"-"` 2898} 2899 2900func (s *FeatureInstance) MarshalJSON() ([]byte, error) { 2901 type NoMethod FeatureInstance 2902 raw := NoMethod(*s) 2903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2904} 2905 2906type FeatureRename struct { 2907 // NewName: New name of the feature. 2908 NewName string `json:"newName,omitempty"` 2909 2910 // ForceSendFields is a list of field names (e.g. "NewName") to 2911 // unconditionally include in API requests. By default, fields with 2912 // empty or default values are omitted from API requests. However, any 2913 // non-pointer, non-interface field appearing in ForceSendFields will be 2914 // sent to the server regardless of whether the field is empty or not. 2915 // This may be used to include empty fields in Patch requests. 2916 ForceSendFields []string `json:"-"` 2917 2918 // NullFields is a list of field names (e.g. "NewName") to include in 2919 // API requests with the JSON null value. By default, fields with empty 2920 // values are omitted from API requests. However, any field with an 2921 // empty value appearing in NullFields will be sent to the server as 2922 // null. It is an error if a field in this list has a non-empty value. 2923 // This may be used to include null fields in Patch requests. 2924 NullFields []string `json:"-"` 2925} 2926 2927func (s *FeatureRename) MarshalJSON() ([]byte, error) { 2928 type NoMethod FeatureRename 2929 raw := NoMethod(*s) 2930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2931} 2932 2933// Features: Public API: Resources.features 2934type Features struct { 2935 // Etag: ETag of the resource. 2936 Etag string `json:"etag,omitempty"` 2937 2938 // Features: The Features in this page of results. 2939 Features []*Feature `json:"features,omitempty"` 2940 2941 // Kind: Kind of resource this is. 2942 Kind string `json:"kind,omitempty"` 2943 2944 // NextPageToken: The continuation token, used to page through large 2945 // result sets. Provide this value in a subsequent request to return the 2946 // next page of results. 2947 NextPageToken string `json:"nextPageToken,omitempty"` 2948 2949 // ServerResponse contains the HTTP response code and headers from the 2950 // server. 2951 googleapi.ServerResponse `json:"-"` 2952 2953 // ForceSendFields is a list of field names (e.g. "Etag") to 2954 // unconditionally include in API requests. By default, fields with 2955 // empty or default values are omitted from API requests. However, any 2956 // non-pointer, non-interface field appearing in ForceSendFields will be 2957 // sent to the server regardless of whether the field is empty or not. 2958 // This may be used to include empty fields in Patch requests. 2959 ForceSendFields []string `json:"-"` 2960 2961 // NullFields is a list of field names (e.g. "Etag") to include in API 2962 // requests with the JSON null value. By default, fields with empty 2963 // values are omitted from API requests. However, any field with an 2964 // empty value appearing in NullFields will be sent to the server as 2965 // null. It is an error if a field in this list has a non-empty value. 2966 // This may be used to include null fields in Patch requests. 2967 NullFields []string `json:"-"` 2968} 2969 2970func (s *Features) MarshalJSON() ([]byte, error) { 2971 type NoMethod Features 2972 raw := NoMethod(*s) 2973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2974} 2975 2976// Group: Google Groups provide your users the ability to send messages 2977// to groups of people using the group's email address. For more 2978// information about common tasks, see the Developer's Guide 2979// (/admin-sdk/directory/v1/guides/manage-groups). 2980type Group struct { 2981 // AdminCreated: Value is `true` if this group was created by an 2982 // administrator rather than a user. 2983 AdminCreated bool `json:"adminCreated,omitempty"` 2984 2985 // Aliases: List of a group's alias email addresses. 2986 Aliases []string `json:"aliases,omitempty"` 2987 2988 // Description: An extended description to help users determine the 2989 // purpose of a group. For example, you can include information about 2990 // who should join the group, the types of messages to send to the 2991 // group, links to FAQs about the group, or related groups. Maximum 2992 // length is `4,096` characters. 2993 Description string `json:"description,omitempty"` 2994 2995 // DirectMembersCount: The number of users that are direct members of 2996 // the group. If a group is a member (child) of this group (the parent), 2997 // members of the child group are not counted in the 2998 // `directMembersCount` property of the parent group. 2999 DirectMembersCount int64 `json:"directMembersCount,omitempty,string"` 3000 3001 // Email: The group's email address. If your account has multiple 3002 // domains, select the appropriate domain for the email address. The 3003 // `email` must be unique. This property is required when creating a 3004 // group. Group email addresses are subject to the same character usage 3005 // rules as usernames, see the help center 3006 // (https://support.google.com/a/answer/9193374) for details. 3007 Email string `json:"email,omitempty"` 3008 3009 // Etag: ETag of the resource. 3010 Etag string `json:"etag,omitempty"` 3011 3012 // Id: The unique ID of a group. A group `id` can be used as a group 3013 // request URI's `groupKey`. 3014 Id string `json:"id,omitempty"` 3015 3016 // Kind: The type of the API resource. For Groups resources, the value 3017 // is `admin#directory#group`. 3018 Kind string `json:"kind,omitempty"` 3019 3020 // Name: The group's display name. 3021 Name string `json:"name,omitempty"` 3022 3023 // NonEditableAliases: List of the group's non-editable alias email 3024 // addresses that are outside of the account's primary domain or 3025 // subdomains. These are functioning email addresses used by the group. 3026 // This is a read-only property returned in the API's response for a 3027 // group. If edited in a group's POST or PUT request, the edit is 3028 // ignored by the API service. 3029 NonEditableAliases []string `json:"nonEditableAliases,omitempty"` 3030 3031 // ServerResponse contains the HTTP response code and headers from the 3032 // server. 3033 googleapi.ServerResponse `json:"-"` 3034 3035 // ForceSendFields is a list of field names (e.g. "AdminCreated") to 3036 // unconditionally include in API requests. By default, fields with 3037 // empty or default values are omitted from API requests. However, any 3038 // non-pointer, non-interface field appearing in ForceSendFields will be 3039 // sent to the server regardless of whether the field is empty or not. 3040 // This may be used to include empty fields in Patch requests. 3041 ForceSendFields []string `json:"-"` 3042 3043 // NullFields is a list of field names (e.g. "AdminCreated") to include 3044 // in API requests with the JSON null value. By default, fields with 3045 // empty values are omitted from API requests. However, any field with 3046 // an empty value appearing in NullFields will be sent to the server as 3047 // null. It is an error if a field in this list has a non-empty value. 3048 // This may be used to include null fields in Patch requests. 3049 NullFields []string `json:"-"` 3050} 3051 3052func (s *Group) MarshalJSON() ([]byte, error) { 3053 type NoMethod Group 3054 raw := NoMethod(*s) 3055 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3056} 3057 3058type Groups struct { 3059 // Etag: ETag of the resource. 3060 Etag string `json:"etag,omitempty"` 3061 3062 // Groups: List of group objects. 3063 Groups []*Group `json:"groups,omitempty"` 3064 3065 // Kind: Kind of resource this is. 3066 Kind string `json:"kind,omitempty"` 3067 3068 // NextPageToken: Token used to access next page of this result. 3069 NextPageToken string `json:"nextPageToken,omitempty"` 3070 3071 // ServerResponse contains the HTTP response code and headers from the 3072 // server. 3073 googleapi.ServerResponse `json:"-"` 3074 3075 // ForceSendFields is a list of field names (e.g. "Etag") to 3076 // unconditionally include in API requests. By default, fields with 3077 // empty or default values are omitted from API requests. However, any 3078 // non-pointer, non-interface field appearing in ForceSendFields will be 3079 // sent to the server regardless of whether the field is empty or not. 3080 // This may be used to include empty fields in Patch requests. 3081 ForceSendFields []string `json:"-"` 3082 3083 // NullFields is a list of field names (e.g. "Etag") to include in API 3084 // requests with the JSON null value. By default, fields with empty 3085 // values are omitted from API requests. However, any field with an 3086 // empty value appearing in NullFields will be sent to the server as 3087 // null. It is an error if a field in this list has a non-empty value. 3088 // This may be used to include null fields in Patch requests. 3089 NullFields []string `json:"-"` 3090} 3091 3092func (s *Groups) MarshalJSON() ([]byte, error) { 3093 type NoMethod Groups 3094 raw := NoMethod(*s) 3095 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3096} 3097 3098// ListPrinterModelsResponse: Response for listing allowed printer 3099// models. 3100type ListPrinterModelsResponse struct { 3101 // NextPageToken: A token, which can be sent as `page_token` to retrieve 3102 // the next page. If this field is omitted, there are no subsequent 3103 // pages. 3104 NextPageToken string `json:"nextPageToken,omitempty"` 3105 3106 // PrinterModels: Printer models that are currently allowed to be 3107 // configured for ChromeOs. Some printers may be added or removed over 3108 // time. 3109 PrinterModels []*PrinterModel `json:"printerModels,omitempty"` 3110 3111 // ServerResponse contains the HTTP response code and headers from the 3112 // server. 3113 googleapi.ServerResponse `json:"-"` 3114 3115 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3116 // unconditionally include in API requests. By default, fields with 3117 // empty or default values are omitted from API requests. However, any 3118 // non-pointer, non-interface field appearing in ForceSendFields will be 3119 // sent to the server regardless of whether the field is empty or not. 3120 // This may be used to include empty fields in Patch requests. 3121 ForceSendFields []string `json:"-"` 3122 3123 // NullFields is a list of field names (e.g. "NextPageToken") to include 3124 // in API requests with the JSON null value. By default, fields with 3125 // empty values are omitted from API requests. However, any field with 3126 // an empty value appearing in NullFields will be sent to the server as 3127 // null. It is an error if a field in this list has a non-empty value. 3128 // This may be used to include null fields in Patch requests. 3129 NullFields []string `json:"-"` 3130} 3131 3132func (s *ListPrinterModelsResponse) MarshalJSON() ([]byte, error) { 3133 type NoMethod ListPrinterModelsResponse 3134 raw := NoMethod(*s) 3135 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3136} 3137 3138// ListPrintersResponse: Response for listing printers. 3139type ListPrintersResponse struct { 3140 // NextPageToken: A token, which can be sent as `page_token` to retrieve 3141 // the next page. If this field is omitted, there are no subsequent 3142 // pages. 3143 NextPageToken string `json:"nextPageToken,omitempty"` 3144 3145 // Printers: List of printers. If `org_unit_id` was given in the 3146 // request, then only printers visible for this OU will be returned. If 3147 // `org_unit_id` was given in the request, then all printers will be 3148 // returned. 3149 Printers []*Printer `json:"printers,omitempty"` 3150 3151 // ServerResponse contains the HTTP response code and headers from the 3152 // server. 3153 googleapi.ServerResponse `json:"-"` 3154 3155 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3156 // unconditionally include in API requests. By default, fields with 3157 // empty or default values are omitted from API requests. However, any 3158 // non-pointer, non-interface field appearing in ForceSendFields will be 3159 // sent to the server regardless of whether the field is empty or not. 3160 // This may be used to include empty fields in Patch requests. 3161 ForceSendFields []string `json:"-"` 3162 3163 // NullFields is a list of field names (e.g. "NextPageToken") to include 3164 // in API requests with the JSON null value. By default, fields with 3165 // empty values are omitted from API requests. However, any field with 3166 // an empty value appearing in NullFields will be sent to the server as 3167 // null. It is an error if a field in this list has a non-empty value. 3168 // This may be used to include null fields in Patch requests. 3169 NullFields []string `json:"-"` 3170} 3171 3172func (s *ListPrintersResponse) MarshalJSON() ([]byte, error) { 3173 type NoMethod ListPrintersResponse 3174 raw := NoMethod(*s) 3175 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3176} 3177 3178// Member: A Google Groups member can be a user or another group. This 3179// member can be inside or outside of your account's domains. For more 3180// information about common group member tasks, see the Developer's 3181// Guide (/admin-sdk/directory/v1/guides/manage-group-members). 3182type Member struct { 3183 // DeliverySettings: Defines mail delivery preferences of member. This 3184 // is only supported by create/update/get. 3185 DeliverySettings string `json:"delivery_settings,omitempty"` 3186 3187 // Email: The member's email address. A member can be a user or another 3188 // group. This property is required when adding a member to a group. The 3189 // `email` must be unique and cannot be an alias of another group. If 3190 // the email address is changed, the API automatically reflects the 3191 // email address changes. 3192 Email string `json:"email,omitempty"` 3193 3194 // Etag: ETag of the resource. 3195 Etag string `json:"etag,omitempty"` 3196 3197 // Id: The unique ID of the group member. A member `id` can be used as a 3198 // member request URI's `memberKey`. 3199 Id string `json:"id,omitempty"` 3200 3201 // Kind: The type of the API resource. For Members resources, the value 3202 // is `admin#directory#member`. 3203 Kind string `json:"kind,omitempty"` 3204 3205 // Role: The member's role in a group. The API returns an error for 3206 // cycles in group memberships. For example, if `group1` is a member of 3207 // `group2`, `group2` cannot be a member of `group1`. For more 3208 // information about a member's role, see the administration help center 3209 // (https://support.google.com/a/answer/167094). 3210 Role string `json:"role,omitempty"` 3211 3212 // Status: Status of member (Immutable) 3213 Status string `json:"status,omitempty"` 3214 3215 // Type: The type of group member. 3216 Type string `json:"type,omitempty"` 3217 3218 // ServerResponse contains the HTTP response code and headers from the 3219 // server. 3220 googleapi.ServerResponse `json:"-"` 3221 3222 // ForceSendFields is a list of field names (e.g. "DeliverySettings") to 3223 // unconditionally include in API requests. By default, fields with 3224 // empty or default values are omitted from API requests. However, any 3225 // non-pointer, non-interface field appearing in ForceSendFields will be 3226 // sent to the server regardless of whether the field is empty or not. 3227 // This may be used to include empty fields in Patch requests. 3228 ForceSendFields []string `json:"-"` 3229 3230 // NullFields is a list of field names (e.g. "DeliverySettings") to 3231 // include in API requests with the JSON null value. By default, fields 3232 // with empty values are omitted from API requests. However, any field 3233 // with an empty value appearing in NullFields will be sent to the 3234 // server as null. It is an error if a field in this list has a 3235 // non-empty value. This may be used to include null fields in Patch 3236 // requests. 3237 NullFields []string `json:"-"` 3238} 3239 3240func (s *Member) MarshalJSON() ([]byte, error) { 3241 type NoMethod Member 3242 raw := NoMethod(*s) 3243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3244} 3245 3246type Members struct { 3247 // Etag: ETag of the resource. 3248 Etag string `json:"etag,omitempty"` 3249 3250 // Kind: Kind of resource this is. 3251 Kind string `json:"kind,omitempty"` 3252 3253 // Members: List of member objects. 3254 Members []*Member `json:"members,omitempty"` 3255 3256 // NextPageToken: Token used to access next page of this result. 3257 NextPageToken string `json:"nextPageToken,omitempty"` 3258 3259 // ServerResponse contains the HTTP response code and headers from the 3260 // server. 3261 googleapi.ServerResponse `json:"-"` 3262 3263 // ForceSendFields is a list of field names (e.g. "Etag") to 3264 // unconditionally include in API requests. By default, fields with 3265 // empty or default values are omitted from API requests. However, any 3266 // non-pointer, non-interface field appearing in ForceSendFields will be 3267 // sent to the server regardless of whether the field is empty or not. 3268 // This may be used to include empty fields in Patch requests. 3269 ForceSendFields []string `json:"-"` 3270 3271 // NullFields is a list of field names (e.g. "Etag") to include in API 3272 // requests with the JSON null value. By default, fields with empty 3273 // values are omitted from API requests. However, any field with an 3274 // empty value appearing in NullFields will be sent to the server as 3275 // null. It is an error if a field in this list has a non-empty value. 3276 // This may be used to include null fields in Patch requests. 3277 NullFields []string `json:"-"` 3278} 3279 3280func (s *Members) MarshalJSON() ([]byte, error) { 3281 type NoMethod Members 3282 raw := NoMethod(*s) 3283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3284} 3285 3286// MembersHasMember: JSON template for Has Member response in Directory 3287// API. 3288type MembersHasMember struct { 3289 // IsMember: Output only. Identifies whether the given user is a member 3290 // of the group. Membership can be direct or nested. 3291 IsMember bool `json:"isMember,omitempty"` 3292 3293 // ServerResponse contains the HTTP response code and headers from the 3294 // server. 3295 googleapi.ServerResponse `json:"-"` 3296 3297 // ForceSendFields is a list of field names (e.g. "IsMember") to 3298 // unconditionally include in API requests. By default, fields with 3299 // empty or default values are omitted from API requests. However, any 3300 // non-pointer, non-interface field appearing in ForceSendFields will be 3301 // sent to the server regardless of whether the field is empty or not. 3302 // This may be used to include empty fields in Patch requests. 3303 ForceSendFields []string `json:"-"` 3304 3305 // NullFields is a list of field names (e.g. "IsMember") to include in 3306 // API requests with the JSON null value. By default, fields with empty 3307 // values are omitted from API requests. However, any field with an 3308 // empty value appearing in NullFields will be sent to the server as 3309 // null. It is an error if a field in this list has a non-empty value. 3310 // This may be used to include null fields in Patch requests. 3311 NullFields []string `json:"-"` 3312} 3313 3314func (s *MembersHasMember) MarshalJSON() ([]byte, error) { 3315 type NoMethod MembersHasMember 3316 raw := NoMethod(*s) 3317 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3318} 3319 3320// MobileDevice: Google Workspace Mobile Management includes Android, 3321// Google Sync (https://support.google.com/a/answer/135937), and iOS 3322// devices. For more information about common group mobile device API 3323// tasks, see the Developer's Guide 3324// (/admin-sdk/directory/v1/guides/manage-mobile-devices.html). 3325type MobileDevice struct { 3326 // AdbStatus: Adb (USB debugging) enabled or disabled on device 3327 // (Read-only) 3328 AdbStatus bool `json:"adbStatus,omitempty"` 3329 3330 // Applications: The list of applications installed on an Android mobile 3331 // device. It is not applicable to Google Sync and iOS devices. The list 3332 // includes any Android applications that access Google Workspace data. 3333 // When updating an applications list, it is important to note that 3334 // updates replace the existing list. If the Android device has two 3335 // existing applications and the API updates the list with five 3336 // applications, the is now the updated list of five applications. 3337 Applications []*MobileDeviceApplications `json:"applications,omitempty"` 3338 3339 // BasebandVersion: The device's baseband version. 3340 BasebandVersion string `json:"basebandVersion,omitempty"` 3341 3342 // BootloaderVersion: Mobile Device Bootloader version (Read-only) 3343 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 3344 3345 // Brand: Mobile Device Brand (Read-only) 3346 Brand string `json:"brand,omitempty"` 3347 3348 // BuildNumber: The device's operating system build number. 3349 BuildNumber string `json:"buildNumber,omitempty"` 3350 3351 // DefaultLanguage: The default locale used on the device. 3352 DefaultLanguage string `json:"defaultLanguage,omitempty"` 3353 3354 // DeveloperOptionsStatus: Developer options enabled or disabled on 3355 // device (Read-only) 3356 DeveloperOptionsStatus bool `json:"developerOptionsStatus,omitempty"` 3357 3358 // DeviceCompromisedStatus: The compromised device status. 3359 DeviceCompromisedStatus string `json:"deviceCompromisedStatus,omitempty"` 3360 3361 // DeviceId: The serial number for a Google Sync mobile device. For 3362 // Android and iOS devices, this is a software generated unique 3363 // identifier. 3364 DeviceId string `json:"deviceId,omitempty"` 3365 3366 // DevicePasswordStatus: DevicePasswordStatus (Read-only) 3367 DevicePasswordStatus string `json:"devicePasswordStatus,omitempty"` 3368 3369 // Email: List of owner's email addresses. If your application needs the 3370 // current list of user emails, use the get 3371 // (/admin-sdk/directory/v1/reference/mobiledevices/get.html) method. 3372 // For additional information, see the retrieve a user 3373 // (/admin-sdk/directory/v1/guides/manage-users#get_user) method. 3374 Email []string `json:"email,omitempty"` 3375 3376 // EncryptionStatus: Mobile Device Encryption Status (Read-only) 3377 EncryptionStatus string `json:"encryptionStatus,omitempty"` 3378 3379 // Etag: ETag of the resource. 3380 Etag string `json:"etag,omitempty"` 3381 3382 // FirstSync: Date and time the device was first synchronized with the 3383 // policy settings in the G Suite administrator control panel 3384 // (Read-only) 3385 FirstSync string `json:"firstSync,omitempty"` 3386 3387 // Hardware: Mobile Device Hardware (Read-only) 3388 Hardware string `json:"hardware,omitempty"` 3389 3390 // HardwareId: The IMEI/MEID unique identifier for Android hardware. It 3391 // is not applicable to Google Sync devices. When adding an Android 3392 // mobile device, this is an optional property. When updating one of 3393 // these devices, this is a read-only property. 3394 HardwareId string `json:"hardwareId,omitempty"` 3395 3396 // Imei: The device's IMEI number. 3397 Imei string `json:"imei,omitempty"` 3398 3399 // KernelVersion: The device's kernel version. 3400 KernelVersion string `json:"kernelVersion,omitempty"` 3401 3402 // Kind: The type of the API resource. For Mobiledevices resources, the 3403 // value is `admin#directory#mobiledevice`. 3404 Kind string `json:"kind,omitempty"` 3405 3406 // LastSync: Date and time the device was last synchronized with the 3407 // policy settings in the G Suite administrator control panel 3408 // (Read-only) 3409 LastSync string `json:"lastSync,omitempty"` 3410 3411 // ManagedAccountIsOnOwnerProfile: Boolean indicating if this account is 3412 // on owner/primary profile or not. 3413 ManagedAccountIsOnOwnerProfile bool `json:"managedAccountIsOnOwnerProfile,omitempty"` 3414 3415 // Manufacturer: Mobile Device manufacturer (Read-only) 3416 Manufacturer string `json:"manufacturer,omitempty"` 3417 3418 // Meid: The device's MEID number. 3419 Meid string `json:"meid,omitempty"` 3420 3421 // Model: The mobile device's model name, for example Nexus S. This 3422 // property can be updated 3423 // (/admin-sdk/directory/v1/reference/mobiledevices/update.html). For 3424 // more information, see the Developer's Guide 3425 // (/admin-sdk/directory/v1/guides/manage-mobile=devices#update_mobile_de 3426 // vice). 3427 Model string `json:"model,omitempty"` 3428 3429 // Name: List of the owner's user names. If your application needs the 3430 // current list of device owner names, use the get 3431 // (/admin-sdk/directory/v1/reference/mobiledevices/get.html) method. 3432 // For more information about retrieving mobile device user information, 3433 // see the Developer's Guide 3434 // (/admin-sdk/directory/v1/guides/manage-users#get_user). 3435 Name []string `json:"name,omitempty"` 3436 3437 // NetworkOperator: Mobile Device mobile or network operator (if 3438 // available) (Read-only) 3439 NetworkOperator string `json:"networkOperator,omitempty"` 3440 3441 // Os: The mobile device's operating system, for example IOS 4.3 or 3442 // Android 2.3.5. This property can be updated 3443 // (/admin-sdk/directory/v1/reference/mobiledevices/update.html). For 3444 // more information, see the Developer's Guide 3445 // (/admin-sdk/directory/v1/guides/manage-mobile-devices#update_mobile_de 3446 // vice). 3447 Os string `json:"os,omitempty"` 3448 3449 // OtherAccountsInfo: List of accounts added on device (Read-only) 3450 OtherAccountsInfo []string `json:"otherAccountsInfo,omitempty"` 3451 3452 // Privilege: DMAgentPermission (Read-only) 3453 Privilege string `json:"privilege,omitempty"` 3454 3455 // ReleaseVersion: Mobile Device release version version (Read-only) 3456 ReleaseVersion string `json:"releaseVersion,omitempty"` 3457 3458 // ResourceId: The unique ID the API service uses to identify the mobile 3459 // device. 3460 ResourceId string `json:"resourceId,omitempty"` 3461 3462 // SecurityPatchLevel: Mobile Device Security patch level (Read-only) 3463 SecurityPatchLevel int64 `json:"securityPatchLevel,omitempty,string"` 3464 3465 // SerialNumber: The device's serial number. 3466 SerialNumber string `json:"serialNumber,omitempty"` 3467 3468 // Status: The device's status. 3469 Status string `json:"status,omitempty"` 3470 3471 // SupportsWorkProfile: Work profile supported on device (Read-only) 3472 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 3473 3474 // Type: The type of mobile device. 3475 Type string `json:"type,omitempty"` 3476 3477 // UnknownSourcesStatus: Unknown sources enabled or disabled on device 3478 // (Read-only) 3479 UnknownSourcesStatus bool `json:"unknownSourcesStatus,omitempty"` 3480 3481 // UserAgent: Gives information about the device such as `os` version. 3482 // This property can be updated 3483 // (/admin-sdk/directory/v1/reference/mobiledevices/update.html). For 3484 // more information, see the Developer's Guide 3485 // (/admin-sdk/directory/v1/guides/manage-mobile-devices#update_mobile_de 3486 // vice). 3487 UserAgent string `json:"userAgent,omitempty"` 3488 3489 // WifiMacAddress: The device's MAC address on Wi-Fi networks. 3490 WifiMacAddress string `json:"wifiMacAddress,omitempty"` 3491 3492 // ServerResponse contains the HTTP response code and headers from the 3493 // server. 3494 googleapi.ServerResponse `json:"-"` 3495 3496 // ForceSendFields is a list of field names (e.g. "AdbStatus") to 3497 // unconditionally include in API requests. By default, fields with 3498 // empty or default values are omitted from API requests. However, any 3499 // non-pointer, non-interface field appearing in ForceSendFields will be 3500 // sent to the server regardless of whether the field is empty or not. 3501 // This may be used to include empty fields in Patch requests. 3502 ForceSendFields []string `json:"-"` 3503 3504 // NullFields is a list of field names (e.g. "AdbStatus") to include in 3505 // API requests with the JSON null value. By default, fields with empty 3506 // values are omitted from API requests. However, any field with an 3507 // empty value appearing in NullFields will be sent to the server as 3508 // null. It is an error if a field in this list has a non-empty value. 3509 // This may be used to include null fields in Patch requests. 3510 NullFields []string `json:"-"` 3511} 3512 3513func (s *MobileDevice) MarshalJSON() ([]byte, error) { 3514 type NoMethod MobileDevice 3515 raw := NoMethod(*s) 3516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3517} 3518 3519type MobileDeviceApplications struct { 3520 // DisplayName: The application's display name. An example is `Browser`. 3521 DisplayName string `json:"displayName,omitempty"` 3522 3523 // PackageName: The application's package name. An example is 3524 // `com.android.browser`. 3525 PackageName string `json:"packageName,omitempty"` 3526 3527 // Permission: The list of permissions of this application. These can be 3528 // either a standard Android permission or one defined by the 3529 // application, and are found in an application's Android manifest 3530 // (https://developer.android.com/guide/topics/manifest/uses-permission-element.html). 3531 // Examples of a Calendar application's permissions are `READ_CALENDAR`, 3532 // or `MANAGE_ACCOUNTS`. 3533 Permission []string `json:"permission,omitempty"` 3534 3535 // VersionCode: The application's version code. An example is `13`. 3536 VersionCode int64 `json:"versionCode,omitempty"` 3537 3538 // VersionName: The application's version name. An example is 3539 // `3.2-140714`. 3540 VersionName string `json:"versionName,omitempty"` 3541 3542 // ForceSendFields is a list of field names (e.g. "DisplayName") to 3543 // unconditionally include in API requests. By default, fields with 3544 // empty or default values are omitted from API requests. However, any 3545 // non-pointer, non-interface field appearing in ForceSendFields will be 3546 // sent to the server regardless of whether the field is empty or not. 3547 // This may be used to include empty fields in Patch requests. 3548 ForceSendFields []string `json:"-"` 3549 3550 // NullFields is a list of field names (e.g. "DisplayName") to include 3551 // in API requests with the JSON null value. By default, fields with 3552 // empty values are omitted from API requests. However, any field with 3553 // an empty value appearing in NullFields will be sent to the server as 3554 // null. It is an error if a field in this list has a non-empty value. 3555 // This may be used to include null fields in Patch requests. 3556 NullFields []string `json:"-"` 3557} 3558 3559func (s *MobileDeviceApplications) MarshalJSON() ([]byte, error) { 3560 type NoMethod MobileDeviceApplications 3561 raw := NoMethod(*s) 3562 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3563} 3564 3565type MobileDeviceAction struct { 3566 // Action: The action to be performed on the device. 3567 Action string `json:"action,omitempty"` 3568 3569 // ForceSendFields is a list of field names (e.g. "Action") to 3570 // unconditionally include in API requests. By default, fields with 3571 // empty or default values are omitted from API requests. However, any 3572 // non-pointer, non-interface field appearing in ForceSendFields will be 3573 // sent to the server regardless of whether the field is empty or not. 3574 // This may be used to include empty fields in Patch requests. 3575 ForceSendFields []string `json:"-"` 3576 3577 // NullFields is a list of field names (e.g. "Action") to include in API 3578 // requests with the JSON null value. By default, fields with empty 3579 // values are omitted from API requests. However, any field with an 3580 // empty value appearing in NullFields will be sent to the server as 3581 // null. It is an error if a field in this list has a non-empty value. 3582 // This may be used to include null fields in Patch requests. 3583 NullFields []string `json:"-"` 3584} 3585 3586func (s *MobileDeviceAction) MarshalJSON() ([]byte, error) { 3587 type NoMethod MobileDeviceAction 3588 raw := NoMethod(*s) 3589 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3590} 3591 3592type MobileDevices struct { 3593 // Etag: ETag of the resource. 3594 Etag string `json:"etag,omitempty"` 3595 3596 // Kind: Kind of resource this is. 3597 Kind string `json:"kind,omitempty"` 3598 3599 // Mobiledevices: List of Mobile Device objects. 3600 Mobiledevices []*MobileDevice `json:"mobiledevices,omitempty"` 3601 3602 // NextPageToken: Token used to access next page of this result. 3603 NextPageToken string `json:"nextPageToken,omitempty"` 3604 3605 // ServerResponse contains the HTTP response code and headers from the 3606 // server. 3607 googleapi.ServerResponse `json:"-"` 3608 3609 // ForceSendFields is a list of field names (e.g. "Etag") to 3610 // unconditionally include in API requests. By default, fields with 3611 // empty or default values are omitted from API requests. However, any 3612 // non-pointer, non-interface field appearing in ForceSendFields will be 3613 // sent to the server regardless of whether the field is empty or not. 3614 // This may be used to include empty fields in Patch requests. 3615 ForceSendFields []string `json:"-"` 3616 3617 // NullFields is a list of field names (e.g. "Etag") to include in API 3618 // requests with the JSON null value. By default, fields with empty 3619 // values are omitted from API requests. However, any field with an 3620 // empty value appearing in NullFields will be sent to the server as 3621 // null. It is an error if a field in this list has a non-empty value. 3622 // This may be used to include null fields in Patch requests. 3623 NullFields []string `json:"-"` 3624} 3625 3626func (s *MobileDevices) MarshalJSON() ([]byte, error) { 3627 type NoMethod MobileDevices 3628 raw := NoMethod(*s) 3629 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3630} 3631 3632// OrgUnit: Managing your account's organizational units allows you to 3633// configure your users' access to services and custom settings. For 3634// more information about common organizational unit tasks, see the 3635// Developer's Guide 3636// (/admin-sdk/directory/v1/guides/manage-org-units.html). The 3637// customer's organizational unit hierarchy is limited to 35 levels of 3638// depth. 3639type OrgUnit struct { 3640 // BlockInheritance: Determines if a sub-organizational unit can inherit 3641 // the settings of the parent organization. The default value is 3642 // `false`, meaning a sub-organizational unit inherits the settings of 3643 // the nearest parent organizational unit. For more information on 3644 // inheritance and users in an organization structure, see the 3645 // administration help center 3646 // (https://support.google.com/a/answer/4352075). 3647 BlockInheritance bool `json:"blockInheritance,omitempty"` 3648 3649 // Description: Description of the organizational unit. 3650 Description string `json:"description,omitempty"` 3651 3652 // Etag: ETag of the resource. 3653 Etag string `json:"etag,omitempty"` 3654 3655 // Kind: The type of the API resource. For Orgunits resources, the value 3656 // is `admin#directory#orgUnit`. 3657 Kind string `json:"kind,omitempty"` 3658 3659 // Name: The organizational unit's path name. For example, an 3660 // organizational unit's name within the /corp/support/sales_support 3661 // parent path is sales_support. Required. 3662 Name string `json:"name,omitempty"` 3663 3664 // OrgUnitId: The unique ID of the organizational unit. 3665 OrgUnitId string `json:"orgUnitId,omitempty"` 3666 3667 // OrgUnitPath: The full path to the organizational unit. The 3668 // `orgUnitPath` is a derived property. When listed, it is derived from 3669 // `parentOrgunitPath` and organizational unit's `name`. For example, 3670 // for an organizational unit named 'apps' under parent organization 3671 // '/engineering', the orgUnitPath is '/engineering/apps'. In order to 3672 // edit an `orgUnitPath`, either update the name of the organization or 3673 // the `parentOrgunitPath`. A user's organizational unit determines 3674 // which Google Workspace services the user has access to. If the user 3675 // is moved to a new organization, the user's access changes. For more 3676 // information about organization structures, see the administration 3677 // help center (https://support.google.com/a/answer/4352075). For more 3678 // information about moving a user to a different organization, see 3679 // Update a user 3680 // (/admin-sdk/directory/v1/guides/manage-users.html#update_user). 3681 OrgUnitPath string `json:"orgUnitPath,omitempty"` 3682 3683 // ParentOrgUnitId: The unique ID of the parent organizational unit. 3684 // Required, unless `parentOrgUnitPath` is set. 3685 ParentOrgUnitId string `json:"parentOrgUnitId,omitempty"` 3686 3687 // ParentOrgUnitPath: The organizational unit's parent path. For 3688 // example, /corp/sales is the parent path for /corp/sales/sales_support 3689 // organizational unit. Required, unless `parentOrgUnitId` is set. 3690 ParentOrgUnitPath string `json:"parentOrgUnitPath,omitempty"` 3691 3692 // ServerResponse contains the HTTP response code and headers from the 3693 // server. 3694 googleapi.ServerResponse `json:"-"` 3695 3696 // ForceSendFields is a list of field names (e.g. "BlockInheritance") to 3697 // unconditionally include in API requests. By default, fields with 3698 // empty or default values are omitted from API requests. However, any 3699 // non-pointer, non-interface field appearing in ForceSendFields will be 3700 // sent to the server regardless of whether the field is empty or not. 3701 // This may be used to include empty fields in Patch requests. 3702 ForceSendFields []string `json:"-"` 3703 3704 // NullFields is a list of field names (e.g. "BlockInheritance") to 3705 // include in API requests with the JSON null value. By default, fields 3706 // with empty values are omitted from API requests. However, any field 3707 // with an empty value appearing in NullFields will be sent to the 3708 // server as null. It is an error if a field in this list has a 3709 // non-empty value. This may be used to include null fields in Patch 3710 // requests. 3711 NullFields []string `json:"-"` 3712} 3713 3714func (s *OrgUnit) MarshalJSON() ([]byte, error) { 3715 type NoMethod OrgUnit 3716 raw := NoMethod(*s) 3717 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3718} 3719 3720type OrgUnits struct { 3721 // Etag: ETag of the resource. 3722 Etag string `json:"etag,omitempty"` 3723 3724 // Kind: The type of the API resource. For Org Unit resources, the type 3725 // is `admin#directory#orgUnits`. 3726 Kind string `json:"kind,omitempty"` 3727 3728 // OrganizationUnits: List of organizational unit objects. 3729 OrganizationUnits []*OrgUnit `json:"organizationUnits,omitempty"` 3730 3731 // ServerResponse contains the HTTP response code and headers from the 3732 // server. 3733 googleapi.ServerResponse `json:"-"` 3734 3735 // ForceSendFields is a list of field names (e.g. "Etag") to 3736 // unconditionally include in API requests. By default, fields with 3737 // empty or default values are omitted from API requests. However, any 3738 // non-pointer, non-interface field appearing in ForceSendFields will be 3739 // sent to the server regardless of whether the field is empty or not. 3740 // This may be used to include empty fields in Patch requests. 3741 ForceSendFields []string `json:"-"` 3742 3743 // NullFields is a list of field names (e.g. "Etag") to include in API 3744 // requests with the JSON null value. By default, fields with empty 3745 // values are omitted from API requests. However, any field with an 3746 // empty value appearing in NullFields will be sent to the server as 3747 // null. It is an error if a field in this list has a non-empty value. 3748 // This may be used to include null fields in Patch requests. 3749 NullFields []string `json:"-"` 3750} 3751 3752func (s *OrgUnits) MarshalJSON() ([]byte, error) { 3753 type NoMethod OrgUnits 3754 raw := NoMethod(*s) 3755 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3756} 3757 3758// Printer: Printer configuration. 3759type Printer struct { 3760 // AuxiliaryMessages: Output only. Auxiliary messages about issues with 3761 // the printer configuration if any. 3762 AuxiliaryMessages []*AuxiliaryMessage `json:"auxiliaryMessages,omitempty"` 3763 3764 // CreateTime: Output only. Time when printer was created. 3765 CreateTime string `json:"createTime,omitempty"` 3766 3767 // Description: Editable. Description of printer. 3768 Description string `json:"description,omitempty"` 3769 3770 // DisplayName: Editable. Name of printer. 3771 DisplayName string `json:"displayName,omitempty"` 3772 3773 // Id: Id of the printer. (During printer creation leave empty) 3774 Id string `json:"id,omitempty"` 3775 3776 // MakeAndModel: Editable. Make and model of printer. e.g. Lexmark 3777 // MS610de Value must be in format as seen in ListPrinterModels 3778 // response. 3779 MakeAndModel string `json:"makeAndModel,omitempty"` 3780 3781 // Name: The resource name of the Printer object, in the format 3782 // customers/{customer-id}/printers/{printer-id} (During printer 3783 // creation leave empty) 3784 Name string `json:"name,omitempty"` 3785 3786 // OrgUnitId: Organization Unit that owns this printer (Only can be set 3787 // during Printer creation) 3788 OrgUnitId string `json:"orgUnitId,omitempty"` 3789 3790 // Uri: Editable. Printer URI. 3791 Uri string `json:"uri,omitempty"` 3792 3793 // UseDriverlessConfig: Editable. flag to use driverless configuration 3794 // or not. If it's set to be true, make_and_model can be ignored 3795 UseDriverlessConfig bool `json:"useDriverlessConfig,omitempty"` 3796 3797 // ServerResponse contains the HTTP response code and headers from the 3798 // server. 3799 googleapi.ServerResponse `json:"-"` 3800 3801 // ForceSendFields is a list of field names (e.g. "AuxiliaryMessages") 3802 // to unconditionally include in API requests. By default, fields with 3803 // empty or default values are omitted from API requests. However, any 3804 // non-pointer, non-interface field appearing in ForceSendFields will be 3805 // sent to the server regardless of whether the field is empty or not. 3806 // This may be used to include empty fields in Patch requests. 3807 ForceSendFields []string `json:"-"` 3808 3809 // NullFields is a list of field names (e.g. "AuxiliaryMessages") to 3810 // include in API requests with the JSON null value. By default, fields 3811 // with empty values are omitted from API requests. However, any field 3812 // with an empty value appearing in NullFields will be sent to the 3813 // server as null. It is an error if a field in this list has a 3814 // non-empty value. This may be used to include null fields in Patch 3815 // requests. 3816 NullFields []string `json:"-"` 3817} 3818 3819func (s *Printer) MarshalJSON() ([]byte, error) { 3820 type NoMethod Printer 3821 raw := NoMethod(*s) 3822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3823} 3824 3825// PrinterModel: Printer manufacturer and model 3826type PrinterModel struct { 3827 // DisplayName: Display name. eq. "Brother MFC-8840D" 3828 DisplayName string `json:"displayName,omitempty"` 3829 3830 // MakeAndModel: Make and model as represented in "make_and_model" field 3831 // in Printer object. eq. "brother mfc-8840d" 3832 MakeAndModel string `json:"makeAndModel,omitempty"` 3833 3834 // Manufacturer: Manufacturer. eq. "Brother" 3835 Manufacturer string `json:"manufacturer,omitempty"` 3836 3837 // ForceSendFields is a list of field names (e.g. "DisplayName") to 3838 // unconditionally include in API requests. By default, fields with 3839 // empty or default values are omitted from API requests. However, any 3840 // non-pointer, non-interface field appearing in ForceSendFields will be 3841 // sent to the server regardless of whether the field is empty or not. 3842 // This may be used to include empty fields in Patch requests. 3843 ForceSendFields []string `json:"-"` 3844 3845 // NullFields is a list of field names (e.g. "DisplayName") to include 3846 // in API requests with the JSON null value. By default, fields with 3847 // empty values are omitted from API requests. However, any field with 3848 // an empty value appearing in NullFields will be sent to the server as 3849 // null. It is an error if a field in this list has a non-empty value. 3850 // This may be used to include null fields in Patch requests. 3851 NullFields []string `json:"-"` 3852} 3853 3854func (s *PrinterModel) MarshalJSON() ([]byte, error) { 3855 type NoMethod PrinterModel 3856 raw := NoMethod(*s) 3857 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3858} 3859 3860type Privilege struct { 3861 // ChildPrivileges: A list of child privileges. Privileges for a service 3862 // form a tree. Each privilege can have a list of child privileges; this 3863 // list is empty for a leaf privilege. 3864 ChildPrivileges []*Privilege `json:"childPrivileges,omitempty"` 3865 3866 // Etag: ETag of the resource. 3867 Etag string `json:"etag,omitempty"` 3868 3869 // IsOuScopable: If the privilege can be restricted to an organization 3870 // unit. 3871 IsOuScopable bool `json:"isOuScopable,omitempty"` 3872 3873 // Kind: The type of the API resource. This is always 3874 // `admin#directory#privilege`. 3875 Kind string `json:"kind,omitempty"` 3876 3877 // PrivilegeName: The name of the privilege. 3878 PrivilegeName string `json:"privilegeName,omitempty"` 3879 3880 // ServiceId: The obfuscated ID of the service this privilege is for. 3881 // This value is returned with `Privileges.list()` 3882 // (/admin-sdk/directory/v1/reference/privileges/list). 3883 ServiceId string `json:"serviceId,omitempty"` 3884 3885 // ServiceName: The name of the service this privilege is for. 3886 ServiceName string `json:"serviceName,omitempty"` 3887 3888 // ForceSendFields is a list of field names (e.g. "ChildPrivileges") to 3889 // unconditionally include in API requests. By default, fields with 3890 // empty or default values are omitted from API requests. However, any 3891 // non-pointer, non-interface field appearing in ForceSendFields will be 3892 // sent to the server regardless of whether the field is empty or not. 3893 // This may be used to include empty fields in Patch requests. 3894 ForceSendFields []string `json:"-"` 3895 3896 // NullFields is a list of field names (e.g. "ChildPrivileges") to 3897 // include in API requests with the JSON null value. By default, fields 3898 // with empty values are omitted from API requests. However, any field 3899 // with an empty value appearing in NullFields will be sent to the 3900 // server as null. It is an error if a field in this list has a 3901 // non-empty value. This may be used to include null fields in Patch 3902 // requests. 3903 NullFields []string `json:"-"` 3904} 3905 3906func (s *Privilege) MarshalJSON() ([]byte, error) { 3907 type NoMethod Privilege 3908 raw := NoMethod(*s) 3909 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3910} 3911 3912type Privileges struct { 3913 // Etag: ETag of the resource. 3914 Etag string `json:"etag,omitempty"` 3915 3916 // Items: A list of Privilege resources. 3917 Items []*Privilege `json:"items,omitempty"` 3918 3919 // Kind: The type of the API resource. This is always 3920 // `admin#directory#privileges`. 3921 Kind string `json:"kind,omitempty"` 3922 3923 // ServerResponse contains the HTTP response code and headers from the 3924 // server. 3925 googleapi.ServerResponse `json:"-"` 3926 3927 // ForceSendFields is a list of field names (e.g. "Etag") to 3928 // unconditionally include in API requests. By default, fields with 3929 // empty or default values are omitted from API requests. However, any 3930 // non-pointer, non-interface field appearing in ForceSendFields will be 3931 // sent to the server regardless of whether the field is empty or not. 3932 // This may be used to include empty fields in Patch requests. 3933 ForceSendFields []string `json:"-"` 3934 3935 // NullFields is a list of field names (e.g. "Etag") to include in API 3936 // requests with the JSON null value. By default, fields with empty 3937 // values are omitted from API requests. However, any field with an 3938 // empty value appearing in NullFields will be sent to the server as 3939 // null. It is an error if a field in this list has a non-empty value. 3940 // This may be used to include null fields in Patch requests. 3941 NullFields []string `json:"-"` 3942} 3943 3944func (s *Privileges) MarshalJSON() ([]byte, error) { 3945 type NoMethod Privileges 3946 raw := NoMethod(*s) 3947 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3948} 3949 3950type Role struct { 3951 // Etag: ETag of the resource. 3952 Etag string `json:"etag,omitempty"` 3953 3954 // IsSuperAdminRole: Returns `true` if the role is a super admin role. 3955 IsSuperAdminRole bool `json:"isSuperAdminRole,omitempty"` 3956 3957 // IsSystemRole: Returns `true` if this is a pre-defined system role. 3958 IsSystemRole bool `json:"isSystemRole,omitempty"` 3959 3960 // Kind: The type of the API resource. This is always 3961 // `admin#directory#role`. 3962 Kind string `json:"kind,omitempty"` 3963 3964 // RoleDescription: A short description of the role. 3965 RoleDescription string `json:"roleDescription,omitempty"` 3966 3967 // RoleId: ID of the role. 3968 RoleId int64 `json:"roleId,omitempty,string"` 3969 3970 // RoleName: Name of the role. 3971 RoleName string `json:"roleName,omitempty"` 3972 3973 // RolePrivileges: The set of privileges that are granted to this role. 3974 RolePrivileges []*RoleRolePrivileges `json:"rolePrivileges,omitempty"` 3975 3976 // ServerResponse contains the HTTP response code and headers from the 3977 // server. 3978 googleapi.ServerResponse `json:"-"` 3979 3980 // ForceSendFields is a list of field names (e.g. "Etag") to 3981 // unconditionally include in API requests. By default, fields with 3982 // empty or default values are omitted from API requests. However, any 3983 // non-pointer, non-interface field appearing in ForceSendFields will be 3984 // sent to the server regardless of whether the field is empty or not. 3985 // This may be used to include empty fields in Patch requests. 3986 ForceSendFields []string `json:"-"` 3987 3988 // NullFields is a list of field names (e.g. "Etag") to include in API 3989 // requests with the JSON null value. By default, fields with empty 3990 // values are omitted from API requests. However, any field with an 3991 // empty value appearing in NullFields will be sent to the server as 3992 // null. It is an error if a field in this list has a non-empty value. 3993 // This may be used to include null fields in Patch requests. 3994 NullFields []string `json:"-"` 3995} 3996 3997func (s *Role) MarshalJSON() ([]byte, error) { 3998 type NoMethod Role 3999 raw := NoMethod(*s) 4000 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4001} 4002 4003type RoleRolePrivileges struct { 4004 // PrivilegeName: The name of the privilege. 4005 PrivilegeName string `json:"privilegeName,omitempty"` 4006 4007 // ServiceId: The obfuscated ID of the service this privilege is for. 4008 // This value is returned with `Privileges.list()` 4009 // (/admin-sdk/directory/v1/reference/privileges/list). 4010 ServiceId string `json:"serviceId,omitempty"` 4011 4012 // ForceSendFields is a list of field names (e.g. "PrivilegeName") to 4013 // unconditionally include in API requests. By default, fields with 4014 // empty or default values are omitted from API requests. However, any 4015 // non-pointer, non-interface field appearing in ForceSendFields will be 4016 // sent to the server regardless of whether the field is empty or not. 4017 // This may be used to include empty fields in Patch requests. 4018 ForceSendFields []string `json:"-"` 4019 4020 // NullFields is a list of field names (e.g. "PrivilegeName") to include 4021 // in API requests with the JSON null value. By default, fields with 4022 // empty values are omitted from API requests. However, any field with 4023 // an empty value appearing in NullFields will be sent to the server as 4024 // null. It is an error if a field in this list has a non-empty value. 4025 // This may be used to include null fields in Patch requests. 4026 NullFields []string `json:"-"` 4027} 4028 4029func (s *RoleRolePrivileges) MarshalJSON() ([]byte, error) { 4030 type NoMethod RoleRolePrivileges 4031 raw := NoMethod(*s) 4032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4033} 4034 4035// RoleAssignment: Defines an assignment of a role. 4036type RoleAssignment struct { 4037 // AssignedTo: The unique ID of the user this role is assigned to. 4038 AssignedTo string `json:"assignedTo,omitempty"` 4039 4040 // Etag: ETag of the resource. 4041 Etag string `json:"etag,omitempty"` 4042 4043 // Kind: The type of the API resource. This is always 4044 // `admin#directory#roleAssignment`. 4045 Kind string `json:"kind,omitempty"` 4046 4047 // OrgUnitId: If the role is restricted to an organization unit, this 4048 // contains the ID for the organization unit the exercise of this role 4049 // is restricted to. 4050 OrgUnitId string `json:"orgUnitId,omitempty"` 4051 4052 // RoleAssignmentId: ID of this roleAssignment. 4053 RoleAssignmentId int64 `json:"roleAssignmentId,omitempty,string"` 4054 4055 // RoleId: The ID of the role that is assigned. 4056 RoleId int64 `json:"roleId,omitempty,string"` 4057 4058 // ScopeType: The scope in which this role is assigned. 4059 ScopeType string `json:"scopeType,omitempty"` 4060 4061 // ServerResponse contains the HTTP response code and headers from the 4062 // server. 4063 googleapi.ServerResponse `json:"-"` 4064 4065 // ForceSendFields is a list of field names (e.g. "AssignedTo") to 4066 // unconditionally include in API requests. By default, fields with 4067 // empty or default values are omitted from API requests. However, any 4068 // non-pointer, non-interface field appearing in ForceSendFields will be 4069 // sent to the server regardless of whether the field is empty or not. 4070 // This may be used to include empty fields in Patch requests. 4071 ForceSendFields []string `json:"-"` 4072 4073 // NullFields is a list of field names (e.g. "AssignedTo") to include in 4074 // API requests with the JSON null value. By default, fields with empty 4075 // values are omitted from API requests. However, any field with an 4076 // empty value appearing in NullFields will be sent to the server as 4077 // null. It is an error if a field in this list has a non-empty value. 4078 // This may be used to include null fields in Patch requests. 4079 NullFields []string `json:"-"` 4080} 4081 4082func (s *RoleAssignment) MarshalJSON() ([]byte, error) { 4083 type NoMethod RoleAssignment 4084 raw := NoMethod(*s) 4085 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4086} 4087 4088type RoleAssignments struct { 4089 // Etag: ETag of the resource. 4090 Etag string `json:"etag,omitempty"` 4091 4092 // Items: A list of RoleAssignment resources. 4093 Items []*RoleAssignment `json:"items,omitempty"` 4094 4095 // Kind: The type of the API resource. This is always 4096 // `admin#directory#roleAssignments`. 4097 Kind string `json:"kind,omitempty"` 4098 4099 NextPageToken string `json:"nextPageToken,omitempty"` 4100 4101 // ServerResponse contains the HTTP response code and headers from the 4102 // server. 4103 googleapi.ServerResponse `json:"-"` 4104 4105 // ForceSendFields is a list of field names (e.g. "Etag") to 4106 // unconditionally include in API requests. By default, fields with 4107 // empty or default values are omitted from API requests. However, any 4108 // non-pointer, non-interface field appearing in ForceSendFields will be 4109 // sent to the server regardless of whether the field is empty or not. 4110 // This may be used to include empty fields in Patch requests. 4111 ForceSendFields []string `json:"-"` 4112 4113 // NullFields is a list of field names (e.g. "Etag") to include in API 4114 // requests with the JSON null value. By default, fields with empty 4115 // values are omitted from API requests. However, any field with an 4116 // empty value appearing in NullFields will be sent to the server as 4117 // null. It is an error if a field in this list has a non-empty value. 4118 // This may be used to include null fields in Patch requests. 4119 NullFields []string `json:"-"` 4120} 4121 4122func (s *RoleAssignments) MarshalJSON() ([]byte, error) { 4123 type NoMethod RoleAssignments 4124 raw := NoMethod(*s) 4125 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4126} 4127 4128type Roles struct { 4129 // Etag: ETag of the resource. 4130 Etag string `json:"etag,omitempty"` 4131 4132 // Items: A list of Role resources. 4133 Items []*Role `json:"items,omitempty"` 4134 4135 // Kind: The type of the API resource. This is always 4136 // `admin#directory#roles`. 4137 Kind string `json:"kind,omitempty"` 4138 4139 NextPageToken string `json:"nextPageToken,omitempty"` 4140 4141 // ServerResponse contains the HTTP response code and headers from the 4142 // server. 4143 googleapi.ServerResponse `json:"-"` 4144 4145 // ForceSendFields is a list of field names (e.g. "Etag") to 4146 // unconditionally include in API requests. By default, fields with 4147 // empty or default values are omitted from API requests. However, any 4148 // non-pointer, non-interface field appearing in ForceSendFields will be 4149 // sent to the server regardless of whether the field is empty or not. 4150 // This may be used to include empty fields in Patch requests. 4151 ForceSendFields []string `json:"-"` 4152 4153 // NullFields is a list of field names (e.g. "Etag") to include in API 4154 // requests with the JSON null value. By default, fields with empty 4155 // values are omitted from API requests. However, any field with an 4156 // empty value appearing in NullFields will be sent to the server as 4157 // null. It is an error if a field in this list has a non-empty value. 4158 // This may be used to include null fields in Patch requests. 4159 NullFields []string `json:"-"` 4160} 4161 4162func (s *Roles) MarshalJSON() ([]byte, error) { 4163 type NoMethod Roles 4164 raw := NoMethod(*s) 4165 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4166} 4167 4168// Schema: The type of API resource. For Schema resources, this is 4169// always `admin#directory#schema`. 4170type Schema struct { 4171 // DisplayName: Display name for the schema. 4172 DisplayName string `json:"displayName,omitempty"` 4173 4174 // Etag: The ETag of the resource. 4175 Etag string `json:"etag,omitempty"` 4176 4177 // Fields: A list of fields in the schema. 4178 Fields []*SchemaFieldSpec `json:"fields,omitempty"` 4179 4180 // Kind: Kind of resource this is. 4181 Kind string `json:"kind,omitempty"` 4182 4183 // SchemaId: The unique identifier of the schema (Read-only) 4184 SchemaId string `json:"schemaId,omitempty"` 4185 4186 // SchemaName: The schema's name. Each `schema_name` must be unique 4187 // within a customer. Reusing a name results in a `409: Entity already 4188 // exists` error. 4189 SchemaName string `json:"schemaName,omitempty"` 4190 4191 // ServerResponse contains the HTTP response code and headers from the 4192 // server. 4193 googleapi.ServerResponse `json:"-"` 4194 4195 // ForceSendFields is a list of field names (e.g. "DisplayName") to 4196 // unconditionally include in API requests. By default, fields with 4197 // empty or default values are omitted from API requests. However, any 4198 // non-pointer, non-interface field appearing in ForceSendFields will be 4199 // sent to the server regardless of whether the field is empty or not. 4200 // This may be used to include empty fields in Patch requests. 4201 ForceSendFields []string `json:"-"` 4202 4203 // NullFields is a list of field names (e.g. "DisplayName") to include 4204 // in API requests with the JSON null value. By default, fields with 4205 // empty values are omitted from API requests. However, any field with 4206 // an empty value appearing in NullFields will be sent to the server as 4207 // null. It is an error if a field in this list has a non-empty value. 4208 // This may be used to include null fields in Patch requests. 4209 NullFields []string `json:"-"` 4210} 4211 4212func (s *Schema) MarshalJSON() ([]byte, error) { 4213 type NoMethod Schema 4214 raw := NoMethod(*s) 4215 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4216} 4217 4218// SchemaFieldSpec: You can use schemas to add custom fields to user 4219// profiles. You can use these fields to store information such as the 4220// projects your users work on, their physical locations, their hire 4221// dates, or whatever else fits your business needs. For more 4222// information, see Custom User Fields 4223// (/admin-sdk/directory/v1/guides/manage-schemas). 4224type SchemaFieldSpec struct { 4225 // DisplayName: Display Name of the field. 4226 DisplayName string `json:"displayName,omitempty"` 4227 4228 // Etag: The ETag of the field. 4229 Etag string `json:"etag,omitempty"` 4230 4231 // FieldId: The unique identifier of the field (Read-only) 4232 FieldId string `json:"fieldId,omitempty"` 4233 4234 // FieldName: The name of the field. 4235 FieldName string `json:"fieldName,omitempty"` 4236 4237 // FieldType: The type of the field. 4238 FieldType string `json:"fieldType,omitempty"` 4239 4240 // Indexed: Boolean specifying whether the field is indexed or not. 4241 // Default: `true`. 4242 // 4243 // Default: true 4244 Indexed *bool `json:"indexed,omitempty"` 4245 4246 // Kind: The kind of resource this is. For schema fields this is always 4247 // `admin#directory#schema#fieldspec`. 4248 Kind string `json:"kind,omitempty"` 4249 4250 // MultiValued: A boolean specifying whether this is a multi-valued 4251 // field or not. Default: `false`. 4252 MultiValued bool `json:"multiValued,omitempty"` 4253 4254 // NumericIndexingSpec: Indexing spec for a numeric field. By default, 4255 // only exact match queries will be supported for numeric fields. 4256 // Setting the `numericIndexingSpec` allows range queries to be 4257 // supported. 4258 NumericIndexingSpec *SchemaFieldSpecNumericIndexingSpec `json:"numericIndexingSpec,omitempty"` 4259 4260 // ReadAccessType: Specifies who can view values of this field. See 4261 // Retrieve users as a non-administrator 4262 // (/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) 4263 // for more information. Note: It may take up to 24 hours for changes 4264 // to this field to be reflected. 4265 ReadAccessType string `json:"readAccessType,omitempty"` 4266 4267 // ForceSendFields is a list of field names (e.g. "DisplayName") to 4268 // unconditionally include in API requests. By default, fields with 4269 // empty or default values are omitted from API requests. However, any 4270 // non-pointer, non-interface field appearing in ForceSendFields will be 4271 // sent to the server regardless of whether the field is empty or not. 4272 // This may be used to include empty fields in Patch requests. 4273 ForceSendFields []string `json:"-"` 4274 4275 // NullFields is a list of field names (e.g. "DisplayName") to include 4276 // in API requests with the JSON null value. By default, fields with 4277 // empty values are omitted from API requests. However, any field with 4278 // an empty value appearing in NullFields will be sent to the server as 4279 // null. It is an error if a field in this list has a non-empty value. 4280 // This may be used to include null fields in Patch requests. 4281 NullFields []string `json:"-"` 4282} 4283 4284func (s *SchemaFieldSpec) MarshalJSON() ([]byte, error) { 4285 type NoMethod SchemaFieldSpec 4286 raw := NoMethod(*s) 4287 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4288} 4289 4290// SchemaFieldSpecNumericIndexingSpec: Indexing spec for a numeric 4291// field. By default, only exact match queries will be supported for 4292// numeric fields. Setting the `numericIndexingSpec` allows range 4293// queries to be supported. 4294type SchemaFieldSpecNumericIndexingSpec struct { 4295 // MaxValue: Maximum value of this field. This is meant to be indicative 4296 // rather than enforced. Values outside this range will still be 4297 // indexed, but search may not be as performant. 4298 MaxValue float64 `json:"maxValue,omitempty"` 4299 4300 // MinValue: Minimum value of this field. This is meant to be indicative 4301 // rather than enforced. Values outside this range will still be 4302 // indexed, but search may not be as performant. 4303 MinValue float64 `json:"minValue,omitempty"` 4304 4305 // ForceSendFields is a list of field names (e.g. "MaxValue") to 4306 // unconditionally include in API requests. By default, fields with 4307 // empty or default values are omitted from API requests. However, any 4308 // non-pointer, non-interface field appearing in ForceSendFields will be 4309 // sent to the server regardless of whether the field is empty or not. 4310 // This may be used to include empty fields in Patch requests. 4311 ForceSendFields []string `json:"-"` 4312 4313 // NullFields is a list of field names (e.g. "MaxValue") to include in 4314 // API requests with the JSON null value. By default, fields with empty 4315 // values are omitted from API requests. However, any field with an 4316 // empty value appearing in NullFields will be sent to the server as 4317 // null. It is an error if a field in this list has a non-empty value. 4318 // This may be used to include null fields in Patch requests. 4319 NullFields []string `json:"-"` 4320} 4321 4322func (s *SchemaFieldSpecNumericIndexingSpec) MarshalJSON() ([]byte, error) { 4323 type NoMethod SchemaFieldSpecNumericIndexingSpec 4324 raw := NoMethod(*s) 4325 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4326} 4327 4328func (s *SchemaFieldSpecNumericIndexingSpec) UnmarshalJSON(data []byte) error { 4329 type NoMethod SchemaFieldSpecNumericIndexingSpec 4330 var s1 struct { 4331 MaxValue gensupport.JSONFloat64 `json:"maxValue"` 4332 MinValue gensupport.JSONFloat64 `json:"minValue"` 4333 *NoMethod 4334 } 4335 s1.NoMethod = (*NoMethod)(s) 4336 if err := json.Unmarshal(data, &s1); err != nil { 4337 return err 4338 } 4339 s.MaxValue = float64(s1.MaxValue) 4340 s.MinValue = float64(s1.MinValue) 4341 return nil 4342} 4343 4344// Schemas: JSON response template for List Schema operation in 4345// Directory API. 4346type Schemas struct { 4347 // Etag: ETag of the resource. 4348 Etag string `json:"etag,omitempty"` 4349 4350 // Kind: Kind of resource this is. 4351 Kind string `json:"kind,omitempty"` 4352 4353 // Schemas: List of UserSchema objects. 4354 Schemas []*Schema `json:"schemas,omitempty"` 4355 4356 // ServerResponse contains the HTTP response code and headers from the 4357 // server. 4358 googleapi.ServerResponse `json:"-"` 4359 4360 // ForceSendFields is a list of field names (e.g. "Etag") to 4361 // unconditionally include in API requests. By default, fields with 4362 // empty or default values are omitted from API requests. However, any 4363 // non-pointer, non-interface field appearing in ForceSendFields will be 4364 // sent to the server regardless of whether the field is empty or not. 4365 // This may be used to include empty fields in Patch requests. 4366 ForceSendFields []string `json:"-"` 4367 4368 // NullFields is a list of field names (e.g. "Etag") to include in API 4369 // requests with the JSON null value. By default, fields with empty 4370 // values are omitted from API requests. However, any field with an 4371 // empty value appearing in NullFields will be sent to the server as 4372 // null. It is an error if a field in this list has a non-empty value. 4373 // This may be used to include null fields in Patch requests. 4374 NullFields []string `json:"-"` 4375} 4376 4377func (s *Schemas) MarshalJSON() ([]byte, error) { 4378 type NoMethod Schemas 4379 raw := NoMethod(*s) 4380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4381} 4382 4383// Token: JSON template for token resource in Directory API. 4384type Token struct { 4385 // Anonymous: Whether the application is registered with Google. The 4386 // value is `true` if the application has an anonymous Client ID. 4387 Anonymous bool `json:"anonymous,omitempty"` 4388 4389 // ClientId: The Client ID of the application the token is issued to. 4390 ClientId string `json:"clientId,omitempty"` 4391 4392 // DisplayText: The displayable name of the application the token is 4393 // issued to. 4394 DisplayText string `json:"displayText,omitempty"` 4395 4396 // Etag: ETag of the resource. 4397 Etag string `json:"etag,omitempty"` 4398 4399 // Kind: The type of the API resource. This is always 4400 // `admin#directory#token`. 4401 Kind string `json:"kind,omitempty"` 4402 4403 // NativeApp: Whether the token is issued to an installed application. 4404 // The value is `true` if the application is installed to a desktop or 4405 // mobile device. 4406 NativeApp bool `json:"nativeApp,omitempty"` 4407 4408 // Scopes: A list of authorization scopes the application is granted. 4409 Scopes []string `json:"scopes,omitempty"` 4410 4411 // UserKey: The unique ID of the user that issued the token. 4412 UserKey string `json:"userKey,omitempty"` 4413 4414 // ServerResponse contains the HTTP response code and headers from the 4415 // server. 4416 googleapi.ServerResponse `json:"-"` 4417 4418 // ForceSendFields is a list of field names (e.g. "Anonymous") to 4419 // unconditionally include in API requests. By default, fields with 4420 // empty or default values are omitted from API requests. However, any 4421 // non-pointer, non-interface field appearing in ForceSendFields will be 4422 // sent to the server regardless of whether the field is empty or not. 4423 // This may be used to include empty fields in Patch requests. 4424 ForceSendFields []string `json:"-"` 4425 4426 // NullFields is a list of field names (e.g. "Anonymous") to include in 4427 // API requests with the JSON null value. By default, fields with empty 4428 // values are omitted from API requests. However, any field with an 4429 // empty value appearing in NullFields will be sent to the server as 4430 // null. It is an error if a field in this list has a non-empty value. 4431 // This may be used to include null fields in Patch requests. 4432 NullFields []string `json:"-"` 4433} 4434 4435func (s *Token) MarshalJSON() ([]byte, error) { 4436 type NoMethod Token 4437 raw := NoMethod(*s) 4438 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4439} 4440 4441// Tokens: JSON response template for List tokens operation in Directory 4442// API. 4443type Tokens struct { 4444 // Etag: ETag of the resource. 4445 Etag string `json:"etag,omitempty"` 4446 4447 // Items: A list of Token resources. 4448 Items []*Token `json:"items,omitempty"` 4449 4450 // Kind: The type of the API resource. This is always 4451 // `admin#directory#tokenList`. 4452 Kind string `json:"kind,omitempty"` 4453 4454 // ServerResponse contains the HTTP response code and headers from the 4455 // server. 4456 googleapi.ServerResponse `json:"-"` 4457 4458 // ForceSendFields is a list of field names (e.g. "Etag") to 4459 // unconditionally include in API requests. By default, fields with 4460 // empty or default values are omitted from API requests. However, any 4461 // non-pointer, non-interface field appearing in ForceSendFields will be 4462 // sent to the server regardless of whether the field is empty or not. 4463 // This may be used to include empty fields in Patch requests. 4464 ForceSendFields []string `json:"-"` 4465 4466 // NullFields is a list of field names (e.g. "Etag") to include in API 4467 // requests with the JSON null value. By default, fields with empty 4468 // values are omitted from API requests. However, any field with an 4469 // empty value appearing in NullFields will be sent to the server as 4470 // null. It is an error if a field in this list has a non-empty value. 4471 // This may be used to include null fields in Patch requests. 4472 NullFields []string `json:"-"` 4473} 4474 4475func (s *Tokens) MarshalJSON() ([]byte, error) { 4476 type NoMethod Tokens 4477 raw := NoMethod(*s) 4478 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4479} 4480 4481// User: The Directory API allows you to create and manage your 4482// account's users, user aliases, and user Gmail chat profile photos. 4483// For more information about common tasks, see the User Accounts 4484// Developer's Guide (/admin-sdk/directory/v1/guides/manage-users.html) 4485// and the User Aliases Developer's Guide 4486// (/admin-sdk/directory/v1/guides/manage-user-aliases.html). 4487type User struct { 4488 // Addresses: A list of the user's addresses. The maximum allowed data 4489 // size for this field is 10Kb. 4490 Addresses interface{} `json:"addresses,omitempty"` 4491 4492 // AgreedToTerms: Output only. This property is `true` if the user has 4493 // completed an initial login and accepted the Terms of Service 4494 // agreement. 4495 AgreedToTerms bool `json:"agreedToTerms,omitempty"` 4496 4497 // Aliases: Output only. A list of the user's alias email addresses. 4498 Aliases []string `json:"aliases,omitempty"` 4499 4500 // Archived: Indicates if user is archived. 4501 Archived bool `json:"archived,omitempty"` 4502 4503 // ChangePasswordAtNextLogin: Indicates if the user is forced to change 4504 // their password at next login. This setting doesn't apply when the 4505 // user signs in via a third-party identity provider 4506 // (https://support.google.com/a/answer/60224). 4507 ChangePasswordAtNextLogin bool `json:"changePasswordAtNextLogin,omitempty"` 4508 4509 // CreationTime: User's G Suite account creation time. (Read-only) 4510 CreationTime string `json:"creationTime,omitempty"` 4511 4512 // CustomSchemas: Custom fields of the user. The key is a `schema_name` 4513 // and its values are `'field_name': 'field_value'`. 4514 CustomSchemas map[string]googleapi.RawMessage `json:"customSchemas,omitempty"` 4515 4516 // CustomerId: Output only. The customer ID to retrieve all account 4517 // users 4518 // (/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You 4519 // can use the alias `my_customer` to represent your account's 4520 // `customerId`. As a reseller administrator, you can use the resold 4521 // customer account's `customerId`. To get a `customerId`, use the 4522 // account's primary domain in the `domain` parameter of a users.list 4523 // (/admin-sdk/directory/v1/reference/users/list) request. 4524 CustomerId string `json:"customerId,omitempty"` 4525 4526 DeletionTime string `json:"deletionTime,omitempty"` 4527 4528 // Emails: A list of the user's email addresses. The maximum allowed 4529 // data size for this field is 10Kb. 4530 Emails interface{} `json:"emails,omitempty"` 4531 4532 // Etag: Output only. ETag of the resource. 4533 Etag string `json:"etag,omitempty"` 4534 4535 // ExternalIds: A list of external IDs for the user, such as an employee 4536 // or network ID. The maximum allowed data size for this field is 2Kb. 4537 ExternalIds interface{} `json:"externalIds,omitempty"` 4538 4539 // Gender: The user's gender. The maximum allowed data size for this 4540 // field is 1Kb. 4541 Gender interface{} `json:"gender,omitempty"` 4542 4543 // HashFunction: Stores the hash format of the password property. We 4544 // recommend sending the `password` property value as a base 16 bit 4545 // hexadecimal-encoded hash value. Set the `hashFunction` values as 4546 // either the SHA-1 (https://wikipedia.org/wiki/SHA-1), MD5 4547 // (https://wikipedia.org/wiki/MD5), or crypt 4548 // (https://en.wikipedia.org/wiki/Crypt_\(C\)) hash format. 4549 HashFunction string `json:"hashFunction,omitempty"` 4550 4551 // Id: The unique ID for the user. A user `id` can be used as a user 4552 // request URI's `userKey`. 4553 Id string `json:"id,omitempty"` 4554 4555 // Ims: The user's Instant Messenger (IM) accounts. A user account can 4556 // have multiple ims properties. But, only one of these ims properties 4557 // can be the primary IM contact. The maximum allowed data size for this 4558 // field is 2Kb. 4559 Ims interface{} `json:"ims,omitempty"` 4560 4561 // IncludeInGlobalAddressList: Indicates if the user's profile is 4562 // visible in the Google Workspace global address list when the contact 4563 // sharing feature is enabled for the domain. For more information about 4564 // excluding user profiles, see the administration help center 4565 // (https://support.google.com/a/answer/1285988). 4566 IncludeInGlobalAddressList bool `json:"includeInGlobalAddressList,omitempty"` 4567 4568 // IpWhitelisted: If `true`, the user's IP address is whitelisted 4569 // (https://support.google.com/a/answer/60752). 4570 IpWhitelisted bool `json:"ipWhitelisted,omitempty"` 4571 4572 // IsAdmin: Output only. Indicates a user with super admininistrator 4573 // privileges. The `isAdmin` property can only be edited in the Make a 4574 // user an administrator 4575 // (/admin-sdk/directory/v1/guides/manage-users.html#make_admin) 4576 // operation ( makeAdmin 4577 // (/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If 4578 // edited in the user insert 4579 // (/admin-sdk/directory/v1/reference/users/insert.html) or update 4580 // (/admin-sdk/directory/v1/reference/users/update.html) methods, the 4581 // edit is ignored by the API service. 4582 IsAdmin bool `json:"isAdmin,omitempty"` 4583 4584 // IsDelegatedAdmin: Output only. Indicates if the user is a delegated 4585 // administrator. Delegated administrators are supported by the API but 4586 // cannot create or undelete users, or make users administrators. These 4587 // requests are ignored by the API service. Roles and privileges for 4588 // administrators are assigned using the Admin console 4589 // (https://support.google.com/a/answer/33325). 4590 IsDelegatedAdmin bool `json:"isDelegatedAdmin,omitempty"` 4591 4592 // IsEnforcedIn2Sv: Output only. Is 2-step verification enforced 4593 // (Read-only) 4594 IsEnforcedIn2Sv bool `json:"isEnforcedIn2Sv,omitempty"` 4595 4596 // IsEnrolledIn2Sv: Output only. Is enrolled in 2-step verification 4597 // (Read-only) 4598 IsEnrolledIn2Sv bool `json:"isEnrolledIn2Sv,omitempty"` 4599 4600 // IsMailboxSetup: Output only. Indicates if the user's Google mailbox 4601 // is created. This property is only applicable if the user has been 4602 // assigned a Gmail license. 4603 IsMailboxSetup bool `json:"isMailboxSetup,omitempty"` 4604 4605 // Keywords: The user's keywords. The maximum allowed data size for this 4606 // field is 1Kb. 4607 Keywords interface{} `json:"keywords,omitempty"` 4608 4609 // Kind: Output only. The type of the API resource. For Users resources, 4610 // the value is `admin#directory#user`. 4611 Kind string `json:"kind,omitempty"` 4612 4613 // Languages: The user's languages. The maximum allowed data size for 4614 // this field is 1Kb. 4615 Languages interface{} `json:"languages,omitempty"` 4616 4617 // LastLoginTime: User's last login time. (Read-only) 4618 LastLoginTime string `json:"lastLoginTime,omitempty"` 4619 4620 // Locations: The user's locations. The maximum allowed data size for 4621 // this field is 10Kb. 4622 Locations interface{} `json:"locations,omitempty"` 4623 4624 // Name: Holds the given and family names of the user, and the read-only 4625 // `fullName` value. The maximum number of characters in the `givenName` 4626 // and in the `familyName` values is 60. In addition, name values 4627 // support unicode/UTF-8 characters, and can contain spaces, letters 4628 // (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods 4629 // (.). For more information about character usage rules, see the 4630 // administration help center 4631 // (https://support.google.com/a/answer/9193374). Maximum allowed data 4632 // size for this field is 1Kb. 4633 Name *UserName `json:"name,omitempty"` 4634 4635 // NonEditableAliases: Output only. List of the user's non-editable 4636 // alias email addresses. These are typically outside the account's 4637 // primary domain or sub-domain. 4638 NonEditableAliases []string `json:"nonEditableAliases,omitempty"` 4639 4640 // Notes: Notes for the user. 4641 Notes interface{} `json:"notes,omitempty"` 4642 4643 // OrgUnitPath: The full path of the parent organization associated with 4644 // the user. If the parent organization is the top-level, it is 4645 // represented as a forward slash (`/`). 4646 OrgUnitPath string `json:"orgUnitPath,omitempty"` 4647 4648 // Organizations: A list of organizations the user belongs to. The 4649 // maximum allowed data size for this field is 10Kb. 4650 Organizations interface{} `json:"organizations,omitempty"` 4651 4652 // Password: User's password 4653 Password string `json:"password,omitempty"` 4654 4655 // Phones: A list of the user's phone numbers. The maximum allowed data 4656 // size for this field is 1Kb. 4657 Phones interface{} `json:"phones,omitempty"` 4658 4659 // PosixAccounts: A list of POSIX 4660 // (https://www.opengroup.org/austin/papers/posix_faq.html) account 4661 // information for the user. 4662 PosixAccounts interface{} `json:"posixAccounts,omitempty"` 4663 4664 // PrimaryEmail: The user's primary email address. This property is 4665 // required in a request to create a user account. The `primaryEmail` 4666 // must be unique and cannot be an alias of another user. 4667 PrimaryEmail string `json:"primaryEmail,omitempty"` 4668 4669 // RecoveryEmail: Recovery email of the user. 4670 RecoveryEmail string `json:"recoveryEmail,omitempty"` 4671 4672 // RecoveryPhone: Recovery phone of the user. The phone number must be 4673 // in the E.164 format, starting with the plus sign (+). Example: 4674 // *+16506661212*. 4675 RecoveryPhone string `json:"recoveryPhone,omitempty"` 4676 4677 // Relations: A list of the user's relationships to other users. The 4678 // maximum allowed data size for this field is 2Kb. 4679 Relations interface{} `json:"relations,omitempty"` 4680 4681 // SshPublicKeys: A list of SSH public keys. 4682 SshPublicKeys interface{} `json:"sshPublicKeys,omitempty"` 4683 4684 // Suspended: Indicates if user is suspended. 4685 Suspended bool `json:"suspended,omitempty"` 4686 4687 // SuspensionReason: Output only. Has the reason a user account is 4688 // suspended either by the administrator or by Google at the time of 4689 // suspension. The property is returned only if the `suspended` property 4690 // is `true`. 4691 SuspensionReason string `json:"suspensionReason,omitempty"` 4692 4693 // ThumbnailPhotoEtag: Output only. ETag of the user's photo (Read-only) 4694 ThumbnailPhotoEtag string `json:"thumbnailPhotoEtag,omitempty"` 4695 4696 // ThumbnailPhotoUrl: Output only. Photo Url of the user (Read-only) 4697 ThumbnailPhotoUrl string `json:"thumbnailPhotoUrl,omitempty"` 4698 4699 // Websites: The user's websites. The maximum allowed data size for this 4700 // field is 2Kb. 4701 Websites interface{} `json:"websites,omitempty"` 4702 4703 // ServerResponse contains the HTTP response code and headers from the 4704 // server. 4705 googleapi.ServerResponse `json:"-"` 4706 4707 // ForceSendFields is a list of field names (e.g. "Addresses") to 4708 // unconditionally include in API requests. By default, fields with 4709 // empty or default values are omitted from API requests. However, any 4710 // non-pointer, non-interface field appearing in ForceSendFields will be 4711 // sent to the server regardless of whether the field is empty or not. 4712 // This may be used to include empty fields in Patch requests. 4713 ForceSendFields []string `json:"-"` 4714 4715 // NullFields is a list of field names (e.g. "Addresses") to include in 4716 // API requests with the JSON null value. By default, fields with empty 4717 // values are omitted from API requests. However, any field with an 4718 // empty value appearing in NullFields will be sent to the server as 4719 // null. It is an error if a field in this list has a non-empty value. 4720 // This may be used to include null fields in Patch requests. 4721 NullFields []string `json:"-"` 4722} 4723 4724func (s *User) MarshalJSON() ([]byte, error) { 4725 type NoMethod User 4726 raw := NoMethod(*s) 4727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4728} 4729 4730// UserAbout: JSON template for About (notes) of a user in Directory 4731// API. 4732type UserAbout struct { 4733 // ContentType: About entry can have a type which indicates the content 4734 // type. It can either be plain or html. By default, notes contents are 4735 // assumed to contain plain text. 4736 ContentType string `json:"contentType,omitempty"` 4737 4738 // Value: Actual value of notes. 4739 Value string `json:"value,omitempty"` 4740 4741 // ForceSendFields is a list of field names (e.g. "ContentType") to 4742 // unconditionally include in API requests. By default, fields with 4743 // empty or default values are omitted from API requests. However, any 4744 // non-pointer, non-interface field appearing in ForceSendFields will be 4745 // sent to the server regardless of whether the field is empty or not. 4746 // This may be used to include empty fields in Patch requests. 4747 ForceSendFields []string `json:"-"` 4748 4749 // NullFields is a list of field names (e.g. "ContentType") to include 4750 // in API requests with the JSON null value. By default, fields with 4751 // empty values are omitted from API requests. However, any field with 4752 // an empty value appearing in NullFields will be sent to the server as 4753 // null. It is an error if a field in this list has a non-empty value. 4754 // This may be used to include null fields in Patch requests. 4755 NullFields []string `json:"-"` 4756} 4757 4758func (s *UserAbout) MarshalJSON() ([]byte, error) { 4759 type NoMethod UserAbout 4760 raw := NoMethod(*s) 4761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4762} 4763 4764// UserAddress: JSON template for address. 4765type UserAddress struct { 4766 // Country: Country. 4767 Country string `json:"country,omitempty"` 4768 4769 // CountryCode: Country code. 4770 CountryCode string `json:"countryCode,omitempty"` 4771 4772 // CustomType: Custom type. 4773 CustomType string `json:"customType,omitempty"` 4774 4775 // ExtendedAddress: Extended Address. 4776 ExtendedAddress string `json:"extendedAddress,omitempty"` 4777 4778 // Formatted: Formatted address. 4779 Formatted string `json:"formatted,omitempty"` 4780 4781 // Locality: Locality. 4782 Locality string `json:"locality,omitempty"` 4783 4784 // PoBox: Other parts of address. 4785 PoBox string `json:"poBox,omitempty"` 4786 4787 // PostalCode: Postal code. 4788 PostalCode string `json:"postalCode,omitempty"` 4789 4790 // Primary: If this is user's primary address. Only one entry could be 4791 // marked as primary. 4792 Primary bool `json:"primary,omitempty"` 4793 4794 // Region: Region. 4795 Region string `json:"region,omitempty"` 4796 4797 // SourceIsStructured: User supplied address was structured. Structured 4798 // addresses are NOT supported at this time. You might be able to write 4799 // structured addresses but any values will eventually be clobbered. 4800 SourceIsStructured bool `json:"sourceIsStructured,omitempty"` 4801 4802 // StreetAddress: Street. 4803 StreetAddress string `json:"streetAddress,omitempty"` 4804 4805 // Type: Each entry can have a type which indicates standard values of 4806 // that entry. For example address could be of home work etc. In 4807 // addition to the standard type an entry can have a custom type and can 4808 // take any value. Such type should have the CUSTOM value as type and 4809 // also have a customType value. 4810 Type string `json:"type,omitempty"` 4811 4812 // ForceSendFields is a list of field names (e.g. "Country") to 4813 // unconditionally include in API requests. By default, fields with 4814 // empty or default values are omitted from API requests. However, any 4815 // non-pointer, non-interface field appearing in ForceSendFields will be 4816 // sent to the server regardless of whether the field is empty or not. 4817 // This may be used to include empty fields in Patch requests. 4818 ForceSendFields []string `json:"-"` 4819 4820 // NullFields is a list of field names (e.g. "Country") to include in 4821 // API requests with the JSON null value. By default, fields with empty 4822 // values are omitted from API requests. However, any field with an 4823 // empty value appearing in NullFields will be sent to the server as 4824 // null. It is an error if a field in this list has a non-empty value. 4825 // This may be used to include null fields in Patch requests. 4826 NullFields []string `json:"-"` 4827} 4828 4829func (s *UserAddress) MarshalJSON() ([]byte, error) { 4830 type NoMethod UserAddress 4831 raw := NoMethod(*s) 4832 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4833} 4834 4835// UserEmail: JSON template for an email. 4836type UserEmail struct { 4837 // Address: Email id of the user. 4838 Address string `json:"address,omitempty"` 4839 4840 // CustomType: Custom Type. 4841 CustomType string `json:"customType,omitempty"` 4842 4843 // Primary: If this is user's primary email. Only one entry could be 4844 // marked as primary. 4845 Primary bool `json:"primary,omitempty"` 4846 4847 // Type: Each entry can have a type which indicates standard types of 4848 // that entry. For example email could be of home, work etc. In addition 4849 // to the standard type, an entry can have a custom type and can take 4850 // any value Such types should have the CUSTOM value as type and also 4851 // have a customType value. 4852 Type string `json:"type,omitempty"` 4853 4854 // ForceSendFields is a list of field names (e.g. "Address") to 4855 // unconditionally include in API requests. By default, fields with 4856 // empty or default values are omitted from API requests. However, any 4857 // non-pointer, non-interface field appearing in ForceSendFields will be 4858 // sent to the server regardless of whether the field is empty or not. 4859 // This may be used to include empty fields in Patch requests. 4860 ForceSendFields []string `json:"-"` 4861 4862 // NullFields is a list of field names (e.g. "Address") to include in 4863 // API requests with the JSON null value. By default, fields with empty 4864 // values are omitted from API requests. However, any field with an 4865 // empty value appearing in NullFields will be sent to the server as 4866 // null. It is an error if a field in this list has a non-empty value. 4867 // This may be used to include null fields in Patch requests. 4868 NullFields []string `json:"-"` 4869} 4870 4871func (s *UserEmail) MarshalJSON() ([]byte, error) { 4872 type NoMethod UserEmail 4873 raw := NoMethod(*s) 4874 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4875} 4876 4877// UserExternalId: JSON template for an externalId entry. 4878type UserExternalId struct { 4879 // CustomType: Custom type. 4880 CustomType string `json:"customType,omitempty"` 4881 4882 // Type: The type of the Id. 4883 Type string `json:"type,omitempty"` 4884 4885 // Value: The value of the id. 4886 Value string `json:"value,omitempty"` 4887 4888 // ForceSendFields is a list of field names (e.g. "CustomType") to 4889 // unconditionally include in API requests. By default, fields with 4890 // empty or default values are omitted from API requests. However, any 4891 // non-pointer, non-interface field appearing in ForceSendFields will be 4892 // sent to the server regardless of whether the field is empty or not. 4893 // This may be used to include empty fields in Patch requests. 4894 ForceSendFields []string `json:"-"` 4895 4896 // NullFields is a list of field names (e.g. "CustomType") to include in 4897 // API requests with the JSON null value. By default, fields with empty 4898 // values are omitted from API requests. However, any field with an 4899 // empty value appearing in NullFields will be sent to the server as 4900 // null. It is an error if a field in this list has a non-empty value. 4901 // This may be used to include null fields in Patch requests. 4902 NullFields []string `json:"-"` 4903} 4904 4905func (s *UserExternalId) MarshalJSON() ([]byte, error) { 4906 type NoMethod UserExternalId 4907 raw := NoMethod(*s) 4908 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4909} 4910 4911type UserGender struct { 4912 // AddressMeAs: AddressMeAs. A human-readable string containing the 4913 // proper way to refer to the profile owner by humans for example 4914 // he/him/his or they/them/their. 4915 AddressMeAs string `json:"addressMeAs,omitempty"` 4916 4917 // CustomGender: Custom gender. 4918 CustomGender string `json:"customGender,omitempty"` 4919 4920 // Type: Gender. 4921 Type string `json:"type,omitempty"` 4922 4923 // ForceSendFields is a list of field names (e.g. "AddressMeAs") to 4924 // unconditionally include in API requests. By default, fields with 4925 // empty or default values are omitted from API requests. However, any 4926 // non-pointer, non-interface field appearing in ForceSendFields will be 4927 // sent to the server regardless of whether the field is empty or not. 4928 // This may be used to include empty fields in Patch requests. 4929 ForceSendFields []string `json:"-"` 4930 4931 // NullFields is a list of field names (e.g. "AddressMeAs") to include 4932 // in API requests with the JSON null value. By default, fields with 4933 // empty values are omitted from API requests. However, any field with 4934 // an empty value appearing in NullFields will be sent to the server as 4935 // null. It is an error if a field in this list has a non-empty value. 4936 // This may be used to include null fields in Patch requests. 4937 NullFields []string `json:"-"` 4938} 4939 4940func (s *UserGender) MarshalJSON() ([]byte, error) { 4941 type NoMethod UserGender 4942 raw := NoMethod(*s) 4943 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4944} 4945 4946// UserIm: JSON template for instant messenger of an user. 4947type UserIm struct { 4948 // CustomProtocol: Custom protocol. 4949 CustomProtocol string `json:"customProtocol,omitempty"` 4950 4951 // CustomType: Custom type. 4952 CustomType string `json:"customType,omitempty"` 4953 4954 // Im: Instant messenger id. 4955 Im string `json:"im,omitempty"` 4956 4957 // Primary: If this is user's primary im. Only one entry could be marked 4958 // as primary. 4959 Primary bool `json:"primary,omitempty"` 4960 4961 // Protocol: Protocol used in the instant messenger. It should be one of 4962 // the values from ImProtocolTypes map. Similar to type it can take a 4963 // CUSTOM value and specify the custom name in customProtocol field. 4964 Protocol string `json:"protocol,omitempty"` 4965 4966 // Type: Each entry can have a type which indicates standard types of 4967 // that entry. For example instant messengers could be of home work etc. 4968 // In addition to the standard type an entry can have a custom type and 4969 // can take any value. Such types should have the CUSTOM value as type 4970 // and also have a customType value. 4971 Type string `json:"type,omitempty"` 4972 4973 // ForceSendFields is a list of field names (e.g. "CustomProtocol") to 4974 // unconditionally include in API requests. By default, fields with 4975 // empty or default values are omitted from API requests. However, any 4976 // non-pointer, non-interface field appearing in ForceSendFields will be 4977 // sent to the server regardless of whether the field is empty or not. 4978 // This may be used to include empty fields in Patch requests. 4979 ForceSendFields []string `json:"-"` 4980 4981 // NullFields is a list of field names (e.g. "CustomProtocol") to 4982 // include in API requests with the JSON null value. By default, fields 4983 // with empty values are omitted from API requests. However, any field 4984 // with an empty value appearing in NullFields will be sent to the 4985 // server as null. It is an error if a field in this list has a 4986 // non-empty value. This may be used to include null fields in Patch 4987 // requests. 4988 NullFields []string `json:"-"` 4989} 4990 4991func (s *UserIm) MarshalJSON() ([]byte, error) { 4992 type NoMethod UserIm 4993 raw := NoMethod(*s) 4994 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4995} 4996 4997// UserKeyword: JSON template for a keyword entry. 4998type UserKeyword struct { 4999 // CustomType: Custom Type. 5000 CustomType string `json:"customType,omitempty"` 5001 5002 // Type: Each entry can have a type which indicates standard type of 5003 // that entry. For example keyword could be of type occupation or 5004 // outlook. In addition to the standard type an entry can have a custom 5005 // type and can give it any name. Such types should have the CUSTOM 5006 // value as type and also have a customType value. 5007 Type string `json:"type,omitempty"` 5008 5009 // Value: Keyword. 5010 Value string `json:"value,omitempty"` 5011 5012 // ForceSendFields is a list of field names (e.g. "CustomType") to 5013 // unconditionally include in API requests. By default, fields with 5014 // empty or default values are omitted from API requests. However, any 5015 // non-pointer, non-interface field appearing in ForceSendFields will be 5016 // sent to the server regardless of whether the field is empty or not. 5017 // This may be used to include empty fields in Patch requests. 5018 ForceSendFields []string `json:"-"` 5019 5020 // NullFields is a list of field names (e.g. "CustomType") to include in 5021 // API requests with the JSON null value. By default, fields with empty 5022 // values are omitted from API requests. However, any field with an 5023 // empty value appearing in NullFields will be sent to the server as 5024 // null. It is an error if a field in this list has a non-empty value. 5025 // This may be used to include null fields in Patch requests. 5026 NullFields []string `json:"-"` 5027} 5028 5029func (s *UserKeyword) MarshalJSON() ([]byte, error) { 5030 type NoMethod UserKeyword 5031 raw := NoMethod(*s) 5032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5033} 5034 5035// UserLanguage: JSON template for a language entry. 5036type UserLanguage struct { 5037 // CustomLanguage: Other language. User can provide own language name if 5038 // there is no corresponding Google III language code. If this is set 5039 // LanguageCode can't be set 5040 CustomLanguage string `json:"customLanguage,omitempty"` 5041 5042 // LanguageCode: Language Code. Should be used for storing Google III 5043 // LanguageCode string representation for language. Illegal values cause 5044 // SchemaException. 5045 LanguageCode string `json:"languageCode,omitempty"` 5046 5047 // ForceSendFields is a list of field names (e.g. "CustomLanguage") to 5048 // unconditionally include in API requests. By default, fields with 5049 // empty or default values are omitted from API requests. However, any 5050 // non-pointer, non-interface field appearing in ForceSendFields will be 5051 // sent to the server regardless of whether the field is empty or not. 5052 // This may be used to include empty fields in Patch requests. 5053 ForceSendFields []string `json:"-"` 5054 5055 // NullFields is a list of field names (e.g. "CustomLanguage") to 5056 // include in API requests with the JSON null value. By default, fields 5057 // with empty values are omitted from API requests. However, any field 5058 // with an empty value appearing in NullFields will be sent to the 5059 // server as null. It is an error if a field in this list has a 5060 // non-empty value. This may be used to include null fields in Patch 5061 // requests. 5062 NullFields []string `json:"-"` 5063} 5064 5065func (s *UserLanguage) MarshalJSON() ([]byte, error) { 5066 type NoMethod UserLanguage 5067 raw := NoMethod(*s) 5068 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5069} 5070 5071// UserLocation: JSON template for a location entry. 5072type UserLocation struct { 5073 // Area: Textual location. This is most useful for display purposes to 5074 // concisely describe the location. For example 'Mountain View, CA', 5075 // 'Near Seattle', 'US-NYC-9TH 9A209A.'' 5076 Area string `json:"area,omitempty"` 5077 5078 // BuildingId: Building Identifier. 5079 BuildingId string `json:"buildingId,omitempty"` 5080 5081 // CustomType: Custom Type. 5082 CustomType string `json:"customType,omitempty"` 5083 5084 // DeskCode: Most specific textual code of individual desk location. 5085 DeskCode string `json:"deskCode,omitempty"` 5086 5087 // FloorName: Floor name/number. 5088 FloorName string `json:"floorName,omitempty"` 5089 5090 // FloorSection: Floor section. More specific location within the floor. 5091 // For example if a floor is divided into sections 'A', 'B' and 'C' this 5092 // field would identify one of those values. 5093 FloorSection string `json:"floorSection,omitempty"` 5094 5095 // Type: Each entry can have a type which indicates standard types of 5096 // that entry. For example location could be of types default and desk. 5097 // In addition to standard type an entry can have a custom type and can 5098 // give it any name. Such types should have 'custom' as type and also 5099 // have a customType value. 5100 Type string `json:"type,omitempty"` 5101 5102 // ForceSendFields is a list of field names (e.g. "Area") to 5103 // unconditionally include in API requests. By default, fields with 5104 // empty or default values are omitted from API requests. However, any 5105 // non-pointer, non-interface field appearing in ForceSendFields will be 5106 // sent to the server regardless of whether the field is empty or not. 5107 // This may be used to include empty fields in Patch requests. 5108 ForceSendFields []string `json:"-"` 5109 5110 // NullFields is a list of field names (e.g. "Area") to include in API 5111 // requests with the JSON null value. By default, fields with empty 5112 // values are omitted from API requests. However, any field with an 5113 // empty value appearing in NullFields will be sent to the server as 5114 // null. It is an error if a field in this list has a non-empty value. 5115 // This may be used to include null fields in Patch requests. 5116 NullFields []string `json:"-"` 5117} 5118 5119func (s *UserLocation) MarshalJSON() ([]byte, error) { 5120 type NoMethod UserLocation 5121 raw := NoMethod(*s) 5122 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5123} 5124 5125type UserMakeAdmin struct { 5126 // Status: Indicates the administrator status of the user. 5127 Status bool `json:"status,omitempty"` 5128 5129 // ForceSendFields is a list of field names (e.g. "Status") to 5130 // unconditionally include in API requests. By default, fields with 5131 // empty or default values are omitted from API requests. However, any 5132 // non-pointer, non-interface field appearing in ForceSendFields will be 5133 // sent to the server regardless of whether the field is empty or not. 5134 // This may be used to include empty fields in Patch requests. 5135 ForceSendFields []string `json:"-"` 5136 5137 // NullFields is a list of field names (e.g. "Status") to include in API 5138 // requests with the JSON null value. By default, fields with empty 5139 // values are omitted from API requests. However, any field with an 5140 // empty value appearing in NullFields will be sent to the server as 5141 // null. It is an error if a field in this list has a non-empty value. 5142 // This may be used to include null fields in Patch requests. 5143 NullFields []string `json:"-"` 5144} 5145 5146func (s *UserMakeAdmin) MarshalJSON() ([]byte, error) { 5147 type NoMethod UserMakeAdmin 5148 raw := NoMethod(*s) 5149 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5150} 5151 5152type UserName struct { 5153 // FamilyName: The user's last name. Required when creating a user 5154 // account. 5155 FamilyName string `json:"familyName,omitempty"` 5156 5157 // FullName: The user's full name formed by concatenating the first and 5158 // last name values. 5159 FullName string `json:"fullName,omitempty"` 5160 5161 // GivenName: The user's first name. Required when creating a user 5162 // account. 5163 GivenName string `json:"givenName,omitempty"` 5164 5165 // ForceSendFields is a list of field names (e.g. "FamilyName") to 5166 // unconditionally include in API requests. By default, fields with 5167 // empty or default values are omitted from API requests. However, any 5168 // non-pointer, non-interface field appearing in ForceSendFields will be 5169 // sent to the server regardless of whether the field is empty or not. 5170 // This may be used to include empty fields in Patch requests. 5171 ForceSendFields []string `json:"-"` 5172 5173 // NullFields is a list of field names (e.g. "FamilyName") to include in 5174 // API requests with the JSON null value. By default, fields with empty 5175 // values are omitted from API requests. However, any field with an 5176 // empty value appearing in NullFields will be sent to the server as 5177 // null. It is an error if a field in this list has a non-empty value. 5178 // This may be used to include null fields in Patch requests. 5179 NullFields []string `json:"-"` 5180} 5181 5182func (s *UserName) MarshalJSON() ([]byte, error) { 5183 type NoMethod UserName 5184 raw := NoMethod(*s) 5185 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5186} 5187 5188// UserOrganization: JSON template for an organization entry. 5189type UserOrganization struct { 5190 // CostCenter: The cost center of the users department. 5191 CostCenter string `json:"costCenter,omitempty"` 5192 5193 // CustomType: Custom type. 5194 CustomType string `json:"customType,omitempty"` 5195 5196 // Department: Department within the organization. 5197 Department string `json:"department,omitempty"` 5198 5199 // Description: Description of the organization. 5200 Description string `json:"description,omitempty"` 5201 5202 // Domain: The domain to which the organization belongs to. 5203 Domain string `json:"domain,omitempty"` 5204 5205 // FullTimeEquivalent: The full-time equivalent millipercent within the 5206 // organization (100000 = 100%). 5207 FullTimeEquivalent int64 `json:"fullTimeEquivalent,omitempty"` 5208 5209 // Location: Location of the organization. This need not be fully 5210 // qualified address. 5211 Location string `json:"location,omitempty"` 5212 5213 // Name: Name of the organization 5214 Name string `json:"name,omitempty"` 5215 5216 // Primary: If it user's primary organization. 5217 Primary bool `json:"primary,omitempty"` 5218 5219 // Symbol: Symbol of the organization. 5220 Symbol string `json:"symbol,omitempty"` 5221 5222 // Title: Title (designation) of the user in the organization. 5223 Title string `json:"title,omitempty"` 5224 5225 // Type: Each entry can have a type which indicates standard types of 5226 // that entry. For example organization could be of school work etc. In 5227 // addition to the standard type an entry can have a custom type and can 5228 // give it any name. Such types should have the CUSTOM value as type and 5229 // also have a CustomType value. 5230 Type string `json:"type,omitempty"` 5231 5232 // ForceSendFields is a list of field names (e.g. "CostCenter") to 5233 // unconditionally include in API requests. By default, fields with 5234 // empty or default values are omitted from API requests. However, any 5235 // non-pointer, non-interface field appearing in ForceSendFields will be 5236 // sent to the server regardless of whether the field is empty or not. 5237 // This may be used to include empty fields in Patch requests. 5238 ForceSendFields []string `json:"-"` 5239 5240 // NullFields is a list of field names (e.g. "CostCenter") to include in 5241 // API requests with the JSON null value. By default, fields with empty 5242 // values are omitted from API requests. However, any field with an 5243 // empty value appearing in NullFields will be sent to the server as 5244 // null. It is an error if a field in this list has a non-empty value. 5245 // This may be used to include null fields in Patch requests. 5246 NullFields []string `json:"-"` 5247} 5248 5249func (s *UserOrganization) MarshalJSON() ([]byte, error) { 5250 type NoMethod UserOrganization 5251 raw := NoMethod(*s) 5252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5253} 5254 5255// UserPhone: JSON template for a phone entry. 5256type UserPhone struct { 5257 // CustomType: Custom Type. 5258 CustomType string `json:"customType,omitempty"` 5259 5260 // Primary: If this is user's primary phone or not. 5261 Primary bool `json:"primary,omitempty"` 5262 5263 // Type: Each entry can have a type which indicates standard types of 5264 // that entry. For example phone could be of home_fax work mobile etc. 5265 // In addition to the standard type an entry can have a custom type and 5266 // can give it any name. Such types should have the CUSTOM value as type 5267 // and also have a customType value. 5268 Type string `json:"type,omitempty"` 5269 5270 // Value: Phone number. 5271 Value string `json:"value,omitempty"` 5272 5273 // ForceSendFields is a list of field names (e.g. "CustomType") to 5274 // unconditionally include in API requests. By default, fields with 5275 // empty or default values are omitted from API requests. However, any 5276 // non-pointer, non-interface field appearing in ForceSendFields will be 5277 // sent to the server regardless of whether the field is empty or not. 5278 // This may be used to include empty fields in Patch requests. 5279 ForceSendFields []string `json:"-"` 5280 5281 // NullFields is a list of field names (e.g. "CustomType") to include in 5282 // API requests with the JSON null value. By default, fields with empty 5283 // values are omitted from API requests. However, any field with an 5284 // empty value appearing in NullFields will be sent to the server as 5285 // null. It is an error if a field in this list has a non-empty value. 5286 // This may be used to include null fields in Patch requests. 5287 NullFields []string `json:"-"` 5288} 5289 5290func (s *UserPhone) MarshalJSON() ([]byte, error) { 5291 type NoMethod UserPhone 5292 raw := NoMethod(*s) 5293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5294} 5295 5296type UserPhoto struct { 5297 // Etag: ETag of the resource. 5298 Etag string `json:"etag,omitempty"` 5299 5300 // Height: Height of the photo in pixels. 5301 Height int64 `json:"height,omitempty"` 5302 5303 // Id: The ID the API uses to uniquely identify the user. 5304 Id string `json:"id,omitempty"` 5305 5306 // Kind: The type of the API resource. For Photo resources, this is 5307 // `admin#directory#user#photo`. 5308 Kind string `json:"kind,omitempty"` 5309 5310 // MimeType: The MIME type of the photo. Allowed values are `JPEG`, 5311 // `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding. 5312 MimeType string `json:"mimeType,omitempty"` 5313 5314 // PhotoData: The user photo's upload data in web-safe Base64 5315 // (https://en.wikipedia.org/wiki/Base64#URL_applications) format in 5316 // bytes. This means: * The slash (/) character is replaced with the 5317 // underscore (_) character. * The plus sign (+) character is replaced 5318 // with the hyphen (-) character. * The equals sign (=) character is 5319 // replaced with the asterisk (*). * For padding, the period (.) 5320 // character is used instead of the RFC-4648 baseURL definition which 5321 // uses the equals sign (=) for padding. This is done to simplify 5322 // URL-parsing. * Whatever the size of the photo being uploaded, the API 5323 // downsizes it to 96x96 pixels. 5324 PhotoData string `json:"photoData,omitempty"` 5325 5326 // PrimaryEmail: The user's primary email address. 5327 PrimaryEmail string `json:"primaryEmail,omitempty"` 5328 5329 // Width: Width of the photo in pixels. 5330 Width int64 `json:"width,omitempty"` 5331 5332 // ServerResponse contains the HTTP response code and headers from the 5333 // server. 5334 googleapi.ServerResponse `json:"-"` 5335 5336 // ForceSendFields is a list of field names (e.g. "Etag") to 5337 // unconditionally include in API requests. By default, fields with 5338 // empty or default values are omitted from API requests. However, any 5339 // non-pointer, non-interface field appearing in ForceSendFields will be 5340 // sent to the server regardless of whether the field is empty or not. 5341 // This may be used to include empty fields in Patch requests. 5342 ForceSendFields []string `json:"-"` 5343 5344 // NullFields is a list of field names (e.g. "Etag") to include in API 5345 // requests with the JSON null value. By default, fields with empty 5346 // values are omitted from API requests. However, any field with an 5347 // empty value appearing in NullFields will be sent to the server as 5348 // null. It is an error if a field in this list has a non-empty value. 5349 // This may be used to include null fields in Patch requests. 5350 NullFields []string `json:"-"` 5351} 5352 5353func (s *UserPhoto) MarshalJSON() ([]byte, error) { 5354 type NoMethod UserPhoto 5355 raw := NoMethod(*s) 5356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5357} 5358 5359// UserPosixAccount: JSON template for a POSIX account entry. 5360type UserPosixAccount struct { 5361 // AccountId: A POSIX account field identifier. 5362 AccountId string `json:"accountId,omitempty"` 5363 5364 // Gecos: The GECOS (user information) for this account. 5365 Gecos string `json:"gecos,omitempty"` 5366 5367 // Gid: The default group ID. 5368 Gid uint64 `json:"gid,omitempty,string"` 5369 5370 // HomeDirectory: The path to the home directory for this account. 5371 HomeDirectory string `json:"homeDirectory,omitempty"` 5372 5373 // OperatingSystemType: The operating system type for this account. 5374 OperatingSystemType string `json:"operatingSystemType,omitempty"` 5375 5376 // Primary: If this is user's primary account within the SystemId. 5377 Primary bool `json:"primary,omitempty"` 5378 5379 // Shell: The path to the login shell for this account. 5380 Shell string `json:"shell,omitempty"` 5381 5382 // SystemId: System identifier for which account Username or Uid apply 5383 // to. 5384 SystemId string `json:"systemId,omitempty"` 5385 5386 // Uid: The POSIX compliant user ID. 5387 Uid uint64 `json:"uid,omitempty,string"` 5388 5389 // Username: The username of the account. 5390 Username string `json:"username,omitempty"` 5391 5392 // ForceSendFields is a list of field names (e.g. "AccountId") to 5393 // unconditionally include in API requests. By default, fields with 5394 // empty or default values are omitted from API requests. However, any 5395 // non-pointer, non-interface field appearing in ForceSendFields will be 5396 // sent to the server regardless of whether the field is empty or not. 5397 // This may be used to include empty fields in Patch requests. 5398 ForceSendFields []string `json:"-"` 5399 5400 // NullFields is a list of field names (e.g. "AccountId") to include in 5401 // API requests with the JSON null value. By default, fields with empty 5402 // values are omitted from API requests. However, any field with an 5403 // empty value appearing in NullFields will be sent to the server as 5404 // null. It is an error if a field in this list has a non-empty value. 5405 // This may be used to include null fields in Patch requests. 5406 NullFields []string `json:"-"` 5407} 5408 5409func (s *UserPosixAccount) MarshalJSON() ([]byte, error) { 5410 type NoMethod UserPosixAccount 5411 raw := NoMethod(*s) 5412 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5413} 5414 5415// UserRelation: JSON template for a relation entry. 5416type UserRelation struct { 5417 // CustomType: Custom Type. 5418 CustomType string `json:"customType,omitempty"` 5419 5420 // Type: The relation of the user. Some of the possible values are 5421 // mother father sister brother manager assistant partner. 5422 Type string `json:"type,omitempty"` 5423 5424 // Value: The name of the relation. 5425 Value string `json:"value,omitempty"` 5426 5427 // ForceSendFields is a list of field names (e.g. "CustomType") to 5428 // unconditionally include in API requests. By default, fields with 5429 // empty or default values are omitted from API requests. However, any 5430 // non-pointer, non-interface field appearing in ForceSendFields will be 5431 // sent to the server regardless of whether the field is empty or not. 5432 // This may be used to include empty fields in Patch requests. 5433 ForceSendFields []string `json:"-"` 5434 5435 // NullFields is a list of field names (e.g. "CustomType") to include in 5436 // API requests with the JSON null value. By default, fields with empty 5437 // values are omitted from API requests. However, any field with an 5438 // empty value appearing in NullFields will be sent to the server as 5439 // null. It is an error if a field in this list has a non-empty value. 5440 // This may be used to include null fields in Patch requests. 5441 NullFields []string `json:"-"` 5442} 5443 5444func (s *UserRelation) MarshalJSON() ([]byte, error) { 5445 type NoMethod UserRelation 5446 raw := NoMethod(*s) 5447 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5448} 5449 5450// UserSshPublicKey: JSON template for a POSIX account entry. 5451type UserSshPublicKey struct { 5452 // ExpirationTimeUsec: An expiration time in microseconds since epoch. 5453 ExpirationTimeUsec int64 `json:"expirationTimeUsec,omitempty,string"` 5454 5455 // Fingerprint: A SHA-256 fingerprint of the SSH public key. (Read-only) 5456 Fingerprint string `json:"fingerprint,omitempty"` 5457 5458 // Key: An SSH public key. 5459 Key string `json:"key,omitempty"` 5460 5461 // ForceSendFields is a list of field names (e.g. "ExpirationTimeUsec") 5462 // to unconditionally include in API requests. By default, fields with 5463 // empty or default values are omitted from API requests. However, any 5464 // non-pointer, non-interface field appearing in ForceSendFields will be 5465 // sent to the server regardless of whether the field is empty or not. 5466 // This may be used to include empty fields in Patch requests. 5467 ForceSendFields []string `json:"-"` 5468 5469 // NullFields is a list of field names (e.g. "ExpirationTimeUsec") to 5470 // include in API requests with the JSON null value. By default, fields 5471 // with empty values are omitted from API requests. However, any field 5472 // with an empty value appearing in NullFields will be sent to the 5473 // server as null. It is an error if a field in this list has a 5474 // non-empty value. This may be used to include null fields in Patch 5475 // requests. 5476 NullFields []string `json:"-"` 5477} 5478 5479func (s *UserSshPublicKey) MarshalJSON() ([]byte, error) { 5480 type NoMethod UserSshPublicKey 5481 raw := NoMethod(*s) 5482 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5483} 5484 5485type UserUndelete struct { 5486 // OrgUnitPath: OrgUnit of User 5487 OrgUnitPath string `json:"orgUnitPath,omitempty"` 5488 5489 // ForceSendFields is a list of field names (e.g. "OrgUnitPath") to 5490 // unconditionally include in API requests. By default, fields with 5491 // empty or default values are omitted from API requests. However, any 5492 // non-pointer, non-interface field appearing in ForceSendFields will be 5493 // sent to the server regardless of whether the field is empty or not. 5494 // This may be used to include empty fields in Patch requests. 5495 ForceSendFields []string `json:"-"` 5496 5497 // NullFields is a list of field names (e.g. "OrgUnitPath") to include 5498 // in API requests with the JSON null value. By default, fields with 5499 // empty values are omitted from API requests. However, any field with 5500 // an empty value appearing in NullFields will be sent to the server as 5501 // null. It is an error if a field in this list has a non-empty value. 5502 // This may be used to include null fields in Patch requests. 5503 NullFields []string `json:"-"` 5504} 5505 5506func (s *UserUndelete) MarshalJSON() ([]byte, error) { 5507 type NoMethod UserUndelete 5508 raw := NoMethod(*s) 5509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5510} 5511 5512// UserWebsite: JSON template for a website entry. 5513type UserWebsite struct { 5514 // CustomType: Custom Type. 5515 CustomType string `json:"customType,omitempty"` 5516 5517 // Primary: If this is user's primary website or not. 5518 Primary bool `json:"primary,omitempty"` 5519 5520 // Type: Each entry can have a type which indicates standard types of 5521 // that entry. For example website could be of home work blog etc. In 5522 // addition to the standard type an entry can have a custom type and can 5523 // give it any name. Such types should have the CUSTOM value as type and 5524 // also have a customType value. 5525 Type string `json:"type,omitempty"` 5526 5527 // Value: Website. 5528 Value string `json:"value,omitempty"` 5529 5530 // ForceSendFields is a list of field names (e.g. "CustomType") to 5531 // unconditionally include in API requests. By default, fields with 5532 // empty or default values are omitted from API requests. However, any 5533 // non-pointer, non-interface field appearing in ForceSendFields will be 5534 // sent to the server regardless of whether the field is empty or not. 5535 // This may be used to include empty fields in Patch requests. 5536 ForceSendFields []string `json:"-"` 5537 5538 // NullFields is a list of field names (e.g. "CustomType") to include in 5539 // API requests with the JSON null value. By default, fields with empty 5540 // values are omitted from API requests. However, any field with an 5541 // empty value appearing in NullFields will be sent to the server as 5542 // null. It is an error if a field in this list has a non-empty value. 5543 // This may be used to include null fields in Patch requests. 5544 NullFields []string `json:"-"` 5545} 5546 5547func (s *UserWebsite) MarshalJSON() ([]byte, error) { 5548 type NoMethod UserWebsite 5549 raw := NoMethod(*s) 5550 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5551} 5552 5553type Users struct { 5554 // Etag: ETag of the resource. 5555 Etag string `json:"etag,omitempty"` 5556 5557 // Kind: Kind of resource this is. 5558 Kind string `json:"kind,omitempty"` 5559 5560 // NextPageToken: Token used to access next page of this result. 5561 NextPageToken string `json:"nextPageToken,omitempty"` 5562 5563 // TriggerEvent: Event that triggered this response (only used in case 5564 // of Push Response) 5565 TriggerEvent string `json:"trigger_event,omitempty"` 5566 5567 // Users: List of user objects. 5568 Users []*User `json:"users,omitempty"` 5569 5570 // ServerResponse contains the HTTP response code and headers from the 5571 // server. 5572 googleapi.ServerResponse `json:"-"` 5573 5574 // ForceSendFields is a list of field names (e.g. "Etag") to 5575 // unconditionally include in API requests. By default, fields with 5576 // empty or default values are omitted from API requests. However, any 5577 // non-pointer, non-interface field appearing in ForceSendFields will be 5578 // sent to the server regardless of whether the field is empty or not. 5579 // This may be used to include empty fields in Patch requests. 5580 ForceSendFields []string `json:"-"` 5581 5582 // NullFields is a list of field names (e.g. "Etag") to include in API 5583 // requests with the JSON null value. By default, fields with empty 5584 // values are omitted from API requests. However, any field with an 5585 // empty value appearing in NullFields will be sent to the server as 5586 // null. It is an error if a field in this list has a non-empty value. 5587 // This may be used to include null fields in Patch requests. 5588 NullFields []string `json:"-"` 5589} 5590 5591func (s *Users) MarshalJSON() ([]byte, error) { 5592 type NoMethod Users 5593 raw := NoMethod(*s) 5594 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5595} 5596 5597// VerificationCode: The Directory API allows you to view, generate, and 5598// invalidate backup verification codes for a user. 5599type VerificationCode struct { 5600 // Etag: ETag of the resource. 5601 Etag string `json:"etag,omitempty"` 5602 5603 // Kind: The type of the resource. This is always 5604 // `admin#directory#verificationCode`. 5605 Kind string `json:"kind,omitempty"` 5606 5607 // UserId: The obfuscated unique ID of the user. 5608 UserId string `json:"userId,omitempty"` 5609 5610 // VerificationCode: A current verification code for the user. 5611 // Invalidated or used verification codes are not returned as part of 5612 // the result. 5613 VerificationCode string `json:"verificationCode,omitempty"` 5614 5615 // ForceSendFields is a list of field names (e.g. "Etag") to 5616 // unconditionally include in API requests. By default, fields with 5617 // empty or default values are omitted from API requests. However, any 5618 // non-pointer, non-interface field appearing in ForceSendFields will be 5619 // sent to the server regardless of whether the field is empty or not. 5620 // This may be used to include empty fields in Patch requests. 5621 ForceSendFields []string `json:"-"` 5622 5623 // NullFields is a list of field names (e.g. "Etag") to include in API 5624 // requests with the JSON null value. By default, fields with empty 5625 // values are omitted from API requests. However, any field with an 5626 // empty value appearing in NullFields will be sent to the server as 5627 // null. It is an error if a field in this list has a non-empty value. 5628 // This may be used to include null fields in Patch requests. 5629 NullFields []string `json:"-"` 5630} 5631 5632func (s *VerificationCode) MarshalJSON() ([]byte, error) { 5633 type NoMethod VerificationCode 5634 raw := NoMethod(*s) 5635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5636} 5637 5638// VerificationCodes: JSON response template for List verification codes 5639// operation in Directory API. 5640type VerificationCodes struct { 5641 // Etag: ETag of the resource. 5642 Etag string `json:"etag,omitempty"` 5643 5644 // Items: A list of verification code resources. 5645 Items []*VerificationCode `json:"items,omitempty"` 5646 5647 // Kind: The type of the resource. This is always 5648 // `admin#directory#verificationCodesList`. 5649 Kind string `json:"kind,omitempty"` 5650 5651 // ServerResponse contains the HTTP response code and headers from the 5652 // server. 5653 googleapi.ServerResponse `json:"-"` 5654 5655 // ForceSendFields is a list of field names (e.g. "Etag") to 5656 // unconditionally include in API requests. By default, fields with 5657 // empty or default values are omitted from API requests. However, any 5658 // non-pointer, non-interface field appearing in ForceSendFields will be 5659 // sent to the server regardless of whether the field is empty or not. 5660 // This may be used to include empty fields in Patch requests. 5661 ForceSendFields []string `json:"-"` 5662 5663 // NullFields is a list of field names (e.g. "Etag") to include in API 5664 // requests with the JSON null value. By default, fields with empty 5665 // values are omitted from API requests. However, any field with an 5666 // empty value appearing in NullFields will be sent to the server as 5667 // null. It is an error if a field in this list has a non-empty value. 5668 // This may be used to include null fields in Patch requests. 5669 NullFields []string `json:"-"` 5670} 5671 5672func (s *VerificationCodes) MarshalJSON() ([]byte, error) { 5673 type NoMethod VerificationCodes 5674 raw := NoMethod(*s) 5675 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5676} 5677 5678// method id "directory.asps.delete": 5679 5680type AspsDeleteCall struct { 5681 s *Service 5682 userKey string 5683 codeId int64 5684 urlParams_ gensupport.URLParams 5685 ctx_ context.Context 5686 header_ http.Header 5687} 5688 5689// Delete: Deletes an ASP issued by a user. 5690// 5691// - codeId: The unique ID of the ASP to be deleted. 5692// - userKey: Identifies the user in the API request. The value can be 5693// the user's primary email address, alias email address, or unique 5694// user ID. 5695func (r *AspsService) Delete(userKey string, codeId int64) *AspsDeleteCall { 5696 c := &AspsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5697 c.userKey = userKey 5698 c.codeId = codeId 5699 return c 5700} 5701 5702// Fields allows partial responses to be retrieved. See 5703// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5704// for more information. 5705func (c *AspsDeleteCall) Fields(s ...googleapi.Field) *AspsDeleteCall { 5706 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5707 return c 5708} 5709 5710// Context sets the context to be used in this call's Do method. Any 5711// pending HTTP request will be aborted if the provided context is 5712// canceled. 5713func (c *AspsDeleteCall) Context(ctx context.Context) *AspsDeleteCall { 5714 c.ctx_ = ctx 5715 return c 5716} 5717 5718// Header returns an http.Header that can be modified by the caller to 5719// add HTTP headers to the request. 5720func (c *AspsDeleteCall) Header() http.Header { 5721 if c.header_ == nil { 5722 c.header_ = make(http.Header) 5723 } 5724 return c.header_ 5725} 5726 5727func (c *AspsDeleteCall) doRequest(alt string) (*http.Response, error) { 5728 reqHeaders := make(http.Header) 5729 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5730 for k, v := range c.header_ { 5731 reqHeaders[k] = v 5732 } 5733 reqHeaders.Set("User-Agent", c.s.userAgent()) 5734 var body io.Reader = nil 5735 c.urlParams_.Set("alt", alt) 5736 c.urlParams_.Set("prettyPrint", "false") 5737 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") 5738 urls += "?" + c.urlParams_.Encode() 5739 req, err := http.NewRequest("DELETE", urls, body) 5740 if err != nil { 5741 return nil, err 5742 } 5743 req.Header = reqHeaders 5744 googleapi.Expand(req.URL, map[string]string{ 5745 "userKey": c.userKey, 5746 "codeId": strconv.FormatInt(c.codeId, 10), 5747 }) 5748 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5749} 5750 5751// Do executes the "directory.asps.delete" call. 5752func (c *AspsDeleteCall) Do(opts ...googleapi.CallOption) error { 5753 gensupport.SetOptions(c.urlParams_, opts...) 5754 res, err := c.doRequest("json") 5755 if err != nil { 5756 return err 5757 } 5758 defer googleapi.CloseBody(res) 5759 if err := googleapi.CheckResponse(res); err != nil { 5760 return err 5761 } 5762 return nil 5763 // { 5764 // "description": "Deletes an ASP issued by a user.", 5765 // "flatPath": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5766 // "httpMethod": "DELETE", 5767 // "id": "directory.asps.delete", 5768 // "parameterOrder": [ 5769 // "userKey", 5770 // "codeId" 5771 // ], 5772 // "parameters": { 5773 // "codeId": { 5774 // "description": "The unique ID of the ASP to be deleted.", 5775 // "format": "int32", 5776 // "location": "path", 5777 // "required": true, 5778 // "type": "integer" 5779 // }, 5780 // "userKey": { 5781 // "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.", 5782 // "location": "path", 5783 // "required": true, 5784 // "type": "string" 5785 // } 5786 // }, 5787 // "path": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5788 // "scopes": [ 5789 // "https://www.googleapis.com/auth/admin.directory.user.security" 5790 // ] 5791 // } 5792 5793} 5794 5795// method id "directory.asps.get": 5796 5797type AspsGetCall struct { 5798 s *Service 5799 userKey string 5800 codeId int64 5801 urlParams_ gensupport.URLParams 5802 ifNoneMatch_ string 5803 ctx_ context.Context 5804 header_ http.Header 5805} 5806 5807// Get: Gets information about an ASP issued by a user. 5808// 5809// - codeId: The unique ID of the ASP. 5810// - userKey: Identifies the user in the API request. The value can be 5811// the user's primary email address, alias email address, or unique 5812// user ID. 5813func (r *AspsService) Get(userKey string, codeId int64) *AspsGetCall { 5814 c := &AspsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5815 c.userKey = userKey 5816 c.codeId = codeId 5817 return c 5818} 5819 5820// Fields allows partial responses to be retrieved. See 5821// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5822// for more information. 5823func (c *AspsGetCall) Fields(s ...googleapi.Field) *AspsGetCall { 5824 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5825 return c 5826} 5827 5828// IfNoneMatch sets the optional parameter which makes the operation 5829// fail if the object's ETag matches the given value. This is useful for 5830// getting updates only after the object has changed since the last 5831// request. Use googleapi.IsNotModified to check whether the response 5832// error from Do is the result of In-None-Match. 5833func (c *AspsGetCall) IfNoneMatch(entityTag string) *AspsGetCall { 5834 c.ifNoneMatch_ = entityTag 5835 return c 5836} 5837 5838// Context sets the context to be used in this call's Do method. Any 5839// pending HTTP request will be aborted if the provided context is 5840// canceled. 5841func (c *AspsGetCall) Context(ctx context.Context) *AspsGetCall { 5842 c.ctx_ = ctx 5843 return c 5844} 5845 5846// Header returns an http.Header that can be modified by the caller to 5847// add HTTP headers to the request. 5848func (c *AspsGetCall) Header() http.Header { 5849 if c.header_ == nil { 5850 c.header_ = make(http.Header) 5851 } 5852 return c.header_ 5853} 5854 5855func (c *AspsGetCall) doRequest(alt string) (*http.Response, error) { 5856 reqHeaders := make(http.Header) 5857 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5858 for k, v := range c.header_ { 5859 reqHeaders[k] = v 5860 } 5861 reqHeaders.Set("User-Agent", c.s.userAgent()) 5862 if c.ifNoneMatch_ != "" { 5863 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5864 } 5865 var body io.Reader = nil 5866 c.urlParams_.Set("alt", alt) 5867 c.urlParams_.Set("prettyPrint", "false") 5868 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps/{codeId}") 5869 urls += "?" + c.urlParams_.Encode() 5870 req, err := http.NewRequest("GET", urls, body) 5871 if err != nil { 5872 return nil, err 5873 } 5874 req.Header = reqHeaders 5875 googleapi.Expand(req.URL, map[string]string{ 5876 "userKey": c.userKey, 5877 "codeId": strconv.FormatInt(c.codeId, 10), 5878 }) 5879 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5880} 5881 5882// Do executes the "directory.asps.get" call. 5883// Exactly one of *Asp or error will be non-nil. Any non-2xx status code 5884// is an error. Response headers are in either 5885// *Asp.ServerResponse.Header or (if a response was returned at all) in 5886// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5887// whether the returned error was because http.StatusNotModified was 5888// returned. 5889func (c *AspsGetCall) Do(opts ...googleapi.CallOption) (*Asp, error) { 5890 gensupport.SetOptions(c.urlParams_, opts...) 5891 res, err := c.doRequest("json") 5892 if res != nil && res.StatusCode == http.StatusNotModified { 5893 if res.Body != nil { 5894 res.Body.Close() 5895 } 5896 return nil, &googleapi.Error{ 5897 Code: res.StatusCode, 5898 Header: res.Header, 5899 } 5900 } 5901 if err != nil { 5902 return nil, err 5903 } 5904 defer googleapi.CloseBody(res) 5905 if err := googleapi.CheckResponse(res); err != nil { 5906 return nil, err 5907 } 5908 ret := &Asp{ 5909 ServerResponse: googleapi.ServerResponse{ 5910 Header: res.Header, 5911 HTTPStatusCode: res.StatusCode, 5912 }, 5913 } 5914 target := &ret 5915 if err := gensupport.DecodeResponse(target, res); err != nil { 5916 return nil, err 5917 } 5918 return ret, nil 5919 // { 5920 // "description": "Gets information about an ASP issued by a user.", 5921 // "flatPath": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5922 // "httpMethod": "GET", 5923 // "id": "directory.asps.get", 5924 // "parameterOrder": [ 5925 // "userKey", 5926 // "codeId" 5927 // ], 5928 // "parameters": { 5929 // "codeId": { 5930 // "description": "The unique ID of the ASP.", 5931 // "format": "int32", 5932 // "location": "path", 5933 // "required": true, 5934 // "type": "integer" 5935 // }, 5936 // "userKey": { 5937 // "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.", 5938 // "location": "path", 5939 // "required": true, 5940 // "type": "string" 5941 // } 5942 // }, 5943 // "path": "admin/directory/v1/users/{userKey}/asps/{codeId}", 5944 // "response": { 5945 // "$ref": "Asp" 5946 // }, 5947 // "scopes": [ 5948 // "https://www.googleapis.com/auth/admin.directory.user.security" 5949 // ] 5950 // } 5951 5952} 5953 5954// method id "directory.asps.list": 5955 5956type AspsListCall struct { 5957 s *Service 5958 userKey string 5959 urlParams_ gensupport.URLParams 5960 ifNoneMatch_ string 5961 ctx_ context.Context 5962 header_ http.Header 5963} 5964 5965// List: Lists the ASPs issued by a user. 5966// 5967// - userKey: Identifies the user in the API request. The value can be 5968// the user's primary email address, alias email address, or unique 5969// user ID. 5970func (r *AspsService) List(userKey string) *AspsListCall { 5971 c := &AspsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5972 c.userKey = userKey 5973 return c 5974} 5975 5976// Fields allows partial responses to be retrieved. See 5977// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5978// for more information. 5979func (c *AspsListCall) Fields(s ...googleapi.Field) *AspsListCall { 5980 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5981 return c 5982} 5983 5984// IfNoneMatch sets the optional parameter which makes the operation 5985// fail if the object's ETag matches the given value. This is useful for 5986// getting updates only after the object has changed since the last 5987// request. Use googleapi.IsNotModified to check whether the response 5988// error from Do is the result of In-None-Match. 5989func (c *AspsListCall) IfNoneMatch(entityTag string) *AspsListCall { 5990 c.ifNoneMatch_ = entityTag 5991 return c 5992} 5993 5994// Context sets the context to be used in this call's Do method. Any 5995// pending HTTP request will be aborted if the provided context is 5996// canceled. 5997func (c *AspsListCall) Context(ctx context.Context) *AspsListCall { 5998 c.ctx_ = ctx 5999 return c 6000} 6001 6002// Header returns an http.Header that can be modified by the caller to 6003// add HTTP headers to the request. 6004func (c *AspsListCall) Header() http.Header { 6005 if c.header_ == nil { 6006 c.header_ = make(http.Header) 6007 } 6008 return c.header_ 6009} 6010 6011func (c *AspsListCall) doRequest(alt string) (*http.Response, error) { 6012 reqHeaders := make(http.Header) 6013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6014 for k, v := range c.header_ { 6015 reqHeaders[k] = v 6016 } 6017 reqHeaders.Set("User-Agent", c.s.userAgent()) 6018 if c.ifNoneMatch_ != "" { 6019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6020 } 6021 var body io.Reader = nil 6022 c.urlParams_.Set("alt", alt) 6023 c.urlParams_.Set("prettyPrint", "false") 6024 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/asps") 6025 urls += "?" + c.urlParams_.Encode() 6026 req, err := http.NewRequest("GET", urls, body) 6027 if err != nil { 6028 return nil, err 6029 } 6030 req.Header = reqHeaders 6031 googleapi.Expand(req.URL, map[string]string{ 6032 "userKey": c.userKey, 6033 }) 6034 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6035} 6036 6037// Do executes the "directory.asps.list" call. 6038// Exactly one of *Asps or error will be non-nil. Any non-2xx status 6039// code is an error. Response headers are in either 6040// *Asps.ServerResponse.Header or (if a response was returned at all) in 6041// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6042// whether the returned error was because http.StatusNotModified was 6043// returned. 6044func (c *AspsListCall) Do(opts ...googleapi.CallOption) (*Asps, error) { 6045 gensupport.SetOptions(c.urlParams_, opts...) 6046 res, err := c.doRequest("json") 6047 if res != nil && res.StatusCode == http.StatusNotModified { 6048 if res.Body != nil { 6049 res.Body.Close() 6050 } 6051 return nil, &googleapi.Error{ 6052 Code: res.StatusCode, 6053 Header: res.Header, 6054 } 6055 } 6056 if err != nil { 6057 return nil, err 6058 } 6059 defer googleapi.CloseBody(res) 6060 if err := googleapi.CheckResponse(res); err != nil { 6061 return nil, err 6062 } 6063 ret := &Asps{ 6064 ServerResponse: googleapi.ServerResponse{ 6065 Header: res.Header, 6066 HTTPStatusCode: res.StatusCode, 6067 }, 6068 } 6069 target := &ret 6070 if err := gensupport.DecodeResponse(target, res); err != nil { 6071 return nil, err 6072 } 6073 return ret, nil 6074 // { 6075 // "description": "Lists the ASPs issued by a user.", 6076 // "flatPath": "admin/directory/v1/users/{userKey}/asps", 6077 // "httpMethod": "GET", 6078 // "id": "directory.asps.list", 6079 // "parameterOrder": [ 6080 // "userKey" 6081 // ], 6082 // "parameters": { 6083 // "userKey": { 6084 // "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.", 6085 // "location": "path", 6086 // "required": true, 6087 // "type": "string" 6088 // } 6089 // }, 6090 // "path": "admin/directory/v1/users/{userKey}/asps", 6091 // "response": { 6092 // "$ref": "Asps" 6093 // }, 6094 // "scopes": [ 6095 // "https://www.googleapis.com/auth/admin.directory.user.security" 6096 // ] 6097 // } 6098 6099} 6100 6101// method id "admin.channels.stop": 6102 6103type ChannelsStopCall struct { 6104 s *Service 6105 channel *Channel 6106 urlParams_ gensupport.URLParams 6107 ctx_ context.Context 6108 header_ http.Header 6109} 6110 6111// Stop: Stops watching resources through this channel. 6112func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 6113 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6114 c.channel = channel 6115 return c 6116} 6117 6118// Fields allows partial responses to be retrieved. See 6119// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6120// for more information. 6121func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 6122 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6123 return c 6124} 6125 6126// Context sets the context to be used in this call's Do method. Any 6127// pending HTTP request will be aborted if the provided context is 6128// canceled. 6129func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 6130 c.ctx_ = ctx 6131 return c 6132} 6133 6134// Header returns an http.Header that can be modified by the caller to 6135// add HTTP headers to the request. 6136func (c *ChannelsStopCall) Header() http.Header { 6137 if c.header_ == nil { 6138 c.header_ = make(http.Header) 6139 } 6140 return c.header_ 6141} 6142 6143func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 6144 reqHeaders := make(http.Header) 6145 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6146 for k, v := range c.header_ { 6147 reqHeaders[k] = v 6148 } 6149 reqHeaders.Set("User-Agent", c.s.userAgent()) 6150 var body io.Reader = nil 6151 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 6152 if err != nil { 6153 return nil, err 6154 } 6155 reqHeaders.Set("Content-Type", "application/json") 6156 c.urlParams_.Set("alt", alt) 6157 c.urlParams_.Set("prettyPrint", "false") 6158 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory_v1/channels/stop") 6159 urls += "?" + c.urlParams_.Encode() 6160 req, err := http.NewRequest("POST", urls, body) 6161 if err != nil { 6162 return nil, err 6163 } 6164 req.Header = reqHeaders 6165 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6166} 6167 6168// Do executes the "admin.channels.stop" call. 6169func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 6170 gensupport.SetOptions(c.urlParams_, opts...) 6171 res, err := c.doRequest("json") 6172 if err != nil { 6173 return err 6174 } 6175 defer googleapi.CloseBody(res) 6176 if err := googleapi.CheckResponse(res); err != nil { 6177 return err 6178 } 6179 return nil 6180 // { 6181 // "description": "Stops watching resources through this channel.", 6182 // "flatPath": "admin/directory_v1/channels/stop", 6183 // "httpMethod": "POST", 6184 // "id": "admin.channels.stop", 6185 // "parameterOrder": [], 6186 // "parameters": {}, 6187 // "path": "admin/directory_v1/channels/stop", 6188 // "request": { 6189 // "$ref": "Channel" 6190 // }, 6191 // "scopes": [ 6192 // "https://www.googleapis.com/auth/admin.directory.user", 6193 // "https://www.googleapis.com/auth/admin.directory.user.alias", 6194 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 6195 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 6196 // "https://www.googleapis.com/auth/cloud-platform" 6197 // ] 6198 // } 6199 6200} 6201 6202// method id "directory.chromeosdevices.action": 6203 6204type ChromeosdevicesActionCall struct { 6205 s *Service 6206 customerId string 6207 resourceId string 6208 chromeosdeviceaction *ChromeOsDeviceAction 6209 urlParams_ gensupport.URLParams 6210 ctx_ context.Context 6211 header_ http.Header 6212} 6213 6214// Action: Takes an action that affects a Chrome OS Device. This 6215// includes deprovisioning, disabling, and re-enabling devices. 6216// *Warning:* * Deprovisioning a device will stop device policy syncing 6217// and remove device-level printers. After a device is deprovisioned, it 6218// must be wiped before it can be re-enrolled. * Lost or stolen devices 6219// should use the disable action. * Re-enabling a disabled device will 6220// consume a device license. If you do not have sufficient licenses 6221// available when completing the re-enable action, you will receive an 6222// error. For more information about deprovisioning and disabling 6223// devices, visit the help center 6224// (https://support.google.com/chrome/a/answer/3523633). 6225// 6226// - customerId: The unique ID for the customer's Google Workspace 6227// account. As an account administrator, you can also use the 6228// `my_customer` alias to represent your account's `customerId`. The 6229// `customerId` is also returned as part of the Users resource 6230// (/admin-sdk/directory/v1/reference/users). 6231// - resourceId: The unique ID of the device. The `resourceId`s are 6232// returned in the response from the chromeosdevices.list 6233// (/admin-sdk/directory/v1/reference/chromeosdevices/list) method. 6234func (r *ChromeosdevicesService) Action(customerId string, resourceId string, chromeosdeviceaction *ChromeOsDeviceAction) *ChromeosdevicesActionCall { 6235 c := &ChromeosdevicesActionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6236 c.customerId = customerId 6237 c.resourceId = resourceId 6238 c.chromeosdeviceaction = chromeosdeviceaction 6239 return c 6240} 6241 6242// Fields allows partial responses to be retrieved. See 6243// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6244// for more information. 6245func (c *ChromeosdevicesActionCall) Fields(s ...googleapi.Field) *ChromeosdevicesActionCall { 6246 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6247 return c 6248} 6249 6250// Context sets the context to be used in this call's Do method. Any 6251// pending HTTP request will be aborted if the provided context is 6252// canceled. 6253func (c *ChromeosdevicesActionCall) Context(ctx context.Context) *ChromeosdevicesActionCall { 6254 c.ctx_ = ctx 6255 return c 6256} 6257 6258// Header returns an http.Header that can be modified by the caller to 6259// add HTTP headers to the request. 6260func (c *ChromeosdevicesActionCall) Header() http.Header { 6261 if c.header_ == nil { 6262 c.header_ = make(http.Header) 6263 } 6264 return c.header_ 6265} 6266 6267func (c *ChromeosdevicesActionCall) doRequest(alt string) (*http.Response, error) { 6268 reqHeaders := make(http.Header) 6269 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6270 for k, v := range c.header_ { 6271 reqHeaders[k] = v 6272 } 6273 reqHeaders.Set("User-Agent", c.s.userAgent()) 6274 var body io.Reader = nil 6275 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdeviceaction) 6276 if err != nil { 6277 return nil, err 6278 } 6279 reqHeaders.Set("Content-Type", "application/json") 6280 c.urlParams_.Set("alt", alt) 6281 c.urlParams_.Set("prettyPrint", "false") 6282 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action") 6283 urls += "?" + c.urlParams_.Encode() 6284 req, err := http.NewRequest("POST", urls, body) 6285 if err != nil { 6286 return nil, err 6287 } 6288 req.Header = reqHeaders 6289 googleapi.Expand(req.URL, map[string]string{ 6290 "customerId": c.customerId, 6291 "resourceId": c.resourceId, 6292 }) 6293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6294} 6295 6296// Do executes the "directory.chromeosdevices.action" call. 6297func (c *ChromeosdevicesActionCall) Do(opts ...googleapi.CallOption) error { 6298 gensupport.SetOptions(c.urlParams_, opts...) 6299 res, err := c.doRequest("json") 6300 if err != nil { 6301 return err 6302 } 6303 defer googleapi.CloseBody(res) 6304 if err := googleapi.CheckResponse(res); err != nil { 6305 return err 6306 } 6307 return nil 6308 // { 6309 // "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).", 6310 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action", 6311 // "httpMethod": "POST", 6312 // "id": "directory.chromeosdevices.action", 6313 // "parameterOrder": [ 6314 // "customerId", 6315 // "resourceId" 6316 // ], 6317 // "parameters": { 6318 // "customerId": { 6319 // "description": "The unique ID for the customer's Google Workspace 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).", 6320 // "location": "path", 6321 // "required": true, 6322 // "type": "string" 6323 // }, 6324 // "resourceId": { 6325 // "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.", 6326 // "location": "path", 6327 // "required": true, 6328 // "type": "string" 6329 // } 6330 // }, 6331 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action", 6332 // "request": { 6333 // "$ref": "ChromeOsDeviceAction" 6334 // }, 6335 // "scopes": [ 6336 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6337 // ] 6338 // } 6339 6340} 6341 6342// method id "directory.chromeosdevices.get": 6343 6344type ChromeosdevicesGetCall struct { 6345 s *Service 6346 customerId string 6347 deviceId string 6348 urlParams_ gensupport.URLParams 6349 ifNoneMatch_ string 6350 ctx_ context.Context 6351 header_ http.Header 6352} 6353 6354// Get: Retrieves a Chrome OS device's properties. 6355// 6356// - customerId: The unique ID for the customer's Google Workspace 6357// account. As an account administrator, you can also use the 6358// `my_customer` alias to represent your account's `customerId`. The 6359// `customerId` is also returned as part of the Users resource 6360// (/admin-sdk/directory/v1/reference/users). 6361// - deviceId: The unique ID of the device. The `deviceId`s are returned 6362// in the response from the chromeosdevices.list 6363// (/admin-sdk/directory/v1/reference/chromeosdevices/list) method. 6364func (r *ChromeosdevicesService) Get(customerId string, deviceId string) *ChromeosdevicesGetCall { 6365 c := &ChromeosdevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6366 c.customerId = customerId 6367 c.deviceId = deviceId 6368 return c 6369} 6370 6371// Projection sets the optional parameter "projection": Determines 6372// whether the response contains the full list of properties or only a 6373// subset. 6374// 6375// Possible values: 6376// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 6377// serialNumber, status, and user) 6378// "FULL" - Includes all metadata fields 6379func (c *ChromeosdevicesGetCall) Projection(projection string) *ChromeosdevicesGetCall { 6380 c.urlParams_.Set("projection", projection) 6381 return c 6382} 6383 6384// Fields allows partial responses to be retrieved. See 6385// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6386// for more information. 6387func (c *ChromeosdevicesGetCall) Fields(s ...googleapi.Field) *ChromeosdevicesGetCall { 6388 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6389 return c 6390} 6391 6392// IfNoneMatch sets the optional parameter which makes the operation 6393// fail if the object's ETag matches the given value. This is useful for 6394// getting updates only after the object has changed since the last 6395// request. Use googleapi.IsNotModified to check whether the response 6396// error from Do is the result of In-None-Match. 6397func (c *ChromeosdevicesGetCall) IfNoneMatch(entityTag string) *ChromeosdevicesGetCall { 6398 c.ifNoneMatch_ = entityTag 6399 return c 6400} 6401 6402// Context sets the context to be used in this call's Do method. Any 6403// pending HTTP request will be aborted if the provided context is 6404// canceled. 6405func (c *ChromeosdevicesGetCall) Context(ctx context.Context) *ChromeosdevicesGetCall { 6406 c.ctx_ = ctx 6407 return c 6408} 6409 6410// Header returns an http.Header that can be modified by the caller to 6411// add HTTP headers to the request. 6412func (c *ChromeosdevicesGetCall) Header() http.Header { 6413 if c.header_ == nil { 6414 c.header_ = make(http.Header) 6415 } 6416 return c.header_ 6417} 6418 6419func (c *ChromeosdevicesGetCall) doRequest(alt string) (*http.Response, error) { 6420 reqHeaders := make(http.Header) 6421 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6422 for k, v := range c.header_ { 6423 reqHeaders[k] = v 6424 } 6425 reqHeaders.Set("User-Agent", c.s.userAgent()) 6426 if c.ifNoneMatch_ != "" { 6427 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6428 } 6429 var body io.Reader = nil 6430 c.urlParams_.Set("alt", alt) 6431 c.urlParams_.Set("prettyPrint", "false") 6432 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 6433 urls += "?" + c.urlParams_.Encode() 6434 req, err := http.NewRequest("GET", urls, body) 6435 if err != nil { 6436 return nil, err 6437 } 6438 req.Header = reqHeaders 6439 googleapi.Expand(req.URL, map[string]string{ 6440 "customerId": c.customerId, 6441 "deviceId": c.deviceId, 6442 }) 6443 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6444} 6445 6446// Do executes the "directory.chromeosdevices.get" call. 6447// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 6448// status code is an error. Response headers are in either 6449// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 6450// at all) in error.(*googleapi.Error).Header. Use 6451// googleapi.IsNotModified to check whether the returned error was 6452// because http.StatusNotModified was returned. 6453func (c *ChromeosdevicesGetCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 6454 gensupport.SetOptions(c.urlParams_, opts...) 6455 res, err := c.doRequest("json") 6456 if res != nil && res.StatusCode == http.StatusNotModified { 6457 if res.Body != nil { 6458 res.Body.Close() 6459 } 6460 return nil, &googleapi.Error{ 6461 Code: res.StatusCode, 6462 Header: res.Header, 6463 } 6464 } 6465 if err != nil { 6466 return nil, err 6467 } 6468 defer googleapi.CloseBody(res) 6469 if err := googleapi.CheckResponse(res); err != nil { 6470 return nil, err 6471 } 6472 ret := &ChromeOsDevice{ 6473 ServerResponse: googleapi.ServerResponse{ 6474 Header: res.Header, 6475 HTTPStatusCode: res.StatusCode, 6476 }, 6477 } 6478 target := &ret 6479 if err := gensupport.DecodeResponse(target, res); err != nil { 6480 return nil, err 6481 } 6482 return ret, nil 6483 // { 6484 // "description": "Retrieves a Chrome OS device's properties.", 6485 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6486 // "httpMethod": "GET", 6487 // "id": "directory.chromeosdevices.get", 6488 // "parameterOrder": [ 6489 // "customerId", 6490 // "deviceId" 6491 // ], 6492 // "parameters": { 6493 // "customerId": { 6494 // "description": "The unique ID for the customer's Google Workspace 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).", 6495 // "location": "path", 6496 // "required": true, 6497 // "type": "string" 6498 // }, 6499 // "deviceId": { 6500 // "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.", 6501 // "location": "path", 6502 // "required": true, 6503 // "type": "string" 6504 // }, 6505 // "projection": { 6506 // "description": "Determines whether the response contains the full list of properties or only a subset.", 6507 // "enum": [ 6508 // "BASIC", 6509 // "FULL" 6510 // ], 6511 // "enumDescriptions": [ 6512 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 6513 // "Includes all metadata fields" 6514 // ], 6515 // "location": "query", 6516 // "type": "string" 6517 // } 6518 // }, 6519 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 6520 // "response": { 6521 // "$ref": "ChromeOsDevice" 6522 // }, 6523 // "scopes": [ 6524 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 6525 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 6526 // ] 6527 // } 6528 6529} 6530 6531// method id "directory.chromeosdevices.list": 6532 6533type ChromeosdevicesListCall struct { 6534 s *Service 6535 customerId string 6536 urlParams_ gensupport.URLParams 6537 ifNoneMatch_ string 6538 ctx_ context.Context 6539 header_ http.Header 6540} 6541 6542// List: Retrieves a paginated list of Chrome OS devices within an 6543// account. 6544// 6545// - customerId: The unique ID for the customer's Google Workspace 6546// account. As an account administrator, you can also use the 6547// `my_customer` alias to represent your account's `customerId`. The 6548// `customerId` is also returned as part of the Users resource 6549// (/admin-sdk/directory/v1/reference/users). 6550func (r *ChromeosdevicesService) List(customerId string) *ChromeosdevicesListCall { 6551 c := &ChromeosdevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6552 c.customerId = customerId 6553 return c 6554} 6555 6556// IncludeChildOrgunits sets the optional parameter 6557// "includeChildOrgunits": Return devices from all child orgunits, as 6558// well as the specified org unit. If this is set to true 'orgUnitPath' 6559// must be provided. 6560func (c *ChromeosdevicesListCall) IncludeChildOrgunits(includeChildOrgunits bool) *ChromeosdevicesListCall { 6561 c.urlParams_.Set("includeChildOrgunits", fmt.Sprint(includeChildOrgunits)) 6562 return c 6563} 6564 6565// MaxResults sets the optional parameter "maxResults": Maximum number 6566// of results to return. 6567func (c *ChromeosdevicesListCall) MaxResults(maxResults int64) *ChromeosdevicesListCall { 6568 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6569 return c 6570} 6571 6572// OrderBy sets the optional parameter "orderBy": Device property to use 6573// for sorting results. 6574// 6575// Possible values: 6576// "annotatedLocation" - Chrome device location as annotated by the 6577// administrator. 6578// "annotatedUser" - Chromebook user as annotated by administrator. 6579// "lastSync" - The date and time the Chrome device was last 6580// synchronized with the policy settings in the Admin console. 6581// "notes" - Chrome device notes as annotated by the administrator. 6582// "serialNumber" - The Chrome device serial number entered when the 6583// device was enabled. 6584// "status" - Chrome device status. For more information, see the <a 6585// [chromeosdevices](/admin-sdk/directory/v1/reference/chromeosdevices.ht 6586// ml). 6587// "supportEndDate" - Chrome device support end date. This is 6588// applicable only for devices purchased directly from Google. 6589func (c *ChromeosdevicesListCall) OrderBy(orderBy string) *ChromeosdevicesListCall { 6590 c.urlParams_.Set("orderBy", orderBy) 6591 return c 6592} 6593 6594// OrgUnitPath sets the optional parameter "orgUnitPath": The full path 6595// of the organizational unit or its unique ID. 6596func (c *ChromeosdevicesListCall) OrgUnitPath(orgUnitPath string) *ChromeosdevicesListCall { 6597 c.urlParams_.Set("orgUnitPath", orgUnitPath) 6598 return c 6599} 6600 6601// PageToken sets the optional parameter "pageToken": The `pageToken` 6602// query parameter is used to request the next page of query results. 6603// The follow-on request's `pageToken` query parameter is the 6604// `nextPageToken` from your previous response. 6605func (c *ChromeosdevicesListCall) PageToken(pageToken string) *ChromeosdevicesListCall { 6606 c.urlParams_.Set("pageToken", pageToken) 6607 return c 6608} 6609 6610// Projection sets the optional parameter "projection": Restrict 6611// information returned to a set of selected fields. 6612// 6613// Possible values: 6614// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 6615// serialNumber, status, and user) 6616// "FULL" - Includes all metadata fields 6617func (c *ChromeosdevicesListCall) Projection(projection string) *ChromeosdevicesListCall { 6618 c.urlParams_.Set("projection", projection) 6619 return c 6620} 6621 6622// Query sets the optional parameter "query": Search string in the 6623// format given at 6624// http://support.google.com/chromeos/a/bin/answer.py?answer=1698333 6625func (c *ChromeosdevicesListCall) Query(query string) *ChromeosdevicesListCall { 6626 c.urlParams_.Set("query", query) 6627 return c 6628} 6629 6630// SortOrder sets the optional parameter "sortOrder": Whether to return 6631// results in ascending or descending order. Must be used with the 6632// `orderBy` parameter. 6633// 6634// Possible values: 6635// "ASCENDING" - Ascending order. 6636// "DESCENDING" - Descending order. 6637func (c *ChromeosdevicesListCall) SortOrder(sortOrder string) *ChromeosdevicesListCall { 6638 c.urlParams_.Set("sortOrder", sortOrder) 6639 return c 6640} 6641 6642// Fields allows partial responses to be retrieved. See 6643// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6644// for more information. 6645func (c *ChromeosdevicesListCall) Fields(s ...googleapi.Field) *ChromeosdevicesListCall { 6646 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6647 return c 6648} 6649 6650// IfNoneMatch sets the optional parameter which makes the operation 6651// fail if the object's ETag matches the given value. This is useful for 6652// getting updates only after the object has changed since the last 6653// request. Use googleapi.IsNotModified to check whether the response 6654// error from Do is the result of In-None-Match. 6655func (c *ChromeosdevicesListCall) IfNoneMatch(entityTag string) *ChromeosdevicesListCall { 6656 c.ifNoneMatch_ = entityTag 6657 return c 6658} 6659 6660// Context sets the context to be used in this call's Do method. Any 6661// pending HTTP request will be aborted if the provided context is 6662// canceled. 6663func (c *ChromeosdevicesListCall) Context(ctx context.Context) *ChromeosdevicesListCall { 6664 c.ctx_ = ctx 6665 return c 6666} 6667 6668// Header returns an http.Header that can be modified by the caller to 6669// add HTTP headers to the request. 6670func (c *ChromeosdevicesListCall) Header() http.Header { 6671 if c.header_ == nil { 6672 c.header_ = make(http.Header) 6673 } 6674 return c.header_ 6675} 6676 6677func (c *ChromeosdevicesListCall) doRequest(alt string) (*http.Response, error) { 6678 reqHeaders := make(http.Header) 6679 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6680 for k, v := range c.header_ { 6681 reqHeaders[k] = v 6682 } 6683 reqHeaders.Set("User-Agent", c.s.userAgent()) 6684 if c.ifNoneMatch_ != "" { 6685 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6686 } 6687 var body io.Reader = nil 6688 c.urlParams_.Set("alt", alt) 6689 c.urlParams_.Set("prettyPrint", "false") 6690 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos") 6691 urls += "?" + c.urlParams_.Encode() 6692 req, err := http.NewRequest("GET", urls, body) 6693 if err != nil { 6694 return nil, err 6695 } 6696 req.Header = reqHeaders 6697 googleapi.Expand(req.URL, map[string]string{ 6698 "customerId": c.customerId, 6699 }) 6700 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6701} 6702 6703// Do executes the "directory.chromeosdevices.list" call. 6704// Exactly one of *ChromeOsDevices or error will be non-nil. Any non-2xx 6705// status code is an error. Response headers are in either 6706// *ChromeOsDevices.ServerResponse.Header or (if a response was returned 6707// at all) in error.(*googleapi.Error).Header. Use 6708// googleapi.IsNotModified to check whether the returned error was 6709// because http.StatusNotModified was returned. 6710func (c *ChromeosdevicesListCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevices, error) { 6711 gensupport.SetOptions(c.urlParams_, opts...) 6712 res, err := c.doRequest("json") 6713 if res != nil && res.StatusCode == http.StatusNotModified { 6714 if res.Body != nil { 6715 res.Body.Close() 6716 } 6717 return nil, &googleapi.Error{ 6718 Code: res.StatusCode, 6719 Header: res.Header, 6720 } 6721 } 6722 if err != nil { 6723 return nil, err 6724 } 6725 defer googleapi.CloseBody(res) 6726 if err := googleapi.CheckResponse(res); err != nil { 6727 return nil, err 6728 } 6729 ret := &ChromeOsDevices{ 6730 ServerResponse: googleapi.ServerResponse{ 6731 Header: res.Header, 6732 HTTPStatusCode: res.StatusCode, 6733 }, 6734 } 6735 target := &ret 6736 if err := gensupport.DecodeResponse(target, res); err != nil { 6737 return nil, err 6738 } 6739 return ret, nil 6740 // { 6741 // "description": "Retrieves a paginated list of Chrome OS devices within an account.", 6742 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos", 6743 // "httpMethod": "GET", 6744 // "id": "directory.chromeosdevices.list", 6745 // "parameterOrder": [ 6746 // "customerId" 6747 // ], 6748 // "parameters": { 6749 // "customerId": { 6750 // "description": "The unique ID for the customer's Google Workspace 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).", 6751 // "location": "path", 6752 // "required": true, 6753 // "type": "string" 6754 // }, 6755 // "includeChildOrgunits": { 6756 // "description": "Return devices from all child orgunits, as well as the specified org unit. If this is set to true 'orgUnitPath' must be provided.", 6757 // "location": "query", 6758 // "type": "boolean" 6759 // }, 6760 // "maxResults": { 6761 // "default": "100", 6762 // "description": "Maximum number of results to return.", 6763 // "format": "int32", 6764 // "location": "query", 6765 // "minimum": "1", 6766 // "type": "integer" 6767 // }, 6768 // "orderBy": { 6769 // "description": "Device property to use for sorting results.", 6770 // "enum": [ 6771 // "annotatedLocation", 6772 // "annotatedUser", 6773 // "lastSync", 6774 // "notes", 6775 // "serialNumber", 6776 // "status", 6777 // "supportEndDate" 6778 // ], 6779 // "enumDescriptions": [ 6780 // "Chrome device location as annotated by the administrator.", 6781 // "Chromebook user as annotated by administrator.", 6782 // "The date and time the Chrome device was last synchronized with the policy settings in the Admin console.", 6783 // "Chrome device notes as annotated by the administrator.", 6784 // "The Chrome device serial number entered when the device was enabled.", 6785 // "Chrome device status. For more information, see the \u003ca [chromeosdevices](/admin-sdk/directory/v1/reference/chromeosdevices.html).", 6786 // "Chrome device support end date. This is applicable only for devices purchased directly from Google." 6787 // ], 6788 // "location": "query", 6789 // "type": "string" 6790 // }, 6791 // "orgUnitPath": { 6792 // "description": "The full path of the organizational unit or its unique ID.", 6793 // "location": "query", 6794 // "type": "string" 6795 // }, 6796 // "pageToken": { 6797 // "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.", 6798 // "location": "query", 6799 // "type": "string" 6800 // }, 6801 // "projection": { 6802 // "description": "Restrict information returned to a set of selected fields.", 6803 // "enum": [ 6804 // "BASIC", 6805 // "FULL" 6806 // ], 6807 // "enumDescriptions": [ 6808 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 6809 // "Includes all metadata fields" 6810 // ], 6811 // "location": "query", 6812 // "type": "string" 6813 // }, 6814 // "query": { 6815 // "description": "Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?answer=1698333", 6816 // "location": "query", 6817 // "type": "string" 6818 // }, 6819 // "sortOrder": { 6820 // "description": "Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter.", 6821 // "enum": [ 6822 // "ASCENDING", 6823 // "DESCENDING" 6824 // ], 6825 // "enumDescriptions": [ 6826 // "Ascending order.", 6827 // "Descending order." 6828 // ], 6829 // "location": "query", 6830 // "type": "string" 6831 // } 6832 // }, 6833 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos", 6834 // "response": { 6835 // "$ref": "ChromeOsDevices" 6836 // }, 6837 // "scopes": [ 6838 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 6839 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 6840 // ] 6841 // } 6842 6843} 6844 6845// Pages invokes f for each page of results. 6846// A non-nil error returned from f will halt the iteration. 6847// The provided context supersedes any context provided to the Context method. 6848func (c *ChromeosdevicesListCall) Pages(ctx context.Context, f func(*ChromeOsDevices) error) error { 6849 c.ctx_ = ctx 6850 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6851 for { 6852 x, err := c.Do() 6853 if err != nil { 6854 return err 6855 } 6856 if err := f(x); err != nil { 6857 return err 6858 } 6859 if x.NextPageToken == "" { 6860 return nil 6861 } 6862 c.PageToken(x.NextPageToken) 6863 } 6864} 6865 6866// method id "directory.chromeosdevices.moveDevicesToOu": 6867 6868type ChromeosdevicesMoveDevicesToOuCall struct { 6869 s *Service 6870 customerId string 6871 chromeosmovedevicestoou *ChromeOsMoveDevicesToOu 6872 urlParams_ gensupport.URLParams 6873 ctx_ context.Context 6874 header_ http.Header 6875} 6876 6877// MoveDevicesToOu: Moves or inserts multiple Chrome OS devices to an 6878// organizational unit. You can move up to 50 devices at once. 6879// 6880// - customerId: Immutable ID of the Google Workspace account. 6881// - orgUnitPath: Full path of the target organizational unit or its ID. 6882func (r *ChromeosdevicesService) MoveDevicesToOu(customerId string, orgUnitPath string, chromeosmovedevicestoou *ChromeOsMoveDevicesToOu) *ChromeosdevicesMoveDevicesToOuCall { 6883 c := &ChromeosdevicesMoveDevicesToOuCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6884 c.customerId = customerId 6885 c.urlParams_.Set("orgUnitPath", orgUnitPath) 6886 c.chromeosmovedevicestoou = chromeosmovedevicestoou 6887 return c 6888} 6889 6890// Fields allows partial responses to be retrieved. See 6891// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6892// for more information. 6893func (c *ChromeosdevicesMoveDevicesToOuCall) Fields(s ...googleapi.Field) *ChromeosdevicesMoveDevicesToOuCall { 6894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6895 return c 6896} 6897 6898// Context sets the context to be used in this call's Do method. Any 6899// pending HTTP request will be aborted if the provided context is 6900// canceled. 6901func (c *ChromeosdevicesMoveDevicesToOuCall) Context(ctx context.Context) *ChromeosdevicesMoveDevicesToOuCall { 6902 c.ctx_ = ctx 6903 return c 6904} 6905 6906// Header returns an http.Header that can be modified by the caller to 6907// add HTTP headers to the request. 6908func (c *ChromeosdevicesMoveDevicesToOuCall) Header() http.Header { 6909 if c.header_ == nil { 6910 c.header_ = make(http.Header) 6911 } 6912 return c.header_ 6913} 6914 6915func (c *ChromeosdevicesMoveDevicesToOuCall) doRequest(alt string) (*http.Response, error) { 6916 reqHeaders := make(http.Header) 6917 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6918 for k, v := range c.header_ { 6919 reqHeaders[k] = v 6920 } 6921 reqHeaders.Set("User-Agent", c.s.userAgent()) 6922 var body io.Reader = nil 6923 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosmovedevicestoou) 6924 if err != nil { 6925 return nil, err 6926 } 6927 reqHeaders.Set("Content-Type", "application/json") 6928 c.urlParams_.Set("alt", alt) 6929 c.urlParams_.Set("prettyPrint", "false") 6930 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu") 6931 urls += "?" + c.urlParams_.Encode() 6932 req, err := http.NewRequest("POST", urls, body) 6933 if err != nil { 6934 return nil, err 6935 } 6936 req.Header = reqHeaders 6937 googleapi.Expand(req.URL, map[string]string{ 6938 "customerId": c.customerId, 6939 }) 6940 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6941} 6942 6943// Do executes the "directory.chromeosdevices.moveDevicesToOu" call. 6944func (c *ChromeosdevicesMoveDevicesToOuCall) Do(opts ...googleapi.CallOption) error { 6945 gensupport.SetOptions(c.urlParams_, opts...) 6946 res, err := c.doRequest("json") 6947 if err != nil { 6948 return err 6949 } 6950 defer googleapi.CloseBody(res) 6951 if err := googleapi.CheckResponse(res); err != nil { 6952 return err 6953 } 6954 return nil 6955 // { 6956 // "description": "Moves or inserts multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.", 6957 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu", 6958 // "httpMethod": "POST", 6959 // "id": "directory.chromeosdevices.moveDevicesToOu", 6960 // "parameterOrder": [ 6961 // "customerId", 6962 // "orgUnitPath" 6963 // ], 6964 // "parameters": { 6965 // "customerId": { 6966 // "description": "Immutable ID of the Google Workspace account", 6967 // "location": "path", 6968 // "required": true, 6969 // "type": "string" 6970 // }, 6971 // "orgUnitPath": { 6972 // "description": "Full path of the target organizational unit or its ID", 6973 // "location": "query", 6974 // "required": true, 6975 // "type": "string" 6976 // } 6977 // }, 6978 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu", 6979 // "request": { 6980 // "$ref": "ChromeOsMoveDevicesToOu" 6981 // }, 6982 // "scopes": [ 6983 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 6984 // ] 6985 // } 6986 6987} 6988 6989// method id "directory.chromeosdevices.patch": 6990 6991type ChromeosdevicesPatchCall struct { 6992 s *Service 6993 customerId string 6994 deviceId string 6995 chromeosdevice *ChromeOsDevice 6996 urlParams_ gensupport.URLParams 6997 ctx_ context.Context 6998 header_ http.Header 6999} 7000 7001// Patch: Updates a device's updatable properties, such as 7002// `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or 7003// `annotatedAssetId`. This method supports patch semantics 7004// (/admin-sdk/directory/v1/guides/performance#patch). 7005// 7006// - customerId: The unique ID for the customer's Google Workspace 7007// account. As an account administrator, you can also use the 7008// `my_customer` alias to represent your account's `customerId`. The 7009// `customerId` is also returned as part of the Users resource 7010// (/admin-sdk/directory/v1/reference/users). 7011// - deviceId: The unique ID of the device. The `deviceId`s are returned 7012// in the response from the chromeosdevices.list 7013// (/admin-sdk/v1/reference/chromeosdevices/list) method. 7014func (r *ChromeosdevicesService) Patch(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesPatchCall { 7015 c := &ChromeosdevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7016 c.customerId = customerId 7017 c.deviceId = deviceId 7018 c.chromeosdevice = chromeosdevice 7019 return c 7020} 7021 7022// Projection sets the optional parameter "projection": Restrict 7023// information returned to a set of selected fields. 7024// 7025// Possible values: 7026// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 7027// serialNumber, status, and user) 7028// "FULL" - Includes all metadata fields 7029func (c *ChromeosdevicesPatchCall) Projection(projection string) *ChromeosdevicesPatchCall { 7030 c.urlParams_.Set("projection", projection) 7031 return c 7032} 7033 7034// Fields allows partial responses to be retrieved. See 7035// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7036// for more information. 7037func (c *ChromeosdevicesPatchCall) Fields(s ...googleapi.Field) *ChromeosdevicesPatchCall { 7038 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7039 return c 7040} 7041 7042// Context sets the context to be used in this call's Do method. Any 7043// pending HTTP request will be aborted if the provided context is 7044// canceled. 7045func (c *ChromeosdevicesPatchCall) Context(ctx context.Context) *ChromeosdevicesPatchCall { 7046 c.ctx_ = ctx 7047 return c 7048} 7049 7050// Header returns an http.Header that can be modified by the caller to 7051// add HTTP headers to the request. 7052func (c *ChromeosdevicesPatchCall) Header() http.Header { 7053 if c.header_ == nil { 7054 c.header_ = make(http.Header) 7055 } 7056 return c.header_ 7057} 7058 7059func (c *ChromeosdevicesPatchCall) doRequest(alt string) (*http.Response, error) { 7060 reqHeaders := make(http.Header) 7061 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7062 for k, v := range c.header_ { 7063 reqHeaders[k] = v 7064 } 7065 reqHeaders.Set("User-Agent", c.s.userAgent()) 7066 var body io.Reader = nil 7067 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) 7068 if err != nil { 7069 return nil, err 7070 } 7071 reqHeaders.Set("Content-Type", "application/json") 7072 c.urlParams_.Set("alt", alt) 7073 c.urlParams_.Set("prettyPrint", "false") 7074 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 7075 urls += "?" + c.urlParams_.Encode() 7076 req, err := http.NewRequest("PATCH", urls, body) 7077 if err != nil { 7078 return nil, err 7079 } 7080 req.Header = reqHeaders 7081 googleapi.Expand(req.URL, map[string]string{ 7082 "customerId": c.customerId, 7083 "deviceId": c.deviceId, 7084 }) 7085 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7086} 7087 7088// Do executes the "directory.chromeosdevices.patch" call. 7089// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 7090// status code is an error. Response headers are in either 7091// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 7092// at all) in error.(*googleapi.Error).Header. Use 7093// googleapi.IsNotModified to check whether the returned error was 7094// because http.StatusNotModified was returned. 7095func (c *ChromeosdevicesPatchCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 7096 gensupport.SetOptions(c.urlParams_, opts...) 7097 res, err := c.doRequest("json") 7098 if res != nil && res.StatusCode == http.StatusNotModified { 7099 if res.Body != nil { 7100 res.Body.Close() 7101 } 7102 return nil, &googleapi.Error{ 7103 Code: res.StatusCode, 7104 Header: res.Header, 7105 } 7106 } 7107 if err != nil { 7108 return nil, err 7109 } 7110 defer googleapi.CloseBody(res) 7111 if err := googleapi.CheckResponse(res); err != nil { 7112 return nil, err 7113 } 7114 ret := &ChromeOsDevice{ 7115 ServerResponse: googleapi.ServerResponse{ 7116 Header: res.Header, 7117 HTTPStatusCode: res.StatusCode, 7118 }, 7119 } 7120 target := &ret 7121 if err := gensupport.DecodeResponse(target, res); err != nil { 7122 return nil, err 7123 } 7124 return ret, nil 7125 // { 7126 // "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).", 7127 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 7128 // "httpMethod": "PATCH", 7129 // "id": "directory.chromeosdevices.patch", 7130 // "parameterOrder": [ 7131 // "customerId", 7132 // "deviceId" 7133 // ], 7134 // "parameters": { 7135 // "customerId": { 7136 // "description": "The unique ID for the customer's Google Workspace 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).", 7137 // "location": "path", 7138 // "required": true, 7139 // "type": "string" 7140 // }, 7141 // "deviceId": { 7142 // "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.", 7143 // "location": "path", 7144 // "required": true, 7145 // "type": "string" 7146 // }, 7147 // "projection": { 7148 // "description": "Restrict information returned to a set of selected fields.", 7149 // "enum": [ 7150 // "BASIC", 7151 // "FULL" 7152 // ], 7153 // "enumDescriptions": [ 7154 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 7155 // "Includes all metadata fields" 7156 // ], 7157 // "location": "query", 7158 // "type": "string" 7159 // } 7160 // }, 7161 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 7162 // "request": { 7163 // "$ref": "ChromeOsDevice" 7164 // }, 7165 // "response": { 7166 // "$ref": "ChromeOsDevice" 7167 // }, 7168 // "scopes": [ 7169 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 7170 // ] 7171 // } 7172 7173} 7174 7175// method id "directory.chromeosdevices.update": 7176 7177type ChromeosdevicesUpdateCall struct { 7178 s *Service 7179 customerId string 7180 deviceId string 7181 chromeosdevice *ChromeOsDevice 7182 urlParams_ gensupport.URLParams 7183 ctx_ context.Context 7184 header_ http.Header 7185} 7186 7187// Update: Updates a device's updatable properties, such as 7188// `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or 7189// `annotatedAssetId`. 7190// 7191// - customerId: The unique ID for the customer's Google Workspace 7192// account. As an account administrator, you can also use the 7193// `my_customer` alias to represent your account's `customerId`. The 7194// `customerId` is also returned as part of the Users resource 7195// (/admin-sdk/directory/v1/reference/users). 7196// - deviceId: The unique ID of the device. The `deviceId`s are returned 7197// in the response from the chromeosdevices.list 7198// (/admin-sdk/v1/reference/chromeosdevices/list) method. 7199func (r *ChromeosdevicesService) Update(customerId string, deviceId string, chromeosdevice *ChromeOsDevice) *ChromeosdevicesUpdateCall { 7200 c := &ChromeosdevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7201 c.customerId = customerId 7202 c.deviceId = deviceId 7203 c.chromeosdevice = chromeosdevice 7204 return c 7205} 7206 7207// Projection sets the optional parameter "projection": Restrict 7208// information returned to a set of selected fields. 7209// 7210// Possible values: 7211// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 7212// serialNumber, status, and user) 7213// "FULL" - Includes all metadata fields 7214func (c *ChromeosdevicesUpdateCall) Projection(projection string) *ChromeosdevicesUpdateCall { 7215 c.urlParams_.Set("projection", projection) 7216 return c 7217} 7218 7219// Fields allows partial responses to be retrieved. See 7220// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7221// for more information. 7222func (c *ChromeosdevicesUpdateCall) Fields(s ...googleapi.Field) *ChromeosdevicesUpdateCall { 7223 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7224 return c 7225} 7226 7227// Context sets the context to be used in this call's Do method. Any 7228// pending HTTP request will be aborted if the provided context is 7229// canceled. 7230func (c *ChromeosdevicesUpdateCall) Context(ctx context.Context) *ChromeosdevicesUpdateCall { 7231 c.ctx_ = ctx 7232 return c 7233} 7234 7235// Header returns an http.Header that can be modified by the caller to 7236// add HTTP headers to the request. 7237func (c *ChromeosdevicesUpdateCall) Header() http.Header { 7238 if c.header_ == nil { 7239 c.header_ = make(http.Header) 7240 } 7241 return c.header_ 7242} 7243 7244func (c *ChromeosdevicesUpdateCall) doRequest(alt string) (*http.Response, error) { 7245 reqHeaders := make(http.Header) 7246 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7247 for k, v := range c.header_ { 7248 reqHeaders[k] = v 7249 } 7250 reqHeaders.Set("User-Agent", c.s.userAgent()) 7251 var body io.Reader = nil 7252 body, err := googleapi.WithoutDataWrapper.JSONReader(c.chromeosdevice) 7253 if err != nil { 7254 return nil, err 7255 } 7256 reqHeaders.Set("Content-Type", "application/json") 7257 c.urlParams_.Set("alt", alt) 7258 c.urlParams_.Set("prettyPrint", "false") 7259 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}") 7260 urls += "?" + c.urlParams_.Encode() 7261 req, err := http.NewRequest("PUT", urls, body) 7262 if err != nil { 7263 return nil, err 7264 } 7265 req.Header = reqHeaders 7266 googleapi.Expand(req.URL, map[string]string{ 7267 "customerId": c.customerId, 7268 "deviceId": c.deviceId, 7269 }) 7270 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7271} 7272 7273// Do executes the "directory.chromeosdevices.update" call. 7274// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx 7275// status code is an error. Response headers are in either 7276// *ChromeOsDevice.ServerResponse.Header or (if a response was returned 7277// at all) in error.(*googleapi.Error).Header. Use 7278// googleapi.IsNotModified to check whether the returned error was 7279// because http.StatusNotModified was returned. 7280func (c *ChromeosdevicesUpdateCall) Do(opts ...googleapi.CallOption) (*ChromeOsDevice, error) { 7281 gensupport.SetOptions(c.urlParams_, opts...) 7282 res, err := c.doRequest("json") 7283 if res != nil && res.StatusCode == http.StatusNotModified { 7284 if res.Body != nil { 7285 res.Body.Close() 7286 } 7287 return nil, &googleapi.Error{ 7288 Code: res.StatusCode, 7289 Header: res.Header, 7290 } 7291 } 7292 if err != nil { 7293 return nil, err 7294 } 7295 defer googleapi.CloseBody(res) 7296 if err := googleapi.CheckResponse(res); err != nil { 7297 return nil, err 7298 } 7299 ret := &ChromeOsDevice{ 7300 ServerResponse: googleapi.ServerResponse{ 7301 Header: res.Header, 7302 HTTPStatusCode: res.StatusCode, 7303 }, 7304 } 7305 target := &ret 7306 if err := gensupport.DecodeResponse(target, res); err != nil { 7307 return nil, err 7308 } 7309 return ret, nil 7310 // { 7311 // "description": "Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.", 7312 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 7313 // "httpMethod": "PUT", 7314 // "id": "directory.chromeosdevices.update", 7315 // "parameterOrder": [ 7316 // "customerId", 7317 // "deviceId" 7318 // ], 7319 // "parameters": { 7320 // "customerId": { 7321 // "description": "The unique ID for the customer's Google Workspace 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).", 7322 // "location": "path", 7323 // "required": true, 7324 // "type": "string" 7325 // }, 7326 // "deviceId": { 7327 // "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.", 7328 // "location": "path", 7329 // "required": true, 7330 // "type": "string" 7331 // }, 7332 // "projection": { 7333 // "description": "Restrict information returned to a set of selected fields.", 7334 // "enum": [ 7335 // "BASIC", 7336 // "FULL" 7337 // ], 7338 // "enumDescriptions": [ 7339 // "Includes only the basic metadata fields (e.g., deviceId, serialNumber, status, and user)", 7340 // "Includes all metadata fields" 7341 // ], 7342 // "location": "query", 7343 // "type": "string" 7344 // } 7345 // }, 7346 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}", 7347 // "request": { 7348 // "$ref": "ChromeOsDevice" 7349 // }, 7350 // "response": { 7351 // "$ref": "ChromeOsDevice" 7352 // }, 7353 // "scopes": [ 7354 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 7355 // ] 7356 // } 7357 7358} 7359 7360// method id "admin.customer.devices.chromeos.issueCommand": 7361 7362type CustomerDevicesChromeosIssueCommandCall struct { 7363 s *Service 7364 customerId string 7365 deviceId string 7366 directorychromeosdevicesissuecommandrequest *DirectoryChromeosdevicesIssueCommandRequest 7367 urlParams_ gensupport.URLParams 7368 ctx_ context.Context 7369 header_ http.Header 7370} 7371 7372// IssueCommand: Issues a command for the device to execute. 7373// 7374// - customerId: Immutable. Immutable ID of the Google Workspace 7375// account. 7376// - deviceId: Immutable. Immutable ID of Chrome OS Device. 7377func (r *CustomerDevicesChromeosService) IssueCommand(customerId string, deviceId string, directorychromeosdevicesissuecommandrequest *DirectoryChromeosdevicesIssueCommandRequest) *CustomerDevicesChromeosIssueCommandCall { 7378 c := &CustomerDevicesChromeosIssueCommandCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7379 c.customerId = customerId 7380 c.deviceId = deviceId 7381 c.directorychromeosdevicesissuecommandrequest = directorychromeosdevicesissuecommandrequest 7382 return c 7383} 7384 7385// Fields allows partial responses to be retrieved. See 7386// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7387// for more information. 7388func (c *CustomerDevicesChromeosIssueCommandCall) Fields(s ...googleapi.Field) *CustomerDevicesChromeosIssueCommandCall { 7389 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7390 return c 7391} 7392 7393// Context sets the context to be used in this call's Do method. Any 7394// pending HTTP request will be aborted if the provided context is 7395// canceled. 7396func (c *CustomerDevicesChromeosIssueCommandCall) Context(ctx context.Context) *CustomerDevicesChromeosIssueCommandCall { 7397 c.ctx_ = ctx 7398 return c 7399} 7400 7401// Header returns an http.Header that can be modified by the caller to 7402// add HTTP headers to the request. 7403func (c *CustomerDevicesChromeosIssueCommandCall) Header() http.Header { 7404 if c.header_ == nil { 7405 c.header_ = make(http.Header) 7406 } 7407 return c.header_ 7408} 7409 7410func (c *CustomerDevicesChromeosIssueCommandCall) doRequest(alt string) (*http.Response, error) { 7411 reqHeaders := make(http.Header) 7412 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7413 for k, v := range c.header_ { 7414 reqHeaders[k] = v 7415 } 7416 reqHeaders.Set("User-Agent", c.s.userAgent()) 7417 var body io.Reader = nil 7418 body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorychromeosdevicesissuecommandrequest) 7419 if err != nil { 7420 return nil, err 7421 } 7422 reqHeaders.Set("Content-Type", "application/json") 7423 c.urlParams_.Set("alt", alt) 7424 c.urlParams_.Set("prettyPrint", "false") 7425 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand") 7426 urls += "?" + c.urlParams_.Encode() 7427 req, err := http.NewRequest("POST", urls, body) 7428 if err != nil { 7429 return nil, err 7430 } 7431 req.Header = reqHeaders 7432 googleapi.Expand(req.URL, map[string]string{ 7433 "customerId": c.customerId, 7434 "deviceId": c.deviceId, 7435 }) 7436 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7437} 7438 7439// Do executes the "admin.customer.devices.chromeos.issueCommand" call. 7440// Exactly one of *DirectoryChromeosdevicesIssueCommandResponse or error 7441// will be non-nil. Any non-2xx status code is an error. Response 7442// headers are in either 7443// *DirectoryChromeosdevicesIssueCommandResponse.ServerResponse.Header 7444// or (if a response was returned at all) in 7445// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7446// whether the returned error was because http.StatusNotModified was 7447// returned. 7448func (c *CustomerDevicesChromeosIssueCommandCall) Do(opts ...googleapi.CallOption) (*DirectoryChromeosdevicesIssueCommandResponse, error) { 7449 gensupport.SetOptions(c.urlParams_, opts...) 7450 res, err := c.doRequest("json") 7451 if res != nil && res.StatusCode == http.StatusNotModified { 7452 if res.Body != nil { 7453 res.Body.Close() 7454 } 7455 return nil, &googleapi.Error{ 7456 Code: res.StatusCode, 7457 Header: res.Header, 7458 } 7459 } 7460 if err != nil { 7461 return nil, err 7462 } 7463 defer googleapi.CloseBody(res) 7464 if err := googleapi.CheckResponse(res); err != nil { 7465 return nil, err 7466 } 7467 ret := &DirectoryChromeosdevicesIssueCommandResponse{ 7468 ServerResponse: googleapi.ServerResponse{ 7469 Header: res.Header, 7470 HTTPStatusCode: res.StatusCode, 7471 }, 7472 } 7473 target := &ret 7474 if err := gensupport.DecodeResponse(target, res); err != nil { 7475 return nil, err 7476 } 7477 return ret, nil 7478 // { 7479 // "description": "Issues a command for the device to execute.", 7480 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand", 7481 // "httpMethod": "POST", 7482 // "id": "admin.customer.devices.chromeos.issueCommand", 7483 // "parameterOrder": [ 7484 // "customerId", 7485 // "deviceId" 7486 // ], 7487 // "parameters": { 7488 // "customerId": { 7489 // "description": "Immutable. Immutable ID of the Google Workspace account.", 7490 // "location": "path", 7491 // "required": true, 7492 // "type": "string" 7493 // }, 7494 // "deviceId": { 7495 // "description": "Immutable. Immutable ID of Chrome OS Device.", 7496 // "location": "path", 7497 // "required": true, 7498 // "type": "string" 7499 // } 7500 // }, 7501 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand", 7502 // "request": { 7503 // "$ref": "DirectoryChromeosdevicesIssueCommandRequest" 7504 // }, 7505 // "response": { 7506 // "$ref": "DirectoryChromeosdevicesIssueCommandResponse" 7507 // }, 7508 // "scopes": [ 7509 // "https://www.googleapis.com/auth/admin.directory.device.chromeos" 7510 // ] 7511 // } 7512 7513} 7514 7515// method id "admin.customer.devices.chromeos.commands.get": 7516 7517type CustomerDevicesChromeosCommandsGetCall struct { 7518 s *Service 7519 customerId string 7520 deviceId string 7521 commandId int64 7522 urlParams_ gensupport.URLParams 7523 ifNoneMatch_ string 7524 ctx_ context.Context 7525 header_ http.Header 7526} 7527 7528// Get: Gets command data a specific command issued to the device. 7529// 7530// - commandId: Immutable. Immutable ID of Chrome OS Device Command. 7531// - customerId: Immutable. Immutable ID of the Google Workspace 7532// account. 7533// - deviceId: Immutable. Immutable ID of Chrome OS Device. 7534func (r *CustomerDevicesChromeosCommandsService) Get(customerId string, deviceId string, commandId int64) *CustomerDevicesChromeosCommandsGetCall { 7535 c := &CustomerDevicesChromeosCommandsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7536 c.customerId = customerId 7537 c.deviceId = deviceId 7538 c.commandId = commandId 7539 return c 7540} 7541 7542// Fields allows partial responses to be retrieved. See 7543// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7544// for more information. 7545func (c *CustomerDevicesChromeosCommandsGetCall) Fields(s ...googleapi.Field) *CustomerDevicesChromeosCommandsGetCall { 7546 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7547 return c 7548} 7549 7550// IfNoneMatch sets the optional parameter which makes the operation 7551// fail if the object's ETag matches the given value. This is useful for 7552// getting updates only after the object has changed since the last 7553// request. Use googleapi.IsNotModified to check whether the response 7554// error from Do is the result of In-None-Match. 7555func (c *CustomerDevicesChromeosCommandsGetCall) IfNoneMatch(entityTag string) *CustomerDevicesChromeosCommandsGetCall { 7556 c.ifNoneMatch_ = entityTag 7557 return c 7558} 7559 7560// Context sets the context to be used in this call's Do method. Any 7561// pending HTTP request will be aborted if the provided context is 7562// canceled. 7563func (c *CustomerDevicesChromeosCommandsGetCall) Context(ctx context.Context) *CustomerDevicesChromeosCommandsGetCall { 7564 c.ctx_ = ctx 7565 return c 7566} 7567 7568// Header returns an http.Header that can be modified by the caller to 7569// add HTTP headers to the request. 7570func (c *CustomerDevicesChromeosCommandsGetCall) Header() http.Header { 7571 if c.header_ == nil { 7572 c.header_ = make(http.Header) 7573 } 7574 return c.header_ 7575} 7576 7577func (c *CustomerDevicesChromeosCommandsGetCall) doRequest(alt string) (*http.Response, error) { 7578 reqHeaders := make(http.Header) 7579 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7580 for k, v := range c.header_ { 7581 reqHeaders[k] = v 7582 } 7583 reqHeaders.Set("User-Agent", c.s.userAgent()) 7584 if c.ifNoneMatch_ != "" { 7585 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7586 } 7587 var body io.Reader = nil 7588 c.urlParams_.Set("alt", alt) 7589 c.urlParams_.Set("prettyPrint", "false") 7590 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}") 7591 urls += "?" + c.urlParams_.Encode() 7592 req, err := http.NewRequest("GET", urls, body) 7593 if err != nil { 7594 return nil, err 7595 } 7596 req.Header = reqHeaders 7597 googleapi.Expand(req.URL, map[string]string{ 7598 "customerId": c.customerId, 7599 "deviceId": c.deviceId, 7600 "commandId": strconv.FormatInt(c.commandId, 10), 7601 }) 7602 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7603} 7604 7605// Do executes the "admin.customer.devices.chromeos.commands.get" call. 7606// Exactly one of *DirectoryChromeosdevicesCommand or error will be 7607// non-nil. Any non-2xx status code is an error. Response headers are in 7608// either *DirectoryChromeosdevicesCommand.ServerResponse.Header or (if 7609// a response was returned at all) in error.(*googleapi.Error).Header. 7610// Use googleapi.IsNotModified to check whether the returned error was 7611// because http.StatusNotModified was returned. 7612func (c *CustomerDevicesChromeosCommandsGetCall) Do(opts ...googleapi.CallOption) (*DirectoryChromeosdevicesCommand, error) { 7613 gensupport.SetOptions(c.urlParams_, opts...) 7614 res, err := c.doRequest("json") 7615 if res != nil && res.StatusCode == http.StatusNotModified { 7616 if res.Body != nil { 7617 res.Body.Close() 7618 } 7619 return nil, &googleapi.Error{ 7620 Code: res.StatusCode, 7621 Header: res.Header, 7622 } 7623 } 7624 if err != nil { 7625 return nil, err 7626 } 7627 defer googleapi.CloseBody(res) 7628 if err := googleapi.CheckResponse(res); err != nil { 7629 return nil, err 7630 } 7631 ret := &DirectoryChromeosdevicesCommand{ 7632 ServerResponse: googleapi.ServerResponse{ 7633 Header: res.Header, 7634 HTTPStatusCode: res.StatusCode, 7635 }, 7636 } 7637 target := &ret 7638 if err := gensupport.DecodeResponse(target, res); err != nil { 7639 return nil, err 7640 } 7641 return ret, nil 7642 // { 7643 // "description": "Gets command data a specific command issued to the device.", 7644 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}", 7645 // "httpMethod": "GET", 7646 // "id": "admin.customer.devices.chromeos.commands.get", 7647 // "parameterOrder": [ 7648 // "customerId", 7649 // "deviceId", 7650 // "commandId" 7651 // ], 7652 // "parameters": { 7653 // "commandId": { 7654 // "description": "Immutable. Immutable ID of Chrome OS Device Command.", 7655 // "format": "int64", 7656 // "location": "path", 7657 // "required": true, 7658 // "type": "string" 7659 // }, 7660 // "customerId": { 7661 // "description": "Immutable. Immutable ID of the Google Workspace account.", 7662 // "location": "path", 7663 // "required": true, 7664 // "type": "string" 7665 // }, 7666 // "deviceId": { 7667 // "description": "Immutable. Immutable ID of Chrome OS Device.", 7668 // "location": "path", 7669 // "required": true, 7670 // "type": "string" 7671 // } 7672 // }, 7673 // "path": "admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}", 7674 // "response": { 7675 // "$ref": "DirectoryChromeosdevicesCommand" 7676 // }, 7677 // "scopes": [ 7678 // "https://www.googleapis.com/auth/admin.directory.device.chromeos", 7679 // "https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly" 7680 // ] 7681 // } 7682 7683} 7684 7685// method id "directory.customers.get": 7686 7687type CustomersGetCall struct { 7688 s *Service 7689 customerKey string 7690 urlParams_ gensupport.URLParams 7691 ifNoneMatch_ string 7692 ctx_ context.Context 7693 header_ http.Header 7694} 7695 7696// Get: Retrieves a customer. 7697// 7698// - customerKey: Id of the customer to be retrieved. 7699func (r *CustomersService) Get(customerKey string) *CustomersGetCall { 7700 c := &CustomersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7701 c.customerKey = customerKey 7702 return c 7703} 7704 7705// Fields allows partial responses to be retrieved. See 7706// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7707// for more information. 7708func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall { 7709 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7710 return c 7711} 7712 7713// IfNoneMatch sets the optional parameter which makes the operation 7714// fail if the object's ETag matches the given value. This is useful for 7715// getting updates only after the object has changed since the last 7716// request. Use googleapi.IsNotModified to check whether the response 7717// error from Do is the result of In-None-Match. 7718func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall { 7719 c.ifNoneMatch_ = entityTag 7720 return c 7721} 7722 7723// Context sets the context to be used in this call's Do method. Any 7724// pending HTTP request will be aborted if the provided context is 7725// canceled. 7726func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall { 7727 c.ctx_ = ctx 7728 return c 7729} 7730 7731// Header returns an http.Header that can be modified by the caller to 7732// add HTTP headers to the request. 7733func (c *CustomersGetCall) Header() http.Header { 7734 if c.header_ == nil { 7735 c.header_ = make(http.Header) 7736 } 7737 return c.header_ 7738} 7739 7740func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { 7741 reqHeaders := make(http.Header) 7742 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7743 for k, v := range c.header_ { 7744 reqHeaders[k] = v 7745 } 7746 reqHeaders.Set("User-Agent", c.s.userAgent()) 7747 if c.ifNoneMatch_ != "" { 7748 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7749 } 7750 var body io.Reader = nil 7751 c.urlParams_.Set("alt", alt) 7752 c.urlParams_.Set("prettyPrint", "false") 7753 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 7754 urls += "?" + c.urlParams_.Encode() 7755 req, err := http.NewRequest("GET", urls, body) 7756 if err != nil { 7757 return nil, err 7758 } 7759 req.Header = reqHeaders 7760 googleapi.Expand(req.URL, map[string]string{ 7761 "customerKey": c.customerKey, 7762 }) 7763 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7764} 7765 7766// Do executes the "directory.customers.get" call. 7767// Exactly one of *Customer or error will be non-nil. Any non-2xx status 7768// code is an error. Response headers are in either 7769// *Customer.ServerResponse.Header or (if a response was returned at 7770// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7771// to check whether the returned error was because 7772// http.StatusNotModified was returned. 7773func (c *CustomersGetCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 7774 gensupport.SetOptions(c.urlParams_, opts...) 7775 res, err := c.doRequest("json") 7776 if res != nil && res.StatusCode == http.StatusNotModified { 7777 if res.Body != nil { 7778 res.Body.Close() 7779 } 7780 return nil, &googleapi.Error{ 7781 Code: res.StatusCode, 7782 Header: res.Header, 7783 } 7784 } 7785 if err != nil { 7786 return nil, err 7787 } 7788 defer googleapi.CloseBody(res) 7789 if err := googleapi.CheckResponse(res); err != nil { 7790 return nil, err 7791 } 7792 ret := &Customer{ 7793 ServerResponse: googleapi.ServerResponse{ 7794 Header: res.Header, 7795 HTTPStatusCode: res.StatusCode, 7796 }, 7797 } 7798 target := &ret 7799 if err := gensupport.DecodeResponse(target, res); err != nil { 7800 return nil, err 7801 } 7802 return ret, nil 7803 // { 7804 // "description": "Retrieves a customer.", 7805 // "flatPath": "admin/directory/v1/customers/{customerKey}", 7806 // "httpMethod": "GET", 7807 // "id": "directory.customers.get", 7808 // "parameterOrder": [ 7809 // "customerKey" 7810 // ], 7811 // "parameters": { 7812 // "customerKey": { 7813 // "description": "Id of the customer to be retrieved", 7814 // "location": "path", 7815 // "required": true, 7816 // "type": "string" 7817 // } 7818 // }, 7819 // "path": "admin/directory/v1/customers/{customerKey}", 7820 // "response": { 7821 // "$ref": "Customer" 7822 // }, 7823 // "scopes": [ 7824 // "https://www.googleapis.com/auth/admin.directory.customer", 7825 // "https://www.googleapis.com/auth/admin.directory.customer.readonly" 7826 // ] 7827 // } 7828 7829} 7830 7831// method id "directory.customers.patch": 7832 7833type CustomersPatchCall struct { 7834 s *Service 7835 customerKey string 7836 customer *Customer 7837 urlParams_ gensupport.URLParams 7838 ctx_ context.Context 7839 header_ http.Header 7840} 7841 7842// Patch: Patches a customer. 7843// 7844// - customerKey: Id of the customer to be updated. 7845func (r *CustomersService) Patch(customerKey string, customer *Customer) *CustomersPatchCall { 7846 c := &CustomersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7847 c.customerKey = customerKey 7848 c.customer = customer 7849 return c 7850} 7851 7852// Fields allows partial responses to be retrieved. See 7853// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7854// for more information. 7855func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall { 7856 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7857 return c 7858} 7859 7860// Context sets the context to be used in this call's Do method. Any 7861// pending HTTP request will be aborted if the provided context is 7862// canceled. 7863func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall { 7864 c.ctx_ = ctx 7865 return c 7866} 7867 7868// Header returns an http.Header that can be modified by the caller to 7869// add HTTP headers to the request. 7870func (c *CustomersPatchCall) Header() http.Header { 7871 if c.header_ == nil { 7872 c.header_ = make(http.Header) 7873 } 7874 return c.header_ 7875} 7876 7877func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) { 7878 reqHeaders := make(http.Header) 7879 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7880 for k, v := range c.header_ { 7881 reqHeaders[k] = v 7882 } 7883 reqHeaders.Set("User-Agent", c.s.userAgent()) 7884 var body io.Reader = nil 7885 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) 7886 if err != nil { 7887 return nil, err 7888 } 7889 reqHeaders.Set("Content-Type", "application/json") 7890 c.urlParams_.Set("alt", alt) 7891 c.urlParams_.Set("prettyPrint", "false") 7892 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 7893 urls += "?" + c.urlParams_.Encode() 7894 req, err := http.NewRequest("PATCH", urls, body) 7895 if err != nil { 7896 return nil, err 7897 } 7898 req.Header = reqHeaders 7899 googleapi.Expand(req.URL, map[string]string{ 7900 "customerKey": c.customerKey, 7901 }) 7902 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7903} 7904 7905// Do executes the "directory.customers.patch" call. 7906// Exactly one of *Customer or error will be non-nil. Any non-2xx status 7907// code is an error. Response headers are in either 7908// *Customer.ServerResponse.Header or (if a response was returned at 7909// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7910// to check whether the returned error was because 7911// http.StatusNotModified was returned. 7912func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 7913 gensupport.SetOptions(c.urlParams_, opts...) 7914 res, err := c.doRequest("json") 7915 if res != nil && res.StatusCode == http.StatusNotModified { 7916 if res.Body != nil { 7917 res.Body.Close() 7918 } 7919 return nil, &googleapi.Error{ 7920 Code: res.StatusCode, 7921 Header: res.Header, 7922 } 7923 } 7924 if err != nil { 7925 return nil, err 7926 } 7927 defer googleapi.CloseBody(res) 7928 if err := googleapi.CheckResponse(res); err != nil { 7929 return nil, err 7930 } 7931 ret := &Customer{ 7932 ServerResponse: googleapi.ServerResponse{ 7933 Header: res.Header, 7934 HTTPStatusCode: res.StatusCode, 7935 }, 7936 } 7937 target := &ret 7938 if err := gensupport.DecodeResponse(target, res); err != nil { 7939 return nil, err 7940 } 7941 return ret, nil 7942 // { 7943 // "description": "Patches a customer.", 7944 // "flatPath": "admin/directory/v1/customers/{customerKey}", 7945 // "httpMethod": "PATCH", 7946 // "id": "directory.customers.patch", 7947 // "parameterOrder": [ 7948 // "customerKey" 7949 // ], 7950 // "parameters": { 7951 // "customerKey": { 7952 // "description": "Id of the customer to be updated", 7953 // "location": "path", 7954 // "required": true, 7955 // "type": "string" 7956 // } 7957 // }, 7958 // "path": "admin/directory/v1/customers/{customerKey}", 7959 // "request": { 7960 // "$ref": "Customer" 7961 // }, 7962 // "response": { 7963 // "$ref": "Customer" 7964 // }, 7965 // "scopes": [ 7966 // "https://www.googleapis.com/auth/admin.directory.customer" 7967 // ] 7968 // } 7969 7970} 7971 7972// method id "directory.customers.update": 7973 7974type CustomersUpdateCall struct { 7975 s *Service 7976 customerKey string 7977 customer *Customer 7978 urlParams_ gensupport.URLParams 7979 ctx_ context.Context 7980 header_ http.Header 7981} 7982 7983// Update: Updates a customer. 7984// 7985// - customerKey: Id of the customer to be updated. 7986func (r *CustomersService) Update(customerKey string, customer *Customer) *CustomersUpdateCall { 7987 c := &CustomersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7988 c.customerKey = customerKey 7989 c.customer = customer 7990 return c 7991} 7992 7993// Fields allows partial responses to be retrieved. See 7994// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7995// for more information. 7996func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall { 7997 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7998 return c 7999} 8000 8001// Context sets the context to be used in this call's Do method. Any 8002// pending HTTP request will be aborted if the provided context is 8003// canceled. 8004func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall { 8005 c.ctx_ = ctx 8006 return c 8007} 8008 8009// Header returns an http.Header that can be modified by the caller to 8010// add HTTP headers to the request. 8011func (c *CustomersUpdateCall) Header() http.Header { 8012 if c.header_ == nil { 8013 c.header_ = make(http.Header) 8014 } 8015 return c.header_ 8016} 8017 8018func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, error) { 8019 reqHeaders := make(http.Header) 8020 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8021 for k, v := range c.header_ { 8022 reqHeaders[k] = v 8023 } 8024 reqHeaders.Set("User-Agent", c.s.userAgent()) 8025 var body io.Reader = nil 8026 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer) 8027 if err != nil { 8028 return nil, err 8029 } 8030 reqHeaders.Set("Content-Type", "application/json") 8031 c.urlParams_.Set("alt", alt) 8032 c.urlParams_.Set("prettyPrint", "false") 8033 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customers/{customerKey}") 8034 urls += "?" + c.urlParams_.Encode() 8035 req, err := http.NewRequest("PUT", urls, body) 8036 if err != nil { 8037 return nil, err 8038 } 8039 req.Header = reqHeaders 8040 googleapi.Expand(req.URL, map[string]string{ 8041 "customerKey": c.customerKey, 8042 }) 8043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8044} 8045 8046// Do executes the "directory.customers.update" call. 8047// Exactly one of *Customer or error will be non-nil. Any non-2xx status 8048// code is an error. Response headers are in either 8049// *Customer.ServerResponse.Header or (if a response was returned at 8050// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8051// to check whether the returned error was because 8052// http.StatusNotModified was returned. 8053func (c *CustomersUpdateCall) Do(opts ...googleapi.CallOption) (*Customer, error) { 8054 gensupport.SetOptions(c.urlParams_, opts...) 8055 res, err := c.doRequest("json") 8056 if res != nil && res.StatusCode == http.StatusNotModified { 8057 if res.Body != nil { 8058 res.Body.Close() 8059 } 8060 return nil, &googleapi.Error{ 8061 Code: res.StatusCode, 8062 Header: res.Header, 8063 } 8064 } 8065 if err != nil { 8066 return nil, err 8067 } 8068 defer googleapi.CloseBody(res) 8069 if err := googleapi.CheckResponse(res); err != nil { 8070 return nil, err 8071 } 8072 ret := &Customer{ 8073 ServerResponse: googleapi.ServerResponse{ 8074 Header: res.Header, 8075 HTTPStatusCode: res.StatusCode, 8076 }, 8077 } 8078 target := &ret 8079 if err := gensupport.DecodeResponse(target, res); err != nil { 8080 return nil, err 8081 } 8082 return ret, nil 8083 // { 8084 // "description": "Updates a customer.", 8085 // "flatPath": "admin/directory/v1/customers/{customerKey}", 8086 // "httpMethod": "PUT", 8087 // "id": "directory.customers.update", 8088 // "parameterOrder": [ 8089 // "customerKey" 8090 // ], 8091 // "parameters": { 8092 // "customerKey": { 8093 // "description": "Id of the customer to be updated", 8094 // "location": "path", 8095 // "required": true, 8096 // "type": "string" 8097 // } 8098 // }, 8099 // "path": "admin/directory/v1/customers/{customerKey}", 8100 // "request": { 8101 // "$ref": "Customer" 8102 // }, 8103 // "response": { 8104 // "$ref": "Customer" 8105 // }, 8106 // "scopes": [ 8107 // "https://www.googleapis.com/auth/admin.directory.customer" 8108 // ] 8109 // } 8110 8111} 8112 8113// method id "admin.customers.chrome.printers.batchCreatePrinters": 8114 8115type CustomersChromePrintersBatchCreatePrintersCall struct { 8116 s *Service 8117 parent string 8118 batchcreateprintersrequest *BatchCreatePrintersRequest 8119 urlParams_ gensupport.URLParams 8120 ctx_ context.Context 8121 header_ http.Header 8122} 8123 8124// BatchCreatePrinters: Creates printers under given Organization Unit. 8125// 8126// - parent: The name of the customer. Format: customers/{customer_id}. 8127func (r *CustomersChromePrintersService) BatchCreatePrinters(parent string, batchcreateprintersrequest *BatchCreatePrintersRequest) *CustomersChromePrintersBatchCreatePrintersCall { 8128 c := &CustomersChromePrintersBatchCreatePrintersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8129 c.parent = parent 8130 c.batchcreateprintersrequest = batchcreateprintersrequest 8131 return c 8132} 8133 8134// Fields allows partial responses to be retrieved. See 8135// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8136// for more information. 8137func (c *CustomersChromePrintersBatchCreatePrintersCall) Fields(s ...googleapi.Field) *CustomersChromePrintersBatchCreatePrintersCall { 8138 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8139 return c 8140} 8141 8142// Context sets the context to be used in this call's Do method. Any 8143// pending HTTP request will be aborted if the provided context is 8144// canceled. 8145func (c *CustomersChromePrintersBatchCreatePrintersCall) Context(ctx context.Context) *CustomersChromePrintersBatchCreatePrintersCall { 8146 c.ctx_ = ctx 8147 return c 8148} 8149 8150// Header returns an http.Header that can be modified by the caller to 8151// add HTTP headers to the request. 8152func (c *CustomersChromePrintersBatchCreatePrintersCall) Header() http.Header { 8153 if c.header_ == nil { 8154 c.header_ = make(http.Header) 8155 } 8156 return c.header_ 8157} 8158 8159func (c *CustomersChromePrintersBatchCreatePrintersCall) doRequest(alt string) (*http.Response, error) { 8160 reqHeaders := make(http.Header) 8161 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8162 for k, v := range c.header_ { 8163 reqHeaders[k] = v 8164 } 8165 reqHeaders.Set("User-Agent", c.s.userAgent()) 8166 var body io.Reader = nil 8167 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateprintersrequest) 8168 if err != nil { 8169 return nil, err 8170 } 8171 reqHeaders.Set("Content-Type", "application/json") 8172 c.urlParams_.Set("alt", alt) 8173 c.urlParams_.Set("prettyPrint", "false") 8174 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers:batchCreatePrinters") 8175 urls += "?" + c.urlParams_.Encode() 8176 req, err := http.NewRequest("POST", urls, body) 8177 if err != nil { 8178 return nil, err 8179 } 8180 req.Header = reqHeaders 8181 googleapi.Expand(req.URL, map[string]string{ 8182 "parent": c.parent, 8183 }) 8184 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8185} 8186 8187// Do executes the "admin.customers.chrome.printers.batchCreatePrinters" call. 8188// Exactly one of *BatchCreatePrintersResponse or error will be non-nil. 8189// Any non-2xx status code is an error. Response headers are in either 8190// *BatchCreatePrintersResponse.ServerResponse.Header or (if a response 8191// was returned at all) in error.(*googleapi.Error).Header. Use 8192// googleapi.IsNotModified to check whether the returned error was 8193// because http.StatusNotModified was returned. 8194func (c *CustomersChromePrintersBatchCreatePrintersCall) Do(opts ...googleapi.CallOption) (*BatchCreatePrintersResponse, error) { 8195 gensupport.SetOptions(c.urlParams_, opts...) 8196 res, err := c.doRequest("json") 8197 if res != nil && res.StatusCode == http.StatusNotModified { 8198 if res.Body != nil { 8199 res.Body.Close() 8200 } 8201 return nil, &googleapi.Error{ 8202 Code: res.StatusCode, 8203 Header: res.Header, 8204 } 8205 } 8206 if err != nil { 8207 return nil, err 8208 } 8209 defer googleapi.CloseBody(res) 8210 if err := googleapi.CheckResponse(res); err != nil { 8211 return nil, err 8212 } 8213 ret := &BatchCreatePrintersResponse{ 8214 ServerResponse: googleapi.ServerResponse{ 8215 Header: res.Header, 8216 HTTPStatusCode: res.StatusCode, 8217 }, 8218 } 8219 target := &ret 8220 if err := gensupport.DecodeResponse(target, res); err != nil { 8221 return nil, err 8222 } 8223 return ret, nil 8224 // { 8225 // "description": "Creates printers under given Organization Unit.", 8226 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers:batchCreatePrinters", 8227 // "httpMethod": "POST", 8228 // "id": "admin.customers.chrome.printers.batchCreatePrinters", 8229 // "parameterOrder": [ 8230 // "parent" 8231 // ], 8232 // "parameters": { 8233 // "parent": { 8234 // "description": "Required. The name of the customer. Format: customers/{customer_id}", 8235 // "location": "path", 8236 // "pattern": "^customers/[^/]+$", 8237 // "required": true, 8238 // "type": "string" 8239 // } 8240 // }, 8241 // "path": "admin/directory/v1/{+parent}/chrome/printers:batchCreatePrinters", 8242 // "request": { 8243 // "$ref": "BatchCreatePrintersRequest" 8244 // }, 8245 // "response": { 8246 // "$ref": "BatchCreatePrintersResponse" 8247 // }, 8248 // "scopes": [ 8249 // "https://www.googleapis.com/auth/admin.chrome.printers" 8250 // ] 8251 // } 8252 8253} 8254 8255// method id "admin.customers.chrome.printers.batchDeletePrinters": 8256 8257type CustomersChromePrintersBatchDeletePrintersCall struct { 8258 s *Service 8259 parent string 8260 batchdeleteprintersrequest *BatchDeletePrintersRequest 8261 urlParams_ gensupport.URLParams 8262 ctx_ context.Context 8263 header_ http.Header 8264} 8265 8266// BatchDeletePrinters: Deletes printers in batch. 8267// 8268// - parent: The name of the customer. Format: customers/{customer_id}. 8269func (r *CustomersChromePrintersService) BatchDeletePrinters(parent string, batchdeleteprintersrequest *BatchDeletePrintersRequest) *CustomersChromePrintersBatchDeletePrintersCall { 8270 c := &CustomersChromePrintersBatchDeletePrintersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8271 c.parent = parent 8272 c.batchdeleteprintersrequest = batchdeleteprintersrequest 8273 return c 8274} 8275 8276// Fields allows partial responses to be retrieved. See 8277// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8278// for more information. 8279func (c *CustomersChromePrintersBatchDeletePrintersCall) Fields(s ...googleapi.Field) *CustomersChromePrintersBatchDeletePrintersCall { 8280 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8281 return c 8282} 8283 8284// Context sets the context to be used in this call's Do method. Any 8285// pending HTTP request will be aborted if the provided context is 8286// canceled. 8287func (c *CustomersChromePrintersBatchDeletePrintersCall) Context(ctx context.Context) *CustomersChromePrintersBatchDeletePrintersCall { 8288 c.ctx_ = ctx 8289 return c 8290} 8291 8292// Header returns an http.Header that can be modified by the caller to 8293// add HTTP headers to the request. 8294func (c *CustomersChromePrintersBatchDeletePrintersCall) Header() http.Header { 8295 if c.header_ == nil { 8296 c.header_ = make(http.Header) 8297 } 8298 return c.header_ 8299} 8300 8301func (c *CustomersChromePrintersBatchDeletePrintersCall) doRequest(alt string) (*http.Response, error) { 8302 reqHeaders := make(http.Header) 8303 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8304 for k, v := range c.header_ { 8305 reqHeaders[k] = v 8306 } 8307 reqHeaders.Set("User-Agent", c.s.userAgent()) 8308 var body io.Reader = nil 8309 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeleteprintersrequest) 8310 if err != nil { 8311 return nil, err 8312 } 8313 reqHeaders.Set("Content-Type", "application/json") 8314 c.urlParams_.Set("alt", alt) 8315 c.urlParams_.Set("prettyPrint", "false") 8316 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers:batchDeletePrinters") 8317 urls += "?" + c.urlParams_.Encode() 8318 req, err := http.NewRequest("POST", urls, body) 8319 if err != nil { 8320 return nil, err 8321 } 8322 req.Header = reqHeaders 8323 googleapi.Expand(req.URL, map[string]string{ 8324 "parent": c.parent, 8325 }) 8326 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8327} 8328 8329// Do executes the "admin.customers.chrome.printers.batchDeletePrinters" call. 8330// Exactly one of *BatchDeletePrintersResponse or error will be non-nil. 8331// Any non-2xx status code is an error. Response headers are in either 8332// *BatchDeletePrintersResponse.ServerResponse.Header or (if a response 8333// was returned at all) in error.(*googleapi.Error).Header. Use 8334// googleapi.IsNotModified to check whether the returned error was 8335// because http.StatusNotModified was returned. 8336func (c *CustomersChromePrintersBatchDeletePrintersCall) Do(opts ...googleapi.CallOption) (*BatchDeletePrintersResponse, error) { 8337 gensupport.SetOptions(c.urlParams_, opts...) 8338 res, err := c.doRequest("json") 8339 if res != nil && res.StatusCode == http.StatusNotModified { 8340 if res.Body != nil { 8341 res.Body.Close() 8342 } 8343 return nil, &googleapi.Error{ 8344 Code: res.StatusCode, 8345 Header: res.Header, 8346 } 8347 } 8348 if err != nil { 8349 return nil, err 8350 } 8351 defer googleapi.CloseBody(res) 8352 if err := googleapi.CheckResponse(res); err != nil { 8353 return nil, err 8354 } 8355 ret := &BatchDeletePrintersResponse{ 8356 ServerResponse: googleapi.ServerResponse{ 8357 Header: res.Header, 8358 HTTPStatusCode: res.StatusCode, 8359 }, 8360 } 8361 target := &ret 8362 if err := gensupport.DecodeResponse(target, res); err != nil { 8363 return nil, err 8364 } 8365 return ret, nil 8366 // { 8367 // "description": "Deletes printers in batch.", 8368 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers:batchDeletePrinters", 8369 // "httpMethod": "POST", 8370 // "id": "admin.customers.chrome.printers.batchDeletePrinters", 8371 // "parameterOrder": [ 8372 // "parent" 8373 // ], 8374 // "parameters": { 8375 // "parent": { 8376 // "description": "Required. The name of the customer. Format: customers/{customer_id}", 8377 // "location": "path", 8378 // "pattern": "^customers/[^/]+$", 8379 // "required": true, 8380 // "type": "string" 8381 // } 8382 // }, 8383 // "path": "admin/directory/v1/{+parent}/chrome/printers:batchDeletePrinters", 8384 // "request": { 8385 // "$ref": "BatchDeletePrintersRequest" 8386 // }, 8387 // "response": { 8388 // "$ref": "BatchDeletePrintersResponse" 8389 // }, 8390 // "scopes": [ 8391 // "https://www.googleapis.com/auth/admin.chrome.printers" 8392 // ] 8393 // } 8394 8395} 8396 8397// method id "admin.customers.chrome.printers.create": 8398 8399type CustomersChromePrintersCreateCall struct { 8400 s *Service 8401 parent string 8402 printer *Printer 8403 urlParams_ gensupport.URLParams 8404 ctx_ context.Context 8405 header_ http.Header 8406} 8407 8408// Create: Creates a printer under given Organization Unit. 8409// 8410// - parent: The name of the customer. Format: customers/{customer_id}. 8411func (r *CustomersChromePrintersService) Create(parent string, printer *Printer) *CustomersChromePrintersCreateCall { 8412 c := &CustomersChromePrintersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8413 c.parent = parent 8414 c.printer = printer 8415 return c 8416} 8417 8418// Fields allows partial responses to be retrieved. See 8419// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8420// for more information. 8421func (c *CustomersChromePrintersCreateCall) Fields(s ...googleapi.Field) *CustomersChromePrintersCreateCall { 8422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8423 return c 8424} 8425 8426// Context sets the context to be used in this call's Do method. Any 8427// pending HTTP request will be aborted if the provided context is 8428// canceled. 8429func (c *CustomersChromePrintersCreateCall) Context(ctx context.Context) *CustomersChromePrintersCreateCall { 8430 c.ctx_ = ctx 8431 return c 8432} 8433 8434// Header returns an http.Header that can be modified by the caller to 8435// add HTTP headers to the request. 8436func (c *CustomersChromePrintersCreateCall) Header() http.Header { 8437 if c.header_ == nil { 8438 c.header_ = make(http.Header) 8439 } 8440 return c.header_ 8441} 8442 8443func (c *CustomersChromePrintersCreateCall) doRequest(alt string) (*http.Response, error) { 8444 reqHeaders := make(http.Header) 8445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8446 for k, v := range c.header_ { 8447 reqHeaders[k] = v 8448 } 8449 reqHeaders.Set("User-Agent", c.s.userAgent()) 8450 var body io.Reader = nil 8451 body, err := googleapi.WithoutDataWrapper.JSONReader(c.printer) 8452 if err != nil { 8453 return nil, err 8454 } 8455 reqHeaders.Set("Content-Type", "application/json") 8456 c.urlParams_.Set("alt", alt) 8457 c.urlParams_.Set("prettyPrint", "false") 8458 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers") 8459 urls += "?" + c.urlParams_.Encode() 8460 req, err := http.NewRequest("POST", urls, body) 8461 if err != nil { 8462 return nil, err 8463 } 8464 req.Header = reqHeaders 8465 googleapi.Expand(req.URL, map[string]string{ 8466 "parent": c.parent, 8467 }) 8468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8469} 8470 8471// Do executes the "admin.customers.chrome.printers.create" call. 8472// Exactly one of *Printer or error will be non-nil. Any non-2xx status 8473// code is an error. Response headers are in either 8474// *Printer.ServerResponse.Header or (if a response was returned at all) 8475// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8476// check whether the returned error was because http.StatusNotModified 8477// was returned. 8478func (c *CustomersChromePrintersCreateCall) Do(opts ...googleapi.CallOption) (*Printer, error) { 8479 gensupport.SetOptions(c.urlParams_, opts...) 8480 res, err := c.doRequest("json") 8481 if res != nil && res.StatusCode == http.StatusNotModified { 8482 if res.Body != nil { 8483 res.Body.Close() 8484 } 8485 return nil, &googleapi.Error{ 8486 Code: res.StatusCode, 8487 Header: res.Header, 8488 } 8489 } 8490 if err != nil { 8491 return nil, err 8492 } 8493 defer googleapi.CloseBody(res) 8494 if err := googleapi.CheckResponse(res); err != nil { 8495 return nil, err 8496 } 8497 ret := &Printer{ 8498 ServerResponse: googleapi.ServerResponse{ 8499 Header: res.Header, 8500 HTTPStatusCode: res.StatusCode, 8501 }, 8502 } 8503 target := &ret 8504 if err := gensupport.DecodeResponse(target, res); err != nil { 8505 return nil, err 8506 } 8507 return ret, nil 8508 // { 8509 // "description": "Creates a printer under given Organization Unit.", 8510 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers", 8511 // "httpMethod": "POST", 8512 // "id": "admin.customers.chrome.printers.create", 8513 // "parameterOrder": [ 8514 // "parent" 8515 // ], 8516 // "parameters": { 8517 // "parent": { 8518 // "description": "Required. The name of the customer. Format: customers/{customer_id}", 8519 // "location": "path", 8520 // "pattern": "^customers/[^/]+$", 8521 // "required": true, 8522 // "type": "string" 8523 // } 8524 // }, 8525 // "path": "admin/directory/v1/{+parent}/chrome/printers", 8526 // "request": { 8527 // "$ref": "Printer" 8528 // }, 8529 // "response": { 8530 // "$ref": "Printer" 8531 // }, 8532 // "scopes": [ 8533 // "https://www.googleapis.com/auth/admin.chrome.printers" 8534 // ] 8535 // } 8536 8537} 8538 8539// method id "admin.customers.chrome.printers.delete": 8540 8541type CustomersChromePrintersDeleteCall struct { 8542 s *Service 8543 name string 8544 urlParams_ gensupport.URLParams 8545 ctx_ context.Context 8546 header_ http.Header 8547} 8548 8549// Delete: Deletes a `Printer`. 8550// 8551// - name: The name of the printer to be updated. Format: 8552// customers/{customer_id}/chrome/printers/{printer_id}. 8553func (r *CustomersChromePrintersService) Delete(name string) *CustomersChromePrintersDeleteCall { 8554 c := &CustomersChromePrintersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8555 c.name = name 8556 return c 8557} 8558 8559// Fields allows partial responses to be retrieved. See 8560// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8561// for more information. 8562func (c *CustomersChromePrintersDeleteCall) Fields(s ...googleapi.Field) *CustomersChromePrintersDeleteCall { 8563 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8564 return c 8565} 8566 8567// Context sets the context to be used in this call's Do method. Any 8568// pending HTTP request will be aborted if the provided context is 8569// canceled. 8570func (c *CustomersChromePrintersDeleteCall) Context(ctx context.Context) *CustomersChromePrintersDeleteCall { 8571 c.ctx_ = ctx 8572 return c 8573} 8574 8575// Header returns an http.Header that can be modified by the caller to 8576// add HTTP headers to the request. 8577func (c *CustomersChromePrintersDeleteCall) Header() http.Header { 8578 if c.header_ == nil { 8579 c.header_ = make(http.Header) 8580 } 8581 return c.header_ 8582} 8583 8584func (c *CustomersChromePrintersDeleteCall) doRequest(alt string) (*http.Response, error) { 8585 reqHeaders := make(http.Header) 8586 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8587 for k, v := range c.header_ { 8588 reqHeaders[k] = v 8589 } 8590 reqHeaders.Set("User-Agent", c.s.userAgent()) 8591 var body io.Reader = nil 8592 c.urlParams_.Set("alt", alt) 8593 c.urlParams_.Set("prettyPrint", "false") 8594 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") 8595 urls += "?" + c.urlParams_.Encode() 8596 req, err := http.NewRequest("DELETE", urls, body) 8597 if err != nil { 8598 return nil, err 8599 } 8600 req.Header = reqHeaders 8601 googleapi.Expand(req.URL, map[string]string{ 8602 "name": c.name, 8603 }) 8604 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8605} 8606 8607// Do executes the "admin.customers.chrome.printers.delete" call. 8608// Exactly one of *Empty or error will be non-nil. Any non-2xx status 8609// code is an error. Response headers are in either 8610// *Empty.ServerResponse.Header or (if a response was returned at all) 8611// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8612// check whether the returned error was because http.StatusNotModified 8613// was returned. 8614func (c *CustomersChromePrintersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8615 gensupport.SetOptions(c.urlParams_, opts...) 8616 res, err := c.doRequest("json") 8617 if res != nil && res.StatusCode == http.StatusNotModified { 8618 if res.Body != nil { 8619 res.Body.Close() 8620 } 8621 return nil, &googleapi.Error{ 8622 Code: res.StatusCode, 8623 Header: res.Header, 8624 } 8625 } 8626 if err != nil { 8627 return nil, err 8628 } 8629 defer googleapi.CloseBody(res) 8630 if err := googleapi.CheckResponse(res); err != nil { 8631 return nil, err 8632 } 8633 ret := &Empty{ 8634 ServerResponse: googleapi.ServerResponse{ 8635 Header: res.Header, 8636 HTTPStatusCode: res.StatusCode, 8637 }, 8638 } 8639 target := &ret 8640 if err := gensupport.DecodeResponse(target, res); err != nil { 8641 return nil, err 8642 } 8643 return ret, nil 8644 // { 8645 // "description": "Deletes a `Printer`.", 8646 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers/{printersId}", 8647 // "httpMethod": "DELETE", 8648 // "id": "admin.customers.chrome.printers.delete", 8649 // "parameterOrder": [ 8650 // "name" 8651 // ], 8652 // "parameters": { 8653 // "name": { 8654 // "description": "Required. The name of the printer to be updated. Format: customers/{customer_id}/chrome/printers/{printer_id}", 8655 // "location": "path", 8656 // "pattern": "^customers/[^/]+/chrome/printers/[^/]+$", 8657 // "required": true, 8658 // "type": "string" 8659 // } 8660 // }, 8661 // "path": "admin/directory/v1/{+name}", 8662 // "response": { 8663 // "$ref": "Empty" 8664 // }, 8665 // "scopes": [ 8666 // "https://www.googleapis.com/auth/admin.chrome.printers" 8667 // ] 8668 // } 8669 8670} 8671 8672// method id "admin.customers.chrome.printers.get": 8673 8674type CustomersChromePrintersGetCall struct { 8675 s *Service 8676 name string 8677 urlParams_ gensupport.URLParams 8678 ifNoneMatch_ string 8679 ctx_ context.Context 8680 header_ http.Header 8681} 8682 8683// Get: Returns a `Printer` resource (printer's config). 8684// 8685// - name: The name of the printer to retrieve. Format: 8686// customers/{customer_id}/chrome/printers/{printer_id}. 8687func (r *CustomersChromePrintersService) Get(name string) *CustomersChromePrintersGetCall { 8688 c := &CustomersChromePrintersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8689 c.name = name 8690 return c 8691} 8692 8693// Fields allows partial responses to be retrieved. See 8694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8695// for more information. 8696func (c *CustomersChromePrintersGetCall) Fields(s ...googleapi.Field) *CustomersChromePrintersGetCall { 8697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8698 return c 8699} 8700 8701// IfNoneMatch sets the optional parameter which makes the operation 8702// fail if the object's ETag matches the given value. This is useful for 8703// getting updates only after the object has changed since the last 8704// request. Use googleapi.IsNotModified to check whether the response 8705// error from Do is the result of In-None-Match. 8706func (c *CustomersChromePrintersGetCall) IfNoneMatch(entityTag string) *CustomersChromePrintersGetCall { 8707 c.ifNoneMatch_ = entityTag 8708 return c 8709} 8710 8711// Context sets the context to be used in this call's Do method. Any 8712// pending HTTP request will be aborted if the provided context is 8713// canceled. 8714func (c *CustomersChromePrintersGetCall) Context(ctx context.Context) *CustomersChromePrintersGetCall { 8715 c.ctx_ = ctx 8716 return c 8717} 8718 8719// Header returns an http.Header that can be modified by the caller to 8720// add HTTP headers to the request. 8721func (c *CustomersChromePrintersGetCall) Header() http.Header { 8722 if c.header_ == nil { 8723 c.header_ = make(http.Header) 8724 } 8725 return c.header_ 8726} 8727 8728func (c *CustomersChromePrintersGetCall) doRequest(alt string) (*http.Response, error) { 8729 reqHeaders := make(http.Header) 8730 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8731 for k, v := range c.header_ { 8732 reqHeaders[k] = v 8733 } 8734 reqHeaders.Set("User-Agent", c.s.userAgent()) 8735 if c.ifNoneMatch_ != "" { 8736 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8737 } 8738 var body io.Reader = nil 8739 c.urlParams_.Set("alt", alt) 8740 c.urlParams_.Set("prettyPrint", "false") 8741 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") 8742 urls += "?" + c.urlParams_.Encode() 8743 req, err := http.NewRequest("GET", urls, body) 8744 if err != nil { 8745 return nil, err 8746 } 8747 req.Header = reqHeaders 8748 googleapi.Expand(req.URL, map[string]string{ 8749 "name": c.name, 8750 }) 8751 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8752} 8753 8754// Do executes the "admin.customers.chrome.printers.get" call. 8755// Exactly one of *Printer or error will be non-nil. Any non-2xx status 8756// code is an error. Response headers are in either 8757// *Printer.ServerResponse.Header or (if a response was returned at all) 8758// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8759// check whether the returned error was because http.StatusNotModified 8760// was returned. 8761func (c *CustomersChromePrintersGetCall) Do(opts ...googleapi.CallOption) (*Printer, error) { 8762 gensupport.SetOptions(c.urlParams_, opts...) 8763 res, err := c.doRequest("json") 8764 if res != nil && res.StatusCode == http.StatusNotModified { 8765 if res.Body != nil { 8766 res.Body.Close() 8767 } 8768 return nil, &googleapi.Error{ 8769 Code: res.StatusCode, 8770 Header: res.Header, 8771 } 8772 } 8773 if err != nil { 8774 return nil, err 8775 } 8776 defer googleapi.CloseBody(res) 8777 if err := googleapi.CheckResponse(res); err != nil { 8778 return nil, err 8779 } 8780 ret := &Printer{ 8781 ServerResponse: googleapi.ServerResponse{ 8782 Header: res.Header, 8783 HTTPStatusCode: res.StatusCode, 8784 }, 8785 } 8786 target := &ret 8787 if err := gensupport.DecodeResponse(target, res); err != nil { 8788 return nil, err 8789 } 8790 return ret, nil 8791 // { 8792 // "description": "Returns a `Printer` resource (printer's config).", 8793 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers/{printersId}", 8794 // "httpMethod": "GET", 8795 // "id": "admin.customers.chrome.printers.get", 8796 // "parameterOrder": [ 8797 // "name" 8798 // ], 8799 // "parameters": { 8800 // "name": { 8801 // "description": "Required. The name of the printer to retrieve. Format: customers/{customer_id}/chrome/printers/{printer_id}", 8802 // "location": "path", 8803 // "pattern": "^customers/[^/]+/chrome/printers/[^/]+$", 8804 // "required": true, 8805 // "type": "string" 8806 // } 8807 // }, 8808 // "path": "admin/directory/v1/{+name}", 8809 // "response": { 8810 // "$ref": "Printer" 8811 // }, 8812 // "scopes": [ 8813 // "https://www.googleapis.com/auth/admin.chrome.printers", 8814 // "https://www.googleapis.com/auth/admin.chrome.printers.readonly" 8815 // ] 8816 // } 8817 8818} 8819 8820// method id "admin.customers.chrome.printers.list": 8821 8822type CustomersChromePrintersListCall struct { 8823 s *Service 8824 parent string 8825 urlParams_ gensupport.URLParams 8826 ifNoneMatch_ string 8827 ctx_ context.Context 8828 header_ http.Header 8829} 8830 8831// List: List printers configs. 8832// 8833// - parent: The name of the customer who owns this collection of 8834// printers. Format: customers/{customer_id}. 8835func (r *CustomersChromePrintersService) List(parent string) *CustomersChromePrintersListCall { 8836 c := &CustomersChromePrintersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8837 c.parent = parent 8838 return c 8839} 8840 8841// Filter sets the optional parameter "filter": Search query. Search 8842// syntax is shared between this api and Admin Console printers pages. 8843func (c *CustomersChromePrintersListCall) Filter(filter string) *CustomersChromePrintersListCall { 8844 c.urlParams_.Set("filter", filter) 8845 return c 8846} 8847 8848// OrgUnitId sets the optional parameter "orgUnitId": Organization Unit 8849// that we want to list the printers for. When org_unit is not present 8850// in the request then all printers of the customer are returned (or 8851// filtered). When org_unit is present in the request then only printers 8852// available to this OU will be returned (owned or inherited). You may 8853// see if printer is owned or inherited for this OU by looking at 8854// Printer.org_unit_id. 8855func (c *CustomersChromePrintersListCall) OrgUnitId(orgUnitId string) *CustomersChromePrintersListCall { 8856 c.urlParams_.Set("orgUnitId", orgUnitId) 8857 return c 8858} 8859 8860// PageSize sets the optional parameter "pageSize": The maximum number 8861// of objects to return. The service may return fewer than this value. 8862func (c *CustomersChromePrintersListCall) PageSize(pageSize int64) *CustomersChromePrintersListCall { 8863 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8864 return c 8865} 8866 8867// PageToken sets the optional parameter "pageToken": A page token, 8868// received from a previous call. 8869func (c *CustomersChromePrintersListCall) PageToken(pageToken string) *CustomersChromePrintersListCall { 8870 c.urlParams_.Set("pageToken", pageToken) 8871 return c 8872} 8873 8874// Fields allows partial responses to be retrieved. See 8875// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8876// for more information. 8877func (c *CustomersChromePrintersListCall) Fields(s ...googleapi.Field) *CustomersChromePrintersListCall { 8878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8879 return c 8880} 8881 8882// IfNoneMatch sets the optional parameter which makes the operation 8883// fail if the object's ETag matches the given value. This is useful for 8884// getting updates only after the object has changed since the last 8885// request. Use googleapi.IsNotModified to check whether the response 8886// error from Do is the result of In-None-Match. 8887func (c *CustomersChromePrintersListCall) IfNoneMatch(entityTag string) *CustomersChromePrintersListCall { 8888 c.ifNoneMatch_ = entityTag 8889 return c 8890} 8891 8892// Context sets the context to be used in this call's Do method. Any 8893// pending HTTP request will be aborted if the provided context is 8894// canceled. 8895func (c *CustomersChromePrintersListCall) Context(ctx context.Context) *CustomersChromePrintersListCall { 8896 c.ctx_ = ctx 8897 return c 8898} 8899 8900// Header returns an http.Header that can be modified by the caller to 8901// add HTTP headers to the request. 8902func (c *CustomersChromePrintersListCall) Header() http.Header { 8903 if c.header_ == nil { 8904 c.header_ = make(http.Header) 8905 } 8906 return c.header_ 8907} 8908 8909func (c *CustomersChromePrintersListCall) doRequest(alt string) (*http.Response, error) { 8910 reqHeaders := make(http.Header) 8911 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8912 for k, v := range c.header_ { 8913 reqHeaders[k] = v 8914 } 8915 reqHeaders.Set("User-Agent", c.s.userAgent()) 8916 if c.ifNoneMatch_ != "" { 8917 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8918 } 8919 var body io.Reader = nil 8920 c.urlParams_.Set("alt", alt) 8921 c.urlParams_.Set("prettyPrint", "false") 8922 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers") 8923 urls += "?" + c.urlParams_.Encode() 8924 req, err := http.NewRequest("GET", urls, body) 8925 if err != nil { 8926 return nil, err 8927 } 8928 req.Header = reqHeaders 8929 googleapi.Expand(req.URL, map[string]string{ 8930 "parent": c.parent, 8931 }) 8932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8933} 8934 8935// Do executes the "admin.customers.chrome.printers.list" call. 8936// Exactly one of *ListPrintersResponse or error will be non-nil. Any 8937// non-2xx status code is an error. Response headers are in either 8938// *ListPrintersResponse.ServerResponse.Header or (if a response was 8939// returned at all) in error.(*googleapi.Error).Header. Use 8940// googleapi.IsNotModified to check whether the returned error was 8941// because http.StatusNotModified was returned. 8942func (c *CustomersChromePrintersListCall) Do(opts ...googleapi.CallOption) (*ListPrintersResponse, error) { 8943 gensupport.SetOptions(c.urlParams_, opts...) 8944 res, err := c.doRequest("json") 8945 if res != nil && res.StatusCode == http.StatusNotModified { 8946 if res.Body != nil { 8947 res.Body.Close() 8948 } 8949 return nil, &googleapi.Error{ 8950 Code: res.StatusCode, 8951 Header: res.Header, 8952 } 8953 } 8954 if err != nil { 8955 return nil, err 8956 } 8957 defer googleapi.CloseBody(res) 8958 if err := googleapi.CheckResponse(res); err != nil { 8959 return nil, err 8960 } 8961 ret := &ListPrintersResponse{ 8962 ServerResponse: googleapi.ServerResponse{ 8963 Header: res.Header, 8964 HTTPStatusCode: res.StatusCode, 8965 }, 8966 } 8967 target := &ret 8968 if err := gensupport.DecodeResponse(target, res); err != nil { 8969 return nil, err 8970 } 8971 return ret, nil 8972 // { 8973 // "description": "List printers configs.", 8974 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers", 8975 // "httpMethod": "GET", 8976 // "id": "admin.customers.chrome.printers.list", 8977 // "parameterOrder": [ 8978 // "parent" 8979 // ], 8980 // "parameters": { 8981 // "filter": { 8982 // "description": "Search query. Search syntax is shared between this api and Admin Console printers pages.", 8983 // "location": "query", 8984 // "type": "string" 8985 // }, 8986 // "orgUnitId": { 8987 // "description": "Organization Unit that we want to list the printers for. When org_unit is not present in the request then all printers of the customer are returned (or filtered). When org_unit is present in the request then only printers available to this OU will be returned (owned or inherited). You may see if printer is owned or inherited for this OU by looking at Printer.org_unit_id.", 8988 // "location": "query", 8989 // "type": "string" 8990 // }, 8991 // "pageSize": { 8992 // "description": "The maximum number of objects to return. The service may return fewer than this value.", 8993 // "format": "int32", 8994 // "location": "query", 8995 // "type": "integer" 8996 // }, 8997 // "pageToken": { 8998 // "description": "A page token, received from a previous call.", 8999 // "location": "query", 9000 // "type": "string" 9001 // }, 9002 // "parent": { 9003 // "description": "Required. The name of the customer who owns this collection of printers. Format: customers/{customer_id}", 9004 // "location": "path", 9005 // "pattern": "^customers/[^/]+$", 9006 // "required": true, 9007 // "type": "string" 9008 // } 9009 // }, 9010 // "path": "admin/directory/v1/{+parent}/chrome/printers", 9011 // "response": { 9012 // "$ref": "ListPrintersResponse" 9013 // }, 9014 // "scopes": [ 9015 // "https://www.googleapis.com/auth/admin.chrome.printers", 9016 // "https://www.googleapis.com/auth/admin.chrome.printers.readonly" 9017 // ] 9018 // } 9019 9020} 9021 9022// Pages invokes f for each page of results. 9023// A non-nil error returned from f will halt the iteration. 9024// The provided context supersedes any context provided to the Context method. 9025func (c *CustomersChromePrintersListCall) Pages(ctx context.Context, f func(*ListPrintersResponse) error) error { 9026 c.ctx_ = ctx 9027 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9028 for { 9029 x, err := c.Do() 9030 if err != nil { 9031 return err 9032 } 9033 if err := f(x); err != nil { 9034 return err 9035 } 9036 if x.NextPageToken == "" { 9037 return nil 9038 } 9039 c.PageToken(x.NextPageToken) 9040 } 9041} 9042 9043// method id "admin.customers.chrome.printers.listPrinterModels": 9044 9045type CustomersChromePrintersListPrinterModelsCall struct { 9046 s *Service 9047 parent string 9048 urlParams_ gensupport.URLParams 9049 ifNoneMatch_ string 9050 ctx_ context.Context 9051 header_ http.Header 9052} 9053 9054// ListPrinterModels: Lists the supported printer models. 9055// 9056// - parent: The name of the customer who owns this collection of 9057// printers. Format: customers/{customer_id}. 9058func (r *CustomersChromePrintersService) ListPrinterModels(parent string) *CustomersChromePrintersListPrinterModelsCall { 9059 c := &CustomersChromePrintersListPrinterModelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9060 c.parent = parent 9061 return c 9062} 9063 9064// Filter sets the optional parameter "filter": Filer to list only 9065// models by a given manufacturer in format: "manufacturer:Brother". 9066// Search syntax is shared between this api and Admin Console printers 9067// pages. 9068func (c *CustomersChromePrintersListPrinterModelsCall) Filter(filter string) *CustomersChromePrintersListPrinterModelsCall { 9069 c.urlParams_.Set("filter", filter) 9070 return c 9071} 9072 9073// PageSize sets the optional parameter "pageSize": The maximum number 9074// of objects to return. The service may return fewer than this value. 9075func (c *CustomersChromePrintersListPrinterModelsCall) PageSize(pageSize int64) *CustomersChromePrintersListPrinterModelsCall { 9076 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9077 return c 9078} 9079 9080// PageToken sets the optional parameter "pageToken": A page token, 9081// received from a previous call. 9082func (c *CustomersChromePrintersListPrinterModelsCall) PageToken(pageToken string) *CustomersChromePrintersListPrinterModelsCall { 9083 c.urlParams_.Set("pageToken", pageToken) 9084 return c 9085} 9086 9087// Fields allows partial responses to be retrieved. See 9088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9089// for more information. 9090func (c *CustomersChromePrintersListPrinterModelsCall) Fields(s ...googleapi.Field) *CustomersChromePrintersListPrinterModelsCall { 9091 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9092 return c 9093} 9094 9095// IfNoneMatch sets the optional parameter which makes the operation 9096// fail if the object's ETag matches the given value. This is useful for 9097// getting updates only after the object has changed since the last 9098// request. Use googleapi.IsNotModified to check whether the response 9099// error from Do is the result of In-None-Match. 9100func (c *CustomersChromePrintersListPrinterModelsCall) IfNoneMatch(entityTag string) *CustomersChromePrintersListPrinterModelsCall { 9101 c.ifNoneMatch_ = entityTag 9102 return c 9103} 9104 9105// Context sets the context to be used in this call's Do method. Any 9106// pending HTTP request will be aborted if the provided context is 9107// canceled. 9108func (c *CustomersChromePrintersListPrinterModelsCall) Context(ctx context.Context) *CustomersChromePrintersListPrinterModelsCall { 9109 c.ctx_ = ctx 9110 return c 9111} 9112 9113// Header returns an http.Header that can be modified by the caller to 9114// add HTTP headers to the request. 9115func (c *CustomersChromePrintersListPrinterModelsCall) Header() http.Header { 9116 if c.header_ == nil { 9117 c.header_ = make(http.Header) 9118 } 9119 return c.header_ 9120} 9121 9122func (c *CustomersChromePrintersListPrinterModelsCall) doRequest(alt string) (*http.Response, error) { 9123 reqHeaders := make(http.Header) 9124 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9125 for k, v := range c.header_ { 9126 reqHeaders[k] = v 9127 } 9128 reqHeaders.Set("User-Agent", c.s.userAgent()) 9129 if c.ifNoneMatch_ != "" { 9130 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9131 } 9132 var body io.Reader = nil 9133 c.urlParams_.Set("alt", alt) 9134 c.urlParams_.Set("prettyPrint", "false") 9135 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+parent}/chrome/printers:listPrinterModels") 9136 urls += "?" + c.urlParams_.Encode() 9137 req, err := http.NewRequest("GET", urls, body) 9138 if err != nil { 9139 return nil, err 9140 } 9141 req.Header = reqHeaders 9142 googleapi.Expand(req.URL, map[string]string{ 9143 "parent": c.parent, 9144 }) 9145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9146} 9147 9148// Do executes the "admin.customers.chrome.printers.listPrinterModels" call. 9149// Exactly one of *ListPrinterModelsResponse or error will be non-nil. 9150// Any non-2xx status code is an error. Response headers are in either 9151// *ListPrinterModelsResponse.ServerResponse.Header or (if a response 9152// was returned at all) in error.(*googleapi.Error).Header. Use 9153// googleapi.IsNotModified to check whether the returned error was 9154// because http.StatusNotModified was returned. 9155func (c *CustomersChromePrintersListPrinterModelsCall) Do(opts ...googleapi.CallOption) (*ListPrinterModelsResponse, error) { 9156 gensupport.SetOptions(c.urlParams_, opts...) 9157 res, err := c.doRequest("json") 9158 if res != nil && res.StatusCode == http.StatusNotModified { 9159 if res.Body != nil { 9160 res.Body.Close() 9161 } 9162 return nil, &googleapi.Error{ 9163 Code: res.StatusCode, 9164 Header: res.Header, 9165 } 9166 } 9167 if err != nil { 9168 return nil, err 9169 } 9170 defer googleapi.CloseBody(res) 9171 if err := googleapi.CheckResponse(res); err != nil { 9172 return nil, err 9173 } 9174 ret := &ListPrinterModelsResponse{ 9175 ServerResponse: googleapi.ServerResponse{ 9176 Header: res.Header, 9177 HTTPStatusCode: res.StatusCode, 9178 }, 9179 } 9180 target := &ret 9181 if err := gensupport.DecodeResponse(target, res); err != nil { 9182 return nil, err 9183 } 9184 return ret, nil 9185 // { 9186 // "description": "Lists the supported printer models.", 9187 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers:listPrinterModels", 9188 // "httpMethod": "GET", 9189 // "id": "admin.customers.chrome.printers.listPrinterModels", 9190 // "parameterOrder": [ 9191 // "parent" 9192 // ], 9193 // "parameters": { 9194 // "filter": { 9195 // "description": "Filer to list only models by a given manufacturer in format: \"manufacturer:Brother\". Search syntax is shared between this api and Admin Console printers pages.", 9196 // "location": "query", 9197 // "type": "string" 9198 // }, 9199 // "pageSize": { 9200 // "description": "The maximum number of objects to return. The service may return fewer than this value.", 9201 // "format": "int32", 9202 // "location": "query", 9203 // "type": "integer" 9204 // }, 9205 // "pageToken": { 9206 // "description": "A page token, received from a previous call.", 9207 // "location": "query", 9208 // "type": "string" 9209 // }, 9210 // "parent": { 9211 // "description": "Required. The name of the customer who owns this collection of printers. Format: customers/{customer_id}", 9212 // "location": "path", 9213 // "pattern": "^customers/[^/]+$", 9214 // "required": true, 9215 // "type": "string" 9216 // } 9217 // }, 9218 // "path": "admin/directory/v1/{+parent}/chrome/printers:listPrinterModels", 9219 // "response": { 9220 // "$ref": "ListPrinterModelsResponse" 9221 // }, 9222 // "scopes": [ 9223 // "https://www.googleapis.com/auth/admin.chrome.printers", 9224 // "https://www.googleapis.com/auth/admin.chrome.printers.readonly" 9225 // ] 9226 // } 9227 9228} 9229 9230// Pages invokes f for each page of results. 9231// A non-nil error returned from f will halt the iteration. 9232// The provided context supersedes any context provided to the Context method. 9233func (c *CustomersChromePrintersListPrinterModelsCall) Pages(ctx context.Context, f func(*ListPrinterModelsResponse) error) error { 9234 c.ctx_ = ctx 9235 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9236 for { 9237 x, err := c.Do() 9238 if err != nil { 9239 return err 9240 } 9241 if err := f(x); err != nil { 9242 return err 9243 } 9244 if x.NextPageToken == "" { 9245 return nil 9246 } 9247 c.PageToken(x.NextPageToken) 9248 } 9249} 9250 9251// method id "admin.customers.chrome.printers.patch": 9252 9253type CustomersChromePrintersPatchCall struct { 9254 s *Service 9255 name string 9256 printer *Printer 9257 urlParams_ gensupport.URLParams 9258 ctx_ context.Context 9259 header_ http.Header 9260} 9261 9262// Patch: Updates a `Printer` resource. 9263// 9264// - name: The resource name of the Printer object, in the format 9265// customers/{customer-id}/printers/{printer-id} (During printer 9266// creation leave empty). 9267func (r *CustomersChromePrintersService) Patch(name string, printer *Printer) *CustomersChromePrintersPatchCall { 9268 c := &CustomersChromePrintersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9269 c.name = name 9270 c.printer = printer 9271 return c 9272} 9273 9274// ClearMask sets the optional parameter "clearMask": The list of fields 9275// to be cleared. Note, some of the fields are read only and cannot be 9276// updated. Values for not specified fields will be patched. 9277func (c *CustomersChromePrintersPatchCall) ClearMask(clearMask string) *CustomersChromePrintersPatchCall { 9278 c.urlParams_.Set("clearMask", clearMask) 9279 return c 9280} 9281 9282// UpdateMask sets the optional parameter "updateMask": The list of 9283// fields to be updated. Note, some of the fields are read only and 9284// cannot be updated. Values for not specified fields will be patched. 9285func (c *CustomersChromePrintersPatchCall) UpdateMask(updateMask string) *CustomersChromePrintersPatchCall { 9286 c.urlParams_.Set("updateMask", updateMask) 9287 return c 9288} 9289 9290// Fields allows partial responses to be retrieved. See 9291// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9292// for more information. 9293func (c *CustomersChromePrintersPatchCall) Fields(s ...googleapi.Field) *CustomersChromePrintersPatchCall { 9294 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9295 return c 9296} 9297 9298// Context sets the context to be used in this call's Do method. Any 9299// pending HTTP request will be aborted if the provided context is 9300// canceled. 9301func (c *CustomersChromePrintersPatchCall) Context(ctx context.Context) *CustomersChromePrintersPatchCall { 9302 c.ctx_ = ctx 9303 return c 9304} 9305 9306// Header returns an http.Header that can be modified by the caller to 9307// add HTTP headers to the request. 9308func (c *CustomersChromePrintersPatchCall) Header() http.Header { 9309 if c.header_ == nil { 9310 c.header_ = make(http.Header) 9311 } 9312 return c.header_ 9313} 9314 9315func (c *CustomersChromePrintersPatchCall) doRequest(alt string) (*http.Response, error) { 9316 reqHeaders := make(http.Header) 9317 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9318 for k, v := range c.header_ { 9319 reqHeaders[k] = v 9320 } 9321 reqHeaders.Set("User-Agent", c.s.userAgent()) 9322 var body io.Reader = nil 9323 body, err := googleapi.WithoutDataWrapper.JSONReader(c.printer) 9324 if err != nil { 9325 return nil, err 9326 } 9327 reqHeaders.Set("Content-Type", "application/json") 9328 c.urlParams_.Set("alt", alt) 9329 c.urlParams_.Set("prettyPrint", "false") 9330 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/{+name}") 9331 urls += "?" + c.urlParams_.Encode() 9332 req, err := http.NewRequest("PATCH", urls, body) 9333 if err != nil { 9334 return nil, err 9335 } 9336 req.Header = reqHeaders 9337 googleapi.Expand(req.URL, map[string]string{ 9338 "name": c.name, 9339 }) 9340 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9341} 9342 9343// Do executes the "admin.customers.chrome.printers.patch" call. 9344// Exactly one of *Printer or error will be non-nil. Any non-2xx status 9345// code is an error. Response headers are in either 9346// *Printer.ServerResponse.Header or (if a response was returned at all) 9347// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9348// check whether the returned error was because http.StatusNotModified 9349// was returned. 9350func (c *CustomersChromePrintersPatchCall) Do(opts ...googleapi.CallOption) (*Printer, error) { 9351 gensupport.SetOptions(c.urlParams_, opts...) 9352 res, err := c.doRequest("json") 9353 if res != nil && res.StatusCode == http.StatusNotModified { 9354 if res.Body != nil { 9355 res.Body.Close() 9356 } 9357 return nil, &googleapi.Error{ 9358 Code: res.StatusCode, 9359 Header: res.Header, 9360 } 9361 } 9362 if err != nil { 9363 return nil, err 9364 } 9365 defer googleapi.CloseBody(res) 9366 if err := googleapi.CheckResponse(res); err != nil { 9367 return nil, err 9368 } 9369 ret := &Printer{ 9370 ServerResponse: googleapi.ServerResponse{ 9371 Header: res.Header, 9372 HTTPStatusCode: res.StatusCode, 9373 }, 9374 } 9375 target := &ret 9376 if err := gensupport.DecodeResponse(target, res); err != nil { 9377 return nil, err 9378 } 9379 return ret, nil 9380 // { 9381 // "description": "Updates a `Printer` resource.", 9382 // "flatPath": "admin/directory/v1/customers/{customersId}/chrome/printers/{printersId}", 9383 // "httpMethod": "PATCH", 9384 // "id": "admin.customers.chrome.printers.patch", 9385 // "parameterOrder": [ 9386 // "name" 9387 // ], 9388 // "parameters": { 9389 // "clearMask": { 9390 // "description": "The list of fields to be cleared. Note, some of the fields are read only and cannot be updated. Values for not specified fields will be patched.", 9391 // "format": "google-fieldmask", 9392 // "location": "query", 9393 // "type": "string" 9394 // }, 9395 // "name": { 9396 // "description": "The resource name of the Printer object, in the format customers/{customer-id}/printers/{printer-id} (During printer creation leave empty)", 9397 // "location": "path", 9398 // "pattern": "^customers/[^/]+/chrome/printers/[^/]+$", 9399 // "required": true, 9400 // "type": "string" 9401 // }, 9402 // "updateMask": { 9403 // "description": "The list of fields to be updated. Note, some of the fields are read only and cannot be updated. Values for not specified fields will be patched.", 9404 // "format": "google-fieldmask", 9405 // "location": "query", 9406 // "type": "string" 9407 // } 9408 // }, 9409 // "path": "admin/directory/v1/{+name}", 9410 // "request": { 9411 // "$ref": "Printer" 9412 // }, 9413 // "response": { 9414 // "$ref": "Printer" 9415 // }, 9416 // "scopes": [ 9417 // "https://www.googleapis.com/auth/admin.chrome.printers" 9418 // ] 9419 // } 9420 9421} 9422 9423// method id "directory.domainAliases.delete": 9424 9425type DomainAliasesDeleteCall struct { 9426 s *Service 9427 customer string 9428 domainAliasName string 9429 urlParams_ gensupport.URLParams 9430 ctx_ context.Context 9431 header_ http.Header 9432} 9433 9434// Delete: Deletes a domain Alias of the customer. 9435// 9436// - customer: Immutable ID of the Google Workspace account. 9437// - domainAliasName: Name of domain alias to be retrieved. 9438func (r *DomainAliasesService) Delete(customer string, domainAliasName string) *DomainAliasesDeleteCall { 9439 c := &DomainAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9440 c.customer = customer 9441 c.domainAliasName = domainAliasName 9442 return c 9443} 9444 9445// Fields allows partial responses to be retrieved. See 9446// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9447// for more information. 9448func (c *DomainAliasesDeleteCall) Fields(s ...googleapi.Field) *DomainAliasesDeleteCall { 9449 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9450 return c 9451} 9452 9453// Context sets the context to be used in this call's Do method. Any 9454// pending HTTP request will be aborted if the provided context is 9455// canceled. 9456func (c *DomainAliasesDeleteCall) Context(ctx context.Context) *DomainAliasesDeleteCall { 9457 c.ctx_ = ctx 9458 return c 9459} 9460 9461// Header returns an http.Header that can be modified by the caller to 9462// add HTTP headers to the request. 9463func (c *DomainAliasesDeleteCall) Header() http.Header { 9464 if c.header_ == nil { 9465 c.header_ = make(http.Header) 9466 } 9467 return c.header_ 9468} 9469 9470func (c *DomainAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 9471 reqHeaders := make(http.Header) 9472 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9473 for k, v := range c.header_ { 9474 reqHeaders[k] = v 9475 } 9476 reqHeaders.Set("User-Agent", c.s.userAgent()) 9477 var body io.Reader = nil 9478 c.urlParams_.Set("alt", alt) 9479 c.urlParams_.Set("prettyPrint", "false") 9480 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") 9481 urls += "?" + c.urlParams_.Encode() 9482 req, err := http.NewRequest("DELETE", urls, body) 9483 if err != nil { 9484 return nil, err 9485 } 9486 req.Header = reqHeaders 9487 googleapi.Expand(req.URL, map[string]string{ 9488 "customer": c.customer, 9489 "domainAliasName": c.domainAliasName, 9490 }) 9491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9492} 9493 9494// Do executes the "directory.domainAliases.delete" call. 9495func (c *DomainAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 9496 gensupport.SetOptions(c.urlParams_, opts...) 9497 res, err := c.doRequest("json") 9498 if err != nil { 9499 return err 9500 } 9501 defer googleapi.CloseBody(res) 9502 if err := googleapi.CheckResponse(res); err != nil { 9503 return err 9504 } 9505 return nil 9506 // { 9507 // "description": "Deletes a domain Alias of the customer.", 9508 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 9509 // "httpMethod": "DELETE", 9510 // "id": "directory.domainAliases.delete", 9511 // "parameterOrder": [ 9512 // "customer", 9513 // "domainAliasName" 9514 // ], 9515 // "parameters": { 9516 // "customer": { 9517 // "description": "Immutable ID of the Google Workspace account.", 9518 // "location": "path", 9519 // "required": true, 9520 // "type": "string" 9521 // }, 9522 // "domainAliasName": { 9523 // "description": "Name of domain alias to be retrieved.", 9524 // "location": "path", 9525 // "required": true, 9526 // "type": "string" 9527 // } 9528 // }, 9529 // "path": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 9530 // "scopes": [ 9531 // "https://www.googleapis.com/auth/admin.directory.domain" 9532 // ] 9533 // } 9534 9535} 9536 9537// method id "directory.domainAliases.get": 9538 9539type DomainAliasesGetCall struct { 9540 s *Service 9541 customer string 9542 domainAliasName string 9543 urlParams_ gensupport.URLParams 9544 ifNoneMatch_ string 9545 ctx_ context.Context 9546 header_ http.Header 9547} 9548 9549// Get: Retrieves a domain alias of the customer. 9550// 9551// - customer: Immutable ID of the Google Workspace account. 9552// - domainAliasName: Name of domain alias to be retrieved. 9553func (r *DomainAliasesService) Get(customer string, domainAliasName string) *DomainAliasesGetCall { 9554 c := &DomainAliasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9555 c.customer = customer 9556 c.domainAliasName = domainAliasName 9557 return c 9558} 9559 9560// Fields allows partial responses to be retrieved. See 9561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9562// for more information. 9563func (c *DomainAliasesGetCall) Fields(s ...googleapi.Field) *DomainAliasesGetCall { 9564 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9565 return c 9566} 9567 9568// IfNoneMatch sets the optional parameter which makes the operation 9569// fail if the object's ETag matches the given value. This is useful for 9570// getting updates only after the object has changed since the last 9571// request. Use googleapi.IsNotModified to check whether the response 9572// error from Do is the result of In-None-Match. 9573func (c *DomainAliasesGetCall) IfNoneMatch(entityTag string) *DomainAliasesGetCall { 9574 c.ifNoneMatch_ = entityTag 9575 return c 9576} 9577 9578// Context sets the context to be used in this call's Do method. Any 9579// pending HTTP request will be aborted if the provided context is 9580// canceled. 9581func (c *DomainAliasesGetCall) Context(ctx context.Context) *DomainAliasesGetCall { 9582 c.ctx_ = ctx 9583 return c 9584} 9585 9586// Header returns an http.Header that can be modified by the caller to 9587// add HTTP headers to the request. 9588func (c *DomainAliasesGetCall) Header() http.Header { 9589 if c.header_ == nil { 9590 c.header_ = make(http.Header) 9591 } 9592 return c.header_ 9593} 9594 9595func (c *DomainAliasesGetCall) doRequest(alt string) (*http.Response, error) { 9596 reqHeaders := make(http.Header) 9597 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9598 for k, v := range c.header_ { 9599 reqHeaders[k] = v 9600 } 9601 reqHeaders.Set("User-Agent", c.s.userAgent()) 9602 if c.ifNoneMatch_ != "" { 9603 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9604 } 9605 var body io.Reader = nil 9606 c.urlParams_.Set("alt", alt) 9607 c.urlParams_.Set("prettyPrint", "false") 9608 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}") 9609 urls += "?" + c.urlParams_.Encode() 9610 req, err := http.NewRequest("GET", urls, body) 9611 if err != nil { 9612 return nil, err 9613 } 9614 req.Header = reqHeaders 9615 googleapi.Expand(req.URL, map[string]string{ 9616 "customer": c.customer, 9617 "domainAliasName": c.domainAliasName, 9618 }) 9619 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9620} 9621 9622// Do executes the "directory.domainAliases.get" call. 9623// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx 9624// status code is an error. Response headers are in either 9625// *DomainAlias.ServerResponse.Header or (if a response was returned at 9626// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9627// to check whether the returned error was because 9628// http.StatusNotModified was returned. 9629func (c *DomainAliasesGetCall) Do(opts ...googleapi.CallOption) (*DomainAlias, error) { 9630 gensupport.SetOptions(c.urlParams_, opts...) 9631 res, err := c.doRequest("json") 9632 if res != nil && res.StatusCode == http.StatusNotModified { 9633 if res.Body != nil { 9634 res.Body.Close() 9635 } 9636 return nil, &googleapi.Error{ 9637 Code: res.StatusCode, 9638 Header: res.Header, 9639 } 9640 } 9641 if err != nil { 9642 return nil, err 9643 } 9644 defer googleapi.CloseBody(res) 9645 if err := googleapi.CheckResponse(res); err != nil { 9646 return nil, err 9647 } 9648 ret := &DomainAlias{ 9649 ServerResponse: googleapi.ServerResponse{ 9650 Header: res.Header, 9651 HTTPStatusCode: res.StatusCode, 9652 }, 9653 } 9654 target := &ret 9655 if err := gensupport.DecodeResponse(target, res); err != nil { 9656 return nil, err 9657 } 9658 return ret, nil 9659 // { 9660 // "description": "Retrieves a domain alias of the customer.", 9661 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 9662 // "httpMethod": "GET", 9663 // "id": "directory.domainAliases.get", 9664 // "parameterOrder": [ 9665 // "customer", 9666 // "domainAliasName" 9667 // ], 9668 // "parameters": { 9669 // "customer": { 9670 // "description": "Immutable ID of the Google Workspace account.", 9671 // "location": "path", 9672 // "required": true, 9673 // "type": "string" 9674 // }, 9675 // "domainAliasName": { 9676 // "description": "Name of domain alias to be retrieved.", 9677 // "location": "path", 9678 // "required": true, 9679 // "type": "string" 9680 // } 9681 // }, 9682 // "path": "admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}", 9683 // "response": { 9684 // "$ref": "DomainAlias" 9685 // }, 9686 // "scopes": [ 9687 // "https://www.googleapis.com/auth/admin.directory.domain", 9688 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 9689 // ] 9690 // } 9691 9692} 9693 9694// method id "directory.domainAliases.insert": 9695 9696type DomainAliasesInsertCall struct { 9697 s *Service 9698 customer string 9699 domainalias *DomainAlias 9700 urlParams_ gensupport.URLParams 9701 ctx_ context.Context 9702 header_ http.Header 9703} 9704 9705// Insert: Inserts a domain alias of the customer. 9706// 9707// - customer: Immutable ID of the Google Workspace account. 9708func (r *DomainAliasesService) Insert(customer string, domainalias *DomainAlias) *DomainAliasesInsertCall { 9709 c := &DomainAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9710 c.customer = customer 9711 c.domainalias = domainalias 9712 return c 9713} 9714 9715// Fields allows partial responses to be retrieved. See 9716// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9717// for more information. 9718func (c *DomainAliasesInsertCall) Fields(s ...googleapi.Field) *DomainAliasesInsertCall { 9719 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9720 return c 9721} 9722 9723// Context sets the context to be used in this call's Do method. Any 9724// pending HTTP request will be aborted if the provided context is 9725// canceled. 9726func (c *DomainAliasesInsertCall) Context(ctx context.Context) *DomainAliasesInsertCall { 9727 c.ctx_ = ctx 9728 return c 9729} 9730 9731// Header returns an http.Header that can be modified by the caller to 9732// add HTTP headers to the request. 9733func (c *DomainAliasesInsertCall) Header() http.Header { 9734 if c.header_ == nil { 9735 c.header_ = make(http.Header) 9736 } 9737 return c.header_ 9738} 9739 9740func (c *DomainAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 9741 reqHeaders := make(http.Header) 9742 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9743 for k, v := range c.header_ { 9744 reqHeaders[k] = v 9745 } 9746 reqHeaders.Set("User-Agent", c.s.userAgent()) 9747 var body io.Reader = nil 9748 body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainalias) 9749 if err != nil { 9750 return nil, err 9751 } 9752 reqHeaders.Set("Content-Type", "application/json") 9753 c.urlParams_.Set("alt", alt) 9754 c.urlParams_.Set("prettyPrint", "false") 9755 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases") 9756 urls += "?" + c.urlParams_.Encode() 9757 req, err := http.NewRequest("POST", urls, body) 9758 if err != nil { 9759 return nil, err 9760 } 9761 req.Header = reqHeaders 9762 googleapi.Expand(req.URL, map[string]string{ 9763 "customer": c.customer, 9764 }) 9765 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9766} 9767 9768// Do executes the "directory.domainAliases.insert" call. 9769// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx 9770// status code is an error. Response headers are in either 9771// *DomainAlias.ServerResponse.Header or (if a response was returned at 9772// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9773// to check whether the returned error was because 9774// http.StatusNotModified was returned. 9775func (c *DomainAliasesInsertCall) Do(opts ...googleapi.CallOption) (*DomainAlias, error) { 9776 gensupport.SetOptions(c.urlParams_, opts...) 9777 res, err := c.doRequest("json") 9778 if res != nil && res.StatusCode == http.StatusNotModified { 9779 if res.Body != nil { 9780 res.Body.Close() 9781 } 9782 return nil, &googleapi.Error{ 9783 Code: res.StatusCode, 9784 Header: res.Header, 9785 } 9786 } 9787 if err != nil { 9788 return nil, err 9789 } 9790 defer googleapi.CloseBody(res) 9791 if err := googleapi.CheckResponse(res); err != nil { 9792 return nil, err 9793 } 9794 ret := &DomainAlias{ 9795 ServerResponse: googleapi.ServerResponse{ 9796 Header: res.Header, 9797 HTTPStatusCode: res.StatusCode, 9798 }, 9799 } 9800 target := &ret 9801 if err := gensupport.DecodeResponse(target, res); err != nil { 9802 return nil, err 9803 } 9804 return ret, nil 9805 // { 9806 // "description": "Inserts a domain alias of the customer.", 9807 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases", 9808 // "httpMethod": "POST", 9809 // "id": "directory.domainAliases.insert", 9810 // "parameterOrder": [ 9811 // "customer" 9812 // ], 9813 // "parameters": { 9814 // "customer": { 9815 // "description": "Immutable ID of the Google Workspace account.", 9816 // "location": "path", 9817 // "required": true, 9818 // "type": "string" 9819 // } 9820 // }, 9821 // "path": "admin/directory/v1/customer/{customer}/domainaliases", 9822 // "request": { 9823 // "$ref": "DomainAlias" 9824 // }, 9825 // "response": { 9826 // "$ref": "DomainAlias" 9827 // }, 9828 // "scopes": [ 9829 // "https://www.googleapis.com/auth/admin.directory.domain" 9830 // ] 9831 // } 9832 9833} 9834 9835// method id "directory.domainAliases.list": 9836 9837type DomainAliasesListCall struct { 9838 s *Service 9839 customer string 9840 urlParams_ gensupport.URLParams 9841 ifNoneMatch_ string 9842 ctx_ context.Context 9843 header_ http.Header 9844} 9845 9846// List: Lists the domain aliases of the customer. 9847// 9848// - customer: Immutable ID of the Google Workspace account. 9849func (r *DomainAliasesService) List(customer string) *DomainAliasesListCall { 9850 c := &DomainAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9851 c.customer = customer 9852 return c 9853} 9854 9855// ParentDomainName sets the optional parameter "parentDomainName": Name 9856// of the parent domain for which domain aliases are to be fetched. 9857func (c *DomainAliasesListCall) ParentDomainName(parentDomainName string) *DomainAliasesListCall { 9858 c.urlParams_.Set("parentDomainName", parentDomainName) 9859 return c 9860} 9861 9862// Fields allows partial responses to be retrieved. See 9863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9864// for more information. 9865func (c *DomainAliasesListCall) Fields(s ...googleapi.Field) *DomainAliasesListCall { 9866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9867 return c 9868} 9869 9870// IfNoneMatch sets the optional parameter which makes the operation 9871// fail if the object's ETag matches the given value. This is useful for 9872// getting updates only after the object has changed since the last 9873// request. Use googleapi.IsNotModified to check whether the response 9874// error from Do is the result of In-None-Match. 9875func (c *DomainAliasesListCall) IfNoneMatch(entityTag string) *DomainAliasesListCall { 9876 c.ifNoneMatch_ = entityTag 9877 return c 9878} 9879 9880// Context sets the context to be used in this call's Do method. Any 9881// pending HTTP request will be aborted if the provided context is 9882// canceled. 9883func (c *DomainAliasesListCall) Context(ctx context.Context) *DomainAliasesListCall { 9884 c.ctx_ = ctx 9885 return c 9886} 9887 9888// Header returns an http.Header that can be modified by the caller to 9889// add HTTP headers to the request. 9890func (c *DomainAliasesListCall) Header() http.Header { 9891 if c.header_ == nil { 9892 c.header_ = make(http.Header) 9893 } 9894 return c.header_ 9895} 9896 9897func (c *DomainAliasesListCall) doRequest(alt string) (*http.Response, error) { 9898 reqHeaders := make(http.Header) 9899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9900 for k, v := range c.header_ { 9901 reqHeaders[k] = v 9902 } 9903 reqHeaders.Set("User-Agent", c.s.userAgent()) 9904 if c.ifNoneMatch_ != "" { 9905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9906 } 9907 var body io.Reader = nil 9908 c.urlParams_.Set("alt", alt) 9909 c.urlParams_.Set("prettyPrint", "false") 9910 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domainaliases") 9911 urls += "?" + c.urlParams_.Encode() 9912 req, err := http.NewRequest("GET", urls, body) 9913 if err != nil { 9914 return nil, err 9915 } 9916 req.Header = reqHeaders 9917 googleapi.Expand(req.URL, map[string]string{ 9918 "customer": c.customer, 9919 }) 9920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9921} 9922 9923// Do executes the "directory.domainAliases.list" call. 9924// Exactly one of *DomainAliases or error will be non-nil. Any non-2xx 9925// status code is an error. Response headers are in either 9926// *DomainAliases.ServerResponse.Header or (if a response was returned 9927// at all) in error.(*googleapi.Error).Header. Use 9928// googleapi.IsNotModified to check whether the returned error was 9929// because http.StatusNotModified was returned. 9930func (c *DomainAliasesListCall) Do(opts ...googleapi.CallOption) (*DomainAliases, error) { 9931 gensupport.SetOptions(c.urlParams_, opts...) 9932 res, err := c.doRequest("json") 9933 if res != nil && res.StatusCode == http.StatusNotModified { 9934 if res.Body != nil { 9935 res.Body.Close() 9936 } 9937 return nil, &googleapi.Error{ 9938 Code: res.StatusCode, 9939 Header: res.Header, 9940 } 9941 } 9942 if err != nil { 9943 return nil, err 9944 } 9945 defer googleapi.CloseBody(res) 9946 if err := googleapi.CheckResponse(res); err != nil { 9947 return nil, err 9948 } 9949 ret := &DomainAliases{ 9950 ServerResponse: googleapi.ServerResponse{ 9951 Header: res.Header, 9952 HTTPStatusCode: res.StatusCode, 9953 }, 9954 } 9955 target := &ret 9956 if err := gensupport.DecodeResponse(target, res); err != nil { 9957 return nil, err 9958 } 9959 return ret, nil 9960 // { 9961 // "description": "Lists the domain aliases of the customer.", 9962 // "flatPath": "admin/directory/v1/customer/{customer}/domainaliases", 9963 // "httpMethod": "GET", 9964 // "id": "directory.domainAliases.list", 9965 // "parameterOrder": [ 9966 // "customer" 9967 // ], 9968 // "parameters": { 9969 // "customer": { 9970 // "description": "Immutable ID of the Google Workspace account.", 9971 // "location": "path", 9972 // "required": true, 9973 // "type": "string" 9974 // }, 9975 // "parentDomainName": { 9976 // "description": "Name of the parent domain for which domain aliases are to be fetched.", 9977 // "location": "query", 9978 // "type": "string" 9979 // } 9980 // }, 9981 // "path": "admin/directory/v1/customer/{customer}/domainaliases", 9982 // "response": { 9983 // "$ref": "DomainAliases" 9984 // }, 9985 // "scopes": [ 9986 // "https://www.googleapis.com/auth/admin.directory.domain", 9987 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 9988 // ] 9989 // } 9990 9991} 9992 9993// method id "directory.domains.delete": 9994 9995type DomainsDeleteCall struct { 9996 s *Service 9997 customer string 9998 domainName string 9999 urlParams_ gensupport.URLParams 10000 ctx_ context.Context 10001 header_ http.Header 10002} 10003 10004// Delete: Deletes a domain of the customer. 10005// 10006// - customer: Immutable ID of the Google Workspace account. 10007// - domainName: Name of domain to be deleted. 10008func (r *DomainsService) Delete(customer string, domainName string) *DomainsDeleteCall { 10009 c := &DomainsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10010 c.customer = customer 10011 c.domainName = domainName 10012 return c 10013} 10014 10015// Fields allows partial responses to be retrieved. See 10016// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10017// for more information. 10018func (c *DomainsDeleteCall) Fields(s ...googleapi.Field) *DomainsDeleteCall { 10019 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10020 return c 10021} 10022 10023// Context sets the context to be used in this call's Do method. Any 10024// pending HTTP request will be aborted if the provided context is 10025// canceled. 10026func (c *DomainsDeleteCall) Context(ctx context.Context) *DomainsDeleteCall { 10027 c.ctx_ = ctx 10028 return c 10029} 10030 10031// Header returns an http.Header that can be modified by the caller to 10032// add HTTP headers to the request. 10033func (c *DomainsDeleteCall) Header() http.Header { 10034 if c.header_ == nil { 10035 c.header_ = make(http.Header) 10036 } 10037 return c.header_ 10038} 10039 10040func (c *DomainsDeleteCall) doRequest(alt string) (*http.Response, error) { 10041 reqHeaders := make(http.Header) 10042 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10043 for k, v := range c.header_ { 10044 reqHeaders[k] = v 10045 } 10046 reqHeaders.Set("User-Agent", c.s.userAgent()) 10047 var body io.Reader = nil 10048 c.urlParams_.Set("alt", alt) 10049 c.urlParams_.Set("prettyPrint", "false") 10050 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") 10051 urls += "?" + c.urlParams_.Encode() 10052 req, err := http.NewRequest("DELETE", urls, body) 10053 if err != nil { 10054 return nil, err 10055 } 10056 req.Header = reqHeaders 10057 googleapi.Expand(req.URL, map[string]string{ 10058 "customer": c.customer, 10059 "domainName": c.domainName, 10060 }) 10061 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10062} 10063 10064// Do executes the "directory.domains.delete" call. 10065func (c *DomainsDeleteCall) Do(opts ...googleapi.CallOption) error { 10066 gensupport.SetOptions(c.urlParams_, opts...) 10067 res, err := c.doRequest("json") 10068 if err != nil { 10069 return err 10070 } 10071 defer googleapi.CloseBody(res) 10072 if err := googleapi.CheckResponse(res); err != nil { 10073 return err 10074 } 10075 return nil 10076 // { 10077 // "description": "Deletes a domain of the customer.", 10078 // "flatPath": "admin/directory/v1/customer/{customer}/domains/{domainName}", 10079 // "httpMethod": "DELETE", 10080 // "id": "directory.domains.delete", 10081 // "parameterOrder": [ 10082 // "customer", 10083 // "domainName" 10084 // ], 10085 // "parameters": { 10086 // "customer": { 10087 // "description": "Immutable ID of the Google Workspace account.", 10088 // "location": "path", 10089 // "required": true, 10090 // "type": "string" 10091 // }, 10092 // "domainName": { 10093 // "description": "Name of domain to be deleted", 10094 // "location": "path", 10095 // "required": true, 10096 // "type": "string" 10097 // } 10098 // }, 10099 // "path": "admin/directory/v1/customer/{customer}/domains/{domainName}", 10100 // "scopes": [ 10101 // "https://www.googleapis.com/auth/admin.directory.domain" 10102 // ] 10103 // } 10104 10105} 10106 10107// method id "directory.domains.get": 10108 10109type DomainsGetCall struct { 10110 s *Service 10111 customer string 10112 domainName string 10113 urlParams_ gensupport.URLParams 10114 ifNoneMatch_ string 10115 ctx_ context.Context 10116 header_ http.Header 10117} 10118 10119// Get: Retrieves a domain of the customer. 10120// 10121// - customer: Immutable ID of the Google Workspace account. 10122// - domainName: Name of domain to be retrieved. 10123func (r *DomainsService) Get(customer string, domainName string) *DomainsGetCall { 10124 c := &DomainsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10125 c.customer = customer 10126 c.domainName = domainName 10127 return c 10128} 10129 10130// Fields allows partial responses to be retrieved. See 10131// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10132// for more information. 10133func (c *DomainsGetCall) Fields(s ...googleapi.Field) *DomainsGetCall { 10134 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10135 return c 10136} 10137 10138// IfNoneMatch sets the optional parameter which makes the operation 10139// fail if the object's ETag matches the given value. This is useful for 10140// getting updates only after the object has changed since the last 10141// request. Use googleapi.IsNotModified to check whether the response 10142// error from Do is the result of In-None-Match. 10143func (c *DomainsGetCall) IfNoneMatch(entityTag string) *DomainsGetCall { 10144 c.ifNoneMatch_ = entityTag 10145 return c 10146} 10147 10148// Context sets the context to be used in this call's Do method. Any 10149// pending HTTP request will be aborted if the provided context is 10150// canceled. 10151func (c *DomainsGetCall) Context(ctx context.Context) *DomainsGetCall { 10152 c.ctx_ = ctx 10153 return c 10154} 10155 10156// Header returns an http.Header that can be modified by the caller to 10157// add HTTP headers to the request. 10158func (c *DomainsGetCall) Header() http.Header { 10159 if c.header_ == nil { 10160 c.header_ = make(http.Header) 10161 } 10162 return c.header_ 10163} 10164 10165func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { 10166 reqHeaders := make(http.Header) 10167 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10168 for k, v := range c.header_ { 10169 reqHeaders[k] = v 10170 } 10171 reqHeaders.Set("User-Agent", c.s.userAgent()) 10172 if c.ifNoneMatch_ != "" { 10173 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10174 } 10175 var body io.Reader = nil 10176 c.urlParams_.Set("alt", alt) 10177 c.urlParams_.Set("prettyPrint", "false") 10178 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains/{domainName}") 10179 urls += "?" + c.urlParams_.Encode() 10180 req, err := http.NewRequest("GET", urls, body) 10181 if err != nil { 10182 return nil, err 10183 } 10184 req.Header = reqHeaders 10185 googleapi.Expand(req.URL, map[string]string{ 10186 "customer": c.customer, 10187 "domainName": c.domainName, 10188 }) 10189 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10190} 10191 10192// Do executes the "directory.domains.get" call. 10193// Exactly one of *Domains or error will be non-nil. Any non-2xx status 10194// code is an error. Response headers are in either 10195// *Domains.ServerResponse.Header or (if a response was returned at all) 10196// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10197// check whether the returned error was because http.StatusNotModified 10198// was returned. 10199func (c *DomainsGetCall) Do(opts ...googleapi.CallOption) (*Domains, error) { 10200 gensupport.SetOptions(c.urlParams_, opts...) 10201 res, err := c.doRequest("json") 10202 if res != nil && res.StatusCode == http.StatusNotModified { 10203 if res.Body != nil { 10204 res.Body.Close() 10205 } 10206 return nil, &googleapi.Error{ 10207 Code: res.StatusCode, 10208 Header: res.Header, 10209 } 10210 } 10211 if err != nil { 10212 return nil, err 10213 } 10214 defer googleapi.CloseBody(res) 10215 if err := googleapi.CheckResponse(res); err != nil { 10216 return nil, err 10217 } 10218 ret := &Domains{ 10219 ServerResponse: googleapi.ServerResponse{ 10220 Header: res.Header, 10221 HTTPStatusCode: res.StatusCode, 10222 }, 10223 } 10224 target := &ret 10225 if err := gensupport.DecodeResponse(target, res); err != nil { 10226 return nil, err 10227 } 10228 return ret, nil 10229 // { 10230 // "description": "Retrieves a domain of the customer.", 10231 // "flatPath": "admin/directory/v1/customer/{customer}/domains/{domainName}", 10232 // "httpMethod": "GET", 10233 // "id": "directory.domains.get", 10234 // "parameterOrder": [ 10235 // "customer", 10236 // "domainName" 10237 // ], 10238 // "parameters": { 10239 // "customer": { 10240 // "description": "Immutable ID of the Google Workspace account.", 10241 // "location": "path", 10242 // "required": true, 10243 // "type": "string" 10244 // }, 10245 // "domainName": { 10246 // "description": "Name of domain to be retrieved", 10247 // "location": "path", 10248 // "required": true, 10249 // "type": "string" 10250 // } 10251 // }, 10252 // "path": "admin/directory/v1/customer/{customer}/domains/{domainName}", 10253 // "response": { 10254 // "$ref": "Domains" 10255 // }, 10256 // "scopes": [ 10257 // "https://www.googleapis.com/auth/admin.directory.domain", 10258 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 10259 // ] 10260 // } 10261 10262} 10263 10264// method id "directory.domains.insert": 10265 10266type DomainsInsertCall struct { 10267 s *Service 10268 customer string 10269 domains *Domains 10270 urlParams_ gensupport.URLParams 10271 ctx_ context.Context 10272 header_ http.Header 10273} 10274 10275// Insert: Inserts a domain of the customer. 10276// 10277// - customer: Immutable ID of the Google Workspace account. 10278func (r *DomainsService) Insert(customer string, domains *Domains) *DomainsInsertCall { 10279 c := &DomainsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10280 c.customer = customer 10281 c.domains = domains 10282 return c 10283} 10284 10285// Fields allows partial responses to be retrieved. See 10286// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10287// for more information. 10288func (c *DomainsInsertCall) Fields(s ...googleapi.Field) *DomainsInsertCall { 10289 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10290 return c 10291} 10292 10293// Context sets the context to be used in this call's Do method. Any 10294// pending HTTP request will be aborted if the provided context is 10295// canceled. 10296func (c *DomainsInsertCall) Context(ctx context.Context) *DomainsInsertCall { 10297 c.ctx_ = ctx 10298 return c 10299} 10300 10301// Header returns an http.Header that can be modified by the caller to 10302// add HTTP headers to the request. 10303func (c *DomainsInsertCall) Header() http.Header { 10304 if c.header_ == nil { 10305 c.header_ = make(http.Header) 10306 } 10307 return c.header_ 10308} 10309 10310func (c *DomainsInsertCall) doRequest(alt string) (*http.Response, error) { 10311 reqHeaders := make(http.Header) 10312 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10313 for k, v := range c.header_ { 10314 reqHeaders[k] = v 10315 } 10316 reqHeaders.Set("User-Agent", c.s.userAgent()) 10317 var body io.Reader = nil 10318 body, err := googleapi.WithoutDataWrapper.JSONReader(c.domains) 10319 if err != nil { 10320 return nil, err 10321 } 10322 reqHeaders.Set("Content-Type", "application/json") 10323 c.urlParams_.Set("alt", alt) 10324 c.urlParams_.Set("prettyPrint", "false") 10325 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains") 10326 urls += "?" + c.urlParams_.Encode() 10327 req, err := http.NewRequest("POST", urls, body) 10328 if err != nil { 10329 return nil, err 10330 } 10331 req.Header = reqHeaders 10332 googleapi.Expand(req.URL, map[string]string{ 10333 "customer": c.customer, 10334 }) 10335 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10336} 10337 10338// Do executes the "directory.domains.insert" call. 10339// Exactly one of *Domains or error will be non-nil. Any non-2xx status 10340// code is an error. Response headers are in either 10341// *Domains.ServerResponse.Header or (if a response was returned at all) 10342// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10343// check whether the returned error was because http.StatusNotModified 10344// was returned. 10345func (c *DomainsInsertCall) Do(opts ...googleapi.CallOption) (*Domains, error) { 10346 gensupport.SetOptions(c.urlParams_, opts...) 10347 res, err := c.doRequest("json") 10348 if res != nil && res.StatusCode == http.StatusNotModified { 10349 if res.Body != nil { 10350 res.Body.Close() 10351 } 10352 return nil, &googleapi.Error{ 10353 Code: res.StatusCode, 10354 Header: res.Header, 10355 } 10356 } 10357 if err != nil { 10358 return nil, err 10359 } 10360 defer googleapi.CloseBody(res) 10361 if err := googleapi.CheckResponse(res); err != nil { 10362 return nil, err 10363 } 10364 ret := &Domains{ 10365 ServerResponse: googleapi.ServerResponse{ 10366 Header: res.Header, 10367 HTTPStatusCode: res.StatusCode, 10368 }, 10369 } 10370 target := &ret 10371 if err := gensupport.DecodeResponse(target, res); err != nil { 10372 return nil, err 10373 } 10374 return ret, nil 10375 // { 10376 // "description": "Inserts a domain of the customer.", 10377 // "flatPath": "admin/directory/v1/customer/{customer}/domains", 10378 // "httpMethod": "POST", 10379 // "id": "directory.domains.insert", 10380 // "parameterOrder": [ 10381 // "customer" 10382 // ], 10383 // "parameters": { 10384 // "customer": { 10385 // "description": "Immutable ID of the Google Workspace account.", 10386 // "location": "path", 10387 // "required": true, 10388 // "type": "string" 10389 // } 10390 // }, 10391 // "path": "admin/directory/v1/customer/{customer}/domains", 10392 // "request": { 10393 // "$ref": "Domains" 10394 // }, 10395 // "response": { 10396 // "$ref": "Domains" 10397 // }, 10398 // "scopes": [ 10399 // "https://www.googleapis.com/auth/admin.directory.domain" 10400 // ] 10401 // } 10402 10403} 10404 10405// method id "directory.domains.list": 10406 10407type DomainsListCall struct { 10408 s *Service 10409 customer string 10410 urlParams_ gensupport.URLParams 10411 ifNoneMatch_ string 10412 ctx_ context.Context 10413 header_ http.Header 10414} 10415 10416// List: Lists the domains of the customer. 10417// 10418// - customer: Immutable ID of the Google Workspace account. 10419func (r *DomainsService) List(customer string) *DomainsListCall { 10420 c := &DomainsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10421 c.customer = customer 10422 return c 10423} 10424 10425// Fields allows partial responses to be retrieved. See 10426// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10427// for more information. 10428func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall { 10429 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10430 return c 10431} 10432 10433// IfNoneMatch sets the optional parameter which makes the operation 10434// fail if the object's ETag matches the given value. This is useful for 10435// getting updates only after the object has changed since the last 10436// request. Use googleapi.IsNotModified to check whether the response 10437// error from Do is the result of In-None-Match. 10438func (c *DomainsListCall) IfNoneMatch(entityTag string) *DomainsListCall { 10439 c.ifNoneMatch_ = entityTag 10440 return c 10441} 10442 10443// Context sets the context to be used in this call's Do method. Any 10444// pending HTTP request will be aborted if the provided context is 10445// canceled. 10446func (c *DomainsListCall) Context(ctx context.Context) *DomainsListCall { 10447 c.ctx_ = ctx 10448 return c 10449} 10450 10451// Header returns an http.Header that can be modified by the caller to 10452// add HTTP headers to the request. 10453func (c *DomainsListCall) Header() http.Header { 10454 if c.header_ == nil { 10455 c.header_ = make(http.Header) 10456 } 10457 return c.header_ 10458} 10459 10460func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { 10461 reqHeaders := make(http.Header) 10462 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10463 for k, v := range c.header_ { 10464 reqHeaders[k] = v 10465 } 10466 reqHeaders.Set("User-Agent", c.s.userAgent()) 10467 if c.ifNoneMatch_ != "" { 10468 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10469 } 10470 var body io.Reader = nil 10471 c.urlParams_.Set("alt", alt) 10472 c.urlParams_.Set("prettyPrint", "false") 10473 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/domains") 10474 urls += "?" + c.urlParams_.Encode() 10475 req, err := http.NewRequest("GET", urls, body) 10476 if err != nil { 10477 return nil, err 10478 } 10479 req.Header = reqHeaders 10480 googleapi.Expand(req.URL, map[string]string{ 10481 "customer": c.customer, 10482 }) 10483 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10484} 10485 10486// Do executes the "directory.domains.list" call. 10487// Exactly one of *Domains2 or error will be non-nil. Any non-2xx status 10488// code is an error. Response headers are in either 10489// *Domains2.ServerResponse.Header or (if a response was returned at 10490// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10491// to check whether the returned error was because 10492// http.StatusNotModified was returned. 10493func (c *DomainsListCall) Do(opts ...googleapi.CallOption) (*Domains2, error) { 10494 gensupport.SetOptions(c.urlParams_, opts...) 10495 res, err := c.doRequest("json") 10496 if res != nil && res.StatusCode == http.StatusNotModified { 10497 if res.Body != nil { 10498 res.Body.Close() 10499 } 10500 return nil, &googleapi.Error{ 10501 Code: res.StatusCode, 10502 Header: res.Header, 10503 } 10504 } 10505 if err != nil { 10506 return nil, err 10507 } 10508 defer googleapi.CloseBody(res) 10509 if err := googleapi.CheckResponse(res); err != nil { 10510 return nil, err 10511 } 10512 ret := &Domains2{ 10513 ServerResponse: googleapi.ServerResponse{ 10514 Header: res.Header, 10515 HTTPStatusCode: res.StatusCode, 10516 }, 10517 } 10518 target := &ret 10519 if err := gensupport.DecodeResponse(target, res); err != nil { 10520 return nil, err 10521 } 10522 return ret, nil 10523 // { 10524 // "description": "Lists the domains of the customer.", 10525 // "flatPath": "admin/directory/v1/customer/{customer}/domains", 10526 // "httpMethod": "GET", 10527 // "id": "directory.domains.list", 10528 // "parameterOrder": [ 10529 // "customer" 10530 // ], 10531 // "parameters": { 10532 // "customer": { 10533 // "description": "Immutable ID of the Google Workspace account.", 10534 // "location": "path", 10535 // "required": true, 10536 // "type": "string" 10537 // } 10538 // }, 10539 // "path": "admin/directory/v1/customer/{customer}/domains", 10540 // "response": { 10541 // "$ref": "Domains2" 10542 // }, 10543 // "scopes": [ 10544 // "https://www.googleapis.com/auth/admin.directory.domain", 10545 // "https://www.googleapis.com/auth/admin.directory.domain.readonly" 10546 // ] 10547 // } 10548 10549} 10550 10551// method id "directory.groups.delete": 10552 10553type GroupsDeleteCall struct { 10554 s *Service 10555 groupKey string 10556 urlParams_ gensupport.URLParams 10557 ctx_ context.Context 10558 header_ http.Header 10559} 10560 10561// Delete: Deletes a group. 10562// 10563// - groupKey: Identifies the group in the API request. The value can be 10564// the group's email address, group alias, or the unique group ID. 10565func (r *GroupsService) Delete(groupKey string) *GroupsDeleteCall { 10566 c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10567 c.groupKey = groupKey 10568 return c 10569} 10570 10571// Fields allows partial responses to be retrieved. See 10572// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10573// for more information. 10574func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { 10575 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10576 return c 10577} 10578 10579// Context sets the context to be used in this call's Do method. Any 10580// pending HTTP request will be aborted if the provided context is 10581// canceled. 10582func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { 10583 c.ctx_ = ctx 10584 return c 10585} 10586 10587// Header returns an http.Header that can be modified by the caller to 10588// add HTTP headers to the request. 10589func (c *GroupsDeleteCall) Header() http.Header { 10590 if c.header_ == nil { 10591 c.header_ = make(http.Header) 10592 } 10593 return c.header_ 10594} 10595 10596func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 10597 reqHeaders := make(http.Header) 10598 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10599 for k, v := range c.header_ { 10600 reqHeaders[k] = v 10601 } 10602 reqHeaders.Set("User-Agent", c.s.userAgent()) 10603 var body io.Reader = nil 10604 c.urlParams_.Set("alt", alt) 10605 c.urlParams_.Set("prettyPrint", "false") 10606 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 10607 urls += "?" + c.urlParams_.Encode() 10608 req, err := http.NewRequest("DELETE", urls, body) 10609 if err != nil { 10610 return nil, err 10611 } 10612 req.Header = reqHeaders 10613 googleapi.Expand(req.URL, map[string]string{ 10614 "groupKey": c.groupKey, 10615 }) 10616 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10617} 10618 10619// Do executes the "directory.groups.delete" call. 10620func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) error { 10621 gensupport.SetOptions(c.urlParams_, opts...) 10622 res, err := c.doRequest("json") 10623 if err != nil { 10624 return err 10625 } 10626 defer googleapi.CloseBody(res) 10627 if err := googleapi.CheckResponse(res); err != nil { 10628 return err 10629 } 10630 return nil 10631 // { 10632 // "description": "Deletes a group.", 10633 // "flatPath": "admin/directory/v1/groups/{groupKey}", 10634 // "httpMethod": "DELETE", 10635 // "id": "directory.groups.delete", 10636 // "parameterOrder": [ 10637 // "groupKey" 10638 // ], 10639 // "parameters": { 10640 // "groupKey": { 10641 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10642 // "location": "path", 10643 // "required": true, 10644 // "type": "string" 10645 // } 10646 // }, 10647 // "path": "admin/directory/v1/groups/{groupKey}", 10648 // "scopes": [ 10649 // "https://www.googleapis.com/auth/admin.directory.group" 10650 // ] 10651 // } 10652 10653} 10654 10655// method id "directory.groups.get": 10656 10657type GroupsGetCall struct { 10658 s *Service 10659 groupKey string 10660 urlParams_ gensupport.URLParams 10661 ifNoneMatch_ string 10662 ctx_ context.Context 10663 header_ http.Header 10664} 10665 10666// Get: Retrieves a group's properties. 10667// 10668// - groupKey: Identifies the group in the API request. The value can be 10669// the group's email address, group alias, or the unique group ID. 10670func (r *GroupsService) Get(groupKey string) *GroupsGetCall { 10671 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10672 c.groupKey = groupKey 10673 return c 10674} 10675 10676// Fields allows partial responses to be retrieved. See 10677// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10678// for more information. 10679func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 10680 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10681 return c 10682} 10683 10684// IfNoneMatch sets the optional parameter which makes the operation 10685// fail if the object's ETag matches the given value. This is useful for 10686// getting updates only after the object has changed since the last 10687// request. Use googleapi.IsNotModified to check whether the response 10688// error from Do is the result of In-None-Match. 10689func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 10690 c.ifNoneMatch_ = entityTag 10691 return c 10692} 10693 10694// Context sets the context to be used in this call's Do method. Any 10695// pending HTTP request will be aborted if the provided context is 10696// canceled. 10697func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 10698 c.ctx_ = ctx 10699 return c 10700} 10701 10702// Header returns an http.Header that can be modified by the caller to 10703// add HTTP headers to the request. 10704func (c *GroupsGetCall) Header() http.Header { 10705 if c.header_ == nil { 10706 c.header_ = make(http.Header) 10707 } 10708 return c.header_ 10709} 10710 10711func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 10712 reqHeaders := make(http.Header) 10713 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10714 for k, v := range c.header_ { 10715 reqHeaders[k] = v 10716 } 10717 reqHeaders.Set("User-Agent", c.s.userAgent()) 10718 if c.ifNoneMatch_ != "" { 10719 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10720 } 10721 var body io.Reader = nil 10722 c.urlParams_.Set("alt", alt) 10723 c.urlParams_.Set("prettyPrint", "false") 10724 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 10725 urls += "?" + c.urlParams_.Encode() 10726 req, err := http.NewRequest("GET", urls, body) 10727 if err != nil { 10728 return nil, err 10729 } 10730 req.Header = reqHeaders 10731 googleapi.Expand(req.URL, map[string]string{ 10732 "groupKey": c.groupKey, 10733 }) 10734 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10735} 10736 10737// Do executes the "directory.groups.get" call. 10738// Exactly one of *Group or error will be non-nil. Any non-2xx status 10739// code is an error. Response headers are in either 10740// *Group.ServerResponse.Header or (if a response was returned at all) 10741// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10742// check whether the returned error was because http.StatusNotModified 10743// was returned. 10744func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 10745 gensupport.SetOptions(c.urlParams_, opts...) 10746 res, err := c.doRequest("json") 10747 if res != nil && res.StatusCode == http.StatusNotModified { 10748 if res.Body != nil { 10749 res.Body.Close() 10750 } 10751 return nil, &googleapi.Error{ 10752 Code: res.StatusCode, 10753 Header: res.Header, 10754 } 10755 } 10756 if err != nil { 10757 return nil, err 10758 } 10759 defer googleapi.CloseBody(res) 10760 if err := googleapi.CheckResponse(res); err != nil { 10761 return nil, err 10762 } 10763 ret := &Group{ 10764 ServerResponse: googleapi.ServerResponse{ 10765 Header: res.Header, 10766 HTTPStatusCode: res.StatusCode, 10767 }, 10768 } 10769 target := &ret 10770 if err := gensupport.DecodeResponse(target, res); err != nil { 10771 return nil, err 10772 } 10773 return ret, nil 10774 // { 10775 // "description": "Retrieves a group's properties.", 10776 // "flatPath": "admin/directory/v1/groups/{groupKey}", 10777 // "httpMethod": "GET", 10778 // "id": "directory.groups.get", 10779 // "parameterOrder": [ 10780 // "groupKey" 10781 // ], 10782 // "parameters": { 10783 // "groupKey": { 10784 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 10785 // "location": "path", 10786 // "required": true, 10787 // "type": "string" 10788 // } 10789 // }, 10790 // "path": "admin/directory/v1/groups/{groupKey}", 10791 // "response": { 10792 // "$ref": "Group" 10793 // }, 10794 // "scopes": [ 10795 // "https://www.googleapis.com/auth/admin.directory.group", 10796 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 10797 // ] 10798 // } 10799 10800} 10801 10802// method id "directory.groups.insert": 10803 10804type GroupsInsertCall struct { 10805 s *Service 10806 group *Group 10807 urlParams_ gensupport.URLParams 10808 ctx_ context.Context 10809 header_ http.Header 10810} 10811 10812// Insert: Creates a group. 10813func (r *GroupsService) Insert(group *Group) *GroupsInsertCall { 10814 c := &GroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10815 c.group = group 10816 return c 10817} 10818 10819// Fields allows partial responses to be retrieved. See 10820// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10821// for more information. 10822func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { 10823 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10824 return c 10825} 10826 10827// Context sets the context to be used in this call's Do method. Any 10828// pending HTTP request will be aborted if the provided context is 10829// canceled. 10830func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { 10831 c.ctx_ = ctx 10832 return c 10833} 10834 10835// Header returns an http.Header that can be modified by the caller to 10836// add HTTP headers to the request. 10837func (c *GroupsInsertCall) Header() http.Header { 10838 if c.header_ == nil { 10839 c.header_ = make(http.Header) 10840 } 10841 return c.header_ 10842} 10843 10844func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) { 10845 reqHeaders := make(http.Header) 10846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10847 for k, v := range c.header_ { 10848 reqHeaders[k] = v 10849 } 10850 reqHeaders.Set("User-Agent", c.s.userAgent()) 10851 var body io.Reader = nil 10852 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 10853 if err != nil { 10854 return nil, err 10855 } 10856 reqHeaders.Set("Content-Type", "application/json") 10857 c.urlParams_.Set("alt", alt) 10858 c.urlParams_.Set("prettyPrint", "false") 10859 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups") 10860 urls += "?" + c.urlParams_.Encode() 10861 req, err := http.NewRequest("POST", urls, body) 10862 if err != nil { 10863 return nil, err 10864 } 10865 req.Header = reqHeaders 10866 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10867} 10868 10869// Do executes the "directory.groups.insert" call. 10870// Exactly one of *Group or error will be non-nil. Any non-2xx status 10871// code is an error. Response headers are in either 10872// *Group.ServerResponse.Header or (if a response was returned at all) 10873// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10874// check whether the returned error was because http.StatusNotModified 10875// was returned. 10876func (c *GroupsInsertCall) Do(opts ...googleapi.CallOption) (*Group, error) { 10877 gensupport.SetOptions(c.urlParams_, opts...) 10878 res, err := c.doRequest("json") 10879 if res != nil && res.StatusCode == http.StatusNotModified { 10880 if res.Body != nil { 10881 res.Body.Close() 10882 } 10883 return nil, &googleapi.Error{ 10884 Code: res.StatusCode, 10885 Header: res.Header, 10886 } 10887 } 10888 if err != nil { 10889 return nil, err 10890 } 10891 defer googleapi.CloseBody(res) 10892 if err := googleapi.CheckResponse(res); err != nil { 10893 return nil, err 10894 } 10895 ret := &Group{ 10896 ServerResponse: googleapi.ServerResponse{ 10897 Header: res.Header, 10898 HTTPStatusCode: res.StatusCode, 10899 }, 10900 } 10901 target := &ret 10902 if err := gensupport.DecodeResponse(target, res); err != nil { 10903 return nil, err 10904 } 10905 return ret, nil 10906 // { 10907 // "description": "Creates a group.", 10908 // "flatPath": "admin/directory/v1/groups", 10909 // "httpMethod": "POST", 10910 // "id": "directory.groups.insert", 10911 // "parameterOrder": [], 10912 // "parameters": {}, 10913 // "path": "admin/directory/v1/groups", 10914 // "request": { 10915 // "$ref": "Group" 10916 // }, 10917 // "response": { 10918 // "$ref": "Group" 10919 // }, 10920 // "scopes": [ 10921 // "https://www.googleapis.com/auth/admin.directory.group" 10922 // ] 10923 // } 10924 10925} 10926 10927// method id "directory.groups.list": 10928 10929type GroupsListCall struct { 10930 s *Service 10931 urlParams_ gensupport.URLParams 10932 ifNoneMatch_ string 10933 ctx_ context.Context 10934 header_ http.Header 10935} 10936 10937// List: Retrieves all groups of a domain or of a user given a userKey 10938// (paginated). 10939func (r *GroupsService) List() *GroupsListCall { 10940 c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10941 return c 10942} 10943 10944// Customer sets the optional parameter "customer": The unique ID for 10945// the customer's Google Workspace account. In case of a multi-domain 10946// account, to fetch all groups for a customer, fill this field instead 10947// of domain. As an account administrator, you can also use the 10948// `my_customer` alias to represent your account's `customerId`. The 10949// `customerId` is also returned as part of the Users 10950// (/admin-sdk/directory/v1/reference/users) 10951func (c *GroupsListCall) Customer(customer string) *GroupsListCall { 10952 c.urlParams_.Set("customer", customer) 10953 return c 10954} 10955 10956// Domain sets the optional parameter "domain": The domain name. Use 10957// this field to get fields from only one domain. To return all domains 10958// for a customer account, use the `customer` query parameter instead. 10959func (c *GroupsListCall) Domain(domain string) *GroupsListCall { 10960 c.urlParams_.Set("domain", domain) 10961 return c 10962} 10963 10964// MaxResults sets the optional parameter "maxResults": Maximum number 10965// of results to return. Max allowed value is 200. 10966func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { 10967 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10968 return c 10969} 10970 10971// OrderBy sets the optional parameter "orderBy": Column to use for 10972// sorting results 10973// 10974// Possible values: 10975// "email" - Email of the group. 10976func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { 10977 c.urlParams_.Set("orderBy", orderBy) 10978 return c 10979} 10980 10981// PageToken sets the optional parameter "pageToken": Token to specify 10982// next page in the list 10983func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { 10984 c.urlParams_.Set("pageToken", pageToken) 10985 return c 10986} 10987 10988// Query sets the optional parameter "query": Query string search. 10989// Should be of the form "". Complete documentation is at https: 10990// //developers.google.com/admin-sdk/directory/v1/guides/search-groups 10991func (c *GroupsListCall) Query(query string) *GroupsListCall { 10992 c.urlParams_.Set("query", query) 10993 return c 10994} 10995 10996// SortOrder sets the optional parameter "sortOrder": Whether to return 10997// results in ascending or descending order. Only of use when orderBy is 10998// also used 10999// 11000// Possible values: 11001// "ASCENDING" - Ascending order. 11002// "DESCENDING" - Descending order. 11003func (c *GroupsListCall) SortOrder(sortOrder string) *GroupsListCall { 11004 c.urlParams_.Set("sortOrder", sortOrder) 11005 return c 11006} 11007 11008// UserKey sets the optional parameter "userKey": Email or immutable ID 11009// of the user if only those groups are to be listed, the given user is 11010// a member of. If it's an ID, it should match with the ID of the user 11011// object. 11012func (c *GroupsListCall) UserKey(userKey string) *GroupsListCall { 11013 c.urlParams_.Set("userKey", userKey) 11014 return c 11015} 11016 11017// Fields allows partial responses to be retrieved. See 11018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11019// for more information. 11020func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { 11021 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11022 return c 11023} 11024 11025// IfNoneMatch sets the optional parameter which makes the operation 11026// fail if the object's ETag matches the given value. This is useful for 11027// getting updates only after the object has changed since the last 11028// request. Use googleapi.IsNotModified to check whether the response 11029// error from Do is the result of In-None-Match. 11030func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { 11031 c.ifNoneMatch_ = entityTag 11032 return c 11033} 11034 11035// Context sets the context to be used in this call's Do method. Any 11036// pending HTTP request will be aborted if the provided context is 11037// canceled. 11038func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { 11039 c.ctx_ = ctx 11040 return c 11041} 11042 11043// Header returns an http.Header that can be modified by the caller to 11044// add HTTP headers to the request. 11045func (c *GroupsListCall) Header() http.Header { 11046 if c.header_ == nil { 11047 c.header_ = make(http.Header) 11048 } 11049 return c.header_ 11050} 11051 11052func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { 11053 reqHeaders := make(http.Header) 11054 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11055 for k, v := range c.header_ { 11056 reqHeaders[k] = v 11057 } 11058 reqHeaders.Set("User-Agent", c.s.userAgent()) 11059 if c.ifNoneMatch_ != "" { 11060 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11061 } 11062 var body io.Reader = nil 11063 c.urlParams_.Set("alt", alt) 11064 c.urlParams_.Set("prettyPrint", "false") 11065 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups") 11066 urls += "?" + c.urlParams_.Encode() 11067 req, err := http.NewRequest("GET", urls, body) 11068 if err != nil { 11069 return nil, err 11070 } 11071 req.Header = reqHeaders 11072 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11073} 11074 11075// Do executes the "directory.groups.list" call. 11076// Exactly one of *Groups or error will be non-nil. Any non-2xx status 11077// code is an error. Response headers are in either 11078// *Groups.ServerResponse.Header or (if a response was returned at all) 11079// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11080// check whether the returned error was because http.StatusNotModified 11081// was returned. 11082func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*Groups, error) { 11083 gensupport.SetOptions(c.urlParams_, opts...) 11084 res, err := c.doRequest("json") 11085 if res != nil && res.StatusCode == http.StatusNotModified { 11086 if res.Body != nil { 11087 res.Body.Close() 11088 } 11089 return nil, &googleapi.Error{ 11090 Code: res.StatusCode, 11091 Header: res.Header, 11092 } 11093 } 11094 if err != nil { 11095 return nil, err 11096 } 11097 defer googleapi.CloseBody(res) 11098 if err := googleapi.CheckResponse(res); err != nil { 11099 return nil, err 11100 } 11101 ret := &Groups{ 11102 ServerResponse: googleapi.ServerResponse{ 11103 Header: res.Header, 11104 HTTPStatusCode: res.StatusCode, 11105 }, 11106 } 11107 target := &ret 11108 if err := gensupport.DecodeResponse(target, res); err != nil { 11109 return nil, err 11110 } 11111 return ret, nil 11112 // { 11113 // "description": "Retrieves all groups of a domain or of a user given a userKey (paginated).", 11114 // "flatPath": "admin/directory/v1/groups", 11115 // "httpMethod": "GET", 11116 // "id": "directory.groups.list", 11117 // "parameterOrder": [], 11118 // "parameters": { 11119 // "customer": { 11120 // "description": "The unique ID for the customer's Google Workspace 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)", 11121 // "location": "query", 11122 // "type": "string" 11123 // }, 11124 // "domain": { 11125 // "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.", 11126 // "location": "query", 11127 // "type": "string" 11128 // }, 11129 // "maxResults": { 11130 // "default": "200", 11131 // "description": "Maximum number of results to return. Max allowed value is 200.", 11132 // "format": "int32", 11133 // "location": "query", 11134 // "minimum": "1", 11135 // "type": "integer" 11136 // }, 11137 // "orderBy": { 11138 // "description": "Column to use for sorting results", 11139 // "enum": [ 11140 // "email" 11141 // ], 11142 // "enumDescriptions": [ 11143 // "Email of the group." 11144 // ], 11145 // "location": "query", 11146 // "type": "string" 11147 // }, 11148 // "pageToken": { 11149 // "description": "Token to specify next page in the list", 11150 // "location": "query", 11151 // "type": "string" 11152 // }, 11153 // "query": { 11154 // "description": "Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-groups", 11155 // "location": "query", 11156 // "type": "string" 11157 // }, 11158 // "sortOrder": { 11159 // "description": "Whether to return results in ascending or descending order. Only of use when orderBy is also used", 11160 // "enum": [ 11161 // "ASCENDING", 11162 // "DESCENDING" 11163 // ], 11164 // "enumDescriptions": [ 11165 // "Ascending order.", 11166 // "Descending order." 11167 // ], 11168 // "location": "query", 11169 // "type": "string" 11170 // }, 11171 // "userKey": { 11172 // "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.", 11173 // "location": "query", 11174 // "type": "string" 11175 // } 11176 // }, 11177 // "path": "admin/directory/v1/groups", 11178 // "response": { 11179 // "$ref": "Groups" 11180 // }, 11181 // "scopes": [ 11182 // "https://www.googleapis.com/auth/admin.directory.group", 11183 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 11184 // ] 11185 // } 11186 11187} 11188 11189// Pages invokes f for each page of results. 11190// A non-nil error returned from f will halt the iteration. 11191// The provided context supersedes any context provided to the Context method. 11192func (c *GroupsListCall) Pages(ctx context.Context, f func(*Groups) error) error { 11193 c.ctx_ = ctx 11194 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11195 for { 11196 x, err := c.Do() 11197 if err != nil { 11198 return err 11199 } 11200 if err := f(x); err != nil { 11201 return err 11202 } 11203 if x.NextPageToken == "" { 11204 return nil 11205 } 11206 c.PageToken(x.NextPageToken) 11207 } 11208} 11209 11210// method id "directory.groups.patch": 11211 11212type GroupsPatchCall struct { 11213 s *Service 11214 groupKey string 11215 group *Group 11216 urlParams_ gensupport.URLParams 11217 ctx_ context.Context 11218 header_ http.Header 11219} 11220 11221// Patch: Updates a group's properties. This method supports patch 11222// semantics (/admin-sdk/directory/v1/guides/performance#patch). 11223// 11224// - groupKey: Identifies the group in the API request. The value can be 11225// the group's email address, group alias, or the unique group ID. 11226func (r *GroupsService) Patch(groupKey string, group *Group) *GroupsPatchCall { 11227 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11228 c.groupKey = groupKey 11229 c.group = group 11230 return c 11231} 11232 11233// Fields allows partial responses to be retrieved. See 11234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11235// for more information. 11236func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 11237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11238 return c 11239} 11240 11241// Context sets the context to be used in this call's Do method. Any 11242// pending HTTP request will be aborted if the provided context is 11243// canceled. 11244func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 11245 c.ctx_ = ctx 11246 return c 11247} 11248 11249// Header returns an http.Header that can be modified by the caller to 11250// add HTTP headers to the request. 11251func (c *GroupsPatchCall) Header() http.Header { 11252 if c.header_ == nil { 11253 c.header_ = make(http.Header) 11254 } 11255 return c.header_ 11256} 11257 11258func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 11259 reqHeaders := make(http.Header) 11260 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11261 for k, v := range c.header_ { 11262 reqHeaders[k] = v 11263 } 11264 reqHeaders.Set("User-Agent", c.s.userAgent()) 11265 var body io.Reader = nil 11266 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 11267 if err != nil { 11268 return nil, err 11269 } 11270 reqHeaders.Set("Content-Type", "application/json") 11271 c.urlParams_.Set("alt", alt) 11272 c.urlParams_.Set("prettyPrint", "false") 11273 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 11274 urls += "?" + c.urlParams_.Encode() 11275 req, err := http.NewRequest("PATCH", urls, body) 11276 if err != nil { 11277 return nil, err 11278 } 11279 req.Header = reqHeaders 11280 googleapi.Expand(req.URL, map[string]string{ 11281 "groupKey": c.groupKey, 11282 }) 11283 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11284} 11285 11286// Do executes the "directory.groups.patch" call. 11287// Exactly one of *Group or error will be non-nil. Any non-2xx status 11288// code is an error. Response headers are in either 11289// *Group.ServerResponse.Header or (if a response was returned at all) 11290// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11291// check whether the returned error was because http.StatusNotModified 11292// was returned. 11293func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Group, error) { 11294 gensupport.SetOptions(c.urlParams_, opts...) 11295 res, err := c.doRequest("json") 11296 if res != nil && res.StatusCode == http.StatusNotModified { 11297 if res.Body != nil { 11298 res.Body.Close() 11299 } 11300 return nil, &googleapi.Error{ 11301 Code: res.StatusCode, 11302 Header: res.Header, 11303 } 11304 } 11305 if err != nil { 11306 return nil, err 11307 } 11308 defer googleapi.CloseBody(res) 11309 if err := googleapi.CheckResponse(res); err != nil { 11310 return nil, err 11311 } 11312 ret := &Group{ 11313 ServerResponse: googleapi.ServerResponse{ 11314 Header: res.Header, 11315 HTTPStatusCode: res.StatusCode, 11316 }, 11317 } 11318 target := &ret 11319 if err := gensupport.DecodeResponse(target, res); err != nil { 11320 return nil, err 11321 } 11322 return ret, nil 11323 // { 11324 // "description": "Updates a group's properties. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 11325 // "flatPath": "admin/directory/v1/groups/{groupKey}", 11326 // "httpMethod": "PATCH", 11327 // "id": "directory.groups.patch", 11328 // "parameterOrder": [ 11329 // "groupKey" 11330 // ], 11331 // "parameters": { 11332 // "groupKey": { 11333 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11334 // "location": "path", 11335 // "required": true, 11336 // "type": "string" 11337 // } 11338 // }, 11339 // "path": "admin/directory/v1/groups/{groupKey}", 11340 // "request": { 11341 // "$ref": "Group" 11342 // }, 11343 // "response": { 11344 // "$ref": "Group" 11345 // }, 11346 // "scopes": [ 11347 // "https://www.googleapis.com/auth/admin.directory.group" 11348 // ] 11349 // } 11350 11351} 11352 11353// method id "directory.groups.update": 11354 11355type GroupsUpdateCall struct { 11356 s *Service 11357 groupKey string 11358 group *Group 11359 urlParams_ gensupport.URLParams 11360 ctx_ context.Context 11361 header_ http.Header 11362} 11363 11364// Update: Updates a group's properties. 11365// 11366// - groupKey: Identifies the group in the API request. The value can be 11367// the group's email address, group alias, or the unique group ID. 11368func (r *GroupsService) Update(groupKey string, group *Group) *GroupsUpdateCall { 11369 c := &GroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11370 c.groupKey = groupKey 11371 c.group = group 11372 return c 11373} 11374 11375// Fields allows partial responses to be retrieved. See 11376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11377// for more information. 11378func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall { 11379 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11380 return c 11381} 11382 11383// Context sets the context to be used in this call's Do method. Any 11384// pending HTTP request will be aborted if the provided context is 11385// canceled. 11386func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall { 11387 c.ctx_ = ctx 11388 return c 11389} 11390 11391// Header returns an http.Header that can be modified by the caller to 11392// add HTTP headers to the request. 11393func (c *GroupsUpdateCall) Header() http.Header { 11394 if c.header_ == nil { 11395 c.header_ = make(http.Header) 11396 } 11397 return c.header_ 11398} 11399 11400func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 11401 reqHeaders := make(http.Header) 11402 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11403 for k, v := range c.header_ { 11404 reqHeaders[k] = v 11405 } 11406 reqHeaders.Set("User-Agent", c.s.userAgent()) 11407 var body io.Reader = nil 11408 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 11409 if err != nil { 11410 return nil, err 11411 } 11412 reqHeaders.Set("Content-Type", "application/json") 11413 c.urlParams_.Set("alt", alt) 11414 c.urlParams_.Set("prettyPrint", "false") 11415 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}") 11416 urls += "?" + c.urlParams_.Encode() 11417 req, err := http.NewRequest("PUT", urls, body) 11418 if err != nil { 11419 return nil, err 11420 } 11421 req.Header = reqHeaders 11422 googleapi.Expand(req.URL, map[string]string{ 11423 "groupKey": c.groupKey, 11424 }) 11425 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11426} 11427 11428// Do executes the "directory.groups.update" call. 11429// Exactly one of *Group or error will be non-nil. Any non-2xx status 11430// code is an error. Response headers are in either 11431// *Group.ServerResponse.Header or (if a response was returned at all) 11432// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11433// check whether the returned error was because http.StatusNotModified 11434// was returned. 11435func (c *GroupsUpdateCall) Do(opts ...googleapi.CallOption) (*Group, error) { 11436 gensupport.SetOptions(c.urlParams_, opts...) 11437 res, err := c.doRequest("json") 11438 if res != nil && res.StatusCode == http.StatusNotModified { 11439 if res.Body != nil { 11440 res.Body.Close() 11441 } 11442 return nil, &googleapi.Error{ 11443 Code: res.StatusCode, 11444 Header: res.Header, 11445 } 11446 } 11447 if err != nil { 11448 return nil, err 11449 } 11450 defer googleapi.CloseBody(res) 11451 if err := googleapi.CheckResponse(res); err != nil { 11452 return nil, err 11453 } 11454 ret := &Group{ 11455 ServerResponse: googleapi.ServerResponse{ 11456 Header: res.Header, 11457 HTTPStatusCode: res.StatusCode, 11458 }, 11459 } 11460 target := &ret 11461 if err := gensupport.DecodeResponse(target, res); err != nil { 11462 return nil, err 11463 } 11464 return ret, nil 11465 // { 11466 // "description": "Updates a group's properties.", 11467 // "flatPath": "admin/directory/v1/groups/{groupKey}", 11468 // "httpMethod": "PUT", 11469 // "id": "directory.groups.update", 11470 // "parameterOrder": [ 11471 // "groupKey" 11472 // ], 11473 // "parameters": { 11474 // "groupKey": { 11475 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11476 // "location": "path", 11477 // "required": true, 11478 // "type": "string" 11479 // } 11480 // }, 11481 // "path": "admin/directory/v1/groups/{groupKey}", 11482 // "request": { 11483 // "$ref": "Group" 11484 // }, 11485 // "response": { 11486 // "$ref": "Group" 11487 // }, 11488 // "scopes": [ 11489 // "https://www.googleapis.com/auth/admin.directory.group" 11490 // ] 11491 // } 11492 11493} 11494 11495// method id "directory.groups.aliases.delete": 11496 11497type GroupsAliasesDeleteCall struct { 11498 s *Service 11499 groupKey string 11500 alias string 11501 urlParams_ gensupport.URLParams 11502 ctx_ context.Context 11503 header_ http.Header 11504} 11505 11506// Delete: Removes an alias. 11507// 11508// - alias: The alias to be removed. 11509// - groupKey: Identifies the group in the API request. The value can be 11510// the group's email address, group alias, or the unique group ID. 11511func (r *GroupsAliasesService) Delete(groupKey string, alias string) *GroupsAliasesDeleteCall { 11512 c := &GroupsAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11513 c.groupKey = groupKey 11514 c.alias = alias 11515 return c 11516} 11517 11518// Fields allows partial responses to be retrieved. See 11519// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11520// for more information. 11521func (c *GroupsAliasesDeleteCall) Fields(s ...googleapi.Field) *GroupsAliasesDeleteCall { 11522 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11523 return c 11524} 11525 11526// Context sets the context to be used in this call's Do method. Any 11527// pending HTTP request will be aborted if the provided context is 11528// canceled. 11529func (c *GroupsAliasesDeleteCall) Context(ctx context.Context) *GroupsAliasesDeleteCall { 11530 c.ctx_ = ctx 11531 return c 11532} 11533 11534// Header returns an http.Header that can be modified by the caller to 11535// add HTTP headers to the request. 11536func (c *GroupsAliasesDeleteCall) Header() http.Header { 11537 if c.header_ == nil { 11538 c.header_ = make(http.Header) 11539 } 11540 return c.header_ 11541} 11542 11543func (c *GroupsAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 11544 reqHeaders := make(http.Header) 11545 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11546 for k, v := range c.header_ { 11547 reqHeaders[k] = v 11548 } 11549 reqHeaders.Set("User-Agent", c.s.userAgent()) 11550 var body io.Reader = nil 11551 c.urlParams_.Set("alt", alt) 11552 c.urlParams_.Set("prettyPrint", "false") 11553 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases/{alias}") 11554 urls += "?" + c.urlParams_.Encode() 11555 req, err := http.NewRequest("DELETE", urls, body) 11556 if err != nil { 11557 return nil, err 11558 } 11559 req.Header = reqHeaders 11560 googleapi.Expand(req.URL, map[string]string{ 11561 "groupKey": c.groupKey, 11562 "alias": c.alias, 11563 }) 11564 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11565} 11566 11567// Do executes the "directory.groups.aliases.delete" call. 11568func (c *GroupsAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 11569 gensupport.SetOptions(c.urlParams_, opts...) 11570 res, err := c.doRequest("json") 11571 if err != nil { 11572 return err 11573 } 11574 defer googleapi.CloseBody(res) 11575 if err := googleapi.CheckResponse(res); err != nil { 11576 return err 11577 } 11578 return nil 11579 // { 11580 // "description": "Removes an alias.", 11581 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases/{alias}", 11582 // "httpMethod": "DELETE", 11583 // "id": "directory.groups.aliases.delete", 11584 // "parameterOrder": [ 11585 // "groupKey", 11586 // "alias" 11587 // ], 11588 // "parameters": { 11589 // "alias": { 11590 // "description": "The alias to be removed", 11591 // "location": "path", 11592 // "required": true, 11593 // "type": "string" 11594 // }, 11595 // "groupKey": { 11596 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11597 // "location": "path", 11598 // "required": true, 11599 // "type": "string" 11600 // } 11601 // }, 11602 // "path": "admin/directory/v1/groups/{groupKey}/aliases/{alias}", 11603 // "scopes": [ 11604 // "https://www.googleapis.com/auth/admin.directory.group" 11605 // ] 11606 // } 11607 11608} 11609 11610// method id "directory.groups.aliases.insert": 11611 11612type GroupsAliasesInsertCall struct { 11613 s *Service 11614 groupKey string 11615 alias *Alias 11616 urlParams_ gensupport.URLParams 11617 ctx_ context.Context 11618 header_ http.Header 11619} 11620 11621// Insert: Adds an alias for the group. 11622// 11623// - groupKey: Identifies the group in the API request. The value can be 11624// the group's email address, group alias, or the unique group ID. 11625func (r *GroupsAliasesService) Insert(groupKey string, alias *Alias) *GroupsAliasesInsertCall { 11626 c := &GroupsAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11627 c.groupKey = groupKey 11628 c.alias = alias 11629 return c 11630} 11631 11632// Fields allows partial responses to be retrieved. See 11633// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11634// for more information. 11635func (c *GroupsAliasesInsertCall) Fields(s ...googleapi.Field) *GroupsAliasesInsertCall { 11636 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11637 return c 11638} 11639 11640// Context sets the context to be used in this call's Do method. Any 11641// pending HTTP request will be aborted if the provided context is 11642// canceled. 11643func (c *GroupsAliasesInsertCall) Context(ctx context.Context) *GroupsAliasesInsertCall { 11644 c.ctx_ = ctx 11645 return c 11646} 11647 11648// Header returns an http.Header that can be modified by the caller to 11649// add HTTP headers to the request. 11650func (c *GroupsAliasesInsertCall) Header() http.Header { 11651 if c.header_ == nil { 11652 c.header_ = make(http.Header) 11653 } 11654 return c.header_ 11655} 11656 11657func (c *GroupsAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 11658 reqHeaders := make(http.Header) 11659 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11660 for k, v := range c.header_ { 11661 reqHeaders[k] = v 11662 } 11663 reqHeaders.Set("User-Agent", c.s.userAgent()) 11664 var body io.Reader = nil 11665 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) 11666 if err != nil { 11667 return nil, err 11668 } 11669 reqHeaders.Set("Content-Type", "application/json") 11670 c.urlParams_.Set("alt", alt) 11671 c.urlParams_.Set("prettyPrint", "false") 11672 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases") 11673 urls += "?" + c.urlParams_.Encode() 11674 req, err := http.NewRequest("POST", urls, body) 11675 if err != nil { 11676 return nil, err 11677 } 11678 req.Header = reqHeaders 11679 googleapi.Expand(req.URL, map[string]string{ 11680 "groupKey": c.groupKey, 11681 }) 11682 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11683} 11684 11685// Do executes the "directory.groups.aliases.insert" call. 11686// Exactly one of *Alias or error will be non-nil. Any non-2xx status 11687// code is an error. Response headers are in either 11688// *Alias.ServerResponse.Header or (if a response was returned at all) 11689// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11690// check whether the returned error was because http.StatusNotModified 11691// was returned. 11692func (c *GroupsAliasesInsertCall) Do(opts ...googleapi.CallOption) (*Alias, error) { 11693 gensupport.SetOptions(c.urlParams_, opts...) 11694 res, err := c.doRequest("json") 11695 if res != nil && res.StatusCode == http.StatusNotModified { 11696 if res.Body != nil { 11697 res.Body.Close() 11698 } 11699 return nil, &googleapi.Error{ 11700 Code: res.StatusCode, 11701 Header: res.Header, 11702 } 11703 } 11704 if err != nil { 11705 return nil, err 11706 } 11707 defer googleapi.CloseBody(res) 11708 if err := googleapi.CheckResponse(res); err != nil { 11709 return nil, err 11710 } 11711 ret := &Alias{ 11712 ServerResponse: googleapi.ServerResponse{ 11713 Header: res.Header, 11714 HTTPStatusCode: res.StatusCode, 11715 }, 11716 } 11717 target := &ret 11718 if err := gensupport.DecodeResponse(target, res); err != nil { 11719 return nil, err 11720 } 11721 return ret, nil 11722 // { 11723 // "description": "Adds an alias for the group.", 11724 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases", 11725 // "httpMethod": "POST", 11726 // "id": "directory.groups.aliases.insert", 11727 // "parameterOrder": [ 11728 // "groupKey" 11729 // ], 11730 // "parameters": { 11731 // "groupKey": { 11732 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11733 // "location": "path", 11734 // "required": true, 11735 // "type": "string" 11736 // } 11737 // }, 11738 // "path": "admin/directory/v1/groups/{groupKey}/aliases", 11739 // "request": { 11740 // "$ref": "Alias" 11741 // }, 11742 // "response": { 11743 // "$ref": "Alias" 11744 // }, 11745 // "scopes": [ 11746 // "https://www.googleapis.com/auth/admin.directory.group" 11747 // ] 11748 // } 11749 11750} 11751 11752// method id "directory.groups.aliases.list": 11753 11754type GroupsAliasesListCall struct { 11755 s *Service 11756 groupKey string 11757 urlParams_ gensupport.URLParams 11758 ifNoneMatch_ string 11759 ctx_ context.Context 11760 header_ http.Header 11761} 11762 11763// List: Lists all aliases for a group. 11764// 11765// - groupKey: Identifies the group in the API request. The value can be 11766// the group's email address, group alias, or the unique group ID. 11767func (r *GroupsAliasesService) List(groupKey string) *GroupsAliasesListCall { 11768 c := &GroupsAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11769 c.groupKey = groupKey 11770 return c 11771} 11772 11773// Fields allows partial responses to be retrieved. See 11774// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11775// for more information. 11776func (c *GroupsAliasesListCall) Fields(s ...googleapi.Field) *GroupsAliasesListCall { 11777 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11778 return c 11779} 11780 11781// IfNoneMatch sets the optional parameter which makes the operation 11782// fail if the object's ETag matches the given value. This is useful for 11783// getting updates only after the object has changed since the last 11784// request. Use googleapi.IsNotModified to check whether the response 11785// error from Do is the result of In-None-Match. 11786func (c *GroupsAliasesListCall) IfNoneMatch(entityTag string) *GroupsAliasesListCall { 11787 c.ifNoneMatch_ = entityTag 11788 return c 11789} 11790 11791// Context sets the context to be used in this call's Do method. Any 11792// pending HTTP request will be aborted if the provided context is 11793// canceled. 11794func (c *GroupsAliasesListCall) Context(ctx context.Context) *GroupsAliasesListCall { 11795 c.ctx_ = ctx 11796 return c 11797} 11798 11799// Header returns an http.Header that can be modified by the caller to 11800// add HTTP headers to the request. 11801func (c *GroupsAliasesListCall) Header() http.Header { 11802 if c.header_ == nil { 11803 c.header_ = make(http.Header) 11804 } 11805 return c.header_ 11806} 11807 11808func (c *GroupsAliasesListCall) doRequest(alt string) (*http.Response, error) { 11809 reqHeaders := make(http.Header) 11810 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11811 for k, v := range c.header_ { 11812 reqHeaders[k] = v 11813 } 11814 reqHeaders.Set("User-Agent", c.s.userAgent()) 11815 if c.ifNoneMatch_ != "" { 11816 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11817 } 11818 var body io.Reader = nil 11819 c.urlParams_.Set("alt", alt) 11820 c.urlParams_.Set("prettyPrint", "false") 11821 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/aliases") 11822 urls += "?" + c.urlParams_.Encode() 11823 req, err := http.NewRequest("GET", urls, body) 11824 if err != nil { 11825 return nil, err 11826 } 11827 req.Header = reqHeaders 11828 googleapi.Expand(req.URL, map[string]string{ 11829 "groupKey": c.groupKey, 11830 }) 11831 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11832} 11833 11834// Do executes the "directory.groups.aliases.list" call. 11835// Exactly one of *Aliases or error will be non-nil. Any non-2xx status 11836// code is an error. Response headers are in either 11837// *Aliases.ServerResponse.Header or (if a response was returned at all) 11838// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11839// check whether the returned error was because http.StatusNotModified 11840// was returned. 11841func (c *GroupsAliasesListCall) Do(opts ...googleapi.CallOption) (*Aliases, error) { 11842 gensupport.SetOptions(c.urlParams_, opts...) 11843 res, err := c.doRequest("json") 11844 if res != nil && res.StatusCode == http.StatusNotModified { 11845 if res.Body != nil { 11846 res.Body.Close() 11847 } 11848 return nil, &googleapi.Error{ 11849 Code: res.StatusCode, 11850 Header: res.Header, 11851 } 11852 } 11853 if err != nil { 11854 return nil, err 11855 } 11856 defer googleapi.CloseBody(res) 11857 if err := googleapi.CheckResponse(res); err != nil { 11858 return nil, err 11859 } 11860 ret := &Aliases{ 11861 ServerResponse: googleapi.ServerResponse{ 11862 Header: res.Header, 11863 HTTPStatusCode: res.StatusCode, 11864 }, 11865 } 11866 target := &ret 11867 if err := gensupport.DecodeResponse(target, res); err != nil { 11868 return nil, err 11869 } 11870 return ret, nil 11871 // { 11872 // "description": "Lists all aliases for a group.", 11873 // "flatPath": "admin/directory/v1/groups/{groupKey}/aliases", 11874 // "httpMethod": "GET", 11875 // "id": "directory.groups.aliases.list", 11876 // "parameterOrder": [ 11877 // "groupKey" 11878 // ], 11879 // "parameters": { 11880 // "groupKey": { 11881 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11882 // "location": "path", 11883 // "required": true, 11884 // "type": "string" 11885 // } 11886 // }, 11887 // "path": "admin/directory/v1/groups/{groupKey}/aliases", 11888 // "response": { 11889 // "$ref": "Aliases" 11890 // }, 11891 // "scopes": [ 11892 // "https://www.googleapis.com/auth/admin.directory.group", 11893 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 11894 // ] 11895 // } 11896 11897} 11898 11899// method id "directory.members.delete": 11900 11901type MembersDeleteCall struct { 11902 s *Service 11903 groupKey string 11904 memberKey string 11905 urlParams_ gensupport.URLParams 11906 ctx_ context.Context 11907 header_ http.Header 11908} 11909 11910// Delete: Removes a member from a group. 11911// 11912// - groupKey: Identifies the group in the API request. The value can be 11913// the group's email address, group alias, or the unique group ID. 11914// - memberKey: Identifies the group member in the API request. A group 11915// member can be a user or another group. The value can be the 11916// member's (group or user) primary email address, alias, or unique 11917// ID. 11918func (r *MembersService) Delete(groupKey string, memberKey string) *MembersDeleteCall { 11919 c := &MembersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11920 c.groupKey = groupKey 11921 c.memberKey = memberKey 11922 return c 11923} 11924 11925// Fields allows partial responses to be retrieved. See 11926// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11927// for more information. 11928func (c *MembersDeleteCall) Fields(s ...googleapi.Field) *MembersDeleteCall { 11929 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11930 return c 11931} 11932 11933// Context sets the context to be used in this call's Do method. Any 11934// pending HTTP request will be aborted if the provided context is 11935// canceled. 11936func (c *MembersDeleteCall) Context(ctx context.Context) *MembersDeleteCall { 11937 c.ctx_ = ctx 11938 return c 11939} 11940 11941// Header returns an http.Header that can be modified by the caller to 11942// add HTTP headers to the request. 11943func (c *MembersDeleteCall) Header() http.Header { 11944 if c.header_ == nil { 11945 c.header_ = make(http.Header) 11946 } 11947 return c.header_ 11948} 11949 11950func (c *MembersDeleteCall) doRequest(alt string) (*http.Response, error) { 11951 reqHeaders := make(http.Header) 11952 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11953 for k, v := range c.header_ { 11954 reqHeaders[k] = v 11955 } 11956 reqHeaders.Set("User-Agent", c.s.userAgent()) 11957 var body io.Reader = nil 11958 c.urlParams_.Set("alt", alt) 11959 c.urlParams_.Set("prettyPrint", "false") 11960 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 11961 urls += "?" + c.urlParams_.Encode() 11962 req, err := http.NewRequest("DELETE", urls, body) 11963 if err != nil { 11964 return nil, err 11965 } 11966 req.Header = reqHeaders 11967 googleapi.Expand(req.URL, map[string]string{ 11968 "groupKey": c.groupKey, 11969 "memberKey": c.memberKey, 11970 }) 11971 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11972} 11973 11974// Do executes the "directory.members.delete" call. 11975func (c *MembersDeleteCall) Do(opts ...googleapi.CallOption) error { 11976 gensupport.SetOptions(c.urlParams_, opts...) 11977 res, err := c.doRequest("json") 11978 if err != nil { 11979 return err 11980 } 11981 defer googleapi.CloseBody(res) 11982 if err := googleapi.CheckResponse(res); err != nil { 11983 return err 11984 } 11985 return nil 11986 // { 11987 // "description": "Removes a member from a group.", 11988 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 11989 // "httpMethod": "DELETE", 11990 // "id": "directory.members.delete", 11991 // "parameterOrder": [ 11992 // "groupKey", 11993 // "memberKey" 11994 // ], 11995 // "parameters": { 11996 // "groupKey": { 11997 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 11998 // "location": "path", 11999 // "required": true, 12000 // "type": "string" 12001 // }, 12002 // "memberKey": { 12003 // "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.", 12004 // "location": "path", 12005 // "required": true, 12006 // "type": "string" 12007 // } 12008 // }, 12009 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12010 // "scopes": [ 12011 // "https://www.googleapis.com/auth/admin.directory.group", 12012 // "https://www.googleapis.com/auth/admin.directory.group.member" 12013 // ] 12014 // } 12015 12016} 12017 12018// method id "directory.members.get": 12019 12020type MembersGetCall struct { 12021 s *Service 12022 groupKey string 12023 memberKey string 12024 urlParams_ gensupport.URLParams 12025 ifNoneMatch_ string 12026 ctx_ context.Context 12027 header_ http.Header 12028} 12029 12030// Get: Retrieves a group member's properties. 12031// 12032// - groupKey: Identifies the group in the API request. The value can be 12033// the group's email address, group alias, or the unique group ID. 12034// - memberKey: Identifies the group member in the API request. A group 12035// member can be a user or another group. The value can be the 12036// member's (group or user) primary email address, alias, or unique 12037// ID. 12038func (r *MembersService) Get(groupKey string, memberKey string) *MembersGetCall { 12039 c := &MembersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12040 c.groupKey = groupKey 12041 c.memberKey = memberKey 12042 return c 12043} 12044 12045// Fields allows partial responses to be retrieved. See 12046// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12047// for more information. 12048func (c *MembersGetCall) Fields(s ...googleapi.Field) *MembersGetCall { 12049 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12050 return c 12051} 12052 12053// IfNoneMatch sets the optional parameter which makes the operation 12054// fail if the object's ETag matches the given value. This is useful for 12055// getting updates only after the object has changed since the last 12056// request. Use googleapi.IsNotModified to check whether the response 12057// error from Do is the result of In-None-Match. 12058func (c *MembersGetCall) IfNoneMatch(entityTag string) *MembersGetCall { 12059 c.ifNoneMatch_ = entityTag 12060 return c 12061} 12062 12063// Context sets the context to be used in this call's Do method. Any 12064// pending HTTP request will be aborted if the provided context is 12065// canceled. 12066func (c *MembersGetCall) Context(ctx context.Context) *MembersGetCall { 12067 c.ctx_ = ctx 12068 return c 12069} 12070 12071// Header returns an http.Header that can be modified by the caller to 12072// add HTTP headers to the request. 12073func (c *MembersGetCall) Header() http.Header { 12074 if c.header_ == nil { 12075 c.header_ = make(http.Header) 12076 } 12077 return c.header_ 12078} 12079 12080func (c *MembersGetCall) doRequest(alt string) (*http.Response, error) { 12081 reqHeaders := make(http.Header) 12082 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12083 for k, v := range c.header_ { 12084 reqHeaders[k] = v 12085 } 12086 reqHeaders.Set("User-Agent", c.s.userAgent()) 12087 if c.ifNoneMatch_ != "" { 12088 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12089 } 12090 var body io.Reader = nil 12091 c.urlParams_.Set("alt", alt) 12092 c.urlParams_.Set("prettyPrint", "false") 12093 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 12094 urls += "?" + c.urlParams_.Encode() 12095 req, err := http.NewRequest("GET", urls, body) 12096 if err != nil { 12097 return nil, err 12098 } 12099 req.Header = reqHeaders 12100 googleapi.Expand(req.URL, map[string]string{ 12101 "groupKey": c.groupKey, 12102 "memberKey": c.memberKey, 12103 }) 12104 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12105} 12106 12107// Do executes the "directory.members.get" call. 12108// Exactly one of *Member or error will be non-nil. Any non-2xx status 12109// code is an error. Response headers are in either 12110// *Member.ServerResponse.Header or (if a response was returned at all) 12111// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12112// check whether the returned error was because http.StatusNotModified 12113// was returned. 12114func (c *MembersGetCall) Do(opts ...googleapi.CallOption) (*Member, error) { 12115 gensupport.SetOptions(c.urlParams_, opts...) 12116 res, err := c.doRequest("json") 12117 if res != nil && res.StatusCode == http.StatusNotModified { 12118 if res.Body != nil { 12119 res.Body.Close() 12120 } 12121 return nil, &googleapi.Error{ 12122 Code: res.StatusCode, 12123 Header: res.Header, 12124 } 12125 } 12126 if err != nil { 12127 return nil, err 12128 } 12129 defer googleapi.CloseBody(res) 12130 if err := googleapi.CheckResponse(res); err != nil { 12131 return nil, err 12132 } 12133 ret := &Member{ 12134 ServerResponse: googleapi.ServerResponse{ 12135 Header: res.Header, 12136 HTTPStatusCode: res.StatusCode, 12137 }, 12138 } 12139 target := &ret 12140 if err := gensupport.DecodeResponse(target, res); err != nil { 12141 return nil, err 12142 } 12143 return ret, nil 12144 // { 12145 // "description": "Retrieves a group member's properties.", 12146 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12147 // "httpMethod": "GET", 12148 // "id": "directory.members.get", 12149 // "parameterOrder": [ 12150 // "groupKey", 12151 // "memberKey" 12152 // ], 12153 // "parameters": { 12154 // "groupKey": { 12155 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12156 // "location": "path", 12157 // "required": true, 12158 // "type": "string" 12159 // }, 12160 // "memberKey": { 12161 // "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.", 12162 // "location": "path", 12163 // "required": true, 12164 // "type": "string" 12165 // } 12166 // }, 12167 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12168 // "response": { 12169 // "$ref": "Member" 12170 // }, 12171 // "scopes": [ 12172 // "https://www.googleapis.com/auth/admin.directory.group", 12173 // "https://www.googleapis.com/auth/admin.directory.group.member", 12174 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 12175 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 12176 // ] 12177 // } 12178 12179} 12180 12181// method id "directory.members.hasMember": 12182 12183type MembersHasMemberCall struct { 12184 s *Service 12185 groupKey string 12186 memberKey string 12187 urlParams_ gensupport.URLParams 12188 ifNoneMatch_ string 12189 ctx_ context.Context 12190 header_ http.Header 12191} 12192 12193// HasMember: Checks whether the given user is a member of the group. 12194// Membership can be direct or nested. 12195// 12196// - groupKey: Identifies the group in the API request. The value can be 12197// the group's email address, group alias, or the unique group ID. 12198// - memberKey: Identifies the user member in the API request. The value 12199// can be the user's primary email address, alias, or unique ID. 12200func (r *MembersService) HasMember(groupKey string, memberKey string) *MembersHasMemberCall { 12201 c := &MembersHasMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12202 c.groupKey = groupKey 12203 c.memberKey = memberKey 12204 return c 12205} 12206 12207// Fields allows partial responses to be retrieved. See 12208// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12209// for more information. 12210func (c *MembersHasMemberCall) Fields(s ...googleapi.Field) *MembersHasMemberCall { 12211 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12212 return c 12213} 12214 12215// IfNoneMatch sets the optional parameter which makes the operation 12216// fail if the object's ETag matches the given value. This is useful for 12217// getting updates only after the object has changed since the last 12218// request. Use googleapi.IsNotModified to check whether the response 12219// error from Do is the result of In-None-Match. 12220func (c *MembersHasMemberCall) IfNoneMatch(entityTag string) *MembersHasMemberCall { 12221 c.ifNoneMatch_ = entityTag 12222 return c 12223} 12224 12225// Context sets the context to be used in this call's Do method. Any 12226// pending HTTP request will be aborted if the provided context is 12227// canceled. 12228func (c *MembersHasMemberCall) Context(ctx context.Context) *MembersHasMemberCall { 12229 c.ctx_ = ctx 12230 return c 12231} 12232 12233// Header returns an http.Header that can be modified by the caller to 12234// add HTTP headers to the request. 12235func (c *MembersHasMemberCall) Header() http.Header { 12236 if c.header_ == nil { 12237 c.header_ = make(http.Header) 12238 } 12239 return c.header_ 12240} 12241 12242func (c *MembersHasMemberCall) doRequest(alt string) (*http.Response, error) { 12243 reqHeaders := make(http.Header) 12244 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12245 for k, v := range c.header_ { 12246 reqHeaders[k] = v 12247 } 12248 reqHeaders.Set("User-Agent", c.s.userAgent()) 12249 if c.ifNoneMatch_ != "" { 12250 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12251 } 12252 var body io.Reader = nil 12253 c.urlParams_.Set("alt", alt) 12254 c.urlParams_.Set("prettyPrint", "false") 12255 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}") 12256 urls += "?" + c.urlParams_.Encode() 12257 req, err := http.NewRequest("GET", urls, body) 12258 if err != nil { 12259 return nil, err 12260 } 12261 req.Header = reqHeaders 12262 googleapi.Expand(req.URL, map[string]string{ 12263 "groupKey": c.groupKey, 12264 "memberKey": c.memberKey, 12265 }) 12266 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12267} 12268 12269// Do executes the "directory.members.hasMember" call. 12270// Exactly one of *MembersHasMember or error will be non-nil. Any 12271// non-2xx status code is an error. Response headers are in either 12272// *MembersHasMember.ServerResponse.Header or (if a response was 12273// returned at all) in error.(*googleapi.Error).Header. Use 12274// googleapi.IsNotModified to check whether the returned error was 12275// because http.StatusNotModified was returned. 12276func (c *MembersHasMemberCall) Do(opts ...googleapi.CallOption) (*MembersHasMember, error) { 12277 gensupport.SetOptions(c.urlParams_, opts...) 12278 res, err := c.doRequest("json") 12279 if res != nil && res.StatusCode == http.StatusNotModified { 12280 if res.Body != nil { 12281 res.Body.Close() 12282 } 12283 return nil, &googleapi.Error{ 12284 Code: res.StatusCode, 12285 Header: res.Header, 12286 } 12287 } 12288 if err != nil { 12289 return nil, err 12290 } 12291 defer googleapi.CloseBody(res) 12292 if err := googleapi.CheckResponse(res); err != nil { 12293 return nil, err 12294 } 12295 ret := &MembersHasMember{ 12296 ServerResponse: googleapi.ServerResponse{ 12297 Header: res.Header, 12298 HTTPStatusCode: res.StatusCode, 12299 }, 12300 } 12301 target := &ret 12302 if err := gensupport.DecodeResponse(target, res); err != nil { 12303 return nil, err 12304 } 12305 return ret, nil 12306 // { 12307 // "description": "Checks whether the given user is a member of the group. Membership can be direct or nested.", 12308 // "flatPath": "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}", 12309 // "httpMethod": "GET", 12310 // "id": "directory.members.hasMember", 12311 // "parameterOrder": [ 12312 // "groupKey", 12313 // "memberKey" 12314 // ], 12315 // "parameters": { 12316 // "groupKey": { 12317 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12318 // "location": "path", 12319 // "required": true, 12320 // "type": "string" 12321 // }, 12322 // "memberKey": { 12323 // "description": "Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID.", 12324 // "location": "path", 12325 // "required": true, 12326 // "type": "string" 12327 // } 12328 // }, 12329 // "path": "admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}", 12330 // "response": { 12331 // "$ref": "MembersHasMember" 12332 // }, 12333 // "scopes": [ 12334 // "https://www.googleapis.com/auth/admin.directory.group", 12335 // "https://www.googleapis.com/auth/admin.directory.group.member", 12336 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 12337 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 12338 // ] 12339 // } 12340 12341} 12342 12343// method id "directory.members.insert": 12344 12345type MembersInsertCall struct { 12346 s *Service 12347 groupKey string 12348 member *Member 12349 urlParams_ gensupport.URLParams 12350 ctx_ context.Context 12351 header_ http.Header 12352} 12353 12354// Insert: Adds a user to the specified group. 12355// 12356// - groupKey: Identifies the group in the API request. The value can be 12357// the group's email address, group alias, or the unique group ID. 12358func (r *MembersService) Insert(groupKey string, member *Member) *MembersInsertCall { 12359 c := &MembersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12360 c.groupKey = groupKey 12361 c.member = member 12362 return c 12363} 12364 12365// Fields allows partial responses to be retrieved. See 12366// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12367// for more information. 12368func (c *MembersInsertCall) Fields(s ...googleapi.Field) *MembersInsertCall { 12369 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12370 return c 12371} 12372 12373// Context sets the context to be used in this call's Do method. Any 12374// pending HTTP request will be aborted if the provided context is 12375// canceled. 12376func (c *MembersInsertCall) Context(ctx context.Context) *MembersInsertCall { 12377 c.ctx_ = ctx 12378 return c 12379} 12380 12381// Header returns an http.Header that can be modified by the caller to 12382// add HTTP headers to the request. 12383func (c *MembersInsertCall) Header() http.Header { 12384 if c.header_ == nil { 12385 c.header_ = make(http.Header) 12386 } 12387 return c.header_ 12388} 12389 12390func (c *MembersInsertCall) doRequest(alt string) (*http.Response, error) { 12391 reqHeaders := make(http.Header) 12392 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12393 for k, v := range c.header_ { 12394 reqHeaders[k] = v 12395 } 12396 reqHeaders.Set("User-Agent", c.s.userAgent()) 12397 var body io.Reader = nil 12398 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 12399 if err != nil { 12400 return nil, err 12401 } 12402 reqHeaders.Set("Content-Type", "application/json") 12403 c.urlParams_.Set("alt", alt) 12404 c.urlParams_.Set("prettyPrint", "false") 12405 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members") 12406 urls += "?" + c.urlParams_.Encode() 12407 req, err := http.NewRequest("POST", urls, body) 12408 if err != nil { 12409 return nil, err 12410 } 12411 req.Header = reqHeaders 12412 googleapi.Expand(req.URL, map[string]string{ 12413 "groupKey": c.groupKey, 12414 }) 12415 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12416} 12417 12418// Do executes the "directory.members.insert" call. 12419// Exactly one of *Member or error will be non-nil. Any non-2xx status 12420// code is an error. Response headers are in either 12421// *Member.ServerResponse.Header or (if a response was returned at all) 12422// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12423// check whether the returned error was because http.StatusNotModified 12424// was returned. 12425func (c *MembersInsertCall) Do(opts ...googleapi.CallOption) (*Member, error) { 12426 gensupport.SetOptions(c.urlParams_, opts...) 12427 res, err := c.doRequest("json") 12428 if res != nil && res.StatusCode == http.StatusNotModified { 12429 if res.Body != nil { 12430 res.Body.Close() 12431 } 12432 return nil, &googleapi.Error{ 12433 Code: res.StatusCode, 12434 Header: res.Header, 12435 } 12436 } 12437 if err != nil { 12438 return nil, err 12439 } 12440 defer googleapi.CloseBody(res) 12441 if err := googleapi.CheckResponse(res); err != nil { 12442 return nil, err 12443 } 12444 ret := &Member{ 12445 ServerResponse: googleapi.ServerResponse{ 12446 Header: res.Header, 12447 HTTPStatusCode: res.StatusCode, 12448 }, 12449 } 12450 target := &ret 12451 if err := gensupport.DecodeResponse(target, res); err != nil { 12452 return nil, err 12453 } 12454 return ret, nil 12455 // { 12456 // "description": "Adds a user to the specified group.", 12457 // "flatPath": "admin/directory/v1/groups/{groupKey}/members", 12458 // "httpMethod": "POST", 12459 // "id": "directory.members.insert", 12460 // "parameterOrder": [ 12461 // "groupKey" 12462 // ], 12463 // "parameters": { 12464 // "groupKey": { 12465 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12466 // "location": "path", 12467 // "required": true, 12468 // "type": "string" 12469 // } 12470 // }, 12471 // "path": "admin/directory/v1/groups/{groupKey}/members", 12472 // "request": { 12473 // "$ref": "Member" 12474 // }, 12475 // "response": { 12476 // "$ref": "Member" 12477 // }, 12478 // "scopes": [ 12479 // "https://www.googleapis.com/auth/admin.directory.group", 12480 // "https://www.googleapis.com/auth/admin.directory.group.member" 12481 // ] 12482 // } 12483 12484} 12485 12486// method id "directory.members.list": 12487 12488type MembersListCall struct { 12489 s *Service 12490 groupKey string 12491 urlParams_ gensupport.URLParams 12492 ifNoneMatch_ string 12493 ctx_ context.Context 12494 header_ http.Header 12495} 12496 12497// List: Retrieves a paginated list of all members in a group. 12498// 12499// - groupKey: Identifies the group in the API request. The value can be 12500// the group's email address, group alias, or the unique group ID. 12501func (r *MembersService) List(groupKey string) *MembersListCall { 12502 c := &MembersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12503 c.groupKey = groupKey 12504 return c 12505} 12506 12507// IncludeDerivedMembership sets the optional parameter 12508// "includeDerivedMembership": Whether to list indirect memberships. 12509// Default: false. 12510func (c *MembersListCall) IncludeDerivedMembership(includeDerivedMembership bool) *MembersListCall { 12511 c.urlParams_.Set("includeDerivedMembership", fmt.Sprint(includeDerivedMembership)) 12512 return c 12513} 12514 12515// MaxResults sets the optional parameter "maxResults": Maximum number 12516// of results to return. Max allowed value is 200. 12517func (c *MembersListCall) MaxResults(maxResults int64) *MembersListCall { 12518 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12519 return c 12520} 12521 12522// PageToken sets the optional parameter "pageToken": Token to specify 12523// next page in the list. 12524func (c *MembersListCall) PageToken(pageToken string) *MembersListCall { 12525 c.urlParams_.Set("pageToken", pageToken) 12526 return c 12527} 12528 12529// Roles sets the optional parameter "roles": The `roles` query 12530// parameter allows you to retrieve group members by role. Allowed 12531// values are `OWNER`, `MANAGER`, and `MEMBER`. 12532func (c *MembersListCall) Roles(roles string) *MembersListCall { 12533 c.urlParams_.Set("roles", roles) 12534 return c 12535} 12536 12537// Fields allows partial responses to be retrieved. See 12538// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12539// for more information. 12540func (c *MembersListCall) Fields(s ...googleapi.Field) *MembersListCall { 12541 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12542 return c 12543} 12544 12545// IfNoneMatch sets the optional parameter which makes the operation 12546// fail if the object's ETag matches the given value. This is useful for 12547// getting updates only after the object has changed since the last 12548// request. Use googleapi.IsNotModified to check whether the response 12549// error from Do is the result of In-None-Match. 12550func (c *MembersListCall) IfNoneMatch(entityTag string) *MembersListCall { 12551 c.ifNoneMatch_ = entityTag 12552 return c 12553} 12554 12555// Context sets the context to be used in this call's Do method. Any 12556// pending HTTP request will be aborted if the provided context is 12557// canceled. 12558func (c *MembersListCall) Context(ctx context.Context) *MembersListCall { 12559 c.ctx_ = ctx 12560 return c 12561} 12562 12563// Header returns an http.Header that can be modified by the caller to 12564// add HTTP headers to the request. 12565func (c *MembersListCall) Header() http.Header { 12566 if c.header_ == nil { 12567 c.header_ = make(http.Header) 12568 } 12569 return c.header_ 12570} 12571 12572func (c *MembersListCall) doRequest(alt string) (*http.Response, error) { 12573 reqHeaders := make(http.Header) 12574 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12575 for k, v := range c.header_ { 12576 reqHeaders[k] = v 12577 } 12578 reqHeaders.Set("User-Agent", c.s.userAgent()) 12579 if c.ifNoneMatch_ != "" { 12580 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12581 } 12582 var body io.Reader = nil 12583 c.urlParams_.Set("alt", alt) 12584 c.urlParams_.Set("prettyPrint", "false") 12585 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members") 12586 urls += "?" + c.urlParams_.Encode() 12587 req, err := http.NewRequest("GET", urls, body) 12588 if err != nil { 12589 return nil, err 12590 } 12591 req.Header = reqHeaders 12592 googleapi.Expand(req.URL, map[string]string{ 12593 "groupKey": c.groupKey, 12594 }) 12595 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12596} 12597 12598// Do executes the "directory.members.list" call. 12599// Exactly one of *Members or error will be non-nil. Any non-2xx status 12600// code is an error. Response headers are in either 12601// *Members.ServerResponse.Header or (if a response was returned at all) 12602// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12603// check whether the returned error was because http.StatusNotModified 12604// was returned. 12605func (c *MembersListCall) Do(opts ...googleapi.CallOption) (*Members, error) { 12606 gensupport.SetOptions(c.urlParams_, opts...) 12607 res, err := c.doRequest("json") 12608 if res != nil && res.StatusCode == http.StatusNotModified { 12609 if res.Body != nil { 12610 res.Body.Close() 12611 } 12612 return nil, &googleapi.Error{ 12613 Code: res.StatusCode, 12614 Header: res.Header, 12615 } 12616 } 12617 if err != nil { 12618 return nil, err 12619 } 12620 defer googleapi.CloseBody(res) 12621 if err := googleapi.CheckResponse(res); err != nil { 12622 return nil, err 12623 } 12624 ret := &Members{ 12625 ServerResponse: googleapi.ServerResponse{ 12626 Header: res.Header, 12627 HTTPStatusCode: res.StatusCode, 12628 }, 12629 } 12630 target := &ret 12631 if err := gensupport.DecodeResponse(target, res); err != nil { 12632 return nil, err 12633 } 12634 return ret, nil 12635 // { 12636 // "description": "Retrieves a paginated list of all members in a group.", 12637 // "flatPath": "admin/directory/v1/groups/{groupKey}/members", 12638 // "httpMethod": "GET", 12639 // "id": "directory.members.list", 12640 // "parameterOrder": [ 12641 // "groupKey" 12642 // ], 12643 // "parameters": { 12644 // "groupKey": { 12645 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12646 // "location": "path", 12647 // "required": true, 12648 // "type": "string" 12649 // }, 12650 // "includeDerivedMembership": { 12651 // "description": "Whether to list indirect memberships. Default: false.", 12652 // "location": "query", 12653 // "type": "boolean" 12654 // }, 12655 // "maxResults": { 12656 // "default": "200", 12657 // "description": "Maximum number of results to return. Max allowed value is 200.", 12658 // "format": "int32", 12659 // "location": "query", 12660 // "minimum": "1", 12661 // "type": "integer" 12662 // }, 12663 // "pageToken": { 12664 // "description": "Token to specify next page in the list.", 12665 // "location": "query", 12666 // "type": "string" 12667 // }, 12668 // "roles": { 12669 // "description": "The `roles` query parameter allows you to retrieve group members by role. Allowed values are `OWNER`, `MANAGER`, and `MEMBER`.", 12670 // "location": "query", 12671 // "type": "string" 12672 // } 12673 // }, 12674 // "path": "admin/directory/v1/groups/{groupKey}/members", 12675 // "response": { 12676 // "$ref": "Members" 12677 // }, 12678 // "scopes": [ 12679 // "https://www.googleapis.com/auth/admin.directory.group", 12680 // "https://www.googleapis.com/auth/admin.directory.group.member", 12681 // "https://www.googleapis.com/auth/admin.directory.group.member.readonly", 12682 // "https://www.googleapis.com/auth/admin.directory.group.readonly" 12683 // ] 12684 // } 12685 12686} 12687 12688// Pages invokes f for each page of results. 12689// A non-nil error returned from f will halt the iteration. 12690// The provided context supersedes any context provided to the Context method. 12691func (c *MembersListCall) Pages(ctx context.Context, f func(*Members) error) error { 12692 c.ctx_ = ctx 12693 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 12694 for { 12695 x, err := c.Do() 12696 if err != nil { 12697 return err 12698 } 12699 if err := f(x); err != nil { 12700 return err 12701 } 12702 if x.NextPageToken == "" { 12703 return nil 12704 } 12705 c.PageToken(x.NextPageToken) 12706 } 12707} 12708 12709// method id "directory.members.patch": 12710 12711type MembersPatchCall struct { 12712 s *Service 12713 groupKey string 12714 memberKey string 12715 member *Member 12716 urlParams_ gensupport.URLParams 12717 ctx_ context.Context 12718 header_ http.Header 12719} 12720 12721// Patch: Updates the membership properties of a user in the specified 12722// group. This method supports patch semantics 12723// (/admin-sdk/directory/v1/guides/performance#patch). 12724// 12725// - groupKey: Identifies the group in the API request. The value can be 12726// the group's email address, group alias, or the unique group ID. 12727// - memberKey: Identifies the group member in the API request. A group 12728// member can be a user or another group. The value can be the 12729// member's (group or user) primary email address, alias, or unique 12730// ID. 12731func (r *MembersService) Patch(groupKey string, memberKey string, member *Member) *MembersPatchCall { 12732 c := &MembersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12733 c.groupKey = groupKey 12734 c.memberKey = memberKey 12735 c.member = member 12736 return c 12737} 12738 12739// Fields allows partial responses to be retrieved. See 12740// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12741// for more information. 12742func (c *MembersPatchCall) Fields(s ...googleapi.Field) *MembersPatchCall { 12743 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12744 return c 12745} 12746 12747// Context sets the context to be used in this call's Do method. Any 12748// pending HTTP request will be aborted if the provided context is 12749// canceled. 12750func (c *MembersPatchCall) Context(ctx context.Context) *MembersPatchCall { 12751 c.ctx_ = ctx 12752 return c 12753} 12754 12755// Header returns an http.Header that can be modified by the caller to 12756// add HTTP headers to the request. 12757func (c *MembersPatchCall) Header() http.Header { 12758 if c.header_ == nil { 12759 c.header_ = make(http.Header) 12760 } 12761 return c.header_ 12762} 12763 12764func (c *MembersPatchCall) doRequest(alt string) (*http.Response, error) { 12765 reqHeaders := make(http.Header) 12766 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12767 for k, v := range c.header_ { 12768 reqHeaders[k] = v 12769 } 12770 reqHeaders.Set("User-Agent", c.s.userAgent()) 12771 var body io.Reader = nil 12772 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 12773 if err != nil { 12774 return nil, err 12775 } 12776 reqHeaders.Set("Content-Type", "application/json") 12777 c.urlParams_.Set("alt", alt) 12778 c.urlParams_.Set("prettyPrint", "false") 12779 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 12780 urls += "?" + c.urlParams_.Encode() 12781 req, err := http.NewRequest("PATCH", urls, body) 12782 if err != nil { 12783 return nil, err 12784 } 12785 req.Header = reqHeaders 12786 googleapi.Expand(req.URL, map[string]string{ 12787 "groupKey": c.groupKey, 12788 "memberKey": c.memberKey, 12789 }) 12790 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12791} 12792 12793// Do executes the "directory.members.patch" call. 12794// Exactly one of *Member or error will be non-nil. Any non-2xx status 12795// code is an error. Response headers are in either 12796// *Member.ServerResponse.Header or (if a response was returned at all) 12797// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12798// check whether the returned error was because http.StatusNotModified 12799// was returned. 12800func (c *MembersPatchCall) Do(opts ...googleapi.CallOption) (*Member, error) { 12801 gensupport.SetOptions(c.urlParams_, opts...) 12802 res, err := c.doRequest("json") 12803 if res != nil && res.StatusCode == http.StatusNotModified { 12804 if res.Body != nil { 12805 res.Body.Close() 12806 } 12807 return nil, &googleapi.Error{ 12808 Code: res.StatusCode, 12809 Header: res.Header, 12810 } 12811 } 12812 if err != nil { 12813 return nil, err 12814 } 12815 defer googleapi.CloseBody(res) 12816 if err := googleapi.CheckResponse(res); err != nil { 12817 return nil, err 12818 } 12819 ret := &Member{ 12820 ServerResponse: googleapi.ServerResponse{ 12821 Header: res.Header, 12822 HTTPStatusCode: res.StatusCode, 12823 }, 12824 } 12825 target := &ret 12826 if err := gensupport.DecodeResponse(target, res); err != nil { 12827 return nil, err 12828 } 12829 return ret, nil 12830 // { 12831 // "description": "Updates the membership properties of a user in the specified group. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 12832 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12833 // "httpMethod": "PATCH", 12834 // "id": "directory.members.patch", 12835 // "parameterOrder": [ 12836 // "groupKey", 12837 // "memberKey" 12838 // ], 12839 // "parameters": { 12840 // "groupKey": { 12841 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12842 // "location": "path", 12843 // "required": true, 12844 // "type": "string" 12845 // }, 12846 // "memberKey": { 12847 // "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.", 12848 // "location": "path", 12849 // "required": true, 12850 // "type": "string" 12851 // } 12852 // }, 12853 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12854 // "request": { 12855 // "$ref": "Member" 12856 // }, 12857 // "response": { 12858 // "$ref": "Member" 12859 // }, 12860 // "scopes": [ 12861 // "https://www.googleapis.com/auth/admin.directory.group", 12862 // "https://www.googleapis.com/auth/admin.directory.group.member" 12863 // ] 12864 // } 12865 12866} 12867 12868// method id "directory.members.update": 12869 12870type MembersUpdateCall struct { 12871 s *Service 12872 groupKey string 12873 memberKey string 12874 member *Member 12875 urlParams_ gensupport.URLParams 12876 ctx_ context.Context 12877 header_ http.Header 12878} 12879 12880// Update: Updates the membership of a user in the specified group. 12881// 12882// - groupKey: Identifies the group in the API request. The value can be 12883// the group's email address, group alias, or the unique group ID. 12884// - memberKey: Identifies the group member in the API request. A group 12885// member can be a user or another group. The value can be the 12886// member's (group or user) primary email address, alias, or unique 12887// ID. 12888func (r *MembersService) Update(groupKey string, memberKey string, member *Member) *MembersUpdateCall { 12889 c := &MembersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12890 c.groupKey = groupKey 12891 c.memberKey = memberKey 12892 c.member = member 12893 return c 12894} 12895 12896// Fields allows partial responses to be retrieved. See 12897// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12898// for more information. 12899func (c *MembersUpdateCall) Fields(s ...googleapi.Field) *MembersUpdateCall { 12900 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12901 return c 12902} 12903 12904// Context sets the context to be used in this call's Do method. Any 12905// pending HTTP request will be aborted if the provided context is 12906// canceled. 12907func (c *MembersUpdateCall) Context(ctx context.Context) *MembersUpdateCall { 12908 c.ctx_ = ctx 12909 return c 12910} 12911 12912// Header returns an http.Header that can be modified by the caller to 12913// add HTTP headers to the request. 12914func (c *MembersUpdateCall) Header() http.Header { 12915 if c.header_ == nil { 12916 c.header_ = make(http.Header) 12917 } 12918 return c.header_ 12919} 12920 12921func (c *MembersUpdateCall) doRequest(alt string) (*http.Response, error) { 12922 reqHeaders := make(http.Header) 12923 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12924 for k, v := range c.header_ { 12925 reqHeaders[k] = v 12926 } 12927 reqHeaders.Set("User-Agent", c.s.userAgent()) 12928 var body io.Reader = nil 12929 body, err := googleapi.WithoutDataWrapper.JSONReader(c.member) 12930 if err != nil { 12931 return nil, err 12932 } 12933 reqHeaders.Set("Content-Type", "application/json") 12934 c.urlParams_.Set("alt", alt) 12935 c.urlParams_.Set("prettyPrint", "false") 12936 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/groups/{groupKey}/members/{memberKey}") 12937 urls += "?" + c.urlParams_.Encode() 12938 req, err := http.NewRequest("PUT", urls, body) 12939 if err != nil { 12940 return nil, err 12941 } 12942 req.Header = reqHeaders 12943 googleapi.Expand(req.URL, map[string]string{ 12944 "groupKey": c.groupKey, 12945 "memberKey": c.memberKey, 12946 }) 12947 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12948} 12949 12950// Do executes the "directory.members.update" call. 12951// Exactly one of *Member or error will be non-nil. Any non-2xx status 12952// code is an error. Response headers are in either 12953// *Member.ServerResponse.Header or (if a response was returned at all) 12954// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12955// check whether the returned error was because http.StatusNotModified 12956// was returned. 12957func (c *MembersUpdateCall) Do(opts ...googleapi.CallOption) (*Member, error) { 12958 gensupport.SetOptions(c.urlParams_, opts...) 12959 res, err := c.doRequest("json") 12960 if res != nil && res.StatusCode == http.StatusNotModified { 12961 if res.Body != nil { 12962 res.Body.Close() 12963 } 12964 return nil, &googleapi.Error{ 12965 Code: res.StatusCode, 12966 Header: res.Header, 12967 } 12968 } 12969 if err != nil { 12970 return nil, err 12971 } 12972 defer googleapi.CloseBody(res) 12973 if err := googleapi.CheckResponse(res); err != nil { 12974 return nil, err 12975 } 12976 ret := &Member{ 12977 ServerResponse: googleapi.ServerResponse{ 12978 Header: res.Header, 12979 HTTPStatusCode: res.StatusCode, 12980 }, 12981 } 12982 target := &ret 12983 if err := gensupport.DecodeResponse(target, res); err != nil { 12984 return nil, err 12985 } 12986 return ret, nil 12987 // { 12988 // "description": "Updates the membership of a user in the specified group.", 12989 // "flatPath": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 12990 // "httpMethod": "PUT", 12991 // "id": "directory.members.update", 12992 // "parameterOrder": [ 12993 // "groupKey", 12994 // "memberKey" 12995 // ], 12996 // "parameters": { 12997 // "groupKey": { 12998 // "description": "Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.", 12999 // "location": "path", 13000 // "required": true, 13001 // "type": "string" 13002 // }, 13003 // "memberKey": { 13004 // "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.", 13005 // "location": "path", 13006 // "required": true, 13007 // "type": "string" 13008 // } 13009 // }, 13010 // "path": "admin/directory/v1/groups/{groupKey}/members/{memberKey}", 13011 // "request": { 13012 // "$ref": "Member" 13013 // }, 13014 // "response": { 13015 // "$ref": "Member" 13016 // }, 13017 // "scopes": [ 13018 // "https://www.googleapis.com/auth/admin.directory.group", 13019 // "https://www.googleapis.com/auth/admin.directory.group.member" 13020 // ] 13021 // } 13022 13023} 13024 13025// method id "directory.mobiledevices.action": 13026 13027type MobiledevicesActionCall struct { 13028 s *Service 13029 customerId string 13030 resourceId string 13031 mobiledeviceaction *MobileDeviceAction 13032 urlParams_ gensupport.URLParams 13033 ctx_ context.Context 13034 header_ http.Header 13035} 13036 13037// Action: Takes an action that affects a mobile device. For example, 13038// remotely wiping a device. 13039// 13040// - customerId: The unique ID for the customer's Google Workspace 13041// account. As an account administrator, you can also use the 13042// `my_customer` alias to represent your account's `customerId`. The 13043// `customerId` is also returned as part of the Users resource 13044// (/admin-sdk/directory/v1/reference/users). 13045// - resourceId: The unique ID the API service uses to identify the 13046// mobile device. 13047func (r *MobiledevicesService) Action(customerId string, resourceId string, mobiledeviceaction *MobileDeviceAction) *MobiledevicesActionCall { 13048 c := &MobiledevicesActionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13049 c.customerId = customerId 13050 c.resourceId = resourceId 13051 c.mobiledeviceaction = mobiledeviceaction 13052 return c 13053} 13054 13055// Fields allows partial responses to be retrieved. See 13056// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13057// for more information. 13058func (c *MobiledevicesActionCall) Fields(s ...googleapi.Field) *MobiledevicesActionCall { 13059 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13060 return c 13061} 13062 13063// Context sets the context to be used in this call's Do method. Any 13064// pending HTTP request will be aborted if the provided context is 13065// canceled. 13066func (c *MobiledevicesActionCall) Context(ctx context.Context) *MobiledevicesActionCall { 13067 c.ctx_ = ctx 13068 return c 13069} 13070 13071// Header returns an http.Header that can be modified by the caller to 13072// add HTTP headers to the request. 13073func (c *MobiledevicesActionCall) Header() http.Header { 13074 if c.header_ == nil { 13075 c.header_ = make(http.Header) 13076 } 13077 return c.header_ 13078} 13079 13080func (c *MobiledevicesActionCall) doRequest(alt string) (*http.Response, error) { 13081 reqHeaders := make(http.Header) 13082 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13083 for k, v := range c.header_ { 13084 reqHeaders[k] = v 13085 } 13086 reqHeaders.Set("User-Agent", c.s.userAgent()) 13087 var body io.Reader = nil 13088 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobiledeviceaction) 13089 if err != nil { 13090 return nil, err 13091 } 13092 reqHeaders.Set("Content-Type", "application/json") 13093 c.urlParams_.Set("alt", alt) 13094 c.urlParams_.Set("prettyPrint", "false") 13095 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action") 13096 urls += "?" + c.urlParams_.Encode() 13097 req, err := http.NewRequest("POST", urls, body) 13098 if err != nil { 13099 return nil, err 13100 } 13101 req.Header = reqHeaders 13102 googleapi.Expand(req.URL, map[string]string{ 13103 "customerId": c.customerId, 13104 "resourceId": c.resourceId, 13105 }) 13106 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13107} 13108 13109// Do executes the "directory.mobiledevices.action" call. 13110func (c *MobiledevicesActionCall) Do(opts ...googleapi.CallOption) error { 13111 gensupport.SetOptions(c.urlParams_, opts...) 13112 res, err := c.doRequest("json") 13113 if err != nil { 13114 return err 13115 } 13116 defer googleapi.CloseBody(res) 13117 if err := googleapi.CheckResponse(res); err != nil { 13118 return err 13119 } 13120 return nil 13121 // { 13122 // "description": "Takes an action that affects a mobile device. For example, remotely wiping a device.", 13123 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action", 13124 // "httpMethod": "POST", 13125 // "id": "directory.mobiledevices.action", 13126 // "parameterOrder": [ 13127 // "customerId", 13128 // "resourceId" 13129 // ], 13130 // "parameters": { 13131 // "customerId": { 13132 // "description": "The unique ID for the customer's Google Workspace 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).", 13133 // "location": "path", 13134 // "required": true, 13135 // "type": "string" 13136 // }, 13137 // "resourceId": { 13138 // "description": "The unique ID the API service uses to identify the mobile device.", 13139 // "location": "path", 13140 // "required": true, 13141 // "type": "string" 13142 // } 13143 // }, 13144 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action", 13145 // "request": { 13146 // "$ref": "MobileDeviceAction" 13147 // }, 13148 // "scopes": [ 13149 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 13150 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action" 13151 // ] 13152 // } 13153 13154} 13155 13156// method id "directory.mobiledevices.delete": 13157 13158type MobiledevicesDeleteCall struct { 13159 s *Service 13160 customerId string 13161 resourceId string 13162 urlParams_ gensupport.URLParams 13163 ctx_ context.Context 13164 header_ http.Header 13165} 13166 13167// Delete: Removes a mobile device. 13168// 13169// - customerId: The unique ID for the customer's Google Workspace 13170// account. As an account administrator, you can also use the 13171// `my_customer` alias to represent your account's `customerId`. The 13172// `customerId` is also returned as part of the Users resource 13173// (/admin-sdk/directory/v1/reference/users). 13174// - resourceId: The unique ID the API service uses to identify the 13175// mobile device. 13176func (r *MobiledevicesService) Delete(customerId string, resourceId string) *MobiledevicesDeleteCall { 13177 c := &MobiledevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13178 c.customerId = customerId 13179 c.resourceId = resourceId 13180 return c 13181} 13182 13183// Fields allows partial responses to be retrieved. See 13184// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13185// for more information. 13186func (c *MobiledevicesDeleteCall) Fields(s ...googleapi.Field) *MobiledevicesDeleteCall { 13187 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13188 return c 13189} 13190 13191// Context sets the context to be used in this call's Do method. Any 13192// pending HTTP request will be aborted if the provided context is 13193// canceled. 13194func (c *MobiledevicesDeleteCall) Context(ctx context.Context) *MobiledevicesDeleteCall { 13195 c.ctx_ = ctx 13196 return c 13197} 13198 13199// Header returns an http.Header that can be modified by the caller to 13200// add HTTP headers to the request. 13201func (c *MobiledevicesDeleteCall) Header() http.Header { 13202 if c.header_ == nil { 13203 c.header_ = make(http.Header) 13204 } 13205 return c.header_ 13206} 13207 13208func (c *MobiledevicesDeleteCall) doRequest(alt string) (*http.Response, error) { 13209 reqHeaders := make(http.Header) 13210 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13211 for k, v := range c.header_ { 13212 reqHeaders[k] = v 13213 } 13214 reqHeaders.Set("User-Agent", c.s.userAgent()) 13215 var body io.Reader = nil 13216 c.urlParams_.Set("alt", alt) 13217 c.urlParams_.Set("prettyPrint", "false") 13218 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") 13219 urls += "?" + c.urlParams_.Encode() 13220 req, err := http.NewRequest("DELETE", urls, body) 13221 if err != nil { 13222 return nil, err 13223 } 13224 req.Header = reqHeaders 13225 googleapi.Expand(req.URL, map[string]string{ 13226 "customerId": c.customerId, 13227 "resourceId": c.resourceId, 13228 }) 13229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13230} 13231 13232// Do executes the "directory.mobiledevices.delete" call. 13233func (c *MobiledevicesDeleteCall) Do(opts ...googleapi.CallOption) error { 13234 gensupport.SetOptions(c.urlParams_, opts...) 13235 res, err := c.doRequest("json") 13236 if err != nil { 13237 return err 13238 } 13239 defer googleapi.CloseBody(res) 13240 if err := googleapi.CheckResponse(res); err != nil { 13241 return err 13242 } 13243 return nil 13244 // { 13245 // "description": "Removes a mobile device.", 13246 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 13247 // "httpMethod": "DELETE", 13248 // "id": "directory.mobiledevices.delete", 13249 // "parameterOrder": [ 13250 // "customerId", 13251 // "resourceId" 13252 // ], 13253 // "parameters": { 13254 // "customerId": { 13255 // "description": "The unique ID for the customer's Google Workspace 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).", 13256 // "location": "path", 13257 // "required": true, 13258 // "type": "string" 13259 // }, 13260 // "resourceId": { 13261 // "description": "The unique ID the API service uses to identify the mobile device.", 13262 // "location": "path", 13263 // "required": true, 13264 // "type": "string" 13265 // } 13266 // }, 13267 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 13268 // "scopes": [ 13269 // "https://www.googleapis.com/auth/admin.directory.device.mobile" 13270 // ] 13271 // } 13272 13273} 13274 13275// method id "directory.mobiledevices.get": 13276 13277type MobiledevicesGetCall struct { 13278 s *Service 13279 customerId string 13280 resourceId string 13281 urlParams_ gensupport.URLParams 13282 ifNoneMatch_ string 13283 ctx_ context.Context 13284 header_ http.Header 13285} 13286 13287// Get: Retrieves a mobile device's properties. 13288// 13289// - customerId: The unique ID for the customer's Google Workspace 13290// account. As an account administrator, you can also use the 13291// `my_customer` alias to represent your account's `customerId`. The 13292// `customerId` is also returned as part of the Users resource 13293// (/admin-sdk/directory/v1/reference/users). 13294// - resourceId: The unique ID the API service uses to identify the 13295// mobile device. 13296func (r *MobiledevicesService) Get(customerId string, resourceId string) *MobiledevicesGetCall { 13297 c := &MobiledevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13298 c.customerId = customerId 13299 c.resourceId = resourceId 13300 return c 13301} 13302 13303// Projection sets the optional parameter "projection": Restrict 13304// information returned to a set of selected fields. 13305// 13306// Possible values: 13307// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 13308// model, status, type, and status) 13309// "FULL" - Includes all metadata fields 13310func (c *MobiledevicesGetCall) Projection(projection string) *MobiledevicesGetCall { 13311 c.urlParams_.Set("projection", projection) 13312 return c 13313} 13314 13315// Fields allows partial responses to be retrieved. See 13316// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13317// for more information. 13318func (c *MobiledevicesGetCall) Fields(s ...googleapi.Field) *MobiledevicesGetCall { 13319 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13320 return c 13321} 13322 13323// IfNoneMatch sets the optional parameter which makes the operation 13324// fail if the object's ETag matches the given value. This is useful for 13325// getting updates only after the object has changed since the last 13326// request. Use googleapi.IsNotModified to check whether the response 13327// error from Do is the result of In-None-Match. 13328func (c *MobiledevicesGetCall) IfNoneMatch(entityTag string) *MobiledevicesGetCall { 13329 c.ifNoneMatch_ = entityTag 13330 return c 13331} 13332 13333// Context sets the context to be used in this call's Do method. Any 13334// pending HTTP request will be aborted if the provided context is 13335// canceled. 13336func (c *MobiledevicesGetCall) Context(ctx context.Context) *MobiledevicesGetCall { 13337 c.ctx_ = ctx 13338 return c 13339} 13340 13341// Header returns an http.Header that can be modified by the caller to 13342// add HTTP headers to the request. 13343func (c *MobiledevicesGetCall) Header() http.Header { 13344 if c.header_ == nil { 13345 c.header_ = make(http.Header) 13346 } 13347 return c.header_ 13348} 13349 13350func (c *MobiledevicesGetCall) doRequest(alt string) (*http.Response, error) { 13351 reqHeaders := make(http.Header) 13352 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13353 for k, v := range c.header_ { 13354 reqHeaders[k] = v 13355 } 13356 reqHeaders.Set("User-Agent", c.s.userAgent()) 13357 if c.ifNoneMatch_ != "" { 13358 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13359 } 13360 var body io.Reader = nil 13361 c.urlParams_.Set("alt", alt) 13362 c.urlParams_.Set("prettyPrint", "false") 13363 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}") 13364 urls += "?" + c.urlParams_.Encode() 13365 req, err := http.NewRequest("GET", urls, body) 13366 if err != nil { 13367 return nil, err 13368 } 13369 req.Header = reqHeaders 13370 googleapi.Expand(req.URL, map[string]string{ 13371 "customerId": c.customerId, 13372 "resourceId": c.resourceId, 13373 }) 13374 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13375} 13376 13377// Do executes the "directory.mobiledevices.get" call. 13378// Exactly one of *MobileDevice or error will be non-nil. Any non-2xx 13379// status code is an error. Response headers are in either 13380// *MobileDevice.ServerResponse.Header or (if a response was returned at 13381// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13382// to check whether the returned error was because 13383// http.StatusNotModified was returned. 13384func (c *MobiledevicesGetCall) Do(opts ...googleapi.CallOption) (*MobileDevice, error) { 13385 gensupport.SetOptions(c.urlParams_, opts...) 13386 res, err := c.doRequest("json") 13387 if res != nil && res.StatusCode == http.StatusNotModified { 13388 if res.Body != nil { 13389 res.Body.Close() 13390 } 13391 return nil, &googleapi.Error{ 13392 Code: res.StatusCode, 13393 Header: res.Header, 13394 } 13395 } 13396 if err != nil { 13397 return nil, err 13398 } 13399 defer googleapi.CloseBody(res) 13400 if err := googleapi.CheckResponse(res); err != nil { 13401 return nil, err 13402 } 13403 ret := &MobileDevice{ 13404 ServerResponse: googleapi.ServerResponse{ 13405 Header: res.Header, 13406 HTTPStatusCode: res.StatusCode, 13407 }, 13408 } 13409 target := &ret 13410 if err := gensupport.DecodeResponse(target, res); err != nil { 13411 return nil, err 13412 } 13413 return ret, nil 13414 // { 13415 // "description": "Retrieves a mobile device's properties.", 13416 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 13417 // "httpMethod": "GET", 13418 // "id": "directory.mobiledevices.get", 13419 // "parameterOrder": [ 13420 // "customerId", 13421 // "resourceId" 13422 // ], 13423 // "parameters": { 13424 // "customerId": { 13425 // "description": "The unique ID for the customer's Google Workspace 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).", 13426 // "location": "path", 13427 // "required": true, 13428 // "type": "string" 13429 // }, 13430 // "projection": { 13431 // "description": "Restrict information returned to a set of selected fields.", 13432 // "enum": [ 13433 // "BASIC", 13434 // "FULL" 13435 // ], 13436 // "enumDescriptions": [ 13437 // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", 13438 // "Includes all metadata fields" 13439 // ], 13440 // "location": "query", 13441 // "type": "string" 13442 // }, 13443 // "resourceId": { 13444 // "description": "The unique ID the API service uses to identify the mobile device.", 13445 // "location": "path", 13446 // "required": true, 13447 // "type": "string" 13448 // } 13449 // }, 13450 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}", 13451 // "response": { 13452 // "$ref": "MobileDevice" 13453 // }, 13454 // "scopes": [ 13455 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 13456 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 13457 // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 13458 // ] 13459 // } 13460 13461} 13462 13463// method id "directory.mobiledevices.list": 13464 13465type MobiledevicesListCall struct { 13466 s *Service 13467 customerId string 13468 urlParams_ gensupport.URLParams 13469 ifNoneMatch_ string 13470 ctx_ context.Context 13471 header_ http.Header 13472} 13473 13474// List: Retrieves a paginated list of all mobile devices for an 13475// account. 13476// 13477// - customerId: The unique ID for the customer's Google Workspace 13478// account. As an account administrator, you can also use the 13479// `my_customer` alias to represent your account's `customerId`. The 13480// `customerId` is also returned as part of the Users resource 13481// (/admin-sdk/directory/v1/reference/users). 13482func (r *MobiledevicesService) List(customerId string) *MobiledevicesListCall { 13483 c := &MobiledevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13484 c.customerId = customerId 13485 return c 13486} 13487 13488// MaxResults sets the optional parameter "maxResults": Maximum number 13489// of results to return. Max allowed value is 100. 13490func (c *MobiledevicesListCall) MaxResults(maxResults int64) *MobiledevicesListCall { 13491 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 13492 return c 13493} 13494 13495// OrderBy sets the optional parameter "orderBy": Device property to use 13496// for sorting results. 13497// 13498// Possible values: 13499// "deviceId" - The serial number for a Google Sync mobile device. For 13500// Android devices, this is a software generated unique identifier. 13501// "email" - The device owner's email address. 13502// "lastSync" - Last policy settings sync date time of the device. 13503// "model" - The mobile device's model. 13504// "name" - The device owner's user name. 13505// "os" - The device's operating system. 13506// "status" - The device status. 13507// "type" - Type of the device. 13508func (c *MobiledevicesListCall) OrderBy(orderBy string) *MobiledevicesListCall { 13509 c.urlParams_.Set("orderBy", orderBy) 13510 return c 13511} 13512 13513// PageToken sets the optional parameter "pageToken": Token to specify 13514// next page in the list 13515func (c *MobiledevicesListCall) PageToken(pageToken string) *MobiledevicesListCall { 13516 c.urlParams_.Set("pageToken", pageToken) 13517 return c 13518} 13519 13520// Projection sets the optional parameter "projection": Restrict 13521// information returned to a set of selected fields. 13522// 13523// Possible values: 13524// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, 13525// model, status, type, and status) 13526// "FULL" - Includes all metadata fields 13527func (c *MobiledevicesListCall) Projection(projection string) *MobiledevicesListCall { 13528 c.urlParams_.Set("projection", projection) 13529 return c 13530} 13531 13532// Query sets the optional parameter "query": Search string in the 13533// format given at 13534// https://developers.google.com/admin-sdk/directory/v1/search-operators 13535func (c *MobiledevicesListCall) Query(query string) *MobiledevicesListCall { 13536 c.urlParams_.Set("query", query) 13537 return c 13538} 13539 13540// SortOrder sets the optional parameter "sortOrder": Whether to return 13541// results in ascending or descending order. Must be used with the 13542// `orderBy` parameter. 13543// 13544// Possible values: 13545// "ASCENDING" - Ascending order. 13546// "DESCENDING" - Descending order. 13547func (c *MobiledevicesListCall) SortOrder(sortOrder string) *MobiledevicesListCall { 13548 c.urlParams_.Set("sortOrder", sortOrder) 13549 return c 13550} 13551 13552// Fields allows partial responses to be retrieved. See 13553// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13554// for more information. 13555func (c *MobiledevicesListCall) Fields(s ...googleapi.Field) *MobiledevicesListCall { 13556 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13557 return c 13558} 13559 13560// IfNoneMatch sets the optional parameter which makes the operation 13561// fail if the object's ETag matches the given value. This is useful for 13562// getting updates only after the object has changed since the last 13563// request. Use googleapi.IsNotModified to check whether the response 13564// error from Do is the result of In-None-Match. 13565func (c *MobiledevicesListCall) IfNoneMatch(entityTag string) *MobiledevicesListCall { 13566 c.ifNoneMatch_ = entityTag 13567 return c 13568} 13569 13570// Context sets the context to be used in this call's Do method. Any 13571// pending HTTP request will be aborted if the provided context is 13572// canceled. 13573func (c *MobiledevicesListCall) Context(ctx context.Context) *MobiledevicesListCall { 13574 c.ctx_ = ctx 13575 return c 13576} 13577 13578// Header returns an http.Header that can be modified by the caller to 13579// add HTTP headers to the request. 13580func (c *MobiledevicesListCall) Header() http.Header { 13581 if c.header_ == nil { 13582 c.header_ = make(http.Header) 13583 } 13584 return c.header_ 13585} 13586 13587func (c *MobiledevicesListCall) doRequest(alt string) (*http.Response, error) { 13588 reqHeaders := make(http.Header) 13589 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13590 for k, v := range c.header_ { 13591 reqHeaders[k] = v 13592 } 13593 reqHeaders.Set("User-Agent", c.s.userAgent()) 13594 if c.ifNoneMatch_ != "" { 13595 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13596 } 13597 var body io.Reader = nil 13598 c.urlParams_.Set("alt", alt) 13599 c.urlParams_.Set("prettyPrint", "false") 13600 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/devices/mobile") 13601 urls += "?" + c.urlParams_.Encode() 13602 req, err := http.NewRequest("GET", urls, body) 13603 if err != nil { 13604 return nil, err 13605 } 13606 req.Header = reqHeaders 13607 googleapi.Expand(req.URL, map[string]string{ 13608 "customerId": c.customerId, 13609 }) 13610 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13611} 13612 13613// Do executes the "directory.mobiledevices.list" call. 13614// Exactly one of *MobileDevices or error will be non-nil. Any non-2xx 13615// status code is an error. Response headers are in either 13616// *MobileDevices.ServerResponse.Header or (if a response was returned 13617// at all) in error.(*googleapi.Error).Header. Use 13618// googleapi.IsNotModified to check whether the returned error was 13619// because http.StatusNotModified was returned. 13620func (c *MobiledevicesListCall) Do(opts ...googleapi.CallOption) (*MobileDevices, error) { 13621 gensupport.SetOptions(c.urlParams_, opts...) 13622 res, err := c.doRequest("json") 13623 if res != nil && res.StatusCode == http.StatusNotModified { 13624 if res.Body != nil { 13625 res.Body.Close() 13626 } 13627 return nil, &googleapi.Error{ 13628 Code: res.StatusCode, 13629 Header: res.Header, 13630 } 13631 } 13632 if err != nil { 13633 return nil, err 13634 } 13635 defer googleapi.CloseBody(res) 13636 if err := googleapi.CheckResponse(res); err != nil { 13637 return nil, err 13638 } 13639 ret := &MobileDevices{ 13640 ServerResponse: googleapi.ServerResponse{ 13641 Header: res.Header, 13642 HTTPStatusCode: res.StatusCode, 13643 }, 13644 } 13645 target := &ret 13646 if err := gensupport.DecodeResponse(target, res); err != nil { 13647 return nil, err 13648 } 13649 return ret, nil 13650 // { 13651 // "description": "Retrieves a paginated list of all mobile devices for an account.", 13652 // "flatPath": "admin/directory/v1/customer/{customerId}/devices/mobile", 13653 // "httpMethod": "GET", 13654 // "id": "directory.mobiledevices.list", 13655 // "parameterOrder": [ 13656 // "customerId" 13657 // ], 13658 // "parameters": { 13659 // "customerId": { 13660 // "description": "The unique ID for the customer's Google Workspace 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).", 13661 // "location": "path", 13662 // "required": true, 13663 // "type": "string" 13664 // }, 13665 // "maxResults": { 13666 // "default": "100", 13667 // "description": "Maximum number of results to return. Max allowed value is 100.", 13668 // "format": "int32", 13669 // "location": "query", 13670 // "maximum": "100", 13671 // "minimum": "1", 13672 // "type": "integer" 13673 // }, 13674 // "orderBy": { 13675 // "description": "Device property to use for sorting results.", 13676 // "enum": [ 13677 // "deviceId", 13678 // "email", 13679 // "lastSync", 13680 // "model", 13681 // "name", 13682 // "os", 13683 // "status", 13684 // "type" 13685 // ], 13686 // "enumDescriptions": [ 13687 // "The serial number for a Google Sync mobile device. For Android devices, this is a software generated unique identifier.", 13688 // "The device owner's email address.", 13689 // "Last policy settings sync date time of the device.", 13690 // "The mobile device's model.", 13691 // "The device owner's user name.", 13692 // "The device's operating system.", 13693 // "The device status.", 13694 // "Type of the device." 13695 // ], 13696 // "location": "query", 13697 // "type": "string" 13698 // }, 13699 // "pageToken": { 13700 // "description": "Token to specify next page in the list", 13701 // "location": "query", 13702 // "type": "string" 13703 // }, 13704 // "projection": { 13705 // "description": "Restrict information returned to a set of selected fields.", 13706 // "enum": [ 13707 // "BASIC", 13708 // "FULL" 13709 // ], 13710 // "enumDescriptions": [ 13711 // "Includes only the basic metadata fields (e.g., deviceId, model, status, type, and status)", 13712 // "Includes all metadata fields" 13713 // ], 13714 // "location": "query", 13715 // "type": "string" 13716 // }, 13717 // "query": { 13718 // "description": "Search string in the format given at https://developers.google.com/admin-sdk/directory/v1/search-operators", 13719 // "location": "query", 13720 // "type": "string" 13721 // }, 13722 // "sortOrder": { 13723 // "description": "Whether to return results in ascending or descending order. Must be used with the `orderBy` parameter.", 13724 // "enum": [ 13725 // "ASCENDING", 13726 // "DESCENDING" 13727 // ], 13728 // "enumDescriptions": [ 13729 // "Ascending order.", 13730 // "Descending order." 13731 // ], 13732 // "location": "query", 13733 // "type": "string" 13734 // } 13735 // }, 13736 // "path": "admin/directory/v1/customer/{customerId}/devices/mobile", 13737 // "response": { 13738 // "$ref": "MobileDevices" 13739 // }, 13740 // "scopes": [ 13741 // "https://www.googleapis.com/auth/admin.directory.device.mobile", 13742 // "https://www.googleapis.com/auth/admin.directory.device.mobile.action", 13743 // "https://www.googleapis.com/auth/admin.directory.device.mobile.readonly" 13744 // ] 13745 // } 13746 13747} 13748 13749// Pages invokes f for each page of results. 13750// A non-nil error returned from f will halt the iteration. 13751// The provided context supersedes any context provided to the Context method. 13752func (c *MobiledevicesListCall) Pages(ctx context.Context, f func(*MobileDevices) error) error { 13753 c.ctx_ = ctx 13754 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13755 for { 13756 x, err := c.Do() 13757 if err != nil { 13758 return err 13759 } 13760 if err := f(x); err != nil { 13761 return err 13762 } 13763 if x.NextPageToken == "" { 13764 return nil 13765 } 13766 c.PageToken(x.NextPageToken) 13767 } 13768} 13769 13770// method id "directory.orgunits.delete": 13771 13772type OrgunitsDeleteCall struct { 13773 s *Service 13774 customerId string 13775 orgUnitPath string 13776 urlParams_ gensupport.URLParams 13777 ctx_ context.Context 13778 header_ http.Header 13779} 13780 13781// Delete: Removes an organizational unit. 13782// 13783// - customerId: The unique ID for the customer's Google Workspace 13784// account. As an account administrator, you can also use the 13785// `my_customer` alias to represent your account's `customerId`. The 13786// `customerId` is also returned as part of the Users resource 13787// (/admin-sdk/directory/v1/reference/users). 13788// - orgUnitPath: The full path of the organizational unit or its unique 13789// ID. 13790func (r *OrgunitsService) Delete(customerId string, orgUnitPath string) *OrgunitsDeleteCall { 13791 c := &OrgunitsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13792 c.customerId = customerId 13793 c.orgUnitPath = orgUnitPath 13794 return c 13795} 13796 13797// Fields allows partial responses to be retrieved. See 13798// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13799// for more information. 13800func (c *OrgunitsDeleteCall) Fields(s ...googleapi.Field) *OrgunitsDeleteCall { 13801 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13802 return c 13803} 13804 13805// Context sets the context to be used in this call's Do method. Any 13806// pending HTTP request will be aborted if the provided context is 13807// canceled. 13808func (c *OrgunitsDeleteCall) Context(ctx context.Context) *OrgunitsDeleteCall { 13809 c.ctx_ = ctx 13810 return c 13811} 13812 13813// Header returns an http.Header that can be modified by the caller to 13814// add HTTP headers to the request. 13815func (c *OrgunitsDeleteCall) Header() http.Header { 13816 if c.header_ == nil { 13817 c.header_ = make(http.Header) 13818 } 13819 return c.header_ 13820} 13821 13822func (c *OrgunitsDeleteCall) doRequest(alt string) (*http.Response, error) { 13823 reqHeaders := make(http.Header) 13824 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13825 for k, v := range c.header_ { 13826 reqHeaders[k] = v 13827 } 13828 reqHeaders.Set("User-Agent", c.s.userAgent()) 13829 var body io.Reader = nil 13830 c.urlParams_.Set("alt", alt) 13831 c.urlParams_.Set("prettyPrint", "false") 13832 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 13833 urls += "?" + c.urlParams_.Encode() 13834 req, err := http.NewRequest("DELETE", urls, body) 13835 if err != nil { 13836 return nil, err 13837 } 13838 req.Header = reqHeaders 13839 googleapi.Expand(req.URL, map[string]string{ 13840 "customerId": c.customerId, 13841 "orgUnitPath": c.orgUnitPath, 13842 }) 13843 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13844} 13845 13846// Do executes the "directory.orgunits.delete" call. 13847func (c *OrgunitsDeleteCall) Do(opts ...googleapi.CallOption) error { 13848 gensupport.SetOptions(c.urlParams_, opts...) 13849 res, err := c.doRequest("json") 13850 if err != nil { 13851 return err 13852 } 13853 defer googleapi.CloseBody(res) 13854 if err := googleapi.CheckResponse(res); err != nil { 13855 return err 13856 } 13857 return nil 13858 // { 13859 // "description": "Removes an organizational unit.", 13860 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 13861 // "httpMethod": "DELETE", 13862 // "id": "directory.orgunits.delete", 13863 // "parameterOrder": [ 13864 // "customerId", 13865 // "orgUnitPath" 13866 // ], 13867 // "parameters": { 13868 // "customerId": { 13869 // "description": "The unique ID for the customer's Google Workspace 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).", 13870 // "location": "path", 13871 // "required": true, 13872 // "type": "string" 13873 // }, 13874 // "orgUnitPath": { 13875 // "description": "The full path of the organizational unit or its unique ID.", 13876 // "location": "path", 13877 // "pattern": "^.*$", 13878 // "required": true, 13879 // "type": "string" 13880 // } 13881 // }, 13882 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 13883 // "scopes": [ 13884 // "https://www.googleapis.com/auth/admin.directory.orgunit" 13885 // ] 13886 // } 13887 13888} 13889 13890// method id "directory.orgunits.get": 13891 13892type OrgunitsGetCall struct { 13893 s *Service 13894 customerId string 13895 orgUnitPath string 13896 urlParams_ gensupport.URLParams 13897 ifNoneMatch_ string 13898 ctx_ context.Context 13899 header_ http.Header 13900} 13901 13902// Get: Retrieves an organizational unit. 13903// 13904// - customerId: The unique ID for the customer's Google Workspace 13905// account. As an account administrator, you can also use the 13906// `my_customer` alias to represent your account's `customerId`. The 13907// `customerId` is also returned as part of the Users resource 13908// (/admin-sdk/directory/v1/reference/users). 13909// - orgUnitPath: The full path of the organizational unit or its unique 13910// ID. 13911func (r *OrgunitsService) Get(customerId string, orgUnitPath string) *OrgunitsGetCall { 13912 c := &OrgunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13913 c.customerId = customerId 13914 c.orgUnitPath = orgUnitPath 13915 return c 13916} 13917 13918// Fields allows partial responses to be retrieved. See 13919// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13920// for more information. 13921func (c *OrgunitsGetCall) Fields(s ...googleapi.Field) *OrgunitsGetCall { 13922 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13923 return c 13924} 13925 13926// IfNoneMatch sets the optional parameter which makes the operation 13927// fail if the object's ETag matches the given value. This is useful for 13928// getting updates only after the object has changed since the last 13929// request. Use googleapi.IsNotModified to check whether the response 13930// error from Do is the result of In-None-Match. 13931func (c *OrgunitsGetCall) IfNoneMatch(entityTag string) *OrgunitsGetCall { 13932 c.ifNoneMatch_ = entityTag 13933 return c 13934} 13935 13936// Context sets the context to be used in this call's Do method. Any 13937// pending HTTP request will be aborted if the provided context is 13938// canceled. 13939func (c *OrgunitsGetCall) Context(ctx context.Context) *OrgunitsGetCall { 13940 c.ctx_ = ctx 13941 return c 13942} 13943 13944// Header returns an http.Header that can be modified by the caller to 13945// add HTTP headers to the request. 13946func (c *OrgunitsGetCall) Header() http.Header { 13947 if c.header_ == nil { 13948 c.header_ = make(http.Header) 13949 } 13950 return c.header_ 13951} 13952 13953func (c *OrgunitsGetCall) doRequest(alt string) (*http.Response, error) { 13954 reqHeaders := make(http.Header) 13955 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13956 for k, v := range c.header_ { 13957 reqHeaders[k] = v 13958 } 13959 reqHeaders.Set("User-Agent", c.s.userAgent()) 13960 if c.ifNoneMatch_ != "" { 13961 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13962 } 13963 var body io.Reader = nil 13964 c.urlParams_.Set("alt", alt) 13965 c.urlParams_.Set("prettyPrint", "false") 13966 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 13967 urls += "?" + c.urlParams_.Encode() 13968 req, err := http.NewRequest("GET", urls, body) 13969 if err != nil { 13970 return nil, err 13971 } 13972 req.Header = reqHeaders 13973 googleapi.Expand(req.URL, map[string]string{ 13974 "customerId": c.customerId, 13975 "orgUnitPath": c.orgUnitPath, 13976 }) 13977 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13978} 13979 13980// Do executes the "directory.orgunits.get" call. 13981// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 13982// code is an error. Response headers are in either 13983// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 13984// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13985// check whether the returned error was because http.StatusNotModified 13986// was returned. 13987func (c *OrgunitsGetCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 13988 gensupport.SetOptions(c.urlParams_, opts...) 13989 res, err := c.doRequest("json") 13990 if res != nil && res.StatusCode == http.StatusNotModified { 13991 if res.Body != nil { 13992 res.Body.Close() 13993 } 13994 return nil, &googleapi.Error{ 13995 Code: res.StatusCode, 13996 Header: res.Header, 13997 } 13998 } 13999 if err != nil { 14000 return nil, err 14001 } 14002 defer googleapi.CloseBody(res) 14003 if err := googleapi.CheckResponse(res); err != nil { 14004 return nil, err 14005 } 14006 ret := &OrgUnit{ 14007 ServerResponse: googleapi.ServerResponse{ 14008 Header: res.Header, 14009 HTTPStatusCode: res.StatusCode, 14010 }, 14011 } 14012 target := &ret 14013 if err := gensupport.DecodeResponse(target, res); err != nil { 14014 return nil, err 14015 } 14016 return ret, nil 14017 // { 14018 // "description": "Retrieves an organizational unit.", 14019 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 14020 // "httpMethod": "GET", 14021 // "id": "directory.orgunits.get", 14022 // "parameterOrder": [ 14023 // "customerId", 14024 // "orgUnitPath" 14025 // ], 14026 // "parameters": { 14027 // "customerId": { 14028 // "description": "The unique ID for the customer's Google Workspace 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).", 14029 // "location": "path", 14030 // "required": true, 14031 // "type": "string" 14032 // }, 14033 // "orgUnitPath": { 14034 // "description": "The full path of the organizational unit or its unique ID.", 14035 // "location": "path", 14036 // "pattern": "^.*$", 14037 // "required": true, 14038 // "type": "string" 14039 // } 14040 // }, 14041 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 14042 // "response": { 14043 // "$ref": "OrgUnit" 14044 // }, 14045 // "scopes": [ 14046 // "https://www.googleapis.com/auth/admin.directory.orgunit", 14047 // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 14048 // ] 14049 // } 14050 14051} 14052 14053// method id "directory.orgunits.insert": 14054 14055type OrgunitsInsertCall struct { 14056 s *Service 14057 customerId string 14058 orgunit *OrgUnit 14059 urlParams_ gensupport.URLParams 14060 ctx_ context.Context 14061 header_ http.Header 14062} 14063 14064// Insert: Adds an organizational unit. 14065// 14066// - customerId: The unique ID for the customer's Google Workspace 14067// account. As an account administrator, you can also use the 14068// `my_customer` alias to represent your account's `customerId`. The 14069// `customerId` is also returned as part of the Users resource 14070// (/admin-sdk/directory/v1/reference/users). 14071func (r *OrgunitsService) Insert(customerId string, orgunit *OrgUnit) *OrgunitsInsertCall { 14072 c := &OrgunitsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14073 c.customerId = customerId 14074 c.orgunit = orgunit 14075 return c 14076} 14077 14078// Fields allows partial responses to be retrieved. See 14079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14080// for more information. 14081func (c *OrgunitsInsertCall) Fields(s ...googleapi.Field) *OrgunitsInsertCall { 14082 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14083 return c 14084} 14085 14086// Context sets the context to be used in this call's Do method. Any 14087// pending HTTP request will be aborted if the provided context is 14088// canceled. 14089func (c *OrgunitsInsertCall) Context(ctx context.Context) *OrgunitsInsertCall { 14090 c.ctx_ = ctx 14091 return c 14092} 14093 14094// Header returns an http.Header that can be modified by the caller to 14095// add HTTP headers to the request. 14096func (c *OrgunitsInsertCall) Header() http.Header { 14097 if c.header_ == nil { 14098 c.header_ = make(http.Header) 14099 } 14100 return c.header_ 14101} 14102 14103func (c *OrgunitsInsertCall) doRequest(alt string) (*http.Response, error) { 14104 reqHeaders := make(http.Header) 14105 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14106 for k, v := range c.header_ { 14107 reqHeaders[k] = v 14108 } 14109 reqHeaders.Set("User-Agent", c.s.userAgent()) 14110 var body io.Reader = nil 14111 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 14112 if err != nil { 14113 return nil, err 14114 } 14115 reqHeaders.Set("Content-Type", "application/json") 14116 c.urlParams_.Set("alt", alt) 14117 c.urlParams_.Set("prettyPrint", "false") 14118 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits") 14119 urls += "?" + c.urlParams_.Encode() 14120 req, err := http.NewRequest("POST", urls, body) 14121 if err != nil { 14122 return nil, err 14123 } 14124 req.Header = reqHeaders 14125 googleapi.Expand(req.URL, map[string]string{ 14126 "customerId": c.customerId, 14127 }) 14128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14129} 14130 14131// Do executes the "directory.orgunits.insert" call. 14132// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 14133// code is an error. Response headers are in either 14134// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 14135// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14136// check whether the returned error was because http.StatusNotModified 14137// was returned. 14138func (c *OrgunitsInsertCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 14139 gensupport.SetOptions(c.urlParams_, opts...) 14140 res, err := c.doRequest("json") 14141 if res != nil && res.StatusCode == http.StatusNotModified { 14142 if res.Body != nil { 14143 res.Body.Close() 14144 } 14145 return nil, &googleapi.Error{ 14146 Code: res.StatusCode, 14147 Header: res.Header, 14148 } 14149 } 14150 if err != nil { 14151 return nil, err 14152 } 14153 defer googleapi.CloseBody(res) 14154 if err := googleapi.CheckResponse(res); err != nil { 14155 return nil, err 14156 } 14157 ret := &OrgUnit{ 14158 ServerResponse: googleapi.ServerResponse{ 14159 Header: res.Header, 14160 HTTPStatusCode: res.StatusCode, 14161 }, 14162 } 14163 target := &ret 14164 if err := gensupport.DecodeResponse(target, res); err != nil { 14165 return nil, err 14166 } 14167 return ret, nil 14168 // { 14169 // "description": "Adds an organizational unit.", 14170 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits", 14171 // "httpMethod": "POST", 14172 // "id": "directory.orgunits.insert", 14173 // "parameterOrder": [ 14174 // "customerId" 14175 // ], 14176 // "parameters": { 14177 // "customerId": { 14178 // "description": "The unique ID for the customer's Google Workspace 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).", 14179 // "location": "path", 14180 // "required": true, 14181 // "type": "string" 14182 // } 14183 // }, 14184 // "path": "admin/directory/v1/customer/{customerId}/orgunits", 14185 // "request": { 14186 // "$ref": "OrgUnit" 14187 // }, 14188 // "response": { 14189 // "$ref": "OrgUnit" 14190 // }, 14191 // "scopes": [ 14192 // "https://www.googleapis.com/auth/admin.directory.orgunit" 14193 // ] 14194 // } 14195 14196} 14197 14198// method id "directory.orgunits.list": 14199 14200type OrgunitsListCall struct { 14201 s *Service 14202 customerId string 14203 urlParams_ gensupport.URLParams 14204 ifNoneMatch_ string 14205 ctx_ context.Context 14206 header_ http.Header 14207} 14208 14209// List: Retrieves a list of all organizational units for an account. 14210// 14211// - customerId: The unique ID for the customer's Google Workspace 14212// account. As an account administrator, you can also use the 14213// `my_customer` alias to represent your account's `customerId`. The 14214// `customerId` is also returned as part of the Users resource 14215// (/admin-sdk/directory/v1/reference/users). 14216func (r *OrgunitsService) List(customerId string) *OrgunitsListCall { 14217 c := &OrgunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14218 c.customerId = customerId 14219 return c 14220} 14221 14222// OrgUnitPath sets the optional parameter "orgUnitPath": The full path 14223// to the organizational unit or its unique ID. Returns the children of 14224// the specified organizational unit. 14225func (c *OrgunitsListCall) OrgUnitPath(orgUnitPath string) *OrgunitsListCall { 14226 c.urlParams_.Set("orgUnitPath", orgUnitPath) 14227 return c 14228} 14229 14230// Type sets the optional parameter "type": Whether to return all 14231// sub-organizations or just immediate children. 14232// 14233// Possible values: 14234// "all" - All sub-organizational units. 14235// "children" - Immediate children only (default). 14236func (c *OrgunitsListCall) Type(type_ string) *OrgunitsListCall { 14237 c.urlParams_.Set("type", type_) 14238 return c 14239} 14240 14241// Fields allows partial responses to be retrieved. See 14242// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14243// for more information. 14244func (c *OrgunitsListCall) Fields(s ...googleapi.Field) *OrgunitsListCall { 14245 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14246 return c 14247} 14248 14249// IfNoneMatch sets the optional parameter which makes the operation 14250// fail if the object's ETag matches the given value. This is useful for 14251// getting updates only after the object has changed since the last 14252// request. Use googleapi.IsNotModified to check whether the response 14253// error from Do is the result of In-None-Match. 14254func (c *OrgunitsListCall) IfNoneMatch(entityTag string) *OrgunitsListCall { 14255 c.ifNoneMatch_ = entityTag 14256 return c 14257} 14258 14259// Context sets the context to be used in this call's Do method. Any 14260// pending HTTP request will be aborted if the provided context is 14261// canceled. 14262func (c *OrgunitsListCall) Context(ctx context.Context) *OrgunitsListCall { 14263 c.ctx_ = ctx 14264 return c 14265} 14266 14267// Header returns an http.Header that can be modified by the caller to 14268// add HTTP headers to the request. 14269func (c *OrgunitsListCall) Header() http.Header { 14270 if c.header_ == nil { 14271 c.header_ = make(http.Header) 14272 } 14273 return c.header_ 14274} 14275 14276func (c *OrgunitsListCall) doRequest(alt string) (*http.Response, error) { 14277 reqHeaders := make(http.Header) 14278 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14279 for k, v := range c.header_ { 14280 reqHeaders[k] = v 14281 } 14282 reqHeaders.Set("User-Agent", c.s.userAgent()) 14283 if c.ifNoneMatch_ != "" { 14284 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14285 } 14286 var body io.Reader = nil 14287 c.urlParams_.Set("alt", alt) 14288 c.urlParams_.Set("prettyPrint", "false") 14289 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits") 14290 urls += "?" + c.urlParams_.Encode() 14291 req, err := http.NewRequest("GET", urls, body) 14292 if err != nil { 14293 return nil, err 14294 } 14295 req.Header = reqHeaders 14296 googleapi.Expand(req.URL, map[string]string{ 14297 "customerId": c.customerId, 14298 }) 14299 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14300} 14301 14302// Do executes the "directory.orgunits.list" call. 14303// Exactly one of *OrgUnits or error will be non-nil. Any non-2xx status 14304// code is an error. Response headers are in either 14305// *OrgUnits.ServerResponse.Header or (if a response was returned at 14306// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14307// to check whether the returned error was because 14308// http.StatusNotModified was returned. 14309func (c *OrgunitsListCall) Do(opts ...googleapi.CallOption) (*OrgUnits, error) { 14310 gensupport.SetOptions(c.urlParams_, opts...) 14311 res, err := c.doRequest("json") 14312 if res != nil && res.StatusCode == http.StatusNotModified { 14313 if res.Body != nil { 14314 res.Body.Close() 14315 } 14316 return nil, &googleapi.Error{ 14317 Code: res.StatusCode, 14318 Header: res.Header, 14319 } 14320 } 14321 if err != nil { 14322 return nil, err 14323 } 14324 defer googleapi.CloseBody(res) 14325 if err := googleapi.CheckResponse(res); err != nil { 14326 return nil, err 14327 } 14328 ret := &OrgUnits{ 14329 ServerResponse: googleapi.ServerResponse{ 14330 Header: res.Header, 14331 HTTPStatusCode: res.StatusCode, 14332 }, 14333 } 14334 target := &ret 14335 if err := gensupport.DecodeResponse(target, res); err != nil { 14336 return nil, err 14337 } 14338 return ret, nil 14339 // { 14340 // "description": "Retrieves a list of all organizational units for an account.", 14341 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits", 14342 // "httpMethod": "GET", 14343 // "id": "directory.orgunits.list", 14344 // "parameterOrder": [ 14345 // "customerId" 14346 // ], 14347 // "parameters": { 14348 // "customerId": { 14349 // "description": "The unique ID for the customer's Google Workspace 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).", 14350 // "location": "path", 14351 // "required": true, 14352 // "type": "string" 14353 // }, 14354 // "orgUnitPath": { 14355 // "default": "", 14356 // "description": "The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit.", 14357 // "location": "query", 14358 // "type": "string" 14359 // }, 14360 // "type": { 14361 // "description": "Whether to return all sub-organizations or just immediate children.", 14362 // "enum": [ 14363 // "all", 14364 // "children" 14365 // ], 14366 // "enumDescriptions": [ 14367 // "All sub-organizational units.", 14368 // "Immediate children only (default)." 14369 // ], 14370 // "location": "query", 14371 // "type": "string" 14372 // } 14373 // }, 14374 // "path": "admin/directory/v1/customer/{customerId}/orgunits", 14375 // "response": { 14376 // "$ref": "OrgUnits" 14377 // }, 14378 // "scopes": [ 14379 // "https://www.googleapis.com/auth/admin.directory.orgunit", 14380 // "https://www.googleapis.com/auth/admin.directory.orgunit.readonly" 14381 // ] 14382 // } 14383 14384} 14385 14386// method id "directory.orgunits.patch": 14387 14388type OrgunitsPatchCall struct { 14389 s *Service 14390 customerId string 14391 orgUnitPath string 14392 orgunit *OrgUnit 14393 urlParams_ gensupport.URLParams 14394 ctx_ context.Context 14395 header_ http.Header 14396} 14397 14398// Patch: Updates an organizational unit. This method supports patch 14399// semantics (/admin-sdk/directory/v1/guides/performance#patch) 14400// 14401// - customerId: The unique ID for the customer's Google Workspace 14402// account. As an account administrator, you can also use the 14403// `my_customer` alias to represent your account's `customerId`. The 14404// `customerId` is also returned as part of the Users resource 14405// (/admin-sdk/directory/v1/reference/users). 14406// - orgUnitPath: The full path of the organizational unit or its unique 14407// ID. 14408func (r *OrgunitsService) Patch(customerId string, orgUnitPath string, orgunit *OrgUnit) *OrgunitsPatchCall { 14409 c := &OrgunitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14410 c.customerId = customerId 14411 c.orgUnitPath = orgUnitPath 14412 c.orgunit = orgunit 14413 return c 14414} 14415 14416// Fields allows partial responses to be retrieved. See 14417// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14418// for more information. 14419func (c *OrgunitsPatchCall) Fields(s ...googleapi.Field) *OrgunitsPatchCall { 14420 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14421 return c 14422} 14423 14424// Context sets the context to be used in this call's Do method. Any 14425// pending HTTP request will be aborted if the provided context is 14426// canceled. 14427func (c *OrgunitsPatchCall) Context(ctx context.Context) *OrgunitsPatchCall { 14428 c.ctx_ = ctx 14429 return c 14430} 14431 14432// Header returns an http.Header that can be modified by the caller to 14433// add HTTP headers to the request. 14434func (c *OrgunitsPatchCall) Header() http.Header { 14435 if c.header_ == nil { 14436 c.header_ = make(http.Header) 14437 } 14438 return c.header_ 14439} 14440 14441func (c *OrgunitsPatchCall) doRequest(alt string) (*http.Response, error) { 14442 reqHeaders := make(http.Header) 14443 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14444 for k, v := range c.header_ { 14445 reqHeaders[k] = v 14446 } 14447 reqHeaders.Set("User-Agent", c.s.userAgent()) 14448 var body io.Reader = nil 14449 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 14450 if err != nil { 14451 return nil, err 14452 } 14453 reqHeaders.Set("Content-Type", "application/json") 14454 c.urlParams_.Set("alt", alt) 14455 c.urlParams_.Set("prettyPrint", "false") 14456 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 14457 urls += "?" + c.urlParams_.Encode() 14458 req, err := http.NewRequest("PATCH", urls, body) 14459 if err != nil { 14460 return nil, err 14461 } 14462 req.Header = reqHeaders 14463 googleapi.Expand(req.URL, map[string]string{ 14464 "customerId": c.customerId, 14465 "orgUnitPath": c.orgUnitPath, 14466 }) 14467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14468} 14469 14470// Do executes the "directory.orgunits.patch" call. 14471// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 14472// code is an error. Response headers are in either 14473// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 14474// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14475// check whether the returned error was because http.StatusNotModified 14476// was returned. 14477func (c *OrgunitsPatchCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 14478 gensupport.SetOptions(c.urlParams_, opts...) 14479 res, err := c.doRequest("json") 14480 if res != nil && res.StatusCode == http.StatusNotModified { 14481 if res.Body != nil { 14482 res.Body.Close() 14483 } 14484 return nil, &googleapi.Error{ 14485 Code: res.StatusCode, 14486 Header: res.Header, 14487 } 14488 } 14489 if err != nil { 14490 return nil, err 14491 } 14492 defer googleapi.CloseBody(res) 14493 if err := googleapi.CheckResponse(res); err != nil { 14494 return nil, err 14495 } 14496 ret := &OrgUnit{ 14497 ServerResponse: googleapi.ServerResponse{ 14498 Header: res.Header, 14499 HTTPStatusCode: res.StatusCode, 14500 }, 14501 } 14502 target := &ret 14503 if err := gensupport.DecodeResponse(target, res); err != nil { 14504 return nil, err 14505 } 14506 return ret, nil 14507 // { 14508 // "description": "Updates an organizational unit. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch)", 14509 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 14510 // "httpMethod": "PATCH", 14511 // "id": "directory.orgunits.patch", 14512 // "parameterOrder": [ 14513 // "customerId", 14514 // "orgUnitPath" 14515 // ], 14516 // "parameters": { 14517 // "customerId": { 14518 // "description": "The unique ID for the customer's Google Workspace 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).", 14519 // "location": "path", 14520 // "required": true, 14521 // "type": "string" 14522 // }, 14523 // "orgUnitPath": { 14524 // "description": "The full path of the organizational unit or its unique ID.", 14525 // "location": "path", 14526 // "pattern": "^.*$", 14527 // "required": true, 14528 // "type": "string" 14529 // } 14530 // }, 14531 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 14532 // "request": { 14533 // "$ref": "OrgUnit" 14534 // }, 14535 // "response": { 14536 // "$ref": "OrgUnit" 14537 // }, 14538 // "scopes": [ 14539 // "https://www.googleapis.com/auth/admin.directory.orgunit" 14540 // ] 14541 // } 14542 14543} 14544 14545// method id "directory.orgunits.update": 14546 14547type OrgunitsUpdateCall struct { 14548 s *Service 14549 customerId string 14550 orgUnitPath string 14551 orgunit *OrgUnit 14552 urlParams_ gensupport.URLParams 14553 ctx_ context.Context 14554 header_ http.Header 14555} 14556 14557// Update: Updates an organizational unit. 14558// 14559// - customerId: The unique ID for the customer's Google Workspace 14560// account. As an account administrator, you can also use the 14561// `my_customer` alias to represent your account's `customerId`. The 14562// `customerId` is also returned as part of the Users resource 14563// (/admin-sdk/directory/v1/reference/users). 14564// - orgUnitPath: The full path of the organizational unit or its unique 14565// ID. 14566func (r *OrgunitsService) Update(customerId string, orgUnitPath string, orgunit *OrgUnit) *OrgunitsUpdateCall { 14567 c := &OrgunitsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14568 c.customerId = customerId 14569 c.orgUnitPath = orgUnitPath 14570 c.orgunit = orgunit 14571 return c 14572} 14573 14574// Fields allows partial responses to be retrieved. See 14575// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14576// for more information. 14577func (c *OrgunitsUpdateCall) Fields(s ...googleapi.Field) *OrgunitsUpdateCall { 14578 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14579 return c 14580} 14581 14582// Context sets the context to be used in this call's Do method. Any 14583// pending HTTP request will be aborted if the provided context is 14584// canceled. 14585func (c *OrgunitsUpdateCall) Context(ctx context.Context) *OrgunitsUpdateCall { 14586 c.ctx_ = ctx 14587 return c 14588} 14589 14590// Header returns an http.Header that can be modified by the caller to 14591// add HTTP headers to the request. 14592func (c *OrgunitsUpdateCall) Header() http.Header { 14593 if c.header_ == nil { 14594 c.header_ = make(http.Header) 14595 } 14596 return c.header_ 14597} 14598 14599func (c *OrgunitsUpdateCall) doRequest(alt string) (*http.Response, error) { 14600 reqHeaders := make(http.Header) 14601 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14602 for k, v := range c.header_ { 14603 reqHeaders[k] = v 14604 } 14605 reqHeaders.Set("User-Agent", c.s.userAgent()) 14606 var body io.Reader = nil 14607 body, err := googleapi.WithoutDataWrapper.JSONReader(c.orgunit) 14608 if err != nil { 14609 return nil, err 14610 } 14611 reqHeaders.Set("Content-Type", "application/json") 14612 c.urlParams_.Set("alt", alt) 14613 c.urlParams_.Set("prettyPrint", "false") 14614 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}") 14615 urls += "?" + c.urlParams_.Encode() 14616 req, err := http.NewRequest("PUT", urls, body) 14617 if err != nil { 14618 return nil, err 14619 } 14620 req.Header = reqHeaders 14621 googleapi.Expand(req.URL, map[string]string{ 14622 "customerId": c.customerId, 14623 "orgUnitPath": c.orgUnitPath, 14624 }) 14625 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14626} 14627 14628// Do executes the "directory.orgunits.update" call. 14629// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status 14630// code is an error. Response headers are in either 14631// *OrgUnit.ServerResponse.Header or (if a response was returned at all) 14632// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14633// check whether the returned error was because http.StatusNotModified 14634// was returned. 14635func (c *OrgunitsUpdateCall) Do(opts ...googleapi.CallOption) (*OrgUnit, error) { 14636 gensupport.SetOptions(c.urlParams_, opts...) 14637 res, err := c.doRequest("json") 14638 if res != nil && res.StatusCode == http.StatusNotModified { 14639 if res.Body != nil { 14640 res.Body.Close() 14641 } 14642 return nil, &googleapi.Error{ 14643 Code: res.StatusCode, 14644 Header: res.Header, 14645 } 14646 } 14647 if err != nil { 14648 return nil, err 14649 } 14650 defer googleapi.CloseBody(res) 14651 if err := googleapi.CheckResponse(res); err != nil { 14652 return nil, err 14653 } 14654 ret := &OrgUnit{ 14655 ServerResponse: googleapi.ServerResponse{ 14656 Header: res.Header, 14657 HTTPStatusCode: res.StatusCode, 14658 }, 14659 } 14660 target := &ret 14661 if err := gensupport.DecodeResponse(target, res); err != nil { 14662 return nil, err 14663 } 14664 return ret, nil 14665 // { 14666 // "description": "Updates an organizational unit.", 14667 // "flatPath": "admin/directory/v1/customer/{customerId}/orgunits/{orgunitsId}", 14668 // "httpMethod": "PUT", 14669 // "id": "directory.orgunits.update", 14670 // "parameterOrder": [ 14671 // "customerId", 14672 // "orgUnitPath" 14673 // ], 14674 // "parameters": { 14675 // "customerId": { 14676 // "description": "The unique ID for the customer's Google Workspace 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).", 14677 // "location": "path", 14678 // "required": true, 14679 // "type": "string" 14680 // }, 14681 // "orgUnitPath": { 14682 // "description": "The full path of the organizational unit or its unique ID.", 14683 // "location": "path", 14684 // "pattern": "^.*$", 14685 // "required": true, 14686 // "type": "string" 14687 // } 14688 // }, 14689 // "path": "admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}", 14690 // "request": { 14691 // "$ref": "OrgUnit" 14692 // }, 14693 // "response": { 14694 // "$ref": "OrgUnit" 14695 // }, 14696 // "scopes": [ 14697 // "https://www.googleapis.com/auth/admin.directory.orgunit" 14698 // ] 14699 // } 14700 14701} 14702 14703// method id "directory.privileges.list": 14704 14705type PrivilegesListCall struct { 14706 s *Service 14707 customer string 14708 urlParams_ gensupport.URLParams 14709 ifNoneMatch_ string 14710 ctx_ context.Context 14711 header_ http.Header 14712} 14713 14714// List: Retrieves a paginated list of all privileges for a customer. 14715// 14716// - customer: Immutable ID of the Google Workspace account. 14717func (r *PrivilegesService) List(customer string) *PrivilegesListCall { 14718 c := &PrivilegesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14719 c.customer = customer 14720 return c 14721} 14722 14723// Fields allows partial responses to be retrieved. See 14724// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14725// for more information. 14726func (c *PrivilegesListCall) Fields(s ...googleapi.Field) *PrivilegesListCall { 14727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14728 return c 14729} 14730 14731// IfNoneMatch sets the optional parameter which makes the operation 14732// fail if the object's ETag matches the given value. This is useful for 14733// getting updates only after the object has changed since the last 14734// request. Use googleapi.IsNotModified to check whether the response 14735// error from Do is the result of In-None-Match. 14736func (c *PrivilegesListCall) IfNoneMatch(entityTag string) *PrivilegesListCall { 14737 c.ifNoneMatch_ = entityTag 14738 return c 14739} 14740 14741// Context sets the context to be used in this call's Do method. Any 14742// pending HTTP request will be aborted if the provided context is 14743// canceled. 14744func (c *PrivilegesListCall) Context(ctx context.Context) *PrivilegesListCall { 14745 c.ctx_ = ctx 14746 return c 14747} 14748 14749// Header returns an http.Header that can be modified by the caller to 14750// add HTTP headers to the request. 14751func (c *PrivilegesListCall) Header() http.Header { 14752 if c.header_ == nil { 14753 c.header_ = make(http.Header) 14754 } 14755 return c.header_ 14756} 14757 14758func (c *PrivilegesListCall) doRequest(alt string) (*http.Response, error) { 14759 reqHeaders := make(http.Header) 14760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14761 for k, v := range c.header_ { 14762 reqHeaders[k] = v 14763 } 14764 reqHeaders.Set("User-Agent", c.s.userAgent()) 14765 if c.ifNoneMatch_ != "" { 14766 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14767 } 14768 var body io.Reader = nil 14769 c.urlParams_.Set("alt", alt) 14770 c.urlParams_.Set("prettyPrint", "false") 14771 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/ALL/privileges") 14772 urls += "?" + c.urlParams_.Encode() 14773 req, err := http.NewRequest("GET", urls, body) 14774 if err != nil { 14775 return nil, err 14776 } 14777 req.Header = reqHeaders 14778 googleapi.Expand(req.URL, map[string]string{ 14779 "customer": c.customer, 14780 }) 14781 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14782} 14783 14784// Do executes the "directory.privileges.list" call. 14785// Exactly one of *Privileges or error will be non-nil. Any non-2xx 14786// status code is an error. Response headers are in either 14787// *Privileges.ServerResponse.Header or (if a response was returned at 14788// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14789// to check whether the returned error was because 14790// http.StatusNotModified was returned. 14791func (c *PrivilegesListCall) Do(opts ...googleapi.CallOption) (*Privileges, error) { 14792 gensupport.SetOptions(c.urlParams_, opts...) 14793 res, err := c.doRequest("json") 14794 if res != nil && res.StatusCode == http.StatusNotModified { 14795 if res.Body != nil { 14796 res.Body.Close() 14797 } 14798 return nil, &googleapi.Error{ 14799 Code: res.StatusCode, 14800 Header: res.Header, 14801 } 14802 } 14803 if err != nil { 14804 return nil, err 14805 } 14806 defer googleapi.CloseBody(res) 14807 if err := googleapi.CheckResponse(res); err != nil { 14808 return nil, err 14809 } 14810 ret := &Privileges{ 14811 ServerResponse: googleapi.ServerResponse{ 14812 Header: res.Header, 14813 HTTPStatusCode: res.StatusCode, 14814 }, 14815 } 14816 target := &ret 14817 if err := gensupport.DecodeResponse(target, res); err != nil { 14818 return nil, err 14819 } 14820 return ret, nil 14821 // { 14822 // "description": "Retrieves a paginated list of all privileges for a customer.", 14823 // "flatPath": "admin/directory/v1/customer/{customer}/roles/ALL/privileges", 14824 // "httpMethod": "GET", 14825 // "id": "directory.privileges.list", 14826 // "parameterOrder": [ 14827 // "customer" 14828 // ], 14829 // "parameters": { 14830 // "customer": { 14831 // "description": "Immutable ID of the Google Workspace account.", 14832 // "location": "path", 14833 // "required": true, 14834 // "type": "string" 14835 // } 14836 // }, 14837 // "path": "admin/directory/v1/customer/{customer}/roles/ALL/privileges", 14838 // "response": { 14839 // "$ref": "Privileges" 14840 // }, 14841 // "scopes": [ 14842 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 14843 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 14844 // ] 14845 // } 14846 14847} 14848 14849// method id "directory.resources.buildings.delete": 14850 14851type ResourcesBuildingsDeleteCall struct { 14852 s *Service 14853 customer string 14854 buildingId string 14855 urlParams_ gensupport.URLParams 14856 ctx_ context.Context 14857 header_ http.Header 14858} 14859 14860// Delete: Deletes a building. 14861// 14862// - buildingId: The id of the building to delete. 14863// - customer: The unique ID for the customer's Google Workspace 14864// account. As an account administrator, you can also use the 14865// `my_customer` alias to represent your account's customer ID. 14866func (r *ResourcesBuildingsService) Delete(customer string, buildingId string) *ResourcesBuildingsDeleteCall { 14867 c := &ResourcesBuildingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14868 c.customer = customer 14869 c.buildingId = buildingId 14870 return c 14871} 14872 14873// Fields allows partial responses to be retrieved. See 14874// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14875// for more information. 14876func (c *ResourcesBuildingsDeleteCall) Fields(s ...googleapi.Field) *ResourcesBuildingsDeleteCall { 14877 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14878 return c 14879} 14880 14881// Context sets the context to be used in this call's Do method. Any 14882// pending HTTP request will be aborted if the provided context is 14883// canceled. 14884func (c *ResourcesBuildingsDeleteCall) Context(ctx context.Context) *ResourcesBuildingsDeleteCall { 14885 c.ctx_ = ctx 14886 return c 14887} 14888 14889// Header returns an http.Header that can be modified by the caller to 14890// add HTTP headers to the request. 14891func (c *ResourcesBuildingsDeleteCall) Header() http.Header { 14892 if c.header_ == nil { 14893 c.header_ = make(http.Header) 14894 } 14895 return c.header_ 14896} 14897 14898func (c *ResourcesBuildingsDeleteCall) doRequest(alt string) (*http.Response, error) { 14899 reqHeaders := make(http.Header) 14900 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 14901 for k, v := range c.header_ { 14902 reqHeaders[k] = v 14903 } 14904 reqHeaders.Set("User-Agent", c.s.userAgent()) 14905 var body io.Reader = nil 14906 c.urlParams_.Set("alt", alt) 14907 c.urlParams_.Set("prettyPrint", "false") 14908 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 14909 urls += "?" + c.urlParams_.Encode() 14910 req, err := http.NewRequest("DELETE", urls, body) 14911 if err != nil { 14912 return nil, err 14913 } 14914 req.Header = reqHeaders 14915 googleapi.Expand(req.URL, map[string]string{ 14916 "customer": c.customer, 14917 "buildingId": c.buildingId, 14918 }) 14919 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14920} 14921 14922// Do executes the "directory.resources.buildings.delete" call. 14923func (c *ResourcesBuildingsDeleteCall) Do(opts ...googleapi.CallOption) error { 14924 gensupport.SetOptions(c.urlParams_, opts...) 14925 res, err := c.doRequest("json") 14926 if err != nil { 14927 return err 14928 } 14929 defer googleapi.CloseBody(res) 14930 if err := googleapi.CheckResponse(res); err != nil { 14931 return err 14932 } 14933 return nil 14934 // { 14935 // "description": "Deletes a building.", 14936 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 14937 // "httpMethod": "DELETE", 14938 // "id": "directory.resources.buildings.delete", 14939 // "parameterOrder": [ 14940 // "customer", 14941 // "buildingId" 14942 // ], 14943 // "parameters": { 14944 // "buildingId": { 14945 // "description": "The id of the building to delete.", 14946 // "location": "path", 14947 // "required": true, 14948 // "type": "string" 14949 // }, 14950 // "customer": { 14951 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 14952 // "location": "path", 14953 // "required": true, 14954 // "type": "string" 14955 // } 14956 // }, 14957 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 14958 // "scopes": [ 14959 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 14960 // ] 14961 // } 14962 14963} 14964 14965// method id "directory.resources.buildings.get": 14966 14967type ResourcesBuildingsGetCall struct { 14968 s *Service 14969 customer string 14970 buildingId string 14971 urlParams_ gensupport.URLParams 14972 ifNoneMatch_ string 14973 ctx_ context.Context 14974 header_ http.Header 14975} 14976 14977// Get: Retrieves a building. 14978// 14979// - buildingId: The unique ID of the building to retrieve. 14980// - customer: The unique ID for the customer's Google Workspace 14981// account. As an account administrator, you can also use the 14982// `my_customer` alias to represent your account's customer ID. 14983func (r *ResourcesBuildingsService) Get(customer string, buildingId string) *ResourcesBuildingsGetCall { 14984 c := &ResourcesBuildingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14985 c.customer = customer 14986 c.buildingId = buildingId 14987 return c 14988} 14989 14990// Fields allows partial responses to be retrieved. See 14991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14992// for more information. 14993func (c *ResourcesBuildingsGetCall) Fields(s ...googleapi.Field) *ResourcesBuildingsGetCall { 14994 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14995 return c 14996} 14997 14998// IfNoneMatch sets the optional parameter which makes the operation 14999// fail if the object's ETag matches the given value. This is useful for 15000// getting updates only after the object has changed since the last 15001// request. Use googleapi.IsNotModified to check whether the response 15002// error from Do is the result of In-None-Match. 15003func (c *ResourcesBuildingsGetCall) IfNoneMatch(entityTag string) *ResourcesBuildingsGetCall { 15004 c.ifNoneMatch_ = entityTag 15005 return c 15006} 15007 15008// Context sets the context to be used in this call's Do method. Any 15009// pending HTTP request will be aborted if the provided context is 15010// canceled. 15011func (c *ResourcesBuildingsGetCall) Context(ctx context.Context) *ResourcesBuildingsGetCall { 15012 c.ctx_ = ctx 15013 return c 15014} 15015 15016// Header returns an http.Header that can be modified by the caller to 15017// add HTTP headers to the request. 15018func (c *ResourcesBuildingsGetCall) Header() http.Header { 15019 if c.header_ == nil { 15020 c.header_ = make(http.Header) 15021 } 15022 return c.header_ 15023} 15024 15025func (c *ResourcesBuildingsGetCall) doRequest(alt string) (*http.Response, error) { 15026 reqHeaders := make(http.Header) 15027 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15028 for k, v := range c.header_ { 15029 reqHeaders[k] = v 15030 } 15031 reqHeaders.Set("User-Agent", c.s.userAgent()) 15032 if c.ifNoneMatch_ != "" { 15033 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15034 } 15035 var body io.Reader = nil 15036 c.urlParams_.Set("alt", alt) 15037 c.urlParams_.Set("prettyPrint", "false") 15038 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 15039 urls += "?" + c.urlParams_.Encode() 15040 req, err := http.NewRequest("GET", urls, body) 15041 if err != nil { 15042 return nil, err 15043 } 15044 req.Header = reqHeaders 15045 googleapi.Expand(req.URL, map[string]string{ 15046 "customer": c.customer, 15047 "buildingId": c.buildingId, 15048 }) 15049 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15050} 15051 15052// Do executes the "directory.resources.buildings.get" call. 15053// Exactly one of *Building or error will be non-nil. Any non-2xx status 15054// code is an error. Response headers are in either 15055// *Building.ServerResponse.Header or (if a response was returned at 15056// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15057// to check whether the returned error was because 15058// http.StatusNotModified was returned. 15059func (c *ResourcesBuildingsGetCall) Do(opts ...googleapi.CallOption) (*Building, error) { 15060 gensupport.SetOptions(c.urlParams_, opts...) 15061 res, err := c.doRequest("json") 15062 if res != nil && res.StatusCode == http.StatusNotModified { 15063 if res.Body != nil { 15064 res.Body.Close() 15065 } 15066 return nil, &googleapi.Error{ 15067 Code: res.StatusCode, 15068 Header: res.Header, 15069 } 15070 } 15071 if err != nil { 15072 return nil, err 15073 } 15074 defer googleapi.CloseBody(res) 15075 if err := googleapi.CheckResponse(res); err != nil { 15076 return nil, err 15077 } 15078 ret := &Building{ 15079 ServerResponse: googleapi.ServerResponse{ 15080 Header: res.Header, 15081 HTTPStatusCode: res.StatusCode, 15082 }, 15083 } 15084 target := &ret 15085 if err := gensupport.DecodeResponse(target, res); err != nil { 15086 return nil, err 15087 } 15088 return ret, nil 15089 // { 15090 // "description": "Retrieves a building.", 15091 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15092 // "httpMethod": "GET", 15093 // "id": "directory.resources.buildings.get", 15094 // "parameterOrder": [ 15095 // "customer", 15096 // "buildingId" 15097 // ], 15098 // "parameters": { 15099 // "buildingId": { 15100 // "description": "The unique ID of the building to retrieve.", 15101 // "location": "path", 15102 // "required": true, 15103 // "type": "string" 15104 // }, 15105 // "customer": { 15106 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15107 // "location": "path", 15108 // "required": true, 15109 // "type": "string" 15110 // } 15111 // }, 15112 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15113 // "response": { 15114 // "$ref": "Building" 15115 // }, 15116 // "scopes": [ 15117 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 15118 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 15119 // ] 15120 // } 15121 15122} 15123 15124// method id "directory.resources.buildings.insert": 15125 15126type ResourcesBuildingsInsertCall struct { 15127 s *Service 15128 customer string 15129 building *Building 15130 urlParams_ gensupport.URLParams 15131 ctx_ context.Context 15132 header_ http.Header 15133} 15134 15135// Insert: Inserts a building. 15136// 15137// - customer: The unique ID for the customer's Google Workspace 15138// account. As an account administrator, you can also use the 15139// `my_customer` alias to represent your account's customer ID. 15140func (r *ResourcesBuildingsService) Insert(customer string, building *Building) *ResourcesBuildingsInsertCall { 15141 c := &ResourcesBuildingsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15142 c.customer = customer 15143 c.building = building 15144 return c 15145} 15146 15147// CoordinatesSource sets the optional parameter "coordinatesSource": 15148// Source from which Building.coordinates are derived. 15149// 15150// Possible values: 15151// "CLIENT_SPECIFIED" - Building.coordinates are set to the 15152// coordinates included in the request. 15153// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 15154// populated based on the postal address. 15155// "SOURCE_UNSPECIFIED" (default) - Defaults to 15156// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 15157// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 15158func (c *ResourcesBuildingsInsertCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsInsertCall { 15159 c.urlParams_.Set("coordinatesSource", coordinatesSource) 15160 return c 15161} 15162 15163// Fields allows partial responses to be retrieved. See 15164// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15165// for more information. 15166func (c *ResourcesBuildingsInsertCall) Fields(s ...googleapi.Field) *ResourcesBuildingsInsertCall { 15167 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15168 return c 15169} 15170 15171// Context sets the context to be used in this call's Do method. Any 15172// pending HTTP request will be aborted if the provided context is 15173// canceled. 15174func (c *ResourcesBuildingsInsertCall) Context(ctx context.Context) *ResourcesBuildingsInsertCall { 15175 c.ctx_ = ctx 15176 return c 15177} 15178 15179// Header returns an http.Header that can be modified by the caller to 15180// add HTTP headers to the request. 15181func (c *ResourcesBuildingsInsertCall) Header() http.Header { 15182 if c.header_ == nil { 15183 c.header_ = make(http.Header) 15184 } 15185 return c.header_ 15186} 15187 15188func (c *ResourcesBuildingsInsertCall) doRequest(alt string) (*http.Response, error) { 15189 reqHeaders := make(http.Header) 15190 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15191 for k, v := range c.header_ { 15192 reqHeaders[k] = v 15193 } 15194 reqHeaders.Set("User-Agent", c.s.userAgent()) 15195 var body io.Reader = nil 15196 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 15197 if err != nil { 15198 return nil, err 15199 } 15200 reqHeaders.Set("Content-Type", "application/json") 15201 c.urlParams_.Set("alt", alt) 15202 c.urlParams_.Set("prettyPrint", "false") 15203 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings") 15204 urls += "?" + c.urlParams_.Encode() 15205 req, err := http.NewRequest("POST", urls, body) 15206 if err != nil { 15207 return nil, err 15208 } 15209 req.Header = reqHeaders 15210 googleapi.Expand(req.URL, map[string]string{ 15211 "customer": c.customer, 15212 }) 15213 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15214} 15215 15216// Do executes the "directory.resources.buildings.insert" call. 15217// Exactly one of *Building or error will be non-nil. Any non-2xx status 15218// code is an error. Response headers are in either 15219// *Building.ServerResponse.Header or (if a response was returned at 15220// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15221// to check whether the returned error was because 15222// http.StatusNotModified was returned. 15223func (c *ResourcesBuildingsInsertCall) Do(opts ...googleapi.CallOption) (*Building, error) { 15224 gensupport.SetOptions(c.urlParams_, opts...) 15225 res, err := c.doRequest("json") 15226 if res != nil && res.StatusCode == http.StatusNotModified { 15227 if res.Body != nil { 15228 res.Body.Close() 15229 } 15230 return nil, &googleapi.Error{ 15231 Code: res.StatusCode, 15232 Header: res.Header, 15233 } 15234 } 15235 if err != nil { 15236 return nil, err 15237 } 15238 defer googleapi.CloseBody(res) 15239 if err := googleapi.CheckResponse(res); err != nil { 15240 return nil, err 15241 } 15242 ret := &Building{ 15243 ServerResponse: googleapi.ServerResponse{ 15244 Header: res.Header, 15245 HTTPStatusCode: res.StatusCode, 15246 }, 15247 } 15248 target := &ret 15249 if err := gensupport.DecodeResponse(target, res); err != nil { 15250 return nil, err 15251 } 15252 return ret, nil 15253 // { 15254 // "description": "Inserts a building.", 15255 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings", 15256 // "httpMethod": "POST", 15257 // "id": "directory.resources.buildings.insert", 15258 // "parameterOrder": [ 15259 // "customer" 15260 // ], 15261 // "parameters": { 15262 // "coordinatesSource": { 15263 // "default": "SOURCE_UNSPECIFIED", 15264 // "description": "Source from which Building.coordinates are derived.", 15265 // "enum": [ 15266 // "CLIENT_SPECIFIED", 15267 // "RESOLVED_FROM_ADDRESS", 15268 // "SOURCE_UNSPECIFIED" 15269 // ], 15270 // "enumDescriptions": [ 15271 // "Building.coordinates are set to the coordinates included in the request.", 15272 // "Building.coordinates are automatically populated based on the postal address.", 15273 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 15274 // ], 15275 // "location": "query", 15276 // "type": "string" 15277 // }, 15278 // "customer": { 15279 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15280 // "location": "path", 15281 // "required": true, 15282 // "type": "string" 15283 // } 15284 // }, 15285 // "path": "admin/directory/v1/customer/{customer}/resources/buildings", 15286 // "request": { 15287 // "$ref": "Building" 15288 // }, 15289 // "response": { 15290 // "$ref": "Building" 15291 // }, 15292 // "scopes": [ 15293 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15294 // ] 15295 // } 15296 15297} 15298 15299// method id "directory.resources.buildings.list": 15300 15301type ResourcesBuildingsListCall struct { 15302 s *Service 15303 customer string 15304 urlParams_ gensupport.URLParams 15305 ifNoneMatch_ string 15306 ctx_ context.Context 15307 header_ http.Header 15308} 15309 15310// List: Retrieves a list of buildings for an account. 15311// 15312// - customer: The unique ID for the customer's Google Workspace 15313// account. As an account administrator, you can also use the 15314// `my_customer` alias to represent your account's customer ID. 15315func (r *ResourcesBuildingsService) List(customer string) *ResourcesBuildingsListCall { 15316 c := &ResourcesBuildingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15317 c.customer = customer 15318 return c 15319} 15320 15321// MaxResults sets the optional parameter "maxResults": Maximum number 15322// of results to return. 15323func (c *ResourcesBuildingsListCall) MaxResults(maxResults int64) *ResourcesBuildingsListCall { 15324 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 15325 return c 15326} 15327 15328// PageToken sets the optional parameter "pageToken": Token to specify 15329// the next page in the list. 15330func (c *ResourcesBuildingsListCall) PageToken(pageToken string) *ResourcesBuildingsListCall { 15331 c.urlParams_.Set("pageToken", pageToken) 15332 return c 15333} 15334 15335// Fields allows partial responses to be retrieved. See 15336// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15337// for more information. 15338func (c *ResourcesBuildingsListCall) Fields(s ...googleapi.Field) *ResourcesBuildingsListCall { 15339 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15340 return c 15341} 15342 15343// IfNoneMatch sets the optional parameter which makes the operation 15344// fail if the object's ETag matches the given value. This is useful for 15345// getting updates only after the object has changed since the last 15346// request. Use googleapi.IsNotModified to check whether the response 15347// error from Do is the result of In-None-Match. 15348func (c *ResourcesBuildingsListCall) IfNoneMatch(entityTag string) *ResourcesBuildingsListCall { 15349 c.ifNoneMatch_ = entityTag 15350 return c 15351} 15352 15353// Context sets the context to be used in this call's Do method. Any 15354// pending HTTP request will be aborted if the provided context is 15355// canceled. 15356func (c *ResourcesBuildingsListCall) Context(ctx context.Context) *ResourcesBuildingsListCall { 15357 c.ctx_ = ctx 15358 return c 15359} 15360 15361// Header returns an http.Header that can be modified by the caller to 15362// add HTTP headers to the request. 15363func (c *ResourcesBuildingsListCall) Header() http.Header { 15364 if c.header_ == nil { 15365 c.header_ = make(http.Header) 15366 } 15367 return c.header_ 15368} 15369 15370func (c *ResourcesBuildingsListCall) doRequest(alt string) (*http.Response, error) { 15371 reqHeaders := make(http.Header) 15372 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15373 for k, v := range c.header_ { 15374 reqHeaders[k] = v 15375 } 15376 reqHeaders.Set("User-Agent", c.s.userAgent()) 15377 if c.ifNoneMatch_ != "" { 15378 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15379 } 15380 var body io.Reader = nil 15381 c.urlParams_.Set("alt", alt) 15382 c.urlParams_.Set("prettyPrint", "false") 15383 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings") 15384 urls += "?" + c.urlParams_.Encode() 15385 req, err := http.NewRequest("GET", urls, body) 15386 if err != nil { 15387 return nil, err 15388 } 15389 req.Header = reqHeaders 15390 googleapi.Expand(req.URL, map[string]string{ 15391 "customer": c.customer, 15392 }) 15393 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15394} 15395 15396// Do executes the "directory.resources.buildings.list" call. 15397// Exactly one of *Buildings or error will be non-nil. Any non-2xx 15398// status code is an error. Response headers are in either 15399// *Buildings.ServerResponse.Header or (if a response was returned at 15400// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15401// to check whether the returned error was because 15402// http.StatusNotModified was returned. 15403func (c *ResourcesBuildingsListCall) Do(opts ...googleapi.CallOption) (*Buildings, error) { 15404 gensupport.SetOptions(c.urlParams_, opts...) 15405 res, err := c.doRequest("json") 15406 if res != nil && res.StatusCode == http.StatusNotModified { 15407 if res.Body != nil { 15408 res.Body.Close() 15409 } 15410 return nil, &googleapi.Error{ 15411 Code: res.StatusCode, 15412 Header: res.Header, 15413 } 15414 } 15415 if err != nil { 15416 return nil, err 15417 } 15418 defer googleapi.CloseBody(res) 15419 if err := googleapi.CheckResponse(res); err != nil { 15420 return nil, err 15421 } 15422 ret := &Buildings{ 15423 ServerResponse: googleapi.ServerResponse{ 15424 Header: res.Header, 15425 HTTPStatusCode: res.StatusCode, 15426 }, 15427 } 15428 target := &ret 15429 if err := gensupport.DecodeResponse(target, res); err != nil { 15430 return nil, err 15431 } 15432 return ret, nil 15433 // { 15434 // "description": "Retrieves a list of buildings for an account.", 15435 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings", 15436 // "httpMethod": "GET", 15437 // "id": "directory.resources.buildings.list", 15438 // "parameterOrder": [ 15439 // "customer" 15440 // ], 15441 // "parameters": { 15442 // "customer": { 15443 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15444 // "location": "path", 15445 // "required": true, 15446 // "type": "string" 15447 // }, 15448 // "maxResults": { 15449 // "description": "Maximum number of results to return.", 15450 // "format": "int32", 15451 // "location": "query", 15452 // "maximum": "500", 15453 // "minimum": "1", 15454 // "type": "integer" 15455 // }, 15456 // "pageToken": { 15457 // "description": "Token to specify the next page in the list.", 15458 // "location": "query", 15459 // "type": "string" 15460 // } 15461 // }, 15462 // "path": "admin/directory/v1/customer/{customer}/resources/buildings", 15463 // "response": { 15464 // "$ref": "Buildings" 15465 // }, 15466 // "scopes": [ 15467 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 15468 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 15469 // ] 15470 // } 15471 15472} 15473 15474// Pages invokes f for each page of results. 15475// A non-nil error returned from f will halt the iteration. 15476// The provided context supersedes any context provided to the Context method. 15477func (c *ResourcesBuildingsListCall) Pages(ctx context.Context, f func(*Buildings) error) error { 15478 c.ctx_ = ctx 15479 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 15480 for { 15481 x, err := c.Do() 15482 if err != nil { 15483 return err 15484 } 15485 if err := f(x); err != nil { 15486 return err 15487 } 15488 if x.NextPageToken == "" { 15489 return nil 15490 } 15491 c.PageToken(x.NextPageToken) 15492 } 15493} 15494 15495// method id "directory.resources.buildings.patch": 15496 15497type ResourcesBuildingsPatchCall struct { 15498 s *Service 15499 customer string 15500 buildingId string 15501 building *Building 15502 urlParams_ gensupport.URLParams 15503 ctx_ context.Context 15504 header_ http.Header 15505} 15506 15507// Patch: Patches a building. 15508// 15509// - buildingId: The id of the building to update. 15510// - customer: The unique ID for the customer's Google Workspace 15511// account. As an account administrator, you can also use the 15512// `my_customer` alias to represent your account's customer ID. 15513func (r *ResourcesBuildingsService) Patch(customer string, buildingId string, building *Building) *ResourcesBuildingsPatchCall { 15514 c := &ResourcesBuildingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15515 c.customer = customer 15516 c.buildingId = buildingId 15517 c.building = building 15518 return c 15519} 15520 15521// CoordinatesSource sets the optional parameter "coordinatesSource": 15522// Source from which Building.coordinates are derived. 15523// 15524// Possible values: 15525// "CLIENT_SPECIFIED" - Building.coordinates are set to the 15526// coordinates included in the request. 15527// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 15528// populated based on the postal address. 15529// "SOURCE_UNSPECIFIED" (default) - Defaults to 15530// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 15531// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 15532func (c *ResourcesBuildingsPatchCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsPatchCall { 15533 c.urlParams_.Set("coordinatesSource", coordinatesSource) 15534 return c 15535} 15536 15537// Fields allows partial responses to be retrieved. See 15538// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15539// for more information. 15540func (c *ResourcesBuildingsPatchCall) Fields(s ...googleapi.Field) *ResourcesBuildingsPatchCall { 15541 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15542 return c 15543} 15544 15545// Context sets the context to be used in this call's Do method. Any 15546// pending HTTP request will be aborted if the provided context is 15547// canceled. 15548func (c *ResourcesBuildingsPatchCall) Context(ctx context.Context) *ResourcesBuildingsPatchCall { 15549 c.ctx_ = ctx 15550 return c 15551} 15552 15553// Header returns an http.Header that can be modified by the caller to 15554// add HTTP headers to the request. 15555func (c *ResourcesBuildingsPatchCall) Header() http.Header { 15556 if c.header_ == nil { 15557 c.header_ = make(http.Header) 15558 } 15559 return c.header_ 15560} 15561 15562func (c *ResourcesBuildingsPatchCall) doRequest(alt string) (*http.Response, error) { 15563 reqHeaders := make(http.Header) 15564 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15565 for k, v := range c.header_ { 15566 reqHeaders[k] = v 15567 } 15568 reqHeaders.Set("User-Agent", c.s.userAgent()) 15569 var body io.Reader = nil 15570 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 15571 if err != nil { 15572 return nil, err 15573 } 15574 reqHeaders.Set("Content-Type", "application/json") 15575 c.urlParams_.Set("alt", alt) 15576 c.urlParams_.Set("prettyPrint", "false") 15577 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 15578 urls += "?" + c.urlParams_.Encode() 15579 req, err := http.NewRequest("PATCH", urls, body) 15580 if err != nil { 15581 return nil, err 15582 } 15583 req.Header = reqHeaders 15584 googleapi.Expand(req.URL, map[string]string{ 15585 "customer": c.customer, 15586 "buildingId": c.buildingId, 15587 }) 15588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15589} 15590 15591// Do executes the "directory.resources.buildings.patch" call. 15592// Exactly one of *Building or error will be non-nil. Any non-2xx status 15593// code is an error. Response headers are in either 15594// *Building.ServerResponse.Header or (if a response was returned at 15595// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15596// to check whether the returned error was because 15597// http.StatusNotModified was returned. 15598func (c *ResourcesBuildingsPatchCall) Do(opts ...googleapi.CallOption) (*Building, error) { 15599 gensupport.SetOptions(c.urlParams_, opts...) 15600 res, err := c.doRequest("json") 15601 if res != nil && res.StatusCode == http.StatusNotModified { 15602 if res.Body != nil { 15603 res.Body.Close() 15604 } 15605 return nil, &googleapi.Error{ 15606 Code: res.StatusCode, 15607 Header: res.Header, 15608 } 15609 } 15610 if err != nil { 15611 return nil, err 15612 } 15613 defer googleapi.CloseBody(res) 15614 if err := googleapi.CheckResponse(res); err != nil { 15615 return nil, err 15616 } 15617 ret := &Building{ 15618 ServerResponse: googleapi.ServerResponse{ 15619 Header: res.Header, 15620 HTTPStatusCode: res.StatusCode, 15621 }, 15622 } 15623 target := &ret 15624 if err := gensupport.DecodeResponse(target, res); err != nil { 15625 return nil, err 15626 } 15627 return ret, nil 15628 // { 15629 // "description": "Patches a building.", 15630 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15631 // "httpMethod": "PATCH", 15632 // "id": "directory.resources.buildings.patch", 15633 // "parameterOrder": [ 15634 // "customer", 15635 // "buildingId" 15636 // ], 15637 // "parameters": { 15638 // "buildingId": { 15639 // "description": "The id of the building to update.", 15640 // "location": "path", 15641 // "required": true, 15642 // "type": "string" 15643 // }, 15644 // "coordinatesSource": { 15645 // "default": "SOURCE_UNSPECIFIED", 15646 // "description": "Source from which Building.coordinates are derived.", 15647 // "enum": [ 15648 // "CLIENT_SPECIFIED", 15649 // "RESOLVED_FROM_ADDRESS", 15650 // "SOURCE_UNSPECIFIED" 15651 // ], 15652 // "enumDescriptions": [ 15653 // "Building.coordinates are set to the coordinates included in the request.", 15654 // "Building.coordinates are automatically populated based on the postal address.", 15655 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 15656 // ], 15657 // "location": "query", 15658 // "type": "string" 15659 // }, 15660 // "customer": { 15661 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15662 // "location": "path", 15663 // "required": true, 15664 // "type": "string" 15665 // } 15666 // }, 15667 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15668 // "request": { 15669 // "$ref": "Building" 15670 // }, 15671 // "response": { 15672 // "$ref": "Building" 15673 // }, 15674 // "scopes": [ 15675 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15676 // ] 15677 // } 15678 15679} 15680 15681// method id "directory.resources.buildings.update": 15682 15683type ResourcesBuildingsUpdateCall struct { 15684 s *Service 15685 customer string 15686 buildingId string 15687 building *Building 15688 urlParams_ gensupport.URLParams 15689 ctx_ context.Context 15690 header_ http.Header 15691} 15692 15693// Update: Updates a building. 15694// 15695// - buildingId: The id of the building to update. 15696// - customer: The unique ID for the customer's Google Workspace 15697// account. As an account administrator, you can also use the 15698// `my_customer` alias to represent your account's customer ID. 15699func (r *ResourcesBuildingsService) Update(customer string, buildingId string, building *Building) *ResourcesBuildingsUpdateCall { 15700 c := &ResourcesBuildingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15701 c.customer = customer 15702 c.buildingId = buildingId 15703 c.building = building 15704 return c 15705} 15706 15707// CoordinatesSource sets the optional parameter "coordinatesSource": 15708// Source from which Building.coordinates are derived. 15709// 15710// Possible values: 15711// "CLIENT_SPECIFIED" - Building.coordinates are set to the 15712// coordinates included in the request. 15713// "RESOLVED_FROM_ADDRESS" - Building.coordinates are automatically 15714// populated based on the postal address. 15715// "SOURCE_UNSPECIFIED" (default) - Defaults to 15716// `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, 15717// defaults to `CLIENT_SPECIFIED` if coordinates are provided. 15718func (c *ResourcesBuildingsUpdateCall) CoordinatesSource(coordinatesSource string) *ResourcesBuildingsUpdateCall { 15719 c.urlParams_.Set("coordinatesSource", coordinatesSource) 15720 return c 15721} 15722 15723// Fields allows partial responses to be retrieved. See 15724// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15725// for more information. 15726func (c *ResourcesBuildingsUpdateCall) Fields(s ...googleapi.Field) *ResourcesBuildingsUpdateCall { 15727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15728 return c 15729} 15730 15731// Context sets the context to be used in this call's Do method. Any 15732// pending HTTP request will be aborted if the provided context is 15733// canceled. 15734func (c *ResourcesBuildingsUpdateCall) Context(ctx context.Context) *ResourcesBuildingsUpdateCall { 15735 c.ctx_ = ctx 15736 return c 15737} 15738 15739// Header returns an http.Header that can be modified by the caller to 15740// add HTTP headers to the request. 15741func (c *ResourcesBuildingsUpdateCall) Header() http.Header { 15742 if c.header_ == nil { 15743 c.header_ = make(http.Header) 15744 } 15745 return c.header_ 15746} 15747 15748func (c *ResourcesBuildingsUpdateCall) doRequest(alt string) (*http.Response, error) { 15749 reqHeaders := make(http.Header) 15750 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15751 for k, v := range c.header_ { 15752 reqHeaders[k] = v 15753 } 15754 reqHeaders.Set("User-Agent", c.s.userAgent()) 15755 var body io.Reader = nil 15756 body, err := googleapi.WithoutDataWrapper.JSONReader(c.building) 15757 if err != nil { 15758 return nil, err 15759 } 15760 reqHeaders.Set("Content-Type", "application/json") 15761 c.urlParams_.Set("alt", alt) 15762 c.urlParams_.Set("prettyPrint", "false") 15763 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}") 15764 urls += "?" + c.urlParams_.Encode() 15765 req, err := http.NewRequest("PUT", urls, body) 15766 if err != nil { 15767 return nil, err 15768 } 15769 req.Header = reqHeaders 15770 googleapi.Expand(req.URL, map[string]string{ 15771 "customer": c.customer, 15772 "buildingId": c.buildingId, 15773 }) 15774 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15775} 15776 15777// Do executes the "directory.resources.buildings.update" call. 15778// Exactly one of *Building or error will be non-nil. Any non-2xx status 15779// code is an error. Response headers are in either 15780// *Building.ServerResponse.Header or (if a response was returned at 15781// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15782// to check whether the returned error was because 15783// http.StatusNotModified was returned. 15784func (c *ResourcesBuildingsUpdateCall) Do(opts ...googleapi.CallOption) (*Building, error) { 15785 gensupport.SetOptions(c.urlParams_, opts...) 15786 res, err := c.doRequest("json") 15787 if res != nil && res.StatusCode == http.StatusNotModified { 15788 if res.Body != nil { 15789 res.Body.Close() 15790 } 15791 return nil, &googleapi.Error{ 15792 Code: res.StatusCode, 15793 Header: res.Header, 15794 } 15795 } 15796 if err != nil { 15797 return nil, err 15798 } 15799 defer googleapi.CloseBody(res) 15800 if err := googleapi.CheckResponse(res); err != nil { 15801 return nil, err 15802 } 15803 ret := &Building{ 15804 ServerResponse: googleapi.ServerResponse{ 15805 Header: res.Header, 15806 HTTPStatusCode: res.StatusCode, 15807 }, 15808 } 15809 target := &ret 15810 if err := gensupport.DecodeResponse(target, res); err != nil { 15811 return nil, err 15812 } 15813 return ret, nil 15814 // { 15815 // "description": "Updates a building.", 15816 // "flatPath": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15817 // "httpMethod": "PUT", 15818 // "id": "directory.resources.buildings.update", 15819 // "parameterOrder": [ 15820 // "customer", 15821 // "buildingId" 15822 // ], 15823 // "parameters": { 15824 // "buildingId": { 15825 // "description": "The id of the building to update.", 15826 // "location": "path", 15827 // "required": true, 15828 // "type": "string" 15829 // }, 15830 // "coordinatesSource": { 15831 // "default": "SOURCE_UNSPECIFIED", 15832 // "description": "Source from which Building.coordinates are derived.", 15833 // "enum": [ 15834 // "CLIENT_SPECIFIED", 15835 // "RESOLVED_FROM_ADDRESS", 15836 // "SOURCE_UNSPECIFIED" 15837 // ], 15838 // "enumDescriptions": [ 15839 // "Building.coordinates are set to the coordinates included in the request.", 15840 // "Building.coordinates are automatically populated based on the postal address.", 15841 // "Defaults to `RESOLVED_FROM_ADDRESS` if postal address is provided. Otherwise, defaults to `CLIENT_SPECIFIED` if coordinates are provided." 15842 // ], 15843 // "location": "query", 15844 // "type": "string" 15845 // }, 15846 // "customer": { 15847 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15848 // "location": "path", 15849 // "required": true, 15850 // "type": "string" 15851 // } 15852 // }, 15853 // "path": "admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}", 15854 // "request": { 15855 // "$ref": "Building" 15856 // }, 15857 // "response": { 15858 // "$ref": "Building" 15859 // }, 15860 // "scopes": [ 15861 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15862 // ] 15863 // } 15864 15865} 15866 15867// method id "directory.resources.calendars.delete": 15868 15869type ResourcesCalendarsDeleteCall struct { 15870 s *Service 15871 customer string 15872 calendarResourceId string 15873 urlParams_ gensupport.URLParams 15874 ctx_ context.Context 15875 header_ http.Header 15876} 15877 15878// Delete: Deletes a calendar resource. 15879// 15880// - calendarResourceId: The unique ID of the calendar resource to 15881// delete. 15882// - customer: The unique ID for the customer's Google Workspace 15883// account. As an account administrator, you can also use the 15884// `my_customer` alias to represent your account's customer ID. 15885func (r *ResourcesCalendarsService) Delete(customer string, calendarResourceId string) *ResourcesCalendarsDeleteCall { 15886 c := &ResourcesCalendarsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15887 c.customer = customer 15888 c.calendarResourceId = calendarResourceId 15889 return c 15890} 15891 15892// Fields allows partial responses to be retrieved. See 15893// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15894// for more information. 15895func (c *ResourcesCalendarsDeleteCall) Fields(s ...googleapi.Field) *ResourcesCalendarsDeleteCall { 15896 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15897 return c 15898} 15899 15900// Context sets the context to be used in this call's Do method. Any 15901// pending HTTP request will be aborted if the provided context is 15902// canceled. 15903func (c *ResourcesCalendarsDeleteCall) Context(ctx context.Context) *ResourcesCalendarsDeleteCall { 15904 c.ctx_ = ctx 15905 return c 15906} 15907 15908// Header returns an http.Header that can be modified by the caller to 15909// add HTTP headers to the request. 15910func (c *ResourcesCalendarsDeleteCall) Header() http.Header { 15911 if c.header_ == nil { 15912 c.header_ = make(http.Header) 15913 } 15914 return c.header_ 15915} 15916 15917func (c *ResourcesCalendarsDeleteCall) doRequest(alt string) (*http.Response, error) { 15918 reqHeaders := make(http.Header) 15919 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 15920 for k, v := range c.header_ { 15921 reqHeaders[k] = v 15922 } 15923 reqHeaders.Set("User-Agent", c.s.userAgent()) 15924 var body io.Reader = nil 15925 c.urlParams_.Set("alt", alt) 15926 c.urlParams_.Set("prettyPrint", "false") 15927 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 15928 urls += "?" + c.urlParams_.Encode() 15929 req, err := http.NewRequest("DELETE", urls, body) 15930 if err != nil { 15931 return nil, err 15932 } 15933 req.Header = reqHeaders 15934 googleapi.Expand(req.URL, map[string]string{ 15935 "customer": c.customer, 15936 "calendarResourceId": c.calendarResourceId, 15937 }) 15938 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15939} 15940 15941// Do executes the "directory.resources.calendars.delete" call. 15942func (c *ResourcesCalendarsDeleteCall) Do(opts ...googleapi.CallOption) error { 15943 gensupport.SetOptions(c.urlParams_, opts...) 15944 res, err := c.doRequest("json") 15945 if err != nil { 15946 return err 15947 } 15948 defer googleapi.CloseBody(res) 15949 if err := googleapi.CheckResponse(res); err != nil { 15950 return err 15951 } 15952 return nil 15953 // { 15954 // "description": "Deletes a calendar resource.", 15955 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 15956 // "httpMethod": "DELETE", 15957 // "id": "directory.resources.calendars.delete", 15958 // "parameterOrder": [ 15959 // "customer", 15960 // "calendarResourceId" 15961 // ], 15962 // "parameters": { 15963 // "calendarResourceId": { 15964 // "description": "The unique ID of the calendar resource to delete.", 15965 // "location": "path", 15966 // "required": true, 15967 // "type": "string" 15968 // }, 15969 // "customer": { 15970 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 15971 // "location": "path", 15972 // "required": true, 15973 // "type": "string" 15974 // } 15975 // }, 15976 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 15977 // "scopes": [ 15978 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 15979 // ] 15980 // } 15981 15982} 15983 15984// method id "directory.resources.calendars.get": 15985 15986type ResourcesCalendarsGetCall struct { 15987 s *Service 15988 customer string 15989 calendarResourceId string 15990 urlParams_ gensupport.URLParams 15991 ifNoneMatch_ string 15992 ctx_ context.Context 15993 header_ http.Header 15994} 15995 15996// Get: Retrieves a calendar resource. 15997// 15998// - calendarResourceId: The unique ID of the calendar resource to 15999// retrieve. 16000// - customer: The unique ID for the customer's Google Workspace 16001// account. As an account administrator, you can also use the 16002// `my_customer` alias to represent your account's customer ID. 16003func (r *ResourcesCalendarsService) Get(customer string, calendarResourceId string) *ResourcesCalendarsGetCall { 16004 c := &ResourcesCalendarsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16005 c.customer = customer 16006 c.calendarResourceId = calendarResourceId 16007 return c 16008} 16009 16010// Fields allows partial responses to be retrieved. See 16011// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16012// for more information. 16013func (c *ResourcesCalendarsGetCall) Fields(s ...googleapi.Field) *ResourcesCalendarsGetCall { 16014 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16015 return c 16016} 16017 16018// IfNoneMatch sets the optional parameter which makes the operation 16019// fail if the object's ETag matches the given value. This is useful for 16020// getting updates only after the object has changed since the last 16021// request. Use googleapi.IsNotModified to check whether the response 16022// error from Do is the result of In-None-Match. 16023func (c *ResourcesCalendarsGetCall) IfNoneMatch(entityTag string) *ResourcesCalendarsGetCall { 16024 c.ifNoneMatch_ = entityTag 16025 return c 16026} 16027 16028// Context sets the context to be used in this call's Do method. Any 16029// pending HTTP request will be aborted if the provided context is 16030// canceled. 16031func (c *ResourcesCalendarsGetCall) Context(ctx context.Context) *ResourcesCalendarsGetCall { 16032 c.ctx_ = ctx 16033 return c 16034} 16035 16036// Header returns an http.Header that can be modified by the caller to 16037// add HTTP headers to the request. 16038func (c *ResourcesCalendarsGetCall) Header() http.Header { 16039 if c.header_ == nil { 16040 c.header_ = make(http.Header) 16041 } 16042 return c.header_ 16043} 16044 16045func (c *ResourcesCalendarsGetCall) doRequest(alt string) (*http.Response, error) { 16046 reqHeaders := make(http.Header) 16047 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16048 for k, v := range c.header_ { 16049 reqHeaders[k] = v 16050 } 16051 reqHeaders.Set("User-Agent", c.s.userAgent()) 16052 if c.ifNoneMatch_ != "" { 16053 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16054 } 16055 var body io.Reader = nil 16056 c.urlParams_.Set("alt", alt) 16057 c.urlParams_.Set("prettyPrint", "false") 16058 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 16059 urls += "?" + c.urlParams_.Encode() 16060 req, err := http.NewRequest("GET", urls, body) 16061 if err != nil { 16062 return nil, err 16063 } 16064 req.Header = reqHeaders 16065 googleapi.Expand(req.URL, map[string]string{ 16066 "customer": c.customer, 16067 "calendarResourceId": c.calendarResourceId, 16068 }) 16069 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16070} 16071 16072// Do executes the "directory.resources.calendars.get" call. 16073// Exactly one of *CalendarResource or error will be non-nil. Any 16074// non-2xx status code is an error. Response headers are in either 16075// *CalendarResource.ServerResponse.Header or (if a response was 16076// returned at all) in error.(*googleapi.Error).Header. Use 16077// googleapi.IsNotModified to check whether the returned error was 16078// because http.StatusNotModified was returned. 16079func (c *ResourcesCalendarsGetCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 16080 gensupport.SetOptions(c.urlParams_, opts...) 16081 res, err := c.doRequest("json") 16082 if res != nil && res.StatusCode == http.StatusNotModified { 16083 if res.Body != nil { 16084 res.Body.Close() 16085 } 16086 return nil, &googleapi.Error{ 16087 Code: res.StatusCode, 16088 Header: res.Header, 16089 } 16090 } 16091 if err != nil { 16092 return nil, err 16093 } 16094 defer googleapi.CloseBody(res) 16095 if err := googleapi.CheckResponse(res); err != nil { 16096 return nil, err 16097 } 16098 ret := &CalendarResource{ 16099 ServerResponse: googleapi.ServerResponse{ 16100 Header: res.Header, 16101 HTTPStatusCode: res.StatusCode, 16102 }, 16103 } 16104 target := &ret 16105 if err := gensupport.DecodeResponse(target, res); err != nil { 16106 return nil, err 16107 } 16108 return ret, nil 16109 // { 16110 // "description": "Retrieves a calendar resource.", 16111 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16112 // "httpMethod": "GET", 16113 // "id": "directory.resources.calendars.get", 16114 // "parameterOrder": [ 16115 // "customer", 16116 // "calendarResourceId" 16117 // ], 16118 // "parameters": { 16119 // "calendarResourceId": { 16120 // "description": "The unique ID of the calendar resource to retrieve.", 16121 // "location": "path", 16122 // "required": true, 16123 // "type": "string" 16124 // }, 16125 // "customer": { 16126 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16127 // "location": "path", 16128 // "required": true, 16129 // "type": "string" 16130 // } 16131 // }, 16132 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16133 // "response": { 16134 // "$ref": "CalendarResource" 16135 // }, 16136 // "scopes": [ 16137 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 16138 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 16139 // ] 16140 // } 16141 16142} 16143 16144// method id "directory.resources.calendars.insert": 16145 16146type ResourcesCalendarsInsertCall struct { 16147 s *Service 16148 customer string 16149 calendarresource *CalendarResource 16150 urlParams_ gensupport.URLParams 16151 ctx_ context.Context 16152 header_ http.Header 16153} 16154 16155// Insert: Inserts a calendar resource. 16156// 16157// - customer: The unique ID for the customer's Google Workspace 16158// account. As an account administrator, you can also use the 16159// `my_customer` alias to represent your account's customer ID. 16160func (r *ResourcesCalendarsService) Insert(customer string, calendarresource *CalendarResource) *ResourcesCalendarsInsertCall { 16161 c := &ResourcesCalendarsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16162 c.customer = customer 16163 c.calendarresource = calendarresource 16164 return c 16165} 16166 16167// Fields allows partial responses to be retrieved. See 16168// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16169// for more information. 16170func (c *ResourcesCalendarsInsertCall) Fields(s ...googleapi.Field) *ResourcesCalendarsInsertCall { 16171 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16172 return c 16173} 16174 16175// Context sets the context to be used in this call's Do method. Any 16176// pending HTTP request will be aborted if the provided context is 16177// canceled. 16178func (c *ResourcesCalendarsInsertCall) Context(ctx context.Context) *ResourcesCalendarsInsertCall { 16179 c.ctx_ = ctx 16180 return c 16181} 16182 16183// Header returns an http.Header that can be modified by the caller to 16184// add HTTP headers to the request. 16185func (c *ResourcesCalendarsInsertCall) Header() http.Header { 16186 if c.header_ == nil { 16187 c.header_ = make(http.Header) 16188 } 16189 return c.header_ 16190} 16191 16192func (c *ResourcesCalendarsInsertCall) doRequest(alt string) (*http.Response, error) { 16193 reqHeaders := make(http.Header) 16194 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16195 for k, v := range c.header_ { 16196 reqHeaders[k] = v 16197 } 16198 reqHeaders.Set("User-Agent", c.s.userAgent()) 16199 var body io.Reader = nil 16200 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 16201 if err != nil { 16202 return nil, err 16203 } 16204 reqHeaders.Set("Content-Type", "application/json") 16205 c.urlParams_.Set("alt", alt) 16206 c.urlParams_.Set("prettyPrint", "false") 16207 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars") 16208 urls += "?" + c.urlParams_.Encode() 16209 req, err := http.NewRequest("POST", urls, body) 16210 if err != nil { 16211 return nil, err 16212 } 16213 req.Header = reqHeaders 16214 googleapi.Expand(req.URL, map[string]string{ 16215 "customer": c.customer, 16216 }) 16217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16218} 16219 16220// Do executes the "directory.resources.calendars.insert" call. 16221// Exactly one of *CalendarResource or error will be non-nil. Any 16222// non-2xx status code is an error. Response headers are in either 16223// *CalendarResource.ServerResponse.Header or (if a response was 16224// returned at all) in error.(*googleapi.Error).Header. Use 16225// googleapi.IsNotModified to check whether the returned error was 16226// because http.StatusNotModified was returned. 16227func (c *ResourcesCalendarsInsertCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 16228 gensupport.SetOptions(c.urlParams_, opts...) 16229 res, err := c.doRequest("json") 16230 if res != nil && res.StatusCode == http.StatusNotModified { 16231 if res.Body != nil { 16232 res.Body.Close() 16233 } 16234 return nil, &googleapi.Error{ 16235 Code: res.StatusCode, 16236 Header: res.Header, 16237 } 16238 } 16239 if err != nil { 16240 return nil, err 16241 } 16242 defer googleapi.CloseBody(res) 16243 if err := googleapi.CheckResponse(res); err != nil { 16244 return nil, err 16245 } 16246 ret := &CalendarResource{ 16247 ServerResponse: googleapi.ServerResponse{ 16248 Header: res.Header, 16249 HTTPStatusCode: res.StatusCode, 16250 }, 16251 } 16252 target := &ret 16253 if err := gensupport.DecodeResponse(target, res); err != nil { 16254 return nil, err 16255 } 16256 return ret, nil 16257 // { 16258 // "description": "Inserts a calendar resource.", 16259 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars", 16260 // "httpMethod": "POST", 16261 // "id": "directory.resources.calendars.insert", 16262 // "parameterOrder": [ 16263 // "customer" 16264 // ], 16265 // "parameters": { 16266 // "customer": { 16267 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16268 // "location": "path", 16269 // "required": true, 16270 // "type": "string" 16271 // } 16272 // }, 16273 // "path": "admin/directory/v1/customer/{customer}/resources/calendars", 16274 // "request": { 16275 // "$ref": "CalendarResource" 16276 // }, 16277 // "response": { 16278 // "$ref": "CalendarResource" 16279 // }, 16280 // "scopes": [ 16281 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 16282 // ] 16283 // } 16284 16285} 16286 16287// method id "directory.resources.calendars.list": 16288 16289type ResourcesCalendarsListCall struct { 16290 s *Service 16291 customer string 16292 urlParams_ gensupport.URLParams 16293 ifNoneMatch_ string 16294 ctx_ context.Context 16295 header_ http.Header 16296} 16297 16298// List: Retrieves a list of calendar resources for an account. 16299// 16300// - customer: The unique ID for the customer's Google Workspace 16301// account. As an account administrator, you can also use the 16302// `my_customer` alias to represent your account's customer ID. 16303func (r *ResourcesCalendarsService) List(customer string) *ResourcesCalendarsListCall { 16304 c := &ResourcesCalendarsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16305 c.customer = customer 16306 return c 16307} 16308 16309// MaxResults sets the optional parameter "maxResults": Maximum number 16310// of results to return. 16311func (c *ResourcesCalendarsListCall) MaxResults(maxResults int64) *ResourcesCalendarsListCall { 16312 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 16313 return c 16314} 16315 16316// OrderBy sets the optional parameter "orderBy": Field(s) to sort 16317// results by in either ascending or descending order. Supported fields 16318// include `resourceId`, `resourceName`, `capacity`, `buildingId`, and 16319// `floorName`. If no order is specified, defaults to ascending. Should 16320// be of the form "field [asc|desc], field [asc|desc], ...". For example 16321// `buildingId, capacity desc` would return results sorted first by 16322// `buildingId` in ascending order then by `capacity` in descending 16323// order. 16324func (c *ResourcesCalendarsListCall) OrderBy(orderBy string) *ResourcesCalendarsListCall { 16325 c.urlParams_.Set("orderBy", orderBy) 16326 return c 16327} 16328 16329// PageToken sets the optional parameter "pageToken": Token to specify 16330// the next page in the list. 16331func (c *ResourcesCalendarsListCall) PageToken(pageToken string) *ResourcesCalendarsListCall { 16332 c.urlParams_.Set("pageToken", pageToken) 16333 return c 16334} 16335 16336// Query sets the optional parameter "query": String query used to 16337// filter results. Should be of the form "field operator value" where 16338// field can be any of supported fields and operators can be any of 16339// supported operations. Operators include '=' for exact match, '!=' for 16340// mismatch and ':' for prefix match or HAS match where applicable. For 16341// prefix match, the value should always be followed by a *. Logical 16342// operators NOT and AND are supported (in this order of precedence). 16343// Supported fields include `generatedResourceName`, `name`, 16344// `buildingId`, `floor_name`, `capacity`, 16345// `featureInstances.feature.name`, `resourceEmail`, `resourceCategory`. 16346// For example `buildingId=US-NYC-9TH AND 16347// featureInstances.feature.name:Phone`. 16348func (c *ResourcesCalendarsListCall) Query(query string) *ResourcesCalendarsListCall { 16349 c.urlParams_.Set("query", query) 16350 return c 16351} 16352 16353// Fields allows partial responses to be retrieved. See 16354// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16355// for more information. 16356func (c *ResourcesCalendarsListCall) Fields(s ...googleapi.Field) *ResourcesCalendarsListCall { 16357 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16358 return c 16359} 16360 16361// IfNoneMatch sets the optional parameter which makes the operation 16362// fail if the object's ETag matches the given value. This is useful for 16363// getting updates only after the object has changed since the last 16364// request. Use googleapi.IsNotModified to check whether the response 16365// error from Do is the result of In-None-Match. 16366func (c *ResourcesCalendarsListCall) IfNoneMatch(entityTag string) *ResourcesCalendarsListCall { 16367 c.ifNoneMatch_ = entityTag 16368 return c 16369} 16370 16371// Context sets the context to be used in this call's Do method. Any 16372// pending HTTP request will be aborted if the provided context is 16373// canceled. 16374func (c *ResourcesCalendarsListCall) Context(ctx context.Context) *ResourcesCalendarsListCall { 16375 c.ctx_ = ctx 16376 return c 16377} 16378 16379// Header returns an http.Header that can be modified by the caller to 16380// add HTTP headers to the request. 16381func (c *ResourcesCalendarsListCall) Header() http.Header { 16382 if c.header_ == nil { 16383 c.header_ = make(http.Header) 16384 } 16385 return c.header_ 16386} 16387 16388func (c *ResourcesCalendarsListCall) doRequest(alt string) (*http.Response, error) { 16389 reqHeaders := make(http.Header) 16390 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16391 for k, v := range c.header_ { 16392 reqHeaders[k] = v 16393 } 16394 reqHeaders.Set("User-Agent", c.s.userAgent()) 16395 if c.ifNoneMatch_ != "" { 16396 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16397 } 16398 var body io.Reader = nil 16399 c.urlParams_.Set("alt", alt) 16400 c.urlParams_.Set("prettyPrint", "false") 16401 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars") 16402 urls += "?" + c.urlParams_.Encode() 16403 req, err := http.NewRequest("GET", urls, body) 16404 if err != nil { 16405 return nil, err 16406 } 16407 req.Header = reqHeaders 16408 googleapi.Expand(req.URL, map[string]string{ 16409 "customer": c.customer, 16410 }) 16411 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16412} 16413 16414// Do executes the "directory.resources.calendars.list" call. 16415// Exactly one of *CalendarResources or error will be non-nil. Any 16416// non-2xx status code is an error. Response headers are in either 16417// *CalendarResources.ServerResponse.Header or (if a response was 16418// returned at all) in error.(*googleapi.Error).Header. Use 16419// googleapi.IsNotModified to check whether the returned error was 16420// because http.StatusNotModified was returned. 16421func (c *ResourcesCalendarsListCall) Do(opts ...googleapi.CallOption) (*CalendarResources, error) { 16422 gensupport.SetOptions(c.urlParams_, opts...) 16423 res, err := c.doRequest("json") 16424 if res != nil && res.StatusCode == http.StatusNotModified { 16425 if res.Body != nil { 16426 res.Body.Close() 16427 } 16428 return nil, &googleapi.Error{ 16429 Code: res.StatusCode, 16430 Header: res.Header, 16431 } 16432 } 16433 if err != nil { 16434 return nil, err 16435 } 16436 defer googleapi.CloseBody(res) 16437 if err := googleapi.CheckResponse(res); err != nil { 16438 return nil, err 16439 } 16440 ret := &CalendarResources{ 16441 ServerResponse: googleapi.ServerResponse{ 16442 Header: res.Header, 16443 HTTPStatusCode: res.StatusCode, 16444 }, 16445 } 16446 target := &ret 16447 if err := gensupport.DecodeResponse(target, res); err != nil { 16448 return nil, err 16449 } 16450 return ret, nil 16451 // { 16452 // "description": "Retrieves a list of calendar resources for an account.", 16453 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars", 16454 // "httpMethod": "GET", 16455 // "id": "directory.resources.calendars.list", 16456 // "parameterOrder": [ 16457 // "customer" 16458 // ], 16459 // "parameters": { 16460 // "customer": { 16461 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16462 // "location": "path", 16463 // "required": true, 16464 // "type": "string" 16465 // }, 16466 // "maxResults": { 16467 // "description": "Maximum number of results to return.", 16468 // "format": "int32", 16469 // "location": "query", 16470 // "maximum": "500", 16471 // "minimum": "1", 16472 // "type": "integer" 16473 // }, 16474 // "orderBy": { 16475 // "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.", 16476 // "location": "query", 16477 // "type": "string" 16478 // }, 16479 // "pageToken": { 16480 // "description": "Token to specify the next page in the list.", 16481 // "location": "query", 16482 // "type": "string" 16483 // }, 16484 // "query": { 16485 // "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`.", 16486 // "location": "query", 16487 // "type": "string" 16488 // } 16489 // }, 16490 // "path": "admin/directory/v1/customer/{customer}/resources/calendars", 16491 // "response": { 16492 // "$ref": "CalendarResources" 16493 // }, 16494 // "scopes": [ 16495 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 16496 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 16497 // ] 16498 // } 16499 16500} 16501 16502// Pages invokes f for each page of results. 16503// A non-nil error returned from f will halt the iteration. 16504// The provided context supersedes any context provided to the Context method. 16505func (c *ResourcesCalendarsListCall) Pages(ctx context.Context, f func(*CalendarResources) error) error { 16506 c.ctx_ = ctx 16507 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 16508 for { 16509 x, err := c.Do() 16510 if err != nil { 16511 return err 16512 } 16513 if err := f(x); err != nil { 16514 return err 16515 } 16516 if x.NextPageToken == "" { 16517 return nil 16518 } 16519 c.PageToken(x.NextPageToken) 16520 } 16521} 16522 16523// method id "directory.resources.calendars.patch": 16524 16525type ResourcesCalendarsPatchCall struct { 16526 s *Service 16527 customer string 16528 calendarResourceId string 16529 calendarresource *CalendarResource 16530 urlParams_ gensupport.URLParams 16531 ctx_ context.Context 16532 header_ http.Header 16533} 16534 16535// Patch: Patches a calendar resource. 16536// 16537// - calendarResourceId: The unique ID of the calendar resource to 16538// update. 16539// - customer: The unique ID for the customer's Google Workspace 16540// account. As an account administrator, you can also use the 16541// `my_customer` alias to represent your account's customer ID. 16542func (r *ResourcesCalendarsService) Patch(customer string, calendarResourceId string, calendarresource *CalendarResource) *ResourcesCalendarsPatchCall { 16543 c := &ResourcesCalendarsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16544 c.customer = customer 16545 c.calendarResourceId = calendarResourceId 16546 c.calendarresource = calendarresource 16547 return c 16548} 16549 16550// Fields allows partial responses to be retrieved. See 16551// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16552// for more information. 16553func (c *ResourcesCalendarsPatchCall) Fields(s ...googleapi.Field) *ResourcesCalendarsPatchCall { 16554 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16555 return c 16556} 16557 16558// Context sets the context to be used in this call's Do method. Any 16559// pending HTTP request will be aborted if the provided context is 16560// canceled. 16561func (c *ResourcesCalendarsPatchCall) Context(ctx context.Context) *ResourcesCalendarsPatchCall { 16562 c.ctx_ = ctx 16563 return c 16564} 16565 16566// Header returns an http.Header that can be modified by the caller to 16567// add HTTP headers to the request. 16568func (c *ResourcesCalendarsPatchCall) Header() http.Header { 16569 if c.header_ == nil { 16570 c.header_ = make(http.Header) 16571 } 16572 return c.header_ 16573} 16574 16575func (c *ResourcesCalendarsPatchCall) doRequest(alt string) (*http.Response, error) { 16576 reqHeaders := make(http.Header) 16577 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16578 for k, v := range c.header_ { 16579 reqHeaders[k] = v 16580 } 16581 reqHeaders.Set("User-Agent", c.s.userAgent()) 16582 var body io.Reader = nil 16583 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 16584 if err != nil { 16585 return nil, err 16586 } 16587 reqHeaders.Set("Content-Type", "application/json") 16588 c.urlParams_.Set("alt", alt) 16589 c.urlParams_.Set("prettyPrint", "false") 16590 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 16591 urls += "?" + c.urlParams_.Encode() 16592 req, err := http.NewRequest("PATCH", urls, body) 16593 if err != nil { 16594 return nil, err 16595 } 16596 req.Header = reqHeaders 16597 googleapi.Expand(req.URL, map[string]string{ 16598 "customer": c.customer, 16599 "calendarResourceId": c.calendarResourceId, 16600 }) 16601 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16602} 16603 16604// Do executes the "directory.resources.calendars.patch" call. 16605// Exactly one of *CalendarResource or error will be non-nil. Any 16606// non-2xx status code is an error. Response headers are in either 16607// *CalendarResource.ServerResponse.Header or (if a response was 16608// returned at all) in error.(*googleapi.Error).Header. Use 16609// googleapi.IsNotModified to check whether the returned error was 16610// because http.StatusNotModified was returned. 16611func (c *ResourcesCalendarsPatchCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 16612 gensupport.SetOptions(c.urlParams_, opts...) 16613 res, err := c.doRequest("json") 16614 if res != nil && res.StatusCode == http.StatusNotModified { 16615 if res.Body != nil { 16616 res.Body.Close() 16617 } 16618 return nil, &googleapi.Error{ 16619 Code: res.StatusCode, 16620 Header: res.Header, 16621 } 16622 } 16623 if err != nil { 16624 return nil, err 16625 } 16626 defer googleapi.CloseBody(res) 16627 if err := googleapi.CheckResponse(res); err != nil { 16628 return nil, err 16629 } 16630 ret := &CalendarResource{ 16631 ServerResponse: googleapi.ServerResponse{ 16632 Header: res.Header, 16633 HTTPStatusCode: res.StatusCode, 16634 }, 16635 } 16636 target := &ret 16637 if err := gensupport.DecodeResponse(target, res); err != nil { 16638 return nil, err 16639 } 16640 return ret, nil 16641 // { 16642 // "description": "Patches a calendar resource.", 16643 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16644 // "httpMethod": "PATCH", 16645 // "id": "directory.resources.calendars.patch", 16646 // "parameterOrder": [ 16647 // "customer", 16648 // "calendarResourceId" 16649 // ], 16650 // "parameters": { 16651 // "calendarResourceId": { 16652 // "description": "The unique ID of the calendar resource to update.", 16653 // "location": "path", 16654 // "required": true, 16655 // "type": "string" 16656 // }, 16657 // "customer": { 16658 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16659 // "location": "path", 16660 // "required": true, 16661 // "type": "string" 16662 // } 16663 // }, 16664 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16665 // "request": { 16666 // "$ref": "CalendarResource" 16667 // }, 16668 // "response": { 16669 // "$ref": "CalendarResource" 16670 // }, 16671 // "scopes": [ 16672 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 16673 // ] 16674 // } 16675 16676} 16677 16678// method id "directory.resources.calendars.update": 16679 16680type ResourcesCalendarsUpdateCall struct { 16681 s *Service 16682 customer string 16683 calendarResourceId string 16684 calendarresource *CalendarResource 16685 urlParams_ gensupport.URLParams 16686 ctx_ context.Context 16687 header_ http.Header 16688} 16689 16690// Update: Updates a calendar resource. This method supports patch 16691// semantics, meaning you only need to include the fields you wish to 16692// update. Fields that are not present in the request will be preserved. 16693// 16694// - calendarResourceId: The unique ID of the calendar resource to 16695// update. 16696// - customer: The unique ID for the customer's Google Workspace 16697// account. As an account administrator, you can also use the 16698// `my_customer` alias to represent your account's customer ID. 16699func (r *ResourcesCalendarsService) Update(customer string, calendarResourceId string, calendarresource *CalendarResource) *ResourcesCalendarsUpdateCall { 16700 c := &ResourcesCalendarsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16701 c.customer = customer 16702 c.calendarResourceId = calendarResourceId 16703 c.calendarresource = calendarresource 16704 return c 16705} 16706 16707// Fields allows partial responses to be retrieved. See 16708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16709// for more information. 16710func (c *ResourcesCalendarsUpdateCall) Fields(s ...googleapi.Field) *ResourcesCalendarsUpdateCall { 16711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16712 return c 16713} 16714 16715// Context sets the context to be used in this call's Do method. Any 16716// pending HTTP request will be aborted if the provided context is 16717// canceled. 16718func (c *ResourcesCalendarsUpdateCall) Context(ctx context.Context) *ResourcesCalendarsUpdateCall { 16719 c.ctx_ = ctx 16720 return c 16721} 16722 16723// Header returns an http.Header that can be modified by the caller to 16724// add HTTP headers to the request. 16725func (c *ResourcesCalendarsUpdateCall) Header() http.Header { 16726 if c.header_ == nil { 16727 c.header_ = make(http.Header) 16728 } 16729 return c.header_ 16730} 16731 16732func (c *ResourcesCalendarsUpdateCall) doRequest(alt string) (*http.Response, error) { 16733 reqHeaders := make(http.Header) 16734 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16735 for k, v := range c.header_ { 16736 reqHeaders[k] = v 16737 } 16738 reqHeaders.Set("User-Agent", c.s.userAgent()) 16739 var body io.Reader = nil 16740 body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarresource) 16741 if err != nil { 16742 return nil, err 16743 } 16744 reqHeaders.Set("Content-Type", "application/json") 16745 c.urlParams_.Set("alt", alt) 16746 c.urlParams_.Set("prettyPrint", "false") 16747 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}") 16748 urls += "?" + c.urlParams_.Encode() 16749 req, err := http.NewRequest("PUT", urls, body) 16750 if err != nil { 16751 return nil, err 16752 } 16753 req.Header = reqHeaders 16754 googleapi.Expand(req.URL, map[string]string{ 16755 "customer": c.customer, 16756 "calendarResourceId": c.calendarResourceId, 16757 }) 16758 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16759} 16760 16761// Do executes the "directory.resources.calendars.update" call. 16762// Exactly one of *CalendarResource or error will be non-nil. Any 16763// non-2xx status code is an error. Response headers are in either 16764// *CalendarResource.ServerResponse.Header or (if a response was 16765// returned at all) in error.(*googleapi.Error).Header. Use 16766// googleapi.IsNotModified to check whether the returned error was 16767// because http.StatusNotModified was returned. 16768func (c *ResourcesCalendarsUpdateCall) Do(opts ...googleapi.CallOption) (*CalendarResource, error) { 16769 gensupport.SetOptions(c.urlParams_, opts...) 16770 res, err := c.doRequest("json") 16771 if res != nil && res.StatusCode == http.StatusNotModified { 16772 if res.Body != nil { 16773 res.Body.Close() 16774 } 16775 return nil, &googleapi.Error{ 16776 Code: res.StatusCode, 16777 Header: res.Header, 16778 } 16779 } 16780 if err != nil { 16781 return nil, err 16782 } 16783 defer googleapi.CloseBody(res) 16784 if err := googleapi.CheckResponse(res); err != nil { 16785 return nil, err 16786 } 16787 ret := &CalendarResource{ 16788 ServerResponse: googleapi.ServerResponse{ 16789 Header: res.Header, 16790 HTTPStatusCode: res.StatusCode, 16791 }, 16792 } 16793 target := &ret 16794 if err := gensupport.DecodeResponse(target, res); err != nil { 16795 return nil, err 16796 } 16797 return ret, nil 16798 // { 16799 // "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.", 16800 // "flatPath": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16801 // "httpMethod": "PUT", 16802 // "id": "directory.resources.calendars.update", 16803 // "parameterOrder": [ 16804 // "customer", 16805 // "calendarResourceId" 16806 // ], 16807 // "parameters": { 16808 // "calendarResourceId": { 16809 // "description": "The unique ID of the calendar resource to update.", 16810 // "location": "path", 16811 // "required": true, 16812 // "type": "string" 16813 // }, 16814 // "customer": { 16815 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16816 // "location": "path", 16817 // "required": true, 16818 // "type": "string" 16819 // } 16820 // }, 16821 // "path": "admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}", 16822 // "request": { 16823 // "$ref": "CalendarResource" 16824 // }, 16825 // "response": { 16826 // "$ref": "CalendarResource" 16827 // }, 16828 // "scopes": [ 16829 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 16830 // ] 16831 // } 16832 16833} 16834 16835// method id "directory.resources.features.delete": 16836 16837type ResourcesFeaturesDeleteCall struct { 16838 s *Service 16839 customer string 16840 featureKey string 16841 urlParams_ gensupport.URLParams 16842 ctx_ context.Context 16843 header_ http.Header 16844} 16845 16846// Delete: Deletes a feature. 16847// 16848// - customer: The unique ID for the customer's Google Workspace 16849// account. As an account administrator, you can also use the 16850// `my_customer` alias to represent your account's customer ID. 16851// - featureKey: The unique ID of the feature to delete. 16852func (r *ResourcesFeaturesService) Delete(customer string, featureKey string) *ResourcesFeaturesDeleteCall { 16853 c := &ResourcesFeaturesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16854 c.customer = customer 16855 c.featureKey = featureKey 16856 return c 16857} 16858 16859// Fields allows partial responses to be retrieved. See 16860// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16861// for more information. 16862func (c *ResourcesFeaturesDeleteCall) Fields(s ...googleapi.Field) *ResourcesFeaturesDeleteCall { 16863 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16864 return c 16865} 16866 16867// Context sets the context to be used in this call's Do method. Any 16868// pending HTTP request will be aborted if the provided context is 16869// canceled. 16870func (c *ResourcesFeaturesDeleteCall) Context(ctx context.Context) *ResourcesFeaturesDeleteCall { 16871 c.ctx_ = ctx 16872 return c 16873} 16874 16875// Header returns an http.Header that can be modified by the caller to 16876// add HTTP headers to the request. 16877func (c *ResourcesFeaturesDeleteCall) Header() http.Header { 16878 if c.header_ == nil { 16879 c.header_ = make(http.Header) 16880 } 16881 return c.header_ 16882} 16883 16884func (c *ResourcesFeaturesDeleteCall) doRequest(alt string) (*http.Response, error) { 16885 reqHeaders := make(http.Header) 16886 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 16887 for k, v := range c.header_ { 16888 reqHeaders[k] = v 16889 } 16890 reqHeaders.Set("User-Agent", c.s.userAgent()) 16891 var body io.Reader = nil 16892 c.urlParams_.Set("alt", alt) 16893 c.urlParams_.Set("prettyPrint", "false") 16894 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 16895 urls += "?" + c.urlParams_.Encode() 16896 req, err := http.NewRequest("DELETE", urls, body) 16897 if err != nil { 16898 return nil, err 16899 } 16900 req.Header = reqHeaders 16901 googleapi.Expand(req.URL, map[string]string{ 16902 "customer": c.customer, 16903 "featureKey": c.featureKey, 16904 }) 16905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16906} 16907 16908// Do executes the "directory.resources.features.delete" call. 16909func (c *ResourcesFeaturesDeleteCall) Do(opts ...googleapi.CallOption) error { 16910 gensupport.SetOptions(c.urlParams_, opts...) 16911 res, err := c.doRequest("json") 16912 if err != nil { 16913 return err 16914 } 16915 defer googleapi.CloseBody(res) 16916 if err := googleapi.CheckResponse(res); err != nil { 16917 return err 16918 } 16919 return nil 16920 // { 16921 // "description": "Deletes a feature.", 16922 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 16923 // "httpMethod": "DELETE", 16924 // "id": "directory.resources.features.delete", 16925 // "parameterOrder": [ 16926 // "customer", 16927 // "featureKey" 16928 // ], 16929 // "parameters": { 16930 // "customer": { 16931 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 16932 // "location": "path", 16933 // "required": true, 16934 // "type": "string" 16935 // }, 16936 // "featureKey": { 16937 // "description": "The unique ID of the feature to delete.", 16938 // "location": "path", 16939 // "required": true, 16940 // "type": "string" 16941 // } 16942 // }, 16943 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 16944 // "scopes": [ 16945 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 16946 // ] 16947 // } 16948 16949} 16950 16951// method id "directory.resources.features.get": 16952 16953type ResourcesFeaturesGetCall struct { 16954 s *Service 16955 customer string 16956 featureKey string 16957 urlParams_ gensupport.URLParams 16958 ifNoneMatch_ string 16959 ctx_ context.Context 16960 header_ http.Header 16961} 16962 16963// Get: Retrieves a feature. 16964// 16965// - customer: The unique ID for the customer's Google Workspace 16966// account. As an account administrator, you can also use the 16967// `my_customer` alias to represent your account's customer ID. 16968// - featureKey: The unique ID of the feature to retrieve. 16969func (r *ResourcesFeaturesService) Get(customer string, featureKey string) *ResourcesFeaturesGetCall { 16970 c := &ResourcesFeaturesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16971 c.customer = customer 16972 c.featureKey = featureKey 16973 return c 16974} 16975 16976// Fields allows partial responses to be retrieved. See 16977// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16978// for more information. 16979func (c *ResourcesFeaturesGetCall) Fields(s ...googleapi.Field) *ResourcesFeaturesGetCall { 16980 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16981 return c 16982} 16983 16984// IfNoneMatch sets the optional parameter which makes the operation 16985// fail if the object's ETag matches the given value. This is useful for 16986// getting updates only after the object has changed since the last 16987// request. Use googleapi.IsNotModified to check whether the response 16988// error from Do is the result of In-None-Match. 16989func (c *ResourcesFeaturesGetCall) IfNoneMatch(entityTag string) *ResourcesFeaturesGetCall { 16990 c.ifNoneMatch_ = entityTag 16991 return c 16992} 16993 16994// Context sets the context to be used in this call's Do method. Any 16995// pending HTTP request will be aborted if the provided context is 16996// canceled. 16997func (c *ResourcesFeaturesGetCall) Context(ctx context.Context) *ResourcesFeaturesGetCall { 16998 c.ctx_ = ctx 16999 return c 17000} 17001 17002// Header returns an http.Header that can be modified by the caller to 17003// add HTTP headers to the request. 17004func (c *ResourcesFeaturesGetCall) Header() http.Header { 17005 if c.header_ == nil { 17006 c.header_ = make(http.Header) 17007 } 17008 return c.header_ 17009} 17010 17011func (c *ResourcesFeaturesGetCall) doRequest(alt string) (*http.Response, error) { 17012 reqHeaders := make(http.Header) 17013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17014 for k, v := range c.header_ { 17015 reqHeaders[k] = v 17016 } 17017 reqHeaders.Set("User-Agent", c.s.userAgent()) 17018 if c.ifNoneMatch_ != "" { 17019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17020 } 17021 var body io.Reader = nil 17022 c.urlParams_.Set("alt", alt) 17023 c.urlParams_.Set("prettyPrint", "false") 17024 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 17025 urls += "?" + c.urlParams_.Encode() 17026 req, err := http.NewRequest("GET", urls, body) 17027 if err != nil { 17028 return nil, err 17029 } 17030 req.Header = reqHeaders 17031 googleapi.Expand(req.URL, map[string]string{ 17032 "customer": c.customer, 17033 "featureKey": c.featureKey, 17034 }) 17035 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17036} 17037 17038// Do executes the "directory.resources.features.get" call. 17039// Exactly one of *Feature or error will be non-nil. Any non-2xx status 17040// code is an error. Response headers are in either 17041// *Feature.ServerResponse.Header or (if a response was returned at all) 17042// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17043// check whether the returned error was because http.StatusNotModified 17044// was returned. 17045func (c *ResourcesFeaturesGetCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 17046 gensupport.SetOptions(c.urlParams_, opts...) 17047 res, err := c.doRequest("json") 17048 if res != nil && res.StatusCode == http.StatusNotModified { 17049 if res.Body != nil { 17050 res.Body.Close() 17051 } 17052 return nil, &googleapi.Error{ 17053 Code: res.StatusCode, 17054 Header: res.Header, 17055 } 17056 } 17057 if err != nil { 17058 return nil, err 17059 } 17060 defer googleapi.CloseBody(res) 17061 if err := googleapi.CheckResponse(res); err != nil { 17062 return nil, err 17063 } 17064 ret := &Feature{ 17065 ServerResponse: googleapi.ServerResponse{ 17066 Header: res.Header, 17067 HTTPStatusCode: res.StatusCode, 17068 }, 17069 } 17070 target := &ret 17071 if err := gensupport.DecodeResponse(target, res); err != nil { 17072 return nil, err 17073 } 17074 return ret, nil 17075 // { 17076 // "description": "Retrieves a feature.", 17077 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17078 // "httpMethod": "GET", 17079 // "id": "directory.resources.features.get", 17080 // "parameterOrder": [ 17081 // "customer", 17082 // "featureKey" 17083 // ], 17084 // "parameters": { 17085 // "customer": { 17086 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17087 // "location": "path", 17088 // "required": true, 17089 // "type": "string" 17090 // }, 17091 // "featureKey": { 17092 // "description": "The unique ID of the feature to retrieve.", 17093 // "location": "path", 17094 // "required": true, 17095 // "type": "string" 17096 // } 17097 // }, 17098 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17099 // "response": { 17100 // "$ref": "Feature" 17101 // }, 17102 // "scopes": [ 17103 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 17104 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 17105 // ] 17106 // } 17107 17108} 17109 17110// method id "directory.resources.features.insert": 17111 17112type ResourcesFeaturesInsertCall struct { 17113 s *Service 17114 customer string 17115 feature *Feature 17116 urlParams_ gensupport.URLParams 17117 ctx_ context.Context 17118 header_ http.Header 17119} 17120 17121// Insert: Inserts a feature. 17122// 17123// - customer: The unique ID for the customer's Google Workspace 17124// account. As an account administrator, you can also use the 17125// `my_customer` alias to represent your account's customer ID. 17126func (r *ResourcesFeaturesService) Insert(customer string, feature *Feature) *ResourcesFeaturesInsertCall { 17127 c := &ResourcesFeaturesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17128 c.customer = customer 17129 c.feature = feature 17130 return c 17131} 17132 17133// Fields allows partial responses to be retrieved. See 17134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17135// for more information. 17136func (c *ResourcesFeaturesInsertCall) Fields(s ...googleapi.Field) *ResourcesFeaturesInsertCall { 17137 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17138 return c 17139} 17140 17141// Context sets the context to be used in this call's Do method. Any 17142// pending HTTP request will be aborted if the provided context is 17143// canceled. 17144func (c *ResourcesFeaturesInsertCall) Context(ctx context.Context) *ResourcesFeaturesInsertCall { 17145 c.ctx_ = ctx 17146 return c 17147} 17148 17149// Header returns an http.Header that can be modified by the caller to 17150// add HTTP headers to the request. 17151func (c *ResourcesFeaturesInsertCall) Header() http.Header { 17152 if c.header_ == nil { 17153 c.header_ = make(http.Header) 17154 } 17155 return c.header_ 17156} 17157 17158func (c *ResourcesFeaturesInsertCall) doRequest(alt string) (*http.Response, error) { 17159 reqHeaders := make(http.Header) 17160 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17161 for k, v := range c.header_ { 17162 reqHeaders[k] = v 17163 } 17164 reqHeaders.Set("User-Agent", c.s.userAgent()) 17165 var body io.Reader = nil 17166 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 17167 if err != nil { 17168 return nil, err 17169 } 17170 reqHeaders.Set("Content-Type", "application/json") 17171 c.urlParams_.Set("alt", alt) 17172 c.urlParams_.Set("prettyPrint", "false") 17173 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features") 17174 urls += "?" + c.urlParams_.Encode() 17175 req, err := http.NewRequest("POST", urls, body) 17176 if err != nil { 17177 return nil, err 17178 } 17179 req.Header = reqHeaders 17180 googleapi.Expand(req.URL, map[string]string{ 17181 "customer": c.customer, 17182 }) 17183 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17184} 17185 17186// Do executes the "directory.resources.features.insert" call. 17187// Exactly one of *Feature or error will be non-nil. Any non-2xx status 17188// code is an error. Response headers are in either 17189// *Feature.ServerResponse.Header or (if a response was returned at all) 17190// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17191// check whether the returned error was because http.StatusNotModified 17192// was returned. 17193func (c *ResourcesFeaturesInsertCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 17194 gensupport.SetOptions(c.urlParams_, opts...) 17195 res, err := c.doRequest("json") 17196 if res != nil && res.StatusCode == http.StatusNotModified { 17197 if res.Body != nil { 17198 res.Body.Close() 17199 } 17200 return nil, &googleapi.Error{ 17201 Code: res.StatusCode, 17202 Header: res.Header, 17203 } 17204 } 17205 if err != nil { 17206 return nil, err 17207 } 17208 defer googleapi.CloseBody(res) 17209 if err := googleapi.CheckResponse(res); err != nil { 17210 return nil, err 17211 } 17212 ret := &Feature{ 17213 ServerResponse: googleapi.ServerResponse{ 17214 Header: res.Header, 17215 HTTPStatusCode: res.StatusCode, 17216 }, 17217 } 17218 target := &ret 17219 if err := gensupport.DecodeResponse(target, res); err != nil { 17220 return nil, err 17221 } 17222 return ret, nil 17223 // { 17224 // "description": "Inserts a feature.", 17225 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features", 17226 // "httpMethod": "POST", 17227 // "id": "directory.resources.features.insert", 17228 // "parameterOrder": [ 17229 // "customer" 17230 // ], 17231 // "parameters": { 17232 // "customer": { 17233 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17234 // "location": "path", 17235 // "required": true, 17236 // "type": "string" 17237 // } 17238 // }, 17239 // "path": "admin/directory/v1/customer/{customer}/resources/features", 17240 // "request": { 17241 // "$ref": "Feature" 17242 // }, 17243 // "response": { 17244 // "$ref": "Feature" 17245 // }, 17246 // "scopes": [ 17247 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 17248 // ] 17249 // } 17250 17251} 17252 17253// method id "directory.resources.features.list": 17254 17255type ResourcesFeaturesListCall struct { 17256 s *Service 17257 customer string 17258 urlParams_ gensupport.URLParams 17259 ifNoneMatch_ string 17260 ctx_ context.Context 17261 header_ http.Header 17262} 17263 17264// List: Retrieves a list of features for an account. 17265// 17266// - customer: The unique ID for the customer's Google Workspace 17267// account. As an account administrator, you can also use the 17268// `my_customer` alias to represent your account's customer ID. 17269func (r *ResourcesFeaturesService) List(customer string) *ResourcesFeaturesListCall { 17270 c := &ResourcesFeaturesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17271 c.customer = customer 17272 return c 17273} 17274 17275// MaxResults sets the optional parameter "maxResults": Maximum number 17276// of results to return. 17277func (c *ResourcesFeaturesListCall) MaxResults(maxResults int64) *ResourcesFeaturesListCall { 17278 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 17279 return c 17280} 17281 17282// PageToken sets the optional parameter "pageToken": Token to specify 17283// the next page in the list. 17284func (c *ResourcesFeaturesListCall) PageToken(pageToken string) *ResourcesFeaturesListCall { 17285 c.urlParams_.Set("pageToken", pageToken) 17286 return c 17287} 17288 17289// Fields allows partial responses to be retrieved. See 17290// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17291// for more information. 17292func (c *ResourcesFeaturesListCall) Fields(s ...googleapi.Field) *ResourcesFeaturesListCall { 17293 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17294 return c 17295} 17296 17297// IfNoneMatch sets the optional parameter which makes the operation 17298// fail if the object's ETag matches the given value. This is useful for 17299// getting updates only after the object has changed since the last 17300// request. Use googleapi.IsNotModified to check whether the response 17301// error from Do is the result of In-None-Match. 17302func (c *ResourcesFeaturesListCall) IfNoneMatch(entityTag string) *ResourcesFeaturesListCall { 17303 c.ifNoneMatch_ = entityTag 17304 return c 17305} 17306 17307// Context sets the context to be used in this call's Do method. Any 17308// pending HTTP request will be aborted if the provided context is 17309// canceled. 17310func (c *ResourcesFeaturesListCall) Context(ctx context.Context) *ResourcesFeaturesListCall { 17311 c.ctx_ = ctx 17312 return c 17313} 17314 17315// Header returns an http.Header that can be modified by the caller to 17316// add HTTP headers to the request. 17317func (c *ResourcesFeaturesListCall) Header() http.Header { 17318 if c.header_ == nil { 17319 c.header_ = make(http.Header) 17320 } 17321 return c.header_ 17322} 17323 17324func (c *ResourcesFeaturesListCall) doRequest(alt string) (*http.Response, error) { 17325 reqHeaders := make(http.Header) 17326 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17327 for k, v := range c.header_ { 17328 reqHeaders[k] = v 17329 } 17330 reqHeaders.Set("User-Agent", c.s.userAgent()) 17331 if c.ifNoneMatch_ != "" { 17332 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17333 } 17334 var body io.Reader = nil 17335 c.urlParams_.Set("alt", alt) 17336 c.urlParams_.Set("prettyPrint", "false") 17337 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features") 17338 urls += "?" + c.urlParams_.Encode() 17339 req, err := http.NewRequest("GET", urls, body) 17340 if err != nil { 17341 return nil, err 17342 } 17343 req.Header = reqHeaders 17344 googleapi.Expand(req.URL, map[string]string{ 17345 "customer": c.customer, 17346 }) 17347 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17348} 17349 17350// Do executes the "directory.resources.features.list" call. 17351// Exactly one of *Features or error will be non-nil. Any non-2xx status 17352// code is an error. Response headers are in either 17353// *Features.ServerResponse.Header or (if a response was returned at 17354// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17355// to check whether the returned error was because 17356// http.StatusNotModified was returned. 17357func (c *ResourcesFeaturesListCall) Do(opts ...googleapi.CallOption) (*Features, error) { 17358 gensupport.SetOptions(c.urlParams_, opts...) 17359 res, err := c.doRequest("json") 17360 if res != nil && res.StatusCode == http.StatusNotModified { 17361 if res.Body != nil { 17362 res.Body.Close() 17363 } 17364 return nil, &googleapi.Error{ 17365 Code: res.StatusCode, 17366 Header: res.Header, 17367 } 17368 } 17369 if err != nil { 17370 return nil, err 17371 } 17372 defer googleapi.CloseBody(res) 17373 if err := googleapi.CheckResponse(res); err != nil { 17374 return nil, err 17375 } 17376 ret := &Features{ 17377 ServerResponse: googleapi.ServerResponse{ 17378 Header: res.Header, 17379 HTTPStatusCode: res.StatusCode, 17380 }, 17381 } 17382 target := &ret 17383 if err := gensupport.DecodeResponse(target, res); err != nil { 17384 return nil, err 17385 } 17386 return ret, nil 17387 // { 17388 // "description": "Retrieves a list of features for an account.", 17389 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features", 17390 // "httpMethod": "GET", 17391 // "id": "directory.resources.features.list", 17392 // "parameterOrder": [ 17393 // "customer" 17394 // ], 17395 // "parameters": { 17396 // "customer": { 17397 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17398 // "location": "path", 17399 // "required": true, 17400 // "type": "string" 17401 // }, 17402 // "maxResults": { 17403 // "description": "Maximum number of results to return.", 17404 // "format": "int32", 17405 // "location": "query", 17406 // "maximum": "500", 17407 // "minimum": "1", 17408 // "type": "integer" 17409 // }, 17410 // "pageToken": { 17411 // "description": "Token to specify the next page in the list.", 17412 // "location": "query", 17413 // "type": "string" 17414 // } 17415 // }, 17416 // "path": "admin/directory/v1/customer/{customer}/resources/features", 17417 // "response": { 17418 // "$ref": "Features" 17419 // }, 17420 // "scopes": [ 17421 // "https://www.googleapis.com/auth/admin.directory.resource.calendar", 17422 // "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly" 17423 // ] 17424 // } 17425 17426} 17427 17428// Pages invokes f for each page of results. 17429// A non-nil error returned from f will halt the iteration. 17430// The provided context supersedes any context provided to the Context method. 17431func (c *ResourcesFeaturesListCall) Pages(ctx context.Context, f func(*Features) error) error { 17432 c.ctx_ = ctx 17433 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 17434 for { 17435 x, err := c.Do() 17436 if err != nil { 17437 return err 17438 } 17439 if err := f(x); err != nil { 17440 return err 17441 } 17442 if x.NextPageToken == "" { 17443 return nil 17444 } 17445 c.PageToken(x.NextPageToken) 17446 } 17447} 17448 17449// method id "directory.resources.features.patch": 17450 17451type ResourcesFeaturesPatchCall struct { 17452 s *Service 17453 customer string 17454 featureKey string 17455 feature *Feature 17456 urlParams_ gensupport.URLParams 17457 ctx_ context.Context 17458 header_ http.Header 17459} 17460 17461// Patch: Patches a feature. 17462// 17463// - customer: The unique ID for the customer's Google Workspace 17464// account. As an account administrator, you can also use the 17465// `my_customer` alias to represent your account's customer ID. 17466// - featureKey: The unique ID of the feature to update. 17467func (r *ResourcesFeaturesService) Patch(customer string, featureKey string, feature *Feature) *ResourcesFeaturesPatchCall { 17468 c := &ResourcesFeaturesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17469 c.customer = customer 17470 c.featureKey = featureKey 17471 c.feature = feature 17472 return c 17473} 17474 17475// Fields allows partial responses to be retrieved. See 17476// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17477// for more information. 17478func (c *ResourcesFeaturesPatchCall) Fields(s ...googleapi.Field) *ResourcesFeaturesPatchCall { 17479 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17480 return c 17481} 17482 17483// Context sets the context to be used in this call's Do method. Any 17484// pending HTTP request will be aborted if the provided context is 17485// canceled. 17486func (c *ResourcesFeaturesPatchCall) Context(ctx context.Context) *ResourcesFeaturesPatchCall { 17487 c.ctx_ = ctx 17488 return c 17489} 17490 17491// Header returns an http.Header that can be modified by the caller to 17492// add HTTP headers to the request. 17493func (c *ResourcesFeaturesPatchCall) Header() http.Header { 17494 if c.header_ == nil { 17495 c.header_ = make(http.Header) 17496 } 17497 return c.header_ 17498} 17499 17500func (c *ResourcesFeaturesPatchCall) doRequest(alt string) (*http.Response, error) { 17501 reqHeaders := make(http.Header) 17502 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17503 for k, v := range c.header_ { 17504 reqHeaders[k] = v 17505 } 17506 reqHeaders.Set("User-Agent", c.s.userAgent()) 17507 var body io.Reader = nil 17508 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 17509 if err != nil { 17510 return nil, err 17511 } 17512 reqHeaders.Set("Content-Type", "application/json") 17513 c.urlParams_.Set("alt", alt) 17514 c.urlParams_.Set("prettyPrint", "false") 17515 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 17516 urls += "?" + c.urlParams_.Encode() 17517 req, err := http.NewRequest("PATCH", urls, body) 17518 if err != nil { 17519 return nil, err 17520 } 17521 req.Header = reqHeaders 17522 googleapi.Expand(req.URL, map[string]string{ 17523 "customer": c.customer, 17524 "featureKey": c.featureKey, 17525 }) 17526 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17527} 17528 17529// Do executes the "directory.resources.features.patch" call. 17530// Exactly one of *Feature or error will be non-nil. Any non-2xx status 17531// code is an error. Response headers are in either 17532// *Feature.ServerResponse.Header or (if a response was returned at all) 17533// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17534// check whether the returned error was because http.StatusNotModified 17535// was returned. 17536func (c *ResourcesFeaturesPatchCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 17537 gensupport.SetOptions(c.urlParams_, opts...) 17538 res, err := c.doRequest("json") 17539 if res != nil && res.StatusCode == http.StatusNotModified { 17540 if res.Body != nil { 17541 res.Body.Close() 17542 } 17543 return nil, &googleapi.Error{ 17544 Code: res.StatusCode, 17545 Header: res.Header, 17546 } 17547 } 17548 if err != nil { 17549 return nil, err 17550 } 17551 defer googleapi.CloseBody(res) 17552 if err := googleapi.CheckResponse(res); err != nil { 17553 return nil, err 17554 } 17555 ret := &Feature{ 17556 ServerResponse: googleapi.ServerResponse{ 17557 Header: res.Header, 17558 HTTPStatusCode: res.StatusCode, 17559 }, 17560 } 17561 target := &ret 17562 if err := gensupport.DecodeResponse(target, res); err != nil { 17563 return nil, err 17564 } 17565 return ret, nil 17566 // { 17567 // "description": "Patches a feature.", 17568 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17569 // "httpMethod": "PATCH", 17570 // "id": "directory.resources.features.patch", 17571 // "parameterOrder": [ 17572 // "customer", 17573 // "featureKey" 17574 // ], 17575 // "parameters": { 17576 // "customer": { 17577 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17578 // "location": "path", 17579 // "required": true, 17580 // "type": "string" 17581 // }, 17582 // "featureKey": { 17583 // "description": "The unique ID of the feature to update.", 17584 // "location": "path", 17585 // "required": true, 17586 // "type": "string" 17587 // } 17588 // }, 17589 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17590 // "request": { 17591 // "$ref": "Feature" 17592 // }, 17593 // "response": { 17594 // "$ref": "Feature" 17595 // }, 17596 // "scopes": [ 17597 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 17598 // ] 17599 // } 17600 17601} 17602 17603// method id "directory.resources.features.rename": 17604 17605type ResourcesFeaturesRenameCall struct { 17606 s *Service 17607 customer string 17608 oldName string 17609 featurerename *FeatureRename 17610 urlParams_ gensupport.URLParams 17611 ctx_ context.Context 17612 header_ http.Header 17613} 17614 17615// Rename: Renames a feature. 17616// 17617// - customer: The unique ID for the customer's Google Workspace 17618// account. As an account administrator, you can also use the 17619// `my_customer` alias to represent your account's customer ID. 17620// - oldName: The unique ID of the feature to rename. 17621func (r *ResourcesFeaturesService) Rename(customer string, oldName string, featurerename *FeatureRename) *ResourcesFeaturesRenameCall { 17622 c := &ResourcesFeaturesRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17623 c.customer = customer 17624 c.oldName = oldName 17625 c.featurerename = featurerename 17626 return c 17627} 17628 17629// Fields allows partial responses to be retrieved. See 17630// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17631// for more information. 17632func (c *ResourcesFeaturesRenameCall) Fields(s ...googleapi.Field) *ResourcesFeaturesRenameCall { 17633 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17634 return c 17635} 17636 17637// Context sets the context to be used in this call's Do method. Any 17638// pending HTTP request will be aborted if the provided context is 17639// canceled. 17640func (c *ResourcesFeaturesRenameCall) Context(ctx context.Context) *ResourcesFeaturesRenameCall { 17641 c.ctx_ = ctx 17642 return c 17643} 17644 17645// Header returns an http.Header that can be modified by the caller to 17646// add HTTP headers to the request. 17647func (c *ResourcesFeaturesRenameCall) Header() http.Header { 17648 if c.header_ == nil { 17649 c.header_ = make(http.Header) 17650 } 17651 return c.header_ 17652} 17653 17654func (c *ResourcesFeaturesRenameCall) doRequest(alt string) (*http.Response, error) { 17655 reqHeaders := make(http.Header) 17656 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17657 for k, v := range c.header_ { 17658 reqHeaders[k] = v 17659 } 17660 reqHeaders.Set("User-Agent", c.s.userAgent()) 17661 var body io.Reader = nil 17662 body, err := googleapi.WithoutDataWrapper.JSONReader(c.featurerename) 17663 if err != nil { 17664 return nil, err 17665 } 17666 reqHeaders.Set("Content-Type", "application/json") 17667 c.urlParams_.Set("alt", alt) 17668 c.urlParams_.Set("prettyPrint", "false") 17669 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename") 17670 urls += "?" + c.urlParams_.Encode() 17671 req, err := http.NewRequest("POST", urls, body) 17672 if err != nil { 17673 return nil, err 17674 } 17675 req.Header = reqHeaders 17676 googleapi.Expand(req.URL, map[string]string{ 17677 "customer": c.customer, 17678 "oldName": c.oldName, 17679 }) 17680 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17681} 17682 17683// Do executes the "directory.resources.features.rename" call. 17684func (c *ResourcesFeaturesRenameCall) Do(opts ...googleapi.CallOption) error { 17685 gensupport.SetOptions(c.urlParams_, opts...) 17686 res, err := c.doRequest("json") 17687 if err != nil { 17688 return err 17689 } 17690 defer googleapi.CloseBody(res) 17691 if err := googleapi.CheckResponse(res); err != nil { 17692 return err 17693 } 17694 return nil 17695 // { 17696 // "description": "Renames a feature.", 17697 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename", 17698 // "httpMethod": "POST", 17699 // "id": "directory.resources.features.rename", 17700 // "parameterOrder": [ 17701 // "customer", 17702 // "oldName" 17703 // ], 17704 // "parameters": { 17705 // "customer": { 17706 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17707 // "location": "path", 17708 // "required": true, 17709 // "type": "string" 17710 // }, 17711 // "oldName": { 17712 // "description": "The unique ID of the feature to rename.", 17713 // "location": "path", 17714 // "required": true, 17715 // "type": "string" 17716 // } 17717 // }, 17718 // "path": "admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename", 17719 // "request": { 17720 // "$ref": "FeatureRename" 17721 // }, 17722 // "scopes": [ 17723 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 17724 // ] 17725 // } 17726 17727} 17728 17729// method id "directory.resources.features.update": 17730 17731type ResourcesFeaturesUpdateCall struct { 17732 s *Service 17733 customer string 17734 featureKey string 17735 feature *Feature 17736 urlParams_ gensupport.URLParams 17737 ctx_ context.Context 17738 header_ http.Header 17739} 17740 17741// Update: Updates a feature. 17742// 17743// - customer: The unique ID for the customer's Google Workspace 17744// account. As an account administrator, you can also use the 17745// `my_customer` alias to represent your account's customer ID. 17746// - featureKey: The unique ID of the feature to update. 17747func (r *ResourcesFeaturesService) Update(customer string, featureKey string, feature *Feature) *ResourcesFeaturesUpdateCall { 17748 c := &ResourcesFeaturesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17749 c.customer = customer 17750 c.featureKey = featureKey 17751 c.feature = feature 17752 return c 17753} 17754 17755// Fields allows partial responses to be retrieved. See 17756// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17757// for more information. 17758func (c *ResourcesFeaturesUpdateCall) Fields(s ...googleapi.Field) *ResourcesFeaturesUpdateCall { 17759 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17760 return c 17761} 17762 17763// Context sets the context to be used in this call's Do method. Any 17764// pending HTTP request will be aborted if the provided context is 17765// canceled. 17766func (c *ResourcesFeaturesUpdateCall) Context(ctx context.Context) *ResourcesFeaturesUpdateCall { 17767 c.ctx_ = ctx 17768 return c 17769} 17770 17771// Header returns an http.Header that can be modified by the caller to 17772// add HTTP headers to the request. 17773func (c *ResourcesFeaturesUpdateCall) Header() http.Header { 17774 if c.header_ == nil { 17775 c.header_ = make(http.Header) 17776 } 17777 return c.header_ 17778} 17779 17780func (c *ResourcesFeaturesUpdateCall) doRequest(alt string) (*http.Response, error) { 17781 reqHeaders := make(http.Header) 17782 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17783 for k, v := range c.header_ { 17784 reqHeaders[k] = v 17785 } 17786 reqHeaders.Set("User-Agent", c.s.userAgent()) 17787 var body io.Reader = nil 17788 body, err := googleapi.WithoutDataWrapper.JSONReader(c.feature) 17789 if err != nil { 17790 return nil, err 17791 } 17792 reqHeaders.Set("Content-Type", "application/json") 17793 c.urlParams_.Set("alt", alt) 17794 c.urlParams_.Set("prettyPrint", "false") 17795 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/resources/features/{featureKey}") 17796 urls += "?" + c.urlParams_.Encode() 17797 req, err := http.NewRequest("PUT", urls, body) 17798 if err != nil { 17799 return nil, err 17800 } 17801 req.Header = reqHeaders 17802 googleapi.Expand(req.URL, map[string]string{ 17803 "customer": c.customer, 17804 "featureKey": c.featureKey, 17805 }) 17806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17807} 17808 17809// Do executes the "directory.resources.features.update" call. 17810// Exactly one of *Feature or error will be non-nil. Any non-2xx status 17811// code is an error. Response headers are in either 17812// *Feature.ServerResponse.Header or (if a response was returned at all) 17813// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17814// check whether the returned error was because http.StatusNotModified 17815// was returned. 17816func (c *ResourcesFeaturesUpdateCall) Do(opts ...googleapi.CallOption) (*Feature, error) { 17817 gensupport.SetOptions(c.urlParams_, opts...) 17818 res, err := c.doRequest("json") 17819 if res != nil && res.StatusCode == http.StatusNotModified { 17820 if res.Body != nil { 17821 res.Body.Close() 17822 } 17823 return nil, &googleapi.Error{ 17824 Code: res.StatusCode, 17825 Header: res.Header, 17826 } 17827 } 17828 if err != nil { 17829 return nil, err 17830 } 17831 defer googleapi.CloseBody(res) 17832 if err := googleapi.CheckResponse(res); err != nil { 17833 return nil, err 17834 } 17835 ret := &Feature{ 17836 ServerResponse: googleapi.ServerResponse{ 17837 Header: res.Header, 17838 HTTPStatusCode: res.StatusCode, 17839 }, 17840 } 17841 target := &ret 17842 if err := gensupport.DecodeResponse(target, res); err != nil { 17843 return nil, err 17844 } 17845 return ret, nil 17846 // { 17847 // "description": "Updates a feature.", 17848 // "flatPath": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17849 // "httpMethod": "PUT", 17850 // "id": "directory.resources.features.update", 17851 // "parameterOrder": [ 17852 // "customer", 17853 // "featureKey" 17854 // ], 17855 // "parameters": { 17856 // "customer": { 17857 // "description": "The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's customer ID.", 17858 // "location": "path", 17859 // "required": true, 17860 // "type": "string" 17861 // }, 17862 // "featureKey": { 17863 // "description": "The unique ID of the feature to update.", 17864 // "location": "path", 17865 // "required": true, 17866 // "type": "string" 17867 // } 17868 // }, 17869 // "path": "admin/directory/v1/customer/{customer}/resources/features/{featureKey}", 17870 // "request": { 17871 // "$ref": "Feature" 17872 // }, 17873 // "response": { 17874 // "$ref": "Feature" 17875 // }, 17876 // "scopes": [ 17877 // "https://www.googleapis.com/auth/admin.directory.resource.calendar" 17878 // ] 17879 // } 17880 17881} 17882 17883// method id "directory.roleAssignments.delete": 17884 17885type RoleAssignmentsDeleteCall struct { 17886 s *Service 17887 customer string 17888 roleAssignmentId string 17889 urlParams_ gensupport.URLParams 17890 ctx_ context.Context 17891 header_ http.Header 17892} 17893 17894// Delete: Deletes a role assignment. 17895// 17896// - customer: Immutable ID of the Google Workspace account. 17897// - roleAssignmentId: Immutable ID of the role assignment. 17898func (r *RoleAssignmentsService) Delete(customer string, roleAssignmentId string) *RoleAssignmentsDeleteCall { 17899 c := &RoleAssignmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17900 c.customer = customer 17901 c.roleAssignmentId = roleAssignmentId 17902 return c 17903} 17904 17905// Fields allows partial responses to be retrieved. See 17906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17907// for more information. 17908func (c *RoleAssignmentsDeleteCall) Fields(s ...googleapi.Field) *RoleAssignmentsDeleteCall { 17909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17910 return c 17911} 17912 17913// Context sets the context to be used in this call's Do method. Any 17914// pending HTTP request will be aborted if the provided context is 17915// canceled. 17916func (c *RoleAssignmentsDeleteCall) Context(ctx context.Context) *RoleAssignmentsDeleteCall { 17917 c.ctx_ = ctx 17918 return c 17919} 17920 17921// Header returns an http.Header that can be modified by the caller to 17922// add HTTP headers to the request. 17923func (c *RoleAssignmentsDeleteCall) Header() http.Header { 17924 if c.header_ == nil { 17925 c.header_ = make(http.Header) 17926 } 17927 return c.header_ 17928} 17929 17930func (c *RoleAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { 17931 reqHeaders := make(http.Header) 17932 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 17933 for k, v := range c.header_ { 17934 reqHeaders[k] = v 17935 } 17936 reqHeaders.Set("User-Agent", c.s.userAgent()) 17937 var body io.Reader = nil 17938 c.urlParams_.Set("alt", alt) 17939 c.urlParams_.Set("prettyPrint", "false") 17940 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") 17941 urls += "?" + c.urlParams_.Encode() 17942 req, err := http.NewRequest("DELETE", urls, body) 17943 if err != nil { 17944 return nil, err 17945 } 17946 req.Header = reqHeaders 17947 googleapi.Expand(req.URL, map[string]string{ 17948 "customer": c.customer, 17949 "roleAssignmentId": c.roleAssignmentId, 17950 }) 17951 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17952} 17953 17954// Do executes the "directory.roleAssignments.delete" call. 17955func (c *RoleAssignmentsDeleteCall) Do(opts ...googleapi.CallOption) error { 17956 gensupport.SetOptions(c.urlParams_, opts...) 17957 res, err := c.doRequest("json") 17958 if err != nil { 17959 return err 17960 } 17961 defer googleapi.CloseBody(res) 17962 if err := googleapi.CheckResponse(res); err != nil { 17963 return err 17964 } 17965 return nil 17966 // { 17967 // "description": "Deletes a role assignment.", 17968 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 17969 // "httpMethod": "DELETE", 17970 // "id": "directory.roleAssignments.delete", 17971 // "parameterOrder": [ 17972 // "customer", 17973 // "roleAssignmentId" 17974 // ], 17975 // "parameters": { 17976 // "customer": { 17977 // "description": "Immutable ID of the Google Workspace account.", 17978 // "location": "path", 17979 // "required": true, 17980 // "type": "string" 17981 // }, 17982 // "roleAssignmentId": { 17983 // "description": "Immutable ID of the role assignment.", 17984 // "location": "path", 17985 // "required": true, 17986 // "type": "string" 17987 // } 17988 // }, 17989 // "path": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 17990 // "scopes": [ 17991 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 17992 // ] 17993 // } 17994 17995} 17996 17997// method id "directory.roleAssignments.get": 17998 17999type RoleAssignmentsGetCall struct { 18000 s *Service 18001 customer string 18002 roleAssignmentId string 18003 urlParams_ gensupport.URLParams 18004 ifNoneMatch_ string 18005 ctx_ context.Context 18006 header_ http.Header 18007} 18008 18009// Get: Retrieves a role assignment. 18010// 18011// - customer: Immutable ID of the Google Workspace account. 18012// - roleAssignmentId: Immutable ID of the role assignment. 18013func (r *RoleAssignmentsService) Get(customer string, roleAssignmentId string) *RoleAssignmentsGetCall { 18014 c := &RoleAssignmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18015 c.customer = customer 18016 c.roleAssignmentId = roleAssignmentId 18017 return c 18018} 18019 18020// Fields allows partial responses to be retrieved. See 18021// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18022// for more information. 18023func (c *RoleAssignmentsGetCall) Fields(s ...googleapi.Field) *RoleAssignmentsGetCall { 18024 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18025 return c 18026} 18027 18028// IfNoneMatch sets the optional parameter which makes the operation 18029// fail if the object's ETag matches the given value. This is useful for 18030// getting updates only after the object has changed since the last 18031// request. Use googleapi.IsNotModified to check whether the response 18032// error from Do is the result of In-None-Match. 18033func (c *RoleAssignmentsGetCall) IfNoneMatch(entityTag string) *RoleAssignmentsGetCall { 18034 c.ifNoneMatch_ = entityTag 18035 return c 18036} 18037 18038// Context sets the context to be used in this call's Do method. Any 18039// pending HTTP request will be aborted if the provided context is 18040// canceled. 18041func (c *RoleAssignmentsGetCall) Context(ctx context.Context) *RoleAssignmentsGetCall { 18042 c.ctx_ = ctx 18043 return c 18044} 18045 18046// Header returns an http.Header that can be modified by the caller to 18047// add HTTP headers to the request. 18048func (c *RoleAssignmentsGetCall) Header() http.Header { 18049 if c.header_ == nil { 18050 c.header_ = make(http.Header) 18051 } 18052 return c.header_ 18053} 18054 18055func (c *RoleAssignmentsGetCall) doRequest(alt string) (*http.Response, error) { 18056 reqHeaders := make(http.Header) 18057 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18058 for k, v := range c.header_ { 18059 reqHeaders[k] = v 18060 } 18061 reqHeaders.Set("User-Agent", c.s.userAgent()) 18062 if c.ifNoneMatch_ != "" { 18063 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18064 } 18065 var body io.Reader = nil 18066 c.urlParams_.Set("alt", alt) 18067 c.urlParams_.Set("prettyPrint", "false") 18068 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}") 18069 urls += "?" + c.urlParams_.Encode() 18070 req, err := http.NewRequest("GET", urls, body) 18071 if err != nil { 18072 return nil, err 18073 } 18074 req.Header = reqHeaders 18075 googleapi.Expand(req.URL, map[string]string{ 18076 "customer": c.customer, 18077 "roleAssignmentId": c.roleAssignmentId, 18078 }) 18079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18080} 18081 18082// Do executes the "directory.roleAssignments.get" call. 18083// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx 18084// status code is an error. Response headers are in either 18085// *RoleAssignment.ServerResponse.Header or (if a response was returned 18086// at all) in error.(*googleapi.Error).Header. Use 18087// googleapi.IsNotModified to check whether the returned error was 18088// because http.StatusNotModified was returned. 18089func (c *RoleAssignmentsGetCall) Do(opts ...googleapi.CallOption) (*RoleAssignment, error) { 18090 gensupport.SetOptions(c.urlParams_, opts...) 18091 res, err := c.doRequest("json") 18092 if res != nil && res.StatusCode == http.StatusNotModified { 18093 if res.Body != nil { 18094 res.Body.Close() 18095 } 18096 return nil, &googleapi.Error{ 18097 Code: res.StatusCode, 18098 Header: res.Header, 18099 } 18100 } 18101 if err != nil { 18102 return nil, err 18103 } 18104 defer googleapi.CloseBody(res) 18105 if err := googleapi.CheckResponse(res); err != nil { 18106 return nil, err 18107 } 18108 ret := &RoleAssignment{ 18109 ServerResponse: googleapi.ServerResponse{ 18110 Header: res.Header, 18111 HTTPStatusCode: res.StatusCode, 18112 }, 18113 } 18114 target := &ret 18115 if err := gensupport.DecodeResponse(target, res); err != nil { 18116 return nil, err 18117 } 18118 return ret, nil 18119 // { 18120 // "description": "Retrieves a role assignment.", 18121 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 18122 // "httpMethod": "GET", 18123 // "id": "directory.roleAssignments.get", 18124 // "parameterOrder": [ 18125 // "customer", 18126 // "roleAssignmentId" 18127 // ], 18128 // "parameters": { 18129 // "customer": { 18130 // "description": "Immutable ID of the Google Workspace account.", 18131 // "location": "path", 18132 // "required": true, 18133 // "type": "string" 18134 // }, 18135 // "roleAssignmentId": { 18136 // "description": "Immutable ID of the role assignment.", 18137 // "location": "path", 18138 // "required": true, 18139 // "type": "string" 18140 // } 18141 // }, 18142 // "path": "admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}", 18143 // "response": { 18144 // "$ref": "RoleAssignment" 18145 // }, 18146 // "scopes": [ 18147 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 18148 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 18149 // ] 18150 // } 18151 18152} 18153 18154// method id "directory.roleAssignments.insert": 18155 18156type RoleAssignmentsInsertCall struct { 18157 s *Service 18158 customer string 18159 roleassignment *RoleAssignment 18160 urlParams_ gensupport.URLParams 18161 ctx_ context.Context 18162 header_ http.Header 18163} 18164 18165// Insert: Creates a role assignment. 18166// 18167// - customer: Immutable ID of the Google Workspace account. 18168func (r *RoleAssignmentsService) Insert(customer string, roleassignment *RoleAssignment) *RoleAssignmentsInsertCall { 18169 c := &RoleAssignmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18170 c.customer = customer 18171 c.roleassignment = roleassignment 18172 return c 18173} 18174 18175// Fields allows partial responses to be retrieved. See 18176// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18177// for more information. 18178func (c *RoleAssignmentsInsertCall) Fields(s ...googleapi.Field) *RoleAssignmentsInsertCall { 18179 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18180 return c 18181} 18182 18183// Context sets the context to be used in this call's Do method. Any 18184// pending HTTP request will be aborted if the provided context is 18185// canceled. 18186func (c *RoleAssignmentsInsertCall) Context(ctx context.Context) *RoleAssignmentsInsertCall { 18187 c.ctx_ = ctx 18188 return c 18189} 18190 18191// Header returns an http.Header that can be modified by the caller to 18192// add HTTP headers to the request. 18193func (c *RoleAssignmentsInsertCall) Header() http.Header { 18194 if c.header_ == nil { 18195 c.header_ = make(http.Header) 18196 } 18197 return c.header_ 18198} 18199 18200func (c *RoleAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { 18201 reqHeaders := make(http.Header) 18202 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18203 for k, v := range c.header_ { 18204 reqHeaders[k] = v 18205 } 18206 reqHeaders.Set("User-Agent", c.s.userAgent()) 18207 var body io.Reader = nil 18208 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roleassignment) 18209 if err != nil { 18210 return nil, err 18211 } 18212 reqHeaders.Set("Content-Type", "application/json") 18213 c.urlParams_.Set("alt", alt) 18214 c.urlParams_.Set("prettyPrint", "false") 18215 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments") 18216 urls += "?" + c.urlParams_.Encode() 18217 req, err := http.NewRequest("POST", urls, body) 18218 if err != nil { 18219 return nil, err 18220 } 18221 req.Header = reqHeaders 18222 googleapi.Expand(req.URL, map[string]string{ 18223 "customer": c.customer, 18224 }) 18225 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18226} 18227 18228// Do executes the "directory.roleAssignments.insert" call. 18229// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx 18230// status code is an error. Response headers are in either 18231// *RoleAssignment.ServerResponse.Header or (if a response was returned 18232// at all) in error.(*googleapi.Error).Header. Use 18233// googleapi.IsNotModified to check whether the returned error was 18234// because http.StatusNotModified was returned. 18235func (c *RoleAssignmentsInsertCall) Do(opts ...googleapi.CallOption) (*RoleAssignment, error) { 18236 gensupport.SetOptions(c.urlParams_, opts...) 18237 res, err := c.doRequest("json") 18238 if res != nil && res.StatusCode == http.StatusNotModified { 18239 if res.Body != nil { 18240 res.Body.Close() 18241 } 18242 return nil, &googleapi.Error{ 18243 Code: res.StatusCode, 18244 Header: res.Header, 18245 } 18246 } 18247 if err != nil { 18248 return nil, err 18249 } 18250 defer googleapi.CloseBody(res) 18251 if err := googleapi.CheckResponse(res); err != nil { 18252 return nil, err 18253 } 18254 ret := &RoleAssignment{ 18255 ServerResponse: googleapi.ServerResponse{ 18256 Header: res.Header, 18257 HTTPStatusCode: res.StatusCode, 18258 }, 18259 } 18260 target := &ret 18261 if err := gensupport.DecodeResponse(target, res); err != nil { 18262 return nil, err 18263 } 18264 return ret, nil 18265 // { 18266 // "description": "Creates a role assignment.", 18267 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments", 18268 // "httpMethod": "POST", 18269 // "id": "directory.roleAssignments.insert", 18270 // "parameterOrder": [ 18271 // "customer" 18272 // ], 18273 // "parameters": { 18274 // "customer": { 18275 // "description": "Immutable ID of the Google Workspace account.", 18276 // "location": "path", 18277 // "required": true, 18278 // "type": "string" 18279 // } 18280 // }, 18281 // "path": "admin/directory/v1/customer/{customer}/roleassignments", 18282 // "request": { 18283 // "$ref": "RoleAssignment" 18284 // }, 18285 // "response": { 18286 // "$ref": "RoleAssignment" 18287 // }, 18288 // "scopes": [ 18289 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 18290 // ] 18291 // } 18292 18293} 18294 18295// method id "directory.roleAssignments.list": 18296 18297type RoleAssignmentsListCall struct { 18298 s *Service 18299 customer string 18300 urlParams_ gensupport.URLParams 18301 ifNoneMatch_ string 18302 ctx_ context.Context 18303 header_ http.Header 18304} 18305 18306// List: Retrieves a paginated list of all roleAssignments. 18307// 18308// - customer: Immutable ID of the Google Workspace account. 18309func (r *RoleAssignmentsService) List(customer string) *RoleAssignmentsListCall { 18310 c := &RoleAssignmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18311 c.customer = customer 18312 return c 18313} 18314 18315// MaxResults sets the optional parameter "maxResults": Maximum number 18316// of results to return. 18317func (c *RoleAssignmentsListCall) MaxResults(maxResults int64) *RoleAssignmentsListCall { 18318 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 18319 return c 18320} 18321 18322// PageToken sets the optional parameter "pageToken": Token to specify 18323// the next page in the list. 18324func (c *RoleAssignmentsListCall) PageToken(pageToken string) *RoleAssignmentsListCall { 18325 c.urlParams_.Set("pageToken", pageToken) 18326 return c 18327} 18328 18329// RoleId sets the optional parameter "roleId": Immutable ID of a role. 18330// If included in the request, returns only role assignments containing 18331// this role ID. 18332func (c *RoleAssignmentsListCall) RoleId(roleId string) *RoleAssignmentsListCall { 18333 c.urlParams_.Set("roleId", roleId) 18334 return c 18335} 18336 18337// UserKey sets the optional parameter "userKey": The user's primary 18338// email address, alias email address, or unique user ID. If included in 18339// the request, returns role assignments only for this user. 18340func (c *RoleAssignmentsListCall) UserKey(userKey string) *RoleAssignmentsListCall { 18341 c.urlParams_.Set("userKey", userKey) 18342 return c 18343} 18344 18345// Fields allows partial responses to be retrieved. See 18346// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18347// for more information. 18348func (c *RoleAssignmentsListCall) Fields(s ...googleapi.Field) *RoleAssignmentsListCall { 18349 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18350 return c 18351} 18352 18353// IfNoneMatch sets the optional parameter which makes the operation 18354// fail if the object's ETag matches the given value. This is useful for 18355// getting updates only after the object has changed since the last 18356// request. Use googleapi.IsNotModified to check whether the response 18357// error from Do is the result of In-None-Match. 18358func (c *RoleAssignmentsListCall) IfNoneMatch(entityTag string) *RoleAssignmentsListCall { 18359 c.ifNoneMatch_ = entityTag 18360 return c 18361} 18362 18363// Context sets the context to be used in this call's Do method. Any 18364// pending HTTP request will be aborted if the provided context is 18365// canceled. 18366func (c *RoleAssignmentsListCall) Context(ctx context.Context) *RoleAssignmentsListCall { 18367 c.ctx_ = ctx 18368 return c 18369} 18370 18371// Header returns an http.Header that can be modified by the caller to 18372// add HTTP headers to the request. 18373func (c *RoleAssignmentsListCall) Header() http.Header { 18374 if c.header_ == nil { 18375 c.header_ = make(http.Header) 18376 } 18377 return c.header_ 18378} 18379 18380func (c *RoleAssignmentsListCall) doRequest(alt string) (*http.Response, error) { 18381 reqHeaders := make(http.Header) 18382 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18383 for k, v := range c.header_ { 18384 reqHeaders[k] = v 18385 } 18386 reqHeaders.Set("User-Agent", c.s.userAgent()) 18387 if c.ifNoneMatch_ != "" { 18388 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18389 } 18390 var body io.Reader = nil 18391 c.urlParams_.Set("alt", alt) 18392 c.urlParams_.Set("prettyPrint", "false") 18393 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roleassignments") 18394 urls += "?" + c.urlParams_.Encode() 18395 req, err := http.NewRequest("GET", urls, body) 18396 if err != nil { 18397 return nil, err 18398 } 18399 req.Header = reqHeaders 18400 googleapi.Expand(req.URL, map[string]string{ 18401 "customer": c.customer, 18402 }) 18403 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18404} 18405 18406// Do executes the "directory.roleAssignments.list" call. 18407// Exactly one of *RoleAssignments or error will be non-nil. Any non-2xx 18408// status code is an error. Response headers are in either 18409// *RoleAssignments.ServerResponse.Header or (if a response was returned 18410// at all) in error.(*googleapi.Error).Header. Use 18411// googleapi.IsNotModified to check whether the returned error was 18412// because http.StatusNotModified was returned. 18413func (c *RoleAssignmentsListCall) Do(opts ...googleapi.CallOption) (*RoleAssignments, error) { 18414 gensupport.SetOptions(c.urlParams_, opts...) 18415 res, err := c.doRequest("json") 18416 if res != nil && res.StatusCode == http.StatusNotModified { 18417 if res.Body != nil { 18418 res.Body.Close() 18419 } 18420 return nil, &googleapi.Error{ 18421 Code: res.StatusCode, 18422 Header: res.Header, 18423 } 18424 } 18425 if err != nil { 18426 return nil, err 18427 } 18428 defer googleapi.CloseBody(res) 18429 if err := googleapi.CheckResponse(res); err != nil { 18430 return nil, err 18431 } 18432 ret := &RoleAssignments{ 18433 ServerResponse: googleapi.ServerResponse{ 18434 Header: res.Header, 18435 HTTPStatusCode: res.StatusCode, 18436 }, 18437 } 18438 target := &ret 18439 if err := gensupport.DecodeResponse(target, res); err != nil { 18440 return nil, err 18441 } 18442 return ret, nil 18443 // { 18444 // "description": "Retrieves a paginated list of all roleAssignments.", 18445 // "flatPath": "admin/directory/v1/customer/{customer}/roleassignments", 18446 // "httpMethod": "GET", 18447 // "id": "directory.roleAssignments.list", 18448 // "parameterOrder": [ 18449 // "customer" 18450 // ], 18451 // "parameters": { 18452 // "customer": { 18453 // "description": "Immutable ID of the Google Workspace account.", 18454 // "location": "path", 18455 // "required": true, 18456 // "type": "string" 18457 // }, 18458 // "maxResults": { 18459 // "description": "Maximum number of results to return.", 18460 // "format": "int32", 18461 // "location": "query", 18462 // "maximum": "200", 18463 // "minimum": "1", 18464 // "type": "integer" 18465 // }, 18466 // "pageToken": { 18467 // "description": "Token to specify the next page in the list.", 18468 // "location": "query", 18469 // "type": "string" 18470 // }, 18471 // "roleId": { 18472 // "description": "Immutable ID of a role. If included in the request, returns only role assignments containing this role ID.", 18473 // "location": "query", 18474 // "type": "string" 18475 // }, 18476 // "userKey": { 18477 // "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.", 18478 // "location": "query", 18479 // "type": "string" 18480 // } 18481 // }, 18482 // "path": "admin/directory/v1/customer/{customer}/roleassignments", 18483 // "response": { 18484 // "$ref": "RoleAssignments" 18485 // }, 18486 // "scopes": [ 18487 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 18488 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 18489 // ] 18490 // } 18491 18492} 18493 18494// Pages invokes f for each page of results. 18495// A non-nil error returned from f will halt the iteration. 18496// The provided context supersedes any context provided to the Context method. 18497func (c *RoleAssignmentsListCall) Pages(ctx context.Context, f func(*RoleAssignments) error) error { 18498 c.ctx_ = ctx 18499 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 18500 for { 18501 x, err := c.Do() 18502 if err != nil { 18503 return err 18504 } 18505 if err := f(x); err != nil { 18506 return err 18507 } 18508 if x.NextPageToken == "" { 18509 return nil 18510 } 18511 c.PageToken(x.NextPageToken) 18512 } 18513} 18514 18515// method id "directory.roles.delete": 18516 18517type RolesDeleteCall struct { 18518 s *Service 18519 customer string 18520 roleId string 18521 urlParams_ gensupport.URLParams 18522 ctx_ context.Context 18523 header_ http.Header 18524} 18525 18526// Delete: Deletes a role. 18527// 18528// - customer: Immutable ID of the Google Workspace account. 18529// - roleId: Immutable ID of the role. 18530func (r *RolesService) Delete(customer string, roleId string) *RolesDeleteCall { 18531 c := &RolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18532 c.customer = customer 18533 c.roleId = roleId 18534 return c 18535} 18536 18537// Fields allows partial responses to be retrieved. See 18538// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18539// for more information. 18540func (c *RolesDeleteCall) Fields(s ...googleapi.Field) *RolesDeleteCall { 18541 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18542 return c 18543} 18544 18545// Context sets the context to be used in this call's Do method. Any 18546// pending HTTP request will be aborted if the provided context is 18547// canceled. 18548func (c *RolesDeleteCall) Context(ctx context.Context) *RolesDeleteCall { 18549 c.ctx_ = ctx 18550 return c 18551} 18552 18553// Header returns an http.Header that can be modified by the caller to 18554// add HTTP headers to the request. 18555func (c *RolesDeleteCall) Header() http.Header { 18556 if c.header_ == nil { 18557 c.header_ = make(http.Header) 18558 } 18559 return c.header_ 18560} 18561 18562func (c *RolesDeleteCall) doRequest(alt string) (*http.Response, error) { 18563 reqHeaders := make(http.Header) 18564 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18565 for k, v := range c.header_ { 18566 reqHeaders[k] = v 18567 } 18568 reqHeaders.Set("User-Agent", c.s.userAgent()) 18569 var body io.Reader = nil 18570 c.urlParams_.Set("alt", alt) 18571 c.urlParams_.Set("prettyPrint", "false") 18572 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 18573 urls += "?" + c.urlParams_.Encode() 18574 req, err := http.NewRequest("DELETE", urls, body) 18575 if err != nil { 18576 return nil, err 18577 } 18578 req.Header = reqHeaders 18579 googleapi.Expand(req.URL, map[string]string{ 18580 "customer": c.customer, 18581 "roleId": c.roleId, 18582 }) 18583 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18584} 18585 18586// Do executes the "directory.roles.delete" call. 18587func (c *RolesDeleteCall) Do(opts ...googleapi.CallOption) error { 18588 gensupport.SetOptions(c.urlParams_, opts...) 18589 res, err := c.doRequest("json") 18590 if err != nil { 18591 return err 18592 } 18593 defer googleapi.CloseBody(res) 18594 if err := googleapi.CheckResponse(res); err != nil { 18595 return err 18596 } 18597 return nil 18598 // { 18599 // "description": "Deletes a role.", 18600 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 18601 // "httpMethod": "DELETE", 18602 // "id": "directory.roles.delete", 18603 // "parameterOrder": [ 18604 // "customer", 18605 // "roleId" 18606 // ], 18607 // "parameters": { 18608 // "customer": { 18609 // "description": "Immutable ID of the Google Workspace account.", 18610 // "location": "path", 18611 // "required": true, 18612 // "type": "string" 18613 // }, 18614 // "roleId": { 18615 // "description": "Immutable ID of the role.", 18616 // "location": "path", 18617 // "required": true, 18618 // "type": "string" 18619 // } 18620 // }, 18621 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 18622 // "scopes": [ 18623 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 18624 // ] 18625 // } 18626 18627} 18628 18629// method id "directory.roles.get": 18630 18631type RolesGetCall struct { 18632 s *Service 18633 customer string 18634 roleId string 18635 urlParams_ gensupport.URLParams 18636 ifNoneMatch_ string 18637 ctx_ context.Context 18638 header_ http.Header 18639} 18640 18641// Get: Retrieves a role. 18642// 18643// - customer: Immutable ID of the Google Workspace account. 18644// - roleId: Immutable ID of the role. 18645func (r *RolesService) Get(customer string, roleId string) *RolesGetCall { 18646 c := &RolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18647 c.customer = customer 18648 c.roleId = roleId 18649 return c 18650} 18651 18652// Fields allows partial responses to be retrieved. See 18653// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18654// for more information. 18655func (c *RolesGetCall) Fields(s ...googleapi.Field) *RolesGetCall { 18656 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18657 return c 18658} 18659 18660// IfNoneMatch sets the optional parameter which makes the operation 18661// fail if the object's ETag matches the given value. This is useful for 18662// getting updates only after the object has changed since the last 18663// request. Use googleapi.IsNotModified to check whether the response 18664// error from Do is the result of In-None-Match. 18665func (c *RolesGetCall) IfNoneMatch(entityTag string) *RolesGetCall { 18666 c.ifNoneMatch_ = entityTag 18667 return c 18668} 18669 18670// Context sets the context to be used in this call's Do method. Any 18671// pending HTTP request will be aborted if the provided context is 18672// canceled. 18673func (c *RolesGetCall) Context(ctx context.Context) *RolesGetCall { 18674 c.ctx_ = ctx 18675 return c 18676} 18677 18678// Header returns an http.Header that can be modified by the caller to 18679// add HTTP headers to the request. 18680func (c *RolesGetCall) Header() http.Header { 18681 if c.header_ == nil { 18682 c.header_ = make(http.Header) 18683 } 18684 return c.header_ 18685} 18686 18687func (c *RolesGetCall) doRequest(alt string) (*http.Response, error) { 18688 reqHeaders := make(http.Header) 18689 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18690 for k, v := range c.header_ { 18691 reqHeaders[k] = v 18692 } 18693 reqHeaders.Set("User-Agent", c.s.userAgent()) 18694 if c.ifNoneMatch_ != "" { 18695 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 18696 } 18697 var body io.Reader = nil 18698 c.urlParams_.Set("alt", alt) 18699 c.urlParams_.Set("prettyPrint", "false") 18700 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 18701 urls += "?" + c.urlParams_.Encode() 18702 req, err := http.NewRequest("GET", urls, body) 18703 if err != nil { 18704 return nil, err 18705 } 18706 req.Header = reqHeaders 18707 googleapi.Expand(req.URL, map[string]string{ 18708 "customer": c.customer, 18709 "roleId": c.roleId, 18710 }) 18711 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18712} 18713 18714// Do executes the "directory.roles.get" call. 18715// Exactly one of *Role or error will be non-nil. Any non-2xx status 18716// code is an error. Response headers are in either 18717// *Role.ServerResponse.Header or (if a response was returned at all) in 18718// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 18719// whether the returned error was because http.StatusNotModified was 18720// returned. 18721func (c *RolesGetCall) Do(opts ...googleapi.CallOption) (*Role, error) { 18722 gensupport.SetOptions(c.urlParams_, opts...) 18723 res, err := c.doRequest("json") 18724 if res != nil && res.StatusCode == http.StatusNotModified { 18725 if res.Body != nil { 18726 res.Body.Close() 18727 } 18728 return nil, &googleapi.Error{ 18729 Code: res.StatusCode, 18730 Header: res.Header, 18731 } 18732 } 18733 if err != nil { 18734 return nil, err 18735 } 18736 defer googleapi.CloseBody(res) 18737 if err := googleapi.CheckResponse(res); err != nil { 18738 return nil, err 18739 } 18740 ret := &Role{ 18741 ServerResponse: googleapi.ServerResponse{ 18742 Header: res.Header, 18743 HTTPStatusCode: res.StatusCode, 18744 }, 18745 } 18746 target := &ret 18747 if err := gensupport.DecodeResponse(target, res); err != nil { 18748 return nil, err 18749 } 18750 return ret, nil 18751 // { 18752 // "description": "Retrieves a role.", 18753 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 18754 // "httpMethod": "GET", 18755 // "id": "directory.roles.get", 18756 // "parameterOrder": [ 18757 // "customer", 18758 // "roleId" 18759 // ], 18760 // "parameters": { 18761 // "customer": { 18762 // "description": "Immutable ID of the Google Workspace account.", 18763 // "location": "path", 18764 // "required": true, 18765 // "type": "string" 18766 // }, 18767 // "roleId": { 18768 // "description": "Immutable ID of the role.", 18769 // "location": "path", 18770 // "required": true, 18771 // "type": "string" 18772 // } 18773 // }, 18774 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 18775 // "response": { 18776 // "$ref": "Role" 18777 // }, 18778 // "scopes": [ 18779 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 18780 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 18781 // ] 18782 // } 18783 18784} 18785 18786// method id "directory.roles.insert": 18787 18788type RolesInsertCall struct { 18789 s *Service 18790 customer string 18791 role *Role 18792 urlParams_ gensupport.URLParams 18793 ctx_ context.Context 18794 header_ http.Header 18795} 18796 18797// Insert: Creates a role. 18798// 18799// - customer: Immutable ID of the Google Workspace account. 18800func (r *RolesService) Insert(customer string, role *Role) *RolesInsertCall { 18801 c := &RolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18802 c.customer = customer 18803 c.role = role 18804 return c 18805} 18806 18807// Fields allows partial responses to be retrieved. See 18808// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18809// for more information. 18810func (c *RolesInsertCall) Fields(s ...googleapi.Field) *RolesInsertCall { 18811 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18812 return c 18813} 18814 18815// Context sets the context to be used in this call's Do method. Any 18816// pending HTTP request will be aborted if the provided context is 18817// canceled. 18818func (c *RolesInsertCall) Context(ctx context.Context) *RolesInsertCall { 18819 c.ctx_ = ctx 18820 return c 18821} 18822 18823// Header returns an http.Header that can be modified by the caller to 18824// add HTTP headers to the request. 18825func (c *RolesInsertCall) Header() http.Header { 18826 if c.header_ == nil { 18827 c.header_ = make(http.Header) 18828 } 18829 return c.header_ 18830} 18831 18832func (c *RolesInsertCall) doRequest(alt string) (*http.Response, error) { 18833 reqHeaders := make(http.Header) 18834 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18835 for k, v := range c.header_ { 18836 reqHeaders[k] = v 18837 } 18838 reqHeaders.Set("User-Agent", c.s.userAgent()) 18839 var body io.Reader = nil 18840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 18841 if err != nil { 18842 return nil, err 18843 } 18844 reqHeaders.Set("Content-Type", "application/json") 18845 c.urlParams_.Set("alt", alt) 18846 c.urlParams_.Set("prettyPrint", "false") 18847 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles") 18848 urls += "?" + c.urlParams_.Encode() 18849 req, err := http.NewRequest("POST", urls, body) 18850 if err != nil { 18851 return nil, err 18852 } 18853 req.Header = reqHeaders 18854 googleapi.Expand(req.URL, map[string]string{ 18855 "customer": c.customer, 18856 }) 18857 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18858} 18859 18860// Do executes the "directory.roles.insert" call. 18861// Exactly one of *Role or error will be non-nil. Any non-2xx status 18862// code is an error. Response headers are in either 18863// *Role.ServerResponse.Header or (if a response was returned at all) in 18864// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 18865// whether the returned error was because http.StatusNotModified was 18866// returned. 18867func (c *RolesInsertCall) Do(opts ...googleapi.CallOption) (*Role, error) { 18868 gensupport.SetOptions(c.urlParams_, opts...) 18869 res, err := c.doRequest("json") 18870 if res != nil && res.StatusCode == http.StatusNotModified { 18871 if res.Body != nil { 18872 res.Body.Close() 18873 } 18874 return nil, &googleapi.Error{ 18875 Code: res.StatusCode, 18876 Header: res.Header, 18877 } 18878 } 18879 if err != nil { 18880 return nil, err 18881 } 18882 defer googleapi.CloseBody(res) 18883 if err := googleapi.CheckResponse(res); err != nil { 18884 return nil, err 18885 } 18886 ret := &Role{ 18887 ServerResponse: googleapi.ServerResponse{ 18888 Header: res.Header, 18889 HTTPStatusCode: res.StatusCode, 18890 }, 18891 } 18892 target := &ret 18893 if err := gensupport.DecodeResponse(target, res); err != nil { 18894 return nil, err 18895 } 18896 return ret, nil 18897 // { 18898 // "description": "Creates a role.", 18899 // "flatPath": "admin/directory/v1/customer/{customer}/roles", 18900 // "httpMethod": "POST", 18901 // "id": "directory.roles.insert", 18902 // "parameterOrder": [ 18903 // "customer" 18904 // ], 18905 // "parameters": { 18906 // "customer": { 18907 // "description": "Immutable ID of the Google Workspace account.", 18908 // "location": "path", 18909 // "required": true, 18910 // "type": "string" 18911 // } 18912 // }, 18913 // "path": "admin/directory/v1/customer/{customer}/roles", 18914 // "request": { 18915 // "$ref": "Role" 18916 // }, 18917 // "response": { 18918 // "$ref": "Role" 18919 // }, 18920 // "scopes": [ 18921 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 18922 // ] 18923 // } 18924 18925} 18926 18927// method id "directory.roles.list": 18928 18929type RolesListCall struct { 18930 s *Service 18931 customer string 18932 urlParams_ gensupport.URLParams 18933 ifNoneMatch_ string 18934 ctx_ context.Context 18935 header_ http.Header 18936} 18937 18938// List: Retrieves a paginated list of all the roles in a domain. 18939// 18940// - customer: Immutable ID of the Google Workspace account. 18941func (r *RolesService) List(customer string) *RolesListCall { 18942 c := &RolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18943 c.customer = customer 18944 return c 18945} 18946 18947// MaxResults sets the optional parameter "maxResults": Maximum number 18948// of results to return. 18949func (c *RolesListCall) MaxResults(maxResults int64) *RolesListCall { 18950 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 18951 return c 18952} 18953 18954// PageToken sets the optional parameter "pageToken": Token to specify 18955// the next page in the list. 18956func (c *RolesListCall) PageToken(pageToken string) *RolesListCall { 18957 c.urlParams_.Set("pageToken", pageToken) 18958 return c 18959} 18960 18961// Fields allows partial responses to be retrieved. See 18962// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 18963// for more information. 18964func (c *RolesListCall) Fields(s ...googleapi.Field) *RolesListCall { 18965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18966 return c 18967} 18968 18969// IfNoneMatch sets the optional parameter which makes the operation 18970// fail if the object's ETag matches the given value. This is useful for 18971// getting updates only after the object has changed since the last 18972// request. Use googleapi.IsNotModified to check whether the response 18973// error from Do is the result of In-None-Match. 18974func (c *RolesListCall) IfNoneMatch(entityTag string) *RolesListCall { 18975 c.ifNoneMatch_ = entityTag 18976 return c 18977} 18978 18979// Context sets the context to be used in this call's Do method. Any 18980// pending HTTP request will be aborted if the provided context is 18981// canceled. 18982func (c *RolesListCall) Context(ctx context.Context) *RolesListCall { 18983 c.ctx_ = ctx 18984 return c 18985} 18986 18987// Header returns an http.Header that can be modified by the caller to 18988// add HTTP headers to the request. 18989func (c *RolesListCall) Header() http.Header { 18990 if c.header_ == nil { 18991 c.header_ = make(http.Header) 18992 } 18993 return c.header_ 18994} 18995 18996func (c *RolesListCall) doRequest(alt string) (*http.Response, error) { 18997 reqHeaders := make(http.Header) 18998 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 18999 for k, v := range c.header_ { 19000 reqHeaders[k] = v 19001 } 19002 reqHeaders.Set("User-Agent", c.s.userAgent()) 19003 if c.ifNoneMatch_ != "" { 19004 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19005 } 19006 var body io.Reader = nil 19007 c.urlParams_.Set("alt", alt) 19008 c.urlParams_.Set("prettyPrint", "false") 19009 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles") 19010 urls += "?" + c.urlParams_.Encode() 19011 req, err := http.NewRequest("GET", urls, body) 19012 if err != nil { 19013 return nil, err 19014 } 19015 req.Header = reqHeaders 19016 googleapi.Expand(req.URL, map[string]string{ 19017 "customer": c.customer, 19018 }) 19019 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19020} 19021 19022// Do executes the "directory.roles.list" call. 19023// Exactly one of *Roles or error will be non-nil. Any non-2xx status 19024// code is an error. Response headers are in either 19025// *Roles.ServerResponse.Header or (if a response was returned at all) 19026// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19027// check whether the returned error was because http.StatusNotModified 19028// was returned. 19029func (c *RolesListCall) Do(opts ...googleapi.CallOption) (*Roles, error) { 19030 gensupport.SetOptions(c.urlParams_, opts...) 19031 res, err := c.doRequest("json") 19032 if res != nil && res.StatusCode == http.StatusNotModified { 19033 if res.Body != nil { 19034 res.Body.Close() 19035 } 19036 return nil, &googleapi.Error{ 19037 Code: res.StatusCode, 19038 Header: res.Header, 19039 } 19040 } 19041 if err != nil { 19042 return nil, err 19043 } 19044 defer googleapi.CloseBody(res) 19045 if err := googleapi.CheckResponse(res); err != nil { 19046 return nil, err 19047 } 19048 ret := &Roles{ 19049 ServerResponse: googleapi.ServerResponse{ 19050 Header: res.Header, 19051 HTTPStatusCode: res.StatusCode, 19052 }, 19053 } 19054 target := &ret 19055 if err := gensupport.DecodeResponse(target, res); err != nil { 19056 return nil, err 19057 } 19058 return ret, nil 19059 // { 19060 // "description": "Retrieves a paginated list of all the roles in a domain.", 19061 // "flatPath": "admin/directory/v1/customer/{customer}/roles", 19062 // "httpMethod": "GET", 19063 // "id": "directory.roles.list", 19064 // "parameterOrder": [ 19065 // "customer" 19066 // ], 19067 // "parameters": { 19068 // "customer": { 19069 // "description": "Immutable ID of the Google Workspace account.", 19070 // "location": "path", 19071 // "required": true, 19072 // "type": "string" 19073 // }, 19074 // "maxResults": { 19075 // "description": "Maximum number of results to return.", 19076 // "format": "int32", 19077 // "location": "query", 19078 // "maximum": "100", 19079 // "minimum": "1", 19080 // "type": "integer" 19081 // }, 19082 // "pageToken": { 19083 // "description": "Token to specify the next page in the list.", 19084 // "location": "query", 19085 // "type": "string" 19086 // } 19087 // }, 19088 // "path": "admin/directory/v1/customer/{customer}/roles", 19089 // "response": { 19090 // "$ref": "Roles" 19091 // }, 19092 // "scopes": [ 19093 // "https://www.googleapis.com/auth/admin.directory.rolemanagement", 19094 // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" 19095 // ] 19096 // } 19097 19098} 19099 19100// Pages invokes f for each page of results. 19101// A non-nil error returned from f will halt the iteration. 19102// The provided context supersedes any context provided to the Context method. 19103func (c *RolesListCall) Pages(ctx context.Context, f func(*Roles) error) error { 19104 c.ctx_ = ctx 19105 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 19106 for { 19107 x, err := c.Do() 19108 if err != nil { 19109 return err 19110 } 19111 if err := f(x); err != nil { 19112 return err 19113 } 19114 if x.NextPageToken == "" { 19115 return nil 19116 } 19117 c.PageToken(x.NextPageToken) 19118 } 19119} 19120 19121// method id "directory.roles.patch": 19122 19123type RolesPatchCall struct { 19124 s *Service 19125 customer string 19126 roleId string 19127 role *Role 19128 urlParams_ gensupport.URLParams 19129 ctx_ context.Context 19130 header_ http.Header 19131} 19132 19133// Patch: Patches a role. 19134// 19135// - customer: Immutable ID of the Google Workspace account. 19136// - roleId: Immutable ID of the role. 19137func (r *RolesService) Patch(customer string, roleId string, role *Role) *RolesPatchCall { 19138 c := &RolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19139 c.customer = customer 19140 c.roleId = roleId 19141 c.role = role 19142 return c 19143} 19144 19145// Fields allows partial responses to be retrieved. See 19146// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19147// for more information. 19148func (c *RolesPatchCall) Fields(s ...googleapi.Field) *RolesPatchCall { 19149 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19150 return c 19151} 19152 19153// Context sets the context to be used in this call's Do method. Any 19154// pending HTTP request will be aborted if the provided context is 19155// canceled. 19156func (c *RolesPatchCall) Context(ctx context.Context) *RolesPatchCall { 19157 c.ctx_ = ctx 19158 return c 19159} 19160 19161// Header returns an http.Header that can be modified by the caller to 19162// add HTTP headers to the request. 19163func (c *RolesPatchCall) Header() http.Header { 19164 if c.header_ == nil { 19165 c.header_ = make(http.Header) 19166 } 19167 return c.header_ 19168} 19169 19170func (c *RolesPatchCall) doRequest(alt string) (*http.Response, error) { 19171 reqHeaders := make(http.Header) 19172 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19173 for k, v := range c.header_ { 19174 reqHeaders[k] = v 19175 } 19176 reqHeaders.Set("User-Agent", c.s.userAgent()) 19177 var body io.Reader = nil 19178 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 19179 if err != nil { 19180 return nil, err 19181 } 19182 reqHeaders.Set("Content-Type", "application/json") 19183 c.urlParams_.Set("alt", alt) 19184 c.urlParams_.Set("prettyPrint", "false") 19185 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 19186 urls += "?" + c.urlParams_.Encode() 19187 req, err := http.NewRequest("PATCH", urls, body) 19188 if err != nil { 19189 return nil, err 19190 } 19191 req.Header = reqHeaders 19192 googleapi.Expand(req.URL, map[string]string{ 19193 "customer": c.customer, 19194 "roleId": c.roleId, 19195 }) 19196 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19197} 19198 19199// Do executes the "directory.roles.patch" call. 19200// Exactly one of *Role or error will be non-nil. Any non-2xx status 19201// code is an error. Response headers are in either 19202// *Role.ServerResponse.Header or (if a response was returned at all) in 19203// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 19204// whether the returned error was because http.StatusNotModified was 19205// returned. 19206func (c *RolesPatchCall) Do(opts ...googleapi.CallOption) (*Role, error) { 19207 gensupport.SetOptions(c.urlParams_, opts...) 19208 res, err := c.doRequest("json") 19209 if res != nil && res.StatusCode == http.StatusNotModified { 19210 if res.Body != nil { 19211 res.Body.Close() 19212 } 19213 return nil, &googleapi.Error{ 19214 Code: res.StatusCode, 19215 Header: res.Header, 19216 } 19217 } 19218 if err != nil { 19219 return nil, err 19220 } 19221 defer googleapi.CloseBody(res) 19222 if err := googleapi.CheckResponse(res); err != nil { 19223 return nil, err 19224 } 19225 ret := &Role{ 19226 ServerResponse: googleapi.ServerResponse{ 19227 Header: res.Header, 19228 HTTPStatusCode: res.StatusCode, 19229 }, 19230 } 19231 target := &ret 19232 if err := gensupport.DecodeResponse(target, res); err != nil { 19233 return nil, err 19234 } 19235 return ret, nil 19236 // { 19237 // "description": "Patches a role.", 19238 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 19239 // "httpMethod": "PATCH", 19240 // "id": "directory.roles.patch", 19241 // "parameterOrder": [ 19242 // "customer", 19243 // "roleId" 19244 // ], 19245 // "parameters": { 19246 // "customer": { 19247 // "description": "Immutable ID of the Google Workspace account.", 19248 // "location": "path", 19249 // "required": true, 19250 // "type": "string" 19251 // }, 19252 // "roleId": { 19253 // "description": "Immutable ID of the role.", 19254 // "location": "path", 19255 // "required": true, 19256 // "type": "string" 19257 // } 19258 // }, 19259 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 19260 // "request": { 19261 // "$ref": "Role" 19262 // }, 19263 // "response": { 19264 // "$ref": "Role" 19265 // }, 19266 // "scopes": [ 19267 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 19268 // ] 19269 // } 19270 19271} 19272 19273// method id "directory.roles.update": 19274 19275type RolesUpdateCall struct { 19276 s *Service 19277 customer string 19278 roleId string 19279 role *Role 19280 urlParams_ gensupport.URLParams 19281 ctx_ context.Context 19282 header_ http.Header 19283} 19284 19285// Update: Updates a role. 19286// 19287// - customer: Immutable ID of the Google Workspace account. 19288// - roleId: Immutable ID of the role. 19289func (r *RolesService) Update(customer string, roleId string, role *Role) *RolesUpdateCall { 19290 c := &RolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19291 c.customer = customer 19292 c.roleId = roleId 19293 c.role = role 19294 return c 19295} 19296 19297// Fields allows partial responses to be retrieved. See 19298// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19299// for more information. 19300func (c *RolesUpdateCall) Fields(s ...googleapi.Field) *RolesUpdateCall { 19301 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19302 return c 19303} 19304 19305// Context sets the context to be used in this call's Do method. Any 19306// pending HTTP request will be aborted if the provided context is 19307// canceled. 19308func (c *RolesUpdateCall) Context(ctx context.Context) *RolesUpdateCall { 19309 c.ctx_ = ctx 19310 return c 19311} 19312 19313// Header returns an http.Header that can be modified by the caller to 19314// add HTTP headers to the request. 19315func (c *RolesUpdateCall) Header() http.Header { 19316 if c.header_ == nil { 19317 c.header_ = make(http.Header) 19318 } 19319 return c.header_ 19320} 19321 19322func (c *RolesUpdateCall) doRequest(alt string) (*http.Response, error) { 19323 reqHeaders := make(http.Header) 19324 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19325 for k, v := range c.header_ { 19326 reqHeaders[k] = v 19327 } 19328 reqHeaders.Set("User-Agent", c.s.userAgent()) 19329 var body io.Reader = nil 19330 body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) 19331 if err != nil { 19332 return nil, err 19333 } 19334 reqHeaders.Set("Content-Type", "application/json") 19335 c.urlParams_.Set("alt", alt) 19336 c.urlParams_.Set("prettyPrint", "false") 19337 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customer}/roles/{roleId}") 19338 urls += "?" + c.urlParams_.Encode() 19339 req, err := http.NewRequest("PUT", urls, body) 19340 if err != nil { 19341 return nil, err 19342 } 19343 req.Header = reqHeaders 19344 googleapi.Expand(req.URL, map[string]string{ 19345 "customer": c.customer, 19346 "roleId": c.roleId, 19347 }) 19348 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19349} 19350 19351// Do executes the "directory.roles.update" call. 19352// Exactly one of *Role or error will be non-nil. Any non-2xx status 19353// code is an error. Response headers are in either 19354// *Role.ServerResponse.Header or (if a response was returned at all) in 19355// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 19356// whether the returned error was because http.StatusNotModified was 19357// returned. 19358func (c *RolesUpdateCall) Do(opts ...googleapi.CallOption) (*Role, error) { 19359 gensupport.SetOptions(c.urlParams_, opts...) 19360 res, err := c.doRequest("json") 19361 if res != nil && res.StatusCode == http.StatusNotModified { 19362 if res.Body != nil { 19363 res.Body.Close() 19364 } 19365 return nil, &googleapi.Error{ 19366 Code: res.StatusCode, 19367 Header: res.Header, 19368 } 19369 } 19370 if err != nil { 19371 return nil, err 19372 } 19373 defer googleapi.CloseBody(res) 19374 if err := googleapi.CheckResponse(res); err != nil { 19375 return nil, err 19376 } 19377 ret := &Role{ 19378 ServerResponse: googleapi.ServerResponse{ 19379 Header: res.Header, 19380 HTTPStatusCode: res.StatusCode, 19381 }, 19382 } 19383 target := &ret 19384 if err := gensupport.DecodeResponse(target, res); err != nil { 19385 return nil, err 19386 } 19387 return ret, nil 19388 // { 19389 // "description": "Updates a role.", 19390 // "flatPath": "admin/directory/v1/customer/{customer}/roles/{roleId}", 19391 // "httpMethod": "PUT", 19392 // "id": "directory.roles.update", 19393 // "parameterOrder": [ 19394 // "customer", 19395 // "roleId" 19396 // ], 19397 // "parameters": { 19398 // "customer": { 19399 // "description": "Immutable ID of the Google Workspace account.", 19400 // "location": "path", 19401 // "required": true, 19402 // "type": "string" 19403 // }, 19404 // "roleId": { 19405 // "description": "Immutable ID of the role.", 19406 // "location": "path", 19407 // "required": true, 19408 // "type": "string" 19409 // } 19410 // }, 19411 // "path": "admin/directory/v1/customer/{customer}/roles/{roleId}", 19412 // "request": { 19413 // "$ref": "Role" 19414 // }, 19415 // "response": { 19416 // "$ref": "Role" 19417 // }, 19418 // "scopes": [ 19419 // "https://www.googleapis.com/auth/admin.directory.rolemanagement" 19420 // ] 19421 // } 19422 19423} 19424 19425// method id "directory.schemas.delete": 19426 19427type SchemasDeleteCall struct { 19428 s *Service 19429 customerId string 19430 schemaKey string 19431 urlParams_ gensupport.URLParams 19432 ctx_ context.Context 19433 header_ http.Header 19434} 19435 19436// Delete: Deletes a schema. 19437// 19438// - customerId: Immutable ID of the Google Workspace account. 19439// - schemaKey: Name or immutable ID of the schema. 19440func (r *SchemasService) Delete(customerId string, schemaKey string) *SchemasDeleteCall { 19441 c := &SchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19442 c.customerId = customerId 19443 c.schemaKey = schemaKey 19444 return c 19445} 19446 19447// Fields allows partial responses to be retrieved. See 19448// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19449// for more information. 19450func (c *SchemasDeleteCall) Fields(s ...googleapi.Field) *SchemasDeleteCall { 19451 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19452 return c 19453} 19454 19455// Context sets the context to be used in this call's Do method. Any 19456// pending HTTP request will be aborted if the provided context is 19457// canceled. 19458func (c *SchemasDeleteCall) Context(ctx context.Context) *SchemasDeleteCall { 19459 c.ctx_ = ctx 19460 return c 19461} 19462 19463// Header returns an http.Header that can be modified by the caller to 19464// add HTTP headers to the request. 19465func (c *SchemasDeleteCall) Header() http.Header { 19466 if c.header_ == nil { 19467 c.header_ = make(http.Header) 19468 } 19469 return c.header_ 19470} 19471 19472func (c *SchemasDeleteCall) doRequest(alt string) (*http.Response, error) { 19473 reqHeaders := make(http.Header) 19474 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19475 for k, v := range c.header_ { 19476 reqHeaders[k] = v 19477 } 19478 reqHeaders.Set("User-Agent", c.s.userAgent()) 19479 var body io.Reader = nil 19480 c.urlParams_.Set("alt", alt) 19481 c.urlParams_.Set("prettyPrint", "false") 19482 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 19483 urls += "?" + c.urlParams_.Encode() 19484 req, err := http.NewRequest("DELETE", urls, body) 19485 if err != nil { 19486 return nil, err 19487 } 19488 req.Header = reqHeaders 19489 googleapi.Expand(req.URL, map[string]string{ 19490 "customerId": c.customerId, 19491 "schemaKey": c.schemaKey, 19492 }) 19493 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19494} 19495 19496// Do executes the "directory.schemas.delete" call. 19497func (c *SchemasDeleteCall) Do(opts ...googleapi.CallOption) error { 19498 gensupport.SetOptions(c.urlParams_, opts...) 19499 res, err := c.doRequest("json") 19500 if err != nil { 19501 return err 19502 } 19503 defer googleapi.CloseBody(res) 19504 if err := googleapi.CheckResponse(res); err != nil { 19505 return err 19506 } 19507 return nil 19508 // { 19509 // "description": "Deletes a schema.", 19510 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 19511 // "httpMethod": "DELETE", 19512 // "id": "directory.schemas.delete", 19513 // "parameterOrder": [ 19514 // "customerId", 19515 // "schemaKey" 19516 // ], 19517 // "parameters": { 19518 // "customerId": { 19519 // "description": "Immutable ID of the Google Workspace account.", 19520 // "location": "path", 19521 // "required": true, 19522 // "type": "string" 19523 // }, 19524 // "schemaKey": { 19525 // "description": "Name or immutable ID of the schema.", 19526 // "location": "path", 19527 // "required": true, 19528 // "type": "string" 19529 // } 19530 // }, 19531 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 19532 // "scopes": [ 19533 // "https://www.googleapis.com/auth/admin.directory.userschema" 19534 // ] 19535 // } 19536 19537} 19538 19539// method id "directory.schemas.get": 19540 19541type SchemasGetCall struct { 19542 s *Service 19543 customerId string 19544 schemaKey string 19545 urlParams_ gensupport.URLParams 19546 ifNoneMatch_ string 19547 ctx_ context.Context 19548 header_ http.Header 19549} 19550 19551// Get: Retrieves a schema. 19552// 19553// - customerId: Immutable ID of the Google Workspace account. 19554// - schemaKey: Name or immutable ID of the schema. 19555func (r *SchemasService) Get(customerId string, schemaKey string) *SchemasGetCall { 19556 c := &SchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19557 c.customerId = customerId 19558 c.schemaKey = schemaKey 19559 return c 19560} 19561 19562// Fields allows partial responses to be retrieved. See 19563// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19564// for more information. 19565func (c *SchemasGetCall) Fields(s ...googleapi.Field) *SchemasGetCall { 19566 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19567 return c 19568} 19569 19570// IfNoneMatch sets the optional parameter which makes the operation 19571// fail if the object's ETag matches the given value. This is useful for 19572// getting updates only after the object has changed since the last 19573// request. Use googleapi.IsNotModified to check whether the response 19574// error from Do is the result of In-None-Match. 19575func (c *SchemasGetCall) IfNoneMatch(entityTag string) *SchemasGetCall { 19576 c.ifNoneMatch_ = entityTag 19577 return c 19578} 19579 19580// Context sets the context to be used in this call's Do method. Any 19581// pending HTTP request will be aborted if the provided context is 19582// canceled. 19583func (c *SchemasGetCall) Context(ctx context.Context) *SchemasGetCall { 19584 c.ctx_ = ctx 19585 return c 19586} 19587 19588// Header returns an http.Header that can be modified by the caller to 19589// add HTTP headers to the request. 19590func (c *SchemasGetCall) Header() http.Header { 19591 if c.header_ == nil { 19592 c.header_ = make(http.Header) 19593 } 19594 return c.header_ 19595} 19596 19597func (c *SchemasGetCall) doRequest(alt string) (*http.Response, error) { 19598 reqHeaders := make(http.Header) 19599 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19600 for k, v := range c.header_ { 19601 reqHeaders[k] = v 19602 } 19603 reqHeaders.Set("User-Agent", c.s.userAgent()) 19604 if c.ifNoneMatch_ != "" { 19605 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19606 } 19607 var body io.Reader = nil 19608 c.urlParams_.Set("alt", alt) 19609 c.urlParams_.Set("prettyPrint", "false") 19610 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 19611 urls += "?" + c.urlParams_.Encode() 19612 req, err := http.NewRequest("GET", urls, body) 19613 if err != nil { 19614 return nil, err 19615 } 19616 req.Header = reqHeaders 19617 googleapi.Expand(req.URL, map[string]string{ 19618 "customerId": c.customerId, 19619 "schemaKey": c.schemaKey, 19620 }) 19621 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19622} 19623 19624// Do executes the "directory.schemas.get" call. 19625// Exactly one of *Schema or error will be non-nil. Any non-2xx status 19626// code is an error. Response headers are in either 19627// *Schema.ServerResponse.Header or (if a response was returned at all) 19628// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19629// check whether the returned error was because http.StatusNotModified 19630// was returned. 19631func (c *SchemasGetCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 19632 gensupport.SetOptions(c.urlParams_, opts...) 19633 res, err := c.doRequest("json") 19634 if res != nil && res.StatusCode == http.StatusNotModified { 19635 if res.Body != nil { 19636 res.Body.Close() 19637 } 19638 return nil, &googleapi.Error{ 19639 Code: res.StatusCode, 19640 Header: res.Header, 19641 } 19642 } 19643 if err != nil { 19644 return nil, err 19645 } 19646 defer googleapi.CloseBody(res) 19647 if err := googleapi.CheckResponse(res); err != nil { 19648 return nil, err 19649 } 19650 ret := &Schema{ 19651 ServerResponse: googleapi.ServerResponse{ 19652 Header: res.Header, 19653 HTTPStatusCode: res.StatusCode, 19654 }, 19655 } 19656 target := &ret 19657 if err := gensupport.DecodeResponse(target, res); err != nil { 19658 return nil, err 19659 } 19660 return ret, nil 19661 // { 19662 // "description": "Retrieves a schema.", 19663 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 19664 // "httpMethod": "GET", 19665 // "id": "directory.schemas.get", 19666 // "parameterOrder": [ 19667 // "customerId", 19668 // "schemaKey" 19669 // ], 19670 // "parameters": { 19671 // "customerId": { 19672 // "description": "Immutable ID of the Google Workspace account.", 19673 // "location": "path", 19674 // "required": true, 19675 // "type": "string" 19676 // }, 19677 // "schemaKey": { 19678 // "description": "Name or immutable ID of the schema.", 19679 // "location": "path", 19680 // "required": true, 19681 // "type": "string" 19682 // } 19683 // }, 19684 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 19685 // "response": { 19686 // "$ref": "Schema" 19687 // }, 19688 // "scopes": [ 19689 // "https://www.googleapis.com/auth/admin.directory.userschema", 19690 // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 19691 // ] 19692 // } 19693 19694} 19695 19696// method id "directory.schemas.insert": 19697 19698type SchemasInsertCall struct { 19699 s *Service 19700 customerId string 19701 schema *Schema 19702 urlParams_ gensupport.URLParams 19703 ctx_ context.Context 19704 header_ http.Header 19705} 19706 19707// Insert: Creates a schema. 19708// 19709// - customerId: Immutable ID of the Google Workspace account. 19710func (r *SchemasService) Insert(customerId string, schema *Schema) *SchemasInsertCall { 19711 c := &SchemasInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19712 c.customerId = customerId 19713 c.schema = schema 19714 return c 19715} 19716 19717// Fields allows partial responses to be retrieved. See 19718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19719// for more information. 19720func (c *SchemasInsertCall) Fields(s ...googleapi.Field) *SchemasInsertCall { 19721 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19722 return c 19723} 19724 19725// Context sets the context to be used in this call's Do method. Any 19726// pending HTTP request will be aborted if the provided context is 19727// canceled. 19728func (c *SchemasInsertCall) Context(ctx context.Context) *SchemasInsertCall { 19729 c.ctx_ = ctx 19730 return c 19731} 19732 19733// Header returns an http.Header that can be modified by the caller to 19734// add HTTP headers to the request. 19735func (c *SchemasInsertCall) Header() http.Header { 19736 if c.header_ == nil { 19737 c.header_ = make(http.Header) 19738 } 19739 return c.header_ 19740} 19741 19742func (c *SchemasInsertCall) doRequest(alt string) (*http.Response, error) { 19743 reqHeaders := make(http.Header) 19744 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19745 for k, v := range c.header_ { 19746 reqHeaders[k] = v 19747 } 19748 reqHeaders.Set("User-Agent", c.s.userAgent()) 19749 var body io.Reader = nil 19750 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 19751 if err != nil { 19752 return nil, err 19753 } 19754 reqHeaders.Set("Content-Type", "application/json") 19755 c.urlParams_.Set("alt", alt) 19756 c.urlParams_.Set("prettyPrint", "false") 19757 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas") 19758 urls += "?" + c.urlParams_.Encode() 19759 req, err := http.NewRequest("POST", urls, body) 19760 if err != nil { 19761 return nil, err 19762 } 19763 req.Header = reqHeaders 19764 googleapi.Expand(req.URL, map[string]string{ 19765 "customerId": c.customerId, 19766 }) 19767 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19768} 19769 19770// Do executes the "directory.schemas.insert" call. 19771// Exactly one of *Schema or error will be non-nil. Any non-2xx status 19772// code is an error. Response headers are in either 19773// *Schema.ServerResponse.Header or (if a response was returned at all) 19774// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19775// check whether the returned error was because http.StatusNotModified 19776// was returned. 19777func (c *SchemasInsertCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 19778 gensupport.SetOptions(c.urlParams_, opts...) 19779 res, err := c.doRequest("json") 19780 if res != nil && res.StatusCode == http.StatusNotModified { 19781 if res.Body != nil { 19782 res.Body.Close() 19783 } 19784 return nil, &googleapi.Error{ 19785 Code: res.StatusCode, 19786 Header: res.Header, 19787 } 19788 } 19789 if err != nil { 19790 return nil, err 19791 } 19792 defer googleapi.CloseBody(res) 19793 if err := googleapi.CheckResponse(res); err != nil { 19794 return nil, err 19795 } 19796 ret := &Schema{ 19797 ServerResponse: googleapi.ServerResponse{ 19798 Header: res.Header, 19799 HTTPStatusCode: res.StatusCode, 19800 }, 19801 } 19802 target := &ret 19803 if err := gensupport.DecodeResponse(target, res); err != nil { 19804 return nil, err 19805 } 19806 return ret, nil 19807 // { 19808 // "description": "Creates a schema.", 19809 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas", 19810 // "httpMethod": "POST", 19811 // "id": "directory.schemas.insert", 19812 // "parameterOrder": [ 19813 // "customerId" 19814 // ], 19815 // "parameters": { 19816 // "customerId": { 19817 // "description": "Immutable ID of the Google Workspace account.", 19818 // "location": "path", 19819 // "required": true, 19820 // "type": "string" 19821 // } 19822 // }, 19823 // "path": "admin/directory/v1/customer/{customerId}/schemas", 19824 // "request": { 19825 // "$ref": "Schema" 19826 // }, 19827 // "response": { 19828 // "$ref": "Schema" 19829 // }, 19830 // "scopes": [ 19831 // "https://www.googleapis.com/auth/admin.directory.userschema" 19832 // ] 19833 // } 19834 19835} 19836 19837// method id "directory.schemas.list": 19838 19839type SchemasListCall struct { 19840 s *Service 19841 customerId string 19842 urlParams_ gensupport.URLParams 19843 ifNoneMatch_ string 19844 ctx_ context.Context 19845 header_ http.Header 19846} 19847 19848// List: Retrieves all schemas for a customer. 19849// 19850// - customerId: Immutable ID of the Google Workspace account. 19851func (r *SchemasService) List(customerId string) *SchemasListCall { 19852 c := &SchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 19853 c.customerId = customerId 19854 return c 19855} 19856 19857// Fields allows partial responses to be retrieved. See 19858// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 19859// for more information. 19860func (c *SchemasListCall) Fields(s ...googleapi.Field) *SchemasListCall { 19861 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 19862 return c 19863} 19864 19865// IfNoneMatch sets the optional parameter which makes the operation 19866// fail if the object's ETag matches the given value. This is useful for 19867// getting updates only after the object has changed since the last 19868// request. Use googleapi.IsNotModified to check whether the response 19869// error from Do is the result of In-None-Match. 19870func (c *SchemasListCall) IfNoneMatch(entityTag string) *SchemasListCall { 19871 c.ifNoneMatch_ = entityTag 19872 return c 19873} 19874 19875// Context sets the context to be used in this call's Do method. Any 19876// pending HTTP request will be aborted if the provided context is 19877// canceled. 19878func (c *SchemasListCall) Context(ctx context.Context) *SchemasListCall { 19879 c.ctx_ = ctx 19880 return c 19881} 19882 19883// Header returns an http.Header that can be modified by the caller to 19884// add HTTP headers to the request. 19885func (c *SchemasListCall) Header() http.Header { 19886 if c.header_ == nil { 19887 c.header_ = make(http.Header) 19888 } 19889 return c.header_ 19890} 19891 19892func (c *SchemasListCall) doRequest(alt string) (*http.Response, error) { 19893 reqHeaders := make(http.Header) 19894 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 19895 for k, v := range c.header_ { 19896 reqHeaders[k] = v 19897 } 19898 reqHeaders.Set("User-Agent", c.s.userAgent()) 19899 if c.ifNoneMatch_ != "" { 19900 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 19901 } 19902 var body io.Reader = nil 19903 c.urlParams_.Set("alt", alt) 19904 c.urlParams_.Set("prettyPrint", "false") 19905 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas") 19906 urls += "?" + c.urlParams_.Encode() 19907 req, err := http.NewRequest("GET", urls, body) 19908 if err != nil { 19909 return nil, err 19910 } 19911 req.Header = reqHeaders 19912 googleapi.Expand(req.URL, map[string]string{ 19913 "customerId": c.customerId, 19914 }) 19915 return gensupport.SendRequest(c.ctx_, c.s.client, req) 19916} 19917 19918// Do executes the "directory.schemas.list" call. 19919// Exactly one of *Schemas or error will be non-nil. Any non-2xx status 19920// code is an error. Response headers are in either 19921// *Schemas.ServerResponse.Header or (if a response was returned at all) 19922// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 19923// check whether the returned error was because http.StatusNotModified 19924// was returned. 19925func (c *SchemasListCall) Do(opts ...googleapi.CallOption) (*Schemas, error) { 19926 gensupport.SetOptions(c.urlParams_, opts...) 19927 res, err := c.doRequest("json") 19928 if res != nil && res.StatusCode == http.StatusNotModified { 19929 if res.Body != nil { 19930 res.Body.Close() 19931 } 19932 return nil, &googleapi.Error{ 19933 Code: res.StatusCode, 19934 Header: res.Header, 19935 } 19936 } 19937 if err != nil { 19938 return nil, err 19939 } 19940 defer googleapi.CloseBody(res) 19941 if err := googleapi.CheckResponse(res); err != nil { 19942 return nil, err 19943 } 19944 ret := &Schemas{ 19945 ServerResponse: googleapi.ServerResponse{ 19946 Header: res.Header, 19947 HTTPStatusCode: res.StatusCode, 19948 }, 19949 } 19950 target := &ret 19951 if err := gensupport.DecodeResponse(target, res); err != nil { 19952 return nil, err 19953 } 19954 return ret, nil 19955 // { 19956 // "description": "Retrieves all schemas for a customer.", 19957 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas", 19958 // "httpMethod": "GET", 19959 // "id": "directory.schemas.list", 19960 // "parameterOrder": [ 19961 // "customerId" 19962 // ], 19963 // "parameters": { 19964 // "customerId": { 19965 // "description": "Immutable ID of the Google Workspace account.", 19966 // "location": "path", 19967 // "required": true, 19968 // "type": "string" 19969 // } 19970 // }, 19971 // "path": "admin/directory/v1/customer/{customerId}/schemas", 19972 // "response": { 19973 // "$ref": "Schemas" 19974 // }, 19975 // "scopes": [ 19976 // "https://www.googleapis.com/auth/admin.directory.userschema", 19977 // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" 19978 // ] 19979 // } 19980 19981} 19982 19983// method id "directory.schemas.patch": 19984 19985type SchemasPatchCall struct { 19986 s *Service 19987 customerId string 19988 schemaKey string 19989 schema *Schema 19990 urlParams_ gensupport.URLParams 19991 ctx_ context.Context 19992 header_ http.Header 19993} 19994 19995// Patch: Patches a schema. 19996// 19997// - customerId: Immutable ID of the Google Workspace account. 19998// - schemaKey: Name or immutable ID of the schema. 19999func (r *SchemasService) Patch(customerId string, schemaKey string, schema *Schema) *SchemasPatchCall { 20000 c := &SchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20001 c.customerId = customerId 20002 c.schemaKey = schemaKey 20003 c.schema = schema 20004 return c 20005} 20006 20007// Fields allows partial responses to be retrieved. See 20008// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20009// for more information. 20010func (c *SchemasPatchCall) Fields(s ...googleapi.Field) *SchemasPatchCall { 20011 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20012 return c 20013} 20014 20015// Context sets the context to be used in this call's Do method. Any 20016// pending HTTP request will be aborted if the provided context is 20017// canceled. 20018func (c *SchemasPatchCall) Context(ctx context.Context) *SchemasPatchCall { 20019 c.ctx_ = ctx 20020 return c 20021} 20022 20023// Header returns an http.Header that can be modified by the caller to 20024// add HTTP headers to the request. 20025func (c *SchemasPatchCall) Header() http.Header { 20026 if c.header_ == nil { 20027 c.header_ = make(http.Header) 20028 } 20029 return c.header_ 20030} 20031 20032func (c *SchemasPatchCall) doRequest(alt string) (*http.Response, error) { 20033 reqHeaders := make(http.Header) 20034 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20035 for k, v := range c.header_ { 20036 reqHeaders[k] = v 20037 } 20038 reqHeaders.Set("User-Agent", c.s.userAgent()) 20039 var body io.Reader = nil 20040 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 20041 if err != nil { 20042 return nil, err 20043 } 20044 reqHeaders.Set("Content-Type", "application/json") 20045 c.urlParams_.Set("alt", alt) 20046 c.urlParams_.Set("prettyPrint", "false") 20047 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 20048 urls += "?" + c.urlParams_.Encode() 20049 req, err := http.NewRequest("PATCH", urls, body) 20050 if err != nil { 20051 return nil, err 20052 } 20053 req.Header = reqHeaders 20054 googleapi.Expand(req.URL, map[string]string{ 20055 "customerId": c.customerId, 20056 "schemaKey": c.schemaKey, 20057 }) 20058 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20059} 20060 20061// Do executes the "directory.schemas.patch" call. 20062// Exactly one of *Schema or error will be non-nil. Any non-2xx status 20063// code is an error. Response headers are in either 20064// *Schema.ServerResponse.Header or (if a response was returned at all) 20065// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20066// check whether the returned error was because http.StatusNotModified 20067// was returned. 20068func (c *SchemasPatchCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 20069 gensupport.SetOptions(c.urlParams_, opts...) 20070 res, err := c.doRequest("json") 20071 if res != nil && res.StatusCode == http.StatusNotModified { 20072 if res.Body != nil { 20073 res.Body.Close() 20074 } 20075 return nil, &googleapi.Error{ 20076 Code: res.StatusCode, 20077 Header: res.Header, 20078 } 20079 } 20080 if err != nil { 20081 return nil, err 20082 } 20083 defer googleapi.CloseBody(res) 20084 if err := googleapi.CheckResponse(res); err != nil { 20085 return nil, err 20086 } 20087 ret := &Schema{ 20088 ServerResponse: googleapi.ServerResponse{ 20089 Header: res.Header, 20090 HTTPStatusCode: res.StatusCode, 20091 }, 20092 } 20093 target := &ret 20094 if err := gensupport.DecodeResponse(target, res); err != nil { 20095 return nil, err 20096 } 20097 return ret, nil 20098 // { 20099 // "description": "Patches a schema.", 20100 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 20101 // "httpMethod": "PATCH", 20102 // "id": "directory.schemas.patch", 20103 // "parameterOrder": [ 20104 // "customerId", 20105 // "schemaKey" 20106 // ], 20107 // "parameters": { 20108 // "customerId": { 20109 // "description": "Immutable ID of the Google Workspace account.", 20110 // "location": "path", 20111 // "required": true, 20112 // "type": "string" 20113 // }, 20114 // "schemaKey": { 20115 // "description": "Name or immutable ID of the schema.", 20116 // "location": "path", 20117 // "required": true, 20118 // "type": "string" 20119 // } 20120 // }, 20121 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 20122 // "request": { 20123 // "$ref": "Schema" 20124 // }, 20125 // "response": { 20126 // "$ref": "Schema" 20127 // }, 20128 // "scopes": [ 20129 // "https://www.googleapis.com/auth/admin.directory.userschema" 20130 // ] 20131 // } 20132 20133} 20134 20135// method id "directory.schemas.update": 20136 20137type SchemasUpdateCall struct { 20138 s *Service 20139 customerId string 20140 schemaKey string 20141 schema *Schema 20142 urlParams_ gensupport.URLParams 20143 ctx_ context.Context 20144 header_ http.Header 20145} 20146 20147// Update: Updates a schema. 20148// 20149// - customerId: Immutable ID of the Google Workspace account. 20150// - schemaKey: Name or immutable ID of the schema. 20151func (r *SchemasService) Update(customerId string, schemaKey string, schema *Schema) *SchemasUpdateCall { 20152 c := &SchemasUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20153 c.customerId = customerId 20154 c.schemaKey = schemaKey 20155 c.schema = schema 20156 return c 20157} 20158 20159// Fields allows partial responses to be retrieved. See 20160// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20161// for more information. 20162func (c *SchemasUpdateCall) Fields(s ...googleapi.Field) *SchemasUpdateCall { 20163 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20164 return c 20165} 20166 20167// Context sets the context to be used in this call's Do method. Any 20168// pending HTTP request will be aborted if the provided context is 20169// canceled. 20170func (c *SchemasUpdateCall) Context(ctx context.Context) *SchemasUpdateCall { 20171 c.ctx_ = ctx 20172 return c 20173} 20174 20175// Header returns an http.Header that can be modified by the caller to 20176// add HTTP headers to the request. 20177func (c *SchemasUpdateCall) Header() http.Header { 20178 if c.header_ == nil { 20179 c.header_ = make(http.Header) 20180 } 20181 return c.header_ 20182} 20183 20184func (c *SchemasUpdateCall) doRequest(alt string) (*http.Response, error) { 20185 reqHeaders := make(http.Header) 20186 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20187 for k, v := range c.header_ { 20188 reqHeaders[k] = v 20189 } 20190 reqHeaders.Set("User-Agent", c.s.userAgent()) 20191 var body io.Reader = nil 20192 body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) 20193 if err != nil { 20194 return nil, err 20195 } 20196 reqHeaders.Set("Content-Type", "application/json") 20197 c.urlParams_.Set("alt", alt) 20198 c.urlParams_.Set("prettyPrint", "false") 20199 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}") 20200 urls += "?" + c.urlParams_.Encode() 20201 req, err := http.NewRequest("PUT", urls, body) 20202 if err != nil { 20203 return nil, err 20204 } 20205 req.Header = reqHeaders 20206 googleapi.Expand(req.URL, map[string]string{ 20207 "customerId": c.customerId, 20208 "schemaKey": c.schemaKey, 20209 }) 20210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20211} 20212 20213// Do executes the "directory.schemas.update" call. 20214// Exactly one of *Schema or error will be non-nil. Any non-2xx status 20215// code is an error. Response headers are in either 20216// *Schema.ServerResponse.Header or (if a response was returned at all) 20217// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20218// check whether the returned error was because http.StatusNotModified 20219// was returned. 20220func (c *SchemasUpdateCall) Do(opts ...googleapi.CallOption) (*Schema, error) { 20221 gensupport.SetOptions(c.urlParams_, opts...) 20222 res, err := c.doRequest("json") 20223 if res != nil && res.StatusCode == http.StatusNotModified { 20224 if res.Body != nil { 20225 res.Body.Close() 20226 } 20227 return nil, &googleapi.Error{ 20228 Code: res.StatusCode, 20229 Header: res.Header, 20230 } 20231 } 20232 if err != nil { 20233 return nil, err 20234 } 20235 defer googleapi.CloseBody(res) 20236 if err := googleapi.CheckResponse(res); err != nil { 20237 return nil, err 20238 } 20239 ret := &Schema{ 20240 ServerResponse: googleapi.ServerResponse{ 20241 Header: res.Header, 20242 HTTPStatusCode: res.StatusCode, 20243 }, 20244 } 20245 target := &ret 20246 if err := gensupport.DecodeResponse(target, res); err != nil { 20247 return nil, err 20248 } 20249 return ret, nil 20250 // { 20251 // "description": "Updates a schema.", 20252 // "flatPath": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 20253 // "httpMethod": "PUT", 20254 // "id": "directory.schemas.update", 20255 // "parameterOrder": [ 20256 // "customerId", 20257 // "schemaKey" 20258 // ], 20259 // "parameters": { 20260 // "customerId": { 20261 // "description": "Immutable ID of the Google Workspace account.", 20262 // "location": "path", 20263 // "required": true, 20264 // "type": "string" 20265 // }, 20266 // "schemaKey": { 20267 // "description": "Name or immutable ID of the schema.", 20268 // "location": "path", 20269 // "required": true, 20270 // "type": "string" 20271 // } 20272 // }, 20273 // "path": "admin/directory/v1/customer/{customerId}/schemas/{schemaKey}", 20274 // "request": { 20275 // "$ref": "Schema" 20276 // }, 20277 // "response": { 20278 // "$ref": "Schema" 20279 // }, 20280 // "scopes": [ 20281 // "https://www.googleapis.com/auth/admin.directory.userschema" 20282 // ] 20283 // } 20284 20285} 20286 20287// method id "directory.tokens.delete": 20288 20289type TokensDeleteCall struct { 20290 s *Service 20291 userKey string 20292 clientId string 20293 urlParams_ gensupport.URLParams 20294 ctx_ context.Context 20295 header_ http.Header 20296} 20297 20298// Delete: Deletes all access tokens issued by a user for an 20299// application. 20300// 20301// - clientId: The Client ID of the application the token is issued to. 20302// - userKey: Identifies the user in the API request. The value can be 20303// the user's primary email address, alias email address, or unique 20304// user ID. 20305func (r *TokensService) Delete(userKey string, clientId string) *TokensDeleteCall { 20306 c := &TokensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20307 c.userKey = userKey 20308 c.clientId = clientId 20309 return c 20310} 20311 20312// Fields allows partial responses to be retrieved. See 20313// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20314// for more information. 20315func (c *TokensDeleteCall) Fields(s ...googleapi.Field) *TokensDeleteCall { 20316 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20317 return c 20318} 20319 20320// Context sets the context to be used in this call's Do method. Any 20321// pending HTTP request will be aborted if the provided context is 20322// canceled. 20323func (c *TokensDeleteCall) Context(ctx context.Context) *TokensDeleteCall { 20324 c.ctx_ = ctx 20325 return c 20326} 20327 20328// Header returns an http.Header that can be modified by the caller to 20329// add HTTP headers to the request. 20330func (c *TokensDeleteCall) Header() http.Header { 20331 if c.header_ == nil { 20332 c.header_ = make(http.Header) 20333 } 20334 return c.header_ 20335} 20336 20337func (c *TokensDeleteCall) doRequest(alt string) (*http.Response, error) { 20338 reqHeaders := make(http.Header) 20339 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20340 for k, v := range c.header_ { 20341 reqHeaders[k] = v 20342 } 20343 reqHeaders.Set("User-Agent", c.s.userAgent()) 20344 var body io.Reader = nil 20345 c.urlParams_.Set("alt", alt) 20346 c.urlParams_.Set("prettyPrint", "false") 20347 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") 20348 urls += "?" + c.urlParams_.Encode() 20349 req, err := http.NewRequest("DELETE", urls, body) 20350 if err != nil { 20351 return nil, err 20352 } 20353 req.Header = reqHeaders 20354 googleapi.Expand(req.URL, map[string]string{ 20355 "userKey": c.userKey, 20356 "clientId": c.clientId, 20357 }) 20358 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20359} 20360 20361// Do executes the "directory.tokens.delete" call. 20362func (c *TokensDeleteCall) Do(opts ...googleapi.CallOption) error { 20363 gensupport.SetOptions(c.urlParams_, opts...) 20364 res, err := c.doRequest("json") 20365 if err != nil { 20366 return err 20367 } 20368 defer googleapi.CloseBody(res) 20369 if err := googleapi.CheckResponse(res); err != nil { 20370 return err 20371 } 20372 return nil 20373 // { 20374 // "description": "Deletes all access tokens issued by a user for an application.", 20375 // "flatPath": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 20376 // "httpMethod": "DELETE", 20377 // "id": "directory.tokens.delete", 20378 // "parameterOrder": [ 20379 // "userKey", 20380 // "clientId" 20381 // ], 20382 // "parameters": { 20383 // "clientId": { 20384 // "description": "The Client ID of the application the token is issued to.", 20385 // "location": "path", 20386 // "required": true, 20387 // "type": "string" 20388 // }, 20389 // "userKey": { 20390 // "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.", 20391 // "location": "path", 20392 // "required": true, 20393 // "type": "string" 20394 // } 20395 // }, 20396 // "path": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 20397 // "scopes": [ 20398 // "https://www.googleapis.com/auth/admin.directory.user.security" 20399 // ] 20400 // } 20401 20402} 20403 20404// method id "directory.tokens.get": 20405 20406type TokensGetCall struct { 20407 s *Service 20408 userKey string 20409 clientId string 20410 urlParams_ gensupport.URLParams 20411 ifNoneMatch_ string 20412 ctx_ context.Context 20413 header_ http.Header 20414} 20415 20416// Get: Gets information about an access token issued by a user. 20417// 20418// - clientId: The Client ID of the application the token is issued to. 20419// - userKey: Identifies the user in the API request. The value can be 20420// the user's primary email address, alias email address, or unique 20421// user ID. 20422func (r *TokensService) Get(userKey string, clientId string) *TokensGetCall { 20423 c := &TokensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20424 c.userKey = userKey 20425 c.clientId = clientId 20426 return c 20427} 20428 20429// Fields allows partial responses to be retrieved. See 20430// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20431// for more information. 20432func (c *TokensGetCall) Fields(s ...googleapi.Field) *TokensGetCall { 20433 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20434 return c 20435} 20436 20437// IfNoneMatch sets the optional parameter which makes the operation 20438// fail if the object's ETag matches the given value. This is useful for 20439// getting updates only after the object has changed since the last 20440// request. Use googleapi.IsNotModified to check whether the response 20441// error from Do is the result of In-None-Match. 20442func (c *TokensGetCall) IfNoneMatch(entityTag string) *TokensGetCall { 20443 c.ifNoneMatch_ = entityTag 20444 return c 20445} 20446 20447// Context sets the context to be used in this call's Do method. Any 20448// pending HTTP request will be aborted if the provided context is 20449// canceled. 20450func (c *TokensGetCall) Context(ctx context.Context) *TokensGetCall { 20451 c.ctx_ = ctx 20452 return c 20453} 20454 20455// Header returns an http.Header that can be modified by the caller to 20456// add HTTP headers to the request. 20457func (c *TokensGetCall) Header() http.Header { 20458 if c.header_ == nil { 20459 c.header_ = make(http.Header) 20460 } 20461 return c.header_ 20462} 20463 20464func (c *TokensGetCall) doRequest(alt string) (*http.Response, error) { 20465 reqHeaders := make(http.Header) 20466 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20467 for k, v := range c.header_ { 20468 reqHeaders[k] = v 20469 } 20470 reqHeaders.Set("User-Agent", c.s.userAgent()) 20471 if c.ifNoneMatch_ != "" { 20472 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 20473 } 20474 var body io.Reader = nil 20475 c.urlParams_.Set("alt", alt) 20476 c.urlParams_.Set("prettyPrint", "false") 20477 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens/{clientId}") 20478 urls += "?" + c.urlParams_.Encode() 20479 req, err := http.NewRequest("GET", urls, body) 20480 if err != nil { 20481 return nil, err 20482 } 20483 req.Header = reqHeaders 20484 googleapi.Expand(req.URL, map[string]string{ 20485 "userKey": c.userKey, 20486 "clientId": c.clientId, 20487 }) 20488 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20489} 20490 20491// Do executes the "directory.tokens.get" call. 20492// Exactly one of *Token or error will be non-nil. Any non-2xx status 20493// code is an error. Response headers are in either 20494// *Token.ServerResponse.Header or (if a response was returned at all) 20495// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20496// check whether the returned error was because http.StatusNotModified 20497// was returned. 20498func (c *TokensGetCall) Do(opts ...googleapi.CallOption) (*Token, error) { 20499 gensupport.SetOptions(c.urlParams_, opts...) 20500 res, err := c.doRequest("json") 20501 if res != nil && res.StatusCode == http.StatusNotModified { 20502 if res.Body != nil { 20503 res.Body.Close() 20504 } 20505 return nil, &googleapi.Error{ 20506 Code: res.StatusCode, 20507 Header: res.Header, 20508 } 20509 } 20510 if err != nil { 20511 return nil, err 20512 } 20513 defer googleapi.CloseBody(res) 20514 if err := googleapi.CheckResponse(res); err != nil { 20515 return nil, err 20516 } 20517 ret := &Token{ 20518 ServerResponse: googleapi.ServerResponse{ 20519 Header: res.Header, 20520 HTTPStatusCode: res.StatusCode, 20521 }, 20522 } 20523 target := &ret 20524 if err := gensupport.DecodeResponse(target, res); err != nil { 20525 return nil, err 20526 } 20527 return ret, nil 20528 // { 20529 // "description": "Gets information about an access token issued by a user.", 20530 // "flatPath": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 20531 // "httpMethod": "GET", 20532 // "id": "directory.tokens.get", 20533 // "parameterOrder": [ 20534 // "userKey", 20535 // "clientId" 20536 // ], 20537 // "parameters": { 20538 // "clientId": { 20539 // "description": "The Client ID of the application the token is issued to.", 20540 // "location": "path", 20541 // "required": true, 20542 // "type": "string" 20543 // }, 20544 // "userKey": { 20545 // "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.", 20546 // "location": "path", 20547 // "required": true, 20548 // "type": "string" 20549 // } 20550 // }, 20551 // "path": "admin/directory/v1/users/{userKey}/tokens/{clientId}", 20552 // "response": { 20553 // "$ref": "Token" 20554 // }, 20555 // "scopes": [ 20556 // "https://www.googleapis.com/auth/admin.directory.user.security" 20557 // ] 20558 // } 20559 20560} 20561 20562// method id "directory.tokens.list": 20563 20564type TokensListCall struct { 20565 s *Service 20566 userKey string 20567 urlParams_ gensupport.URLParams 20568 ifNoneMatch_ string 20569 ctx_ context.Context 20570 header_ http.Header 20571} 20572 20573// List: Returns the set of tokens specified user has issued to 3rd 20574// party applications. 20575// 20576// - userKey: Identifies the user in the API request. The value can be 20577// the user's primary email address, alias email address, or unique 20578// user ID. 20579func (r *TokensService) List(userKey string) *TokensListCall { 20580 c := &TokensListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20581 c.userKey = userKey 20582 return c 20583} 20584 20585// Fields allows partial responses to be retrieved. See 20586// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20587// for more information. 20588func (c *TokensListCall) Fields(s ...googleapi.Field) *TokensListCall { 20589 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20590 return c 20591} 20592 20593// IfNoneMatch sets the optional parameter which makes the operation 20594// fail if the object's ETag matches the given value. This is useful for 20595// getting updates only after the object has changed since the last 20596// request. Use googleapi.IsNotModified to check whether the response 20597// error from Do is the result of In-None-Match. 20598func (c *TokensListCall) IfNoneMatch(entityTag string) *TokensListCall { 20599 c.ifNoneMatch_ = entityTag 20600 return c 20601} 20602 20603// Context sets the context to be used in this call's Do method. Any 20604// pending HTTP request will be aborted if the provided context is 20605// canceled. 20606func (c *TokensListCall) Context(ctx context.Context) *TokensListCall { 20607 c.ctx_ = ctx 20608 return c 20609} 20610 20611// Header returns an http.Header that can be modified by the caller to 20612// add HTTP headers to the request. 20613func (c *TokensListCall) Header() http.Header { 20614 if c.header_ == nil { 20615 c.header_ = make(http.Header) 20616 } 20617 return c.header_ 20618} 20619 20620func (c *TokensListCall) doRequest(alt string) (*http.Response, error) { 20621 reqHeaders := make(http.Header) 20622 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20623 for k, v := range c.header_ { 20624 reqHeaders[k] = v 20625 } 20626 reqHeaders.Set("User-Agent", c.s.userAgent()) 20627 if c.ifNoneMatch_ != "" { 20628 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 20629 } 20630 var body io.Reader = nil 20631 c.urlParams_.Set("alt", alt) 20632 c.urlParams_.Set("prettyPrint", "false") 20633 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/tokens") 20634 urls += "?" + c.urlParams_.Encode() 20635 req, err := http.NewRequest("GET", urls, body) 20636 if err != nil { 20637 return nil, err 20638 } 20639 req.Header = reqHeaders 20640 googleapi.Expand(req.URL, map[string]string{ 20641 "userKey": c.userKey, 20642 }) 20643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20644} 20645 20646// Do executes the "directory.tokens.list" call. 20647// Exactly one of *Tokens or error will be non-nil. Any non-2xx status 20648// code is an error. Response headers are in either 20649// *Tokens.ServerResponse.Header or (if a response was returned at all) 20650// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 20651// check whether the returned error was because http.StatusNotModified 20652// was returned. 20653func (c *TokensListCall) Do(opts ...googleapi.CallOption) (*Tokens, error) { 20654 gensupport.SetOptions(c.urlParams_, opts...) 20655 res, err := c.doRequest("json") 20656 if res != nil && res.StatusCode == http.StatusNotModified { 20657 if res.Body != nil { 20658 res.Body.Close() 20659 } 20660 return nil, &googleapi.Error{ 20661 Code: res.StatusCode, 20662 Header: res.Header, 20663 } 20664 } 20665 if err != nil { 20666 return nil, err 20667 } 20668 defer googleapi.CloseBody(res) 20669 if err := googleapi.CheckResponse(res); err != nil { 20670 return nil, err 20671 } 20672 ret := &Tokens{ 20673 ServerResponse: googleapi.ServerResponse{ 20674 Header: res.Header, 20675 HTTPStatusCode: res.StatusCode, 20676 }, 20677 } 20678 target := &ret 20679 if err := gensupport.DecodeResponse(target, res); err != nil { 20680 return nil, err 20681 } 20682 return ret, nil 20683 // { 20684 // "description": "Returns the set of tokens specified user has issued to 3rd party applications.", 20685 // "flatPath": "admin/directory/v1/users/{userKey}/tokens", 20686 // "httpMethod": "GET", 20687 // "id": "directory.tokens.list", 20688 // "parameterOrder": [ 20689 // "userKey" 20690 // ], 20691 // "parameters": { 20692 // "userKey": { 20693 // "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.", 20694 // "location": "path", 20695 // "required": true, 20696 // "type": "string" 20697 // } 20698 // }, 20699 // "path": "admin/directory/v1/users/{userKey}/tokens", 20700 // "response": { 20701 // "$ref": "Tokens" 20702 // }, 20703 // "scopes": [ 20704 // "https://www.googleapis.com/auth/admin.directory.user.security" 20705 // ] 20706 // } 20707 20708} 20709 20710// method id "directory.twoStepVerification.turnOff": 20711 20712type TwoStepVerificationTurnOffCall struct { 20713 s *Service 20714 userKey string 20715 urlParams_ gensupport.URLParams 20716 ctx_ context.Context 20717 header_ http.Header 20718} 20719 20720// TurnOff: Turns off 2-Step Verification for user. 20721// 20722// - userKey: Identifies the user in the API request. The value can be 20723// the user's primary email address, alias email address, or unique 20724// user ID. 20725func (r *TwoStepVerificationService) TurnOff(userKey string) *TwoStepVerificationTurnOffCall { 20726 c := &TwoStepVerificationTurnOffCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20727 c.userKey = userKey 20728 return c 20729} 20730 20731// Fields allows partial responses to be retrieved. See 20732// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20733// for more information. 20734func (c *TwoStepVerificationTurnOffCall) Fields(s ...googleapi.Field) *TwoStepVerificationTurnOffCall { 20735 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20736 return c 20737} 20738 20739// Context sets the context to be used in this call's Do method. Any 20740// pending HTTP request will be aborted if the provided context is 20741// canceled. 20742func (c *TwoStepVerificationTurnOffCall) Context(ctx context.Context) *TwoStepVerificationTurnOffCall { 20743 c.ctx_ = ctx 20744 return c 20745} 20746 20747// Header returns an http.Header that can be modified by the caller to 20748// add HTTP headers to the request. 20749func (c *TwoStepVerificationTurnOffCall) Header() http.Header { 20750 if c.header_ == nil { 20751 c.header_ = make(http.Header) 20752 } 20753 return c.header_ 20754} 20755 20756func (c *TwoStepVerificationTurnOffCall) doRequest(alt string) (*http.Response, error) { 20757 reqHeaders := make(http.Header) 20758 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20759 for k, v := range c.header_ { 20760 reqHeaders[k] = v 20761 } 20762 reqHeaders.Set("User-Agent", c.s.userAgent()) 20763 var body io.Reader = nil 20764 c.urlParams_.Set("alt", alt) 20765 c.urlParams_.Set("prettyPrint", "false") 20766 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff") 20767 urls += "?" + c.urlParams_.Encode() 20768 req, err := http.NewRequest("POST", urls, body) 20769 if err != nil { 20770 return nil, err 20771 } 20772 req.Header = reqHeaders 20773 googleapi.Expand(req.URL, map[string]string{ 20774 "userKey": c.userKey, 20775 }) 20776 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20777} 20778 20779// Do executes the "directory.twoStepVerification.turnOff" call. 20780func (c *TwoStepVerificationTurnOffCall) Do(opts ...googleapi.CallOption) error { 20781 gensupport.SetOptions(c.urlParams_, opts...) 20782 res, err := c.doRequest("json") 20783 if err != nil { 20784 return err 20785 } 20786 defer googleapi.CloseBody(res) 20787 if err := googleapi.CheckResponse(res); err != nil { 20788 return err 20789 } 20790 return nil 20791 // { 20792 // "description": "Turns off 2-Step Verification for user.", 20793 // "flatPath": "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff", 20794 // "httpMethod": "POST", 20795 // "id": "directory.twoStepVerification.turnOff", 20796 // "parameterOrder": [ 20797 // "userKey" 20798 // ], 20799 // "parameters": { 20800 // "userKey": { 20801 // "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.", 20802 // "location": "path", 20803 // "required": true, 20804 // "type": "string" 20805 // } 20806 // }, 20807 // "path": "admin/directory/v1/users/{userKey}/twoStepVerification/turnOff", 20808 // "scopes": [ 20809 // "https://www.googleapis.com/auth/admin.directory.user.security" 20810 // ] 20811 // } 20812 20813} 20814 20815// method id "directory.users.delete": 20816 20817type UsersDeleteCall struct { 20818 s *Service 20819 userKey string 20820 urlParams_ gensupport.URLParams 20821 ctx_ context.Context 20822 header_ http.Header 20823} 20824 20825// Delete: Deletes a user. 20826// 20827// - userKey: Identifies the user in the API request. The value can be 20828// the user's primary email address, alias email address, or unique 20829// user ID. 20830func (r *UsersService) Delete(userKey string) *UsersDeleteCall { 20831 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20832 c.userKey = userKey 20833 return c 20834} 20835 20836// Fields allows partial responses to be retrieved. See 20837// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20838// for more information. 20839func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 20840 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20841 return c 20842} 20843 20844// Context sets the context to be used in this call's Do method. Any 20845// pending HTTP request will be aborted if the provided context is 20846// canceled. 20847func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 20848 c.ctx_ = ctx 20849 return c 20850} 20851 20852// Header returns an http.Header that can be modified by the caller to 20853// add HTTP headers to the request. 20854func (c *UsersDeleteCall) Header() http.Header { 20855 if c.header_ == nil { 20856 c.header_ = make(http.Header) 20857 } 20858 return c.header_ 20859} 20860 20861func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 20862 reqHeaders := make(http.Header) 20863 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 20864 for k, v := range c.header_ { 20865 reqHeaders[k] = v 20866 } 20867 reqHeaders.Set("User-Agent", c.s.userAgent()) 20868 var body io.Reader = nil 20869 c.urlParams_.Set("alt", alt) 20870 c.urlParams_.Set("prettyPrint", "false") 20871 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 20872 urls += "?" + c.urlParams_.Encode() 20873 req, err := http.NewRequest("DELETE", urls, body) 20874 if err != nil { 20875 return nil, err 20876 } 20877 req.Header = reqHeaders 20878 googleapi.Expand(req.URL, map[string]string{ 20879 "userKey": c.userKey, 20880 }) 20881 return gensupport.SendRequest(c.ctx_, c.s.client, req) 20882} 20883 20884// Do executes the "directory.users.delete" call. 20885func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { 20886 gensupport.SetOptions(c.urlParams_, opts...) 20887 res, err := c.doRequest("json") 20888 if err != nil { 20889 return err 20890 } 20891 defer googleapi.CloseBody(res) 20892 if err := googleapi.CheckResponse(res); err != nil { 20893 return err 20894 } 20895 return nil 20896 // { 20897 // "description": "Deletes a user.", 20898 // "flatPath": "admin/directory/v1/users/{userKey}", 20899 // "httpMethod": "DELETE", 20900 // "id": "directory.users.delete", 20901 // "parameterOrder": [ 20902 // "userKey" 20903 // ], 20904 // "parameters": { 20905 // "userKey": { 20906 // "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.", 20907 // "location": "path", 20908 // "required": true, 20909 // "type": "string" 20910 // } 20911 // }, 20912 // "path": "admin/directory/v1/users/{userKey}", 20913 // "scopes": [ 20914 // "https://www.googleapis.com/auth/admin.directory.user" 20915 // ] 20916 // } 20917 20918} 20919 20920// method id "directory.users.get": 20921 20922type UsersGetCall struct { 20923 s *Service 20924 userKey string 20925 urlParams_ gensupport.URLParams 20926 ifNoneMatch_ string 20927 ctx_ context.Context 20928 header_ http.Header 20929} 20930 20931// Get: Retrieves a user. 20932// 20933// - userKey: Identifies the user in the API request. The value can be 20934// the user's primary email address, alias email address, or unique 20935// user ID. 20936func (r *UsersService) Get(userKey string) *UsersGetCall { 20937 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 20938 c.userKey = userKey 20939 return c 20940} 20941 20942// CustomFieldMask sets the optional parameter "customFieldMask": A 20943// comma-separated list of schema names. All fields from these schemas 20944// are fetched. This should only be set when `projection=custom`. 20945func (c *UsersGetCall) CustomFieldMask(customFieldMask string) *UsersGetCall { 20946 c.urlParams_.Set("customFieldMask", customFieldMask) 20947 return c 20948} 20949 20950// Projection sets the optional parameter "projection": What subset of 20951// fields to fetch for this user. 20952// 20953// Possible values: 20954// "basic" (default) - Do not include any custom fields for the user. 20955// "custom" - Include custom fields from schemas requested in 20956// `customFieldMask`. 20957// "full" - Include all fields associated with this user. 20958func (c *UsersGetCall) Projection(projection string) *UsersGetCall { 20959 c.urlParams_.Set("projection", projection) 20960 return c 20961} 20962 20963// ViewType sets the optional parameter "viewType": Whether to fetch the 20964// administrator-only or domain-wide public view of the user. For more 20965// information, see Retrieve a user as a non-administrator 20966// (/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) 20967// . 20968// 20969// Possible values: 20970// "admin_view" (default) - Results include both administrator-only 20971// and domain-public fields for the user. 20972// "domain_public" - Results only include fields for the user that are 20973// publicly visible to other users in the domain. 20974func (c *UsersGetCall) ViewType(viewType string) *UsersGetCall { 20975 c.urlParams_.Set("viewType", viewType) 20976 return c 20977} 20978 20979// Fields allows partial responses to be retrieved. See 20980// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 20981// for more information. 20982func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 20983 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 20984 return c 20985} 20986 20987// IfNoneMatch sets the optional parameter which makes the operation 20988// fail if the object's ETag matches the given value. This is useful for 20989// getting updates only after the object has changed since the last 20990// request. Use googleapi.IsNotModified to check whether the response 20991// error from Do is the result of In-None-Match. 20992func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 20993 c.ifNoneMatch_ = entityTag 20994 return c 20995} 20996 20997// Context sets the context to be used in this call's Do method. Any 20998// pending HTTP request will be aborted if the provided context is 20999// canceled. 21000func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 21001 c.ctx_ = ctx 21002 return c 21003} 21004 21005// Header returns an http.Header that can be modified by the caller to 21006// add HTTP headers to the request. 21007func (c *UsersGetCall) Header() http.Header { 21008 if c.header_ == nil { 21009 c.header_ = make(http.Header) 21010 } 21011 return c.header_ 21012} 21013 21014func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 21015 reqHeaders := make(http.Header) 21016 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21017 for k, v := range c.header_ { 21018 reqHeaders[k] = v 21019 } 21020 reqHeaders.Set("User-Agent", c.s.userAgent()) 21021 if c.ifNoneMatch_ != "" { 21022 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 21023 } 21024 var body io.Reader = nil 21025 c.urlParams_.Set("alt", alt) 21026 c.urlParams_.Set("prettyPrint", "false") 21027 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 21028 urls += "?" + c.urlParams_.Encode() 21029 req, err := http.NewRequest("GET", urls, body) 21030 if err != nil { 21031 return nil, err 21032 } 21033 req.Header = reqHeaders 21034 googleapi.Expand(req.URL, map[string]string{ 21035 "userKey": c.userKey, 21036 }) 21037 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21038} 21039 21040// Do executes the "directory.users.get" call. 21041// Exactly one of *User or error will be non-nil. Any non-2xx status 21042// code is an error. Response headers are in either 21043// *User.ServerResponse.Header or (if a response was returned at all) in 21044// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 21045// whether the returned error was because http.StatusNotModified was 21046// returned. 21047func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 21048 gensupport.SetOptions(c.urlParams_, opts...) 21049 res, err := c.doRequest("json") 21050 if res != nil && res.StatusCode == http.StatusNotModified { 21051 if res.Body != nil { 21052 res.Body.Close() 21053 } 21054 return nil, &googleapi.Error{ 21055 Code: res.StatusCode, 21056 Header: res.Header, 21057 } 21058 } 21059 if err != nil { 21060 return nil, err 21061 } 21062 defer googleapi.CloseBody(res) 21063 if err := googleapi.CheckResponse(res); err != nil { 21064 return nil, err 21065 } 21066 ret := &User{ 21067 ServerResponse: googleapi.ServerResponse{ 21068 Header: res.Header, 21069 HTTPStatusCode: res.StatusCode, 21070 }, 21071 } 21072 target := &ret 21073 if err := gensupport.DecodeResponse(target, res); err != nil { 21074 return nil, err 21075 } 21076 return ret, nil 21077 // { 21078 // "description": "Retrieves a user.", 21079 // "flatPath": "admin/directory/v1/users/{userKey}", 21080 // "httpMethod": "GET", 21081 // "id": "directory.users.get", 21082 // "parameterOrder": [ 21083 // "userKey" 21084 // ], 21085 // "parameters": { 21086 // "customFieldMask": { 21087 // "description": "A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.", 21088 // "location": "query", 21089 // "type": "string" 21090 // }, 21091 // "projection": { 21092 // "default": "basic", 21093 // "description": "What subset of fields to fetch for this user.", 21094 // "enum": [ 21095 // "basic", 21096 // "custom", 21097 // "full" 21098 // ], 21099 // "enumDescriptions": [ 21100 // "Do not include any custom fields for the user.", 21101 // "Include custom fields from schemas requested in `customFieldMask`.", 21102 // "Include all fields associated with this user." 21103 // ], 21104 // "location": "query", 21105 // "type": "string" 21106 // }, 21107 // "userKey": { 21108 // "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.", 21109 // "location": "path", 21110 // "required": true, 21111 // "type": "string" 21112 // }, 21113 // "viewType": { 21114 // "default": "admin_view", 21115 // "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).", 21116 // "enum": [ 21117 // "admin_view", 21118 // "domain_public" 21119 // ], 21120 // "enumDescriptions": [ 21121 // "Results include both administrator-only and domain-public fields for the user.", 21122 // "Results only include fields for the user that are publicly visible to other users in the domain." 21123 // ], 21124 // "location": "query", 21125 // "type": "string" 21126 // } 21127 // }, 21128 // "path": "admin/directory/v1/users/{userKey}", 21129 // "response": { 21130 // "$ref": "User" 21131 // }, 21132 // "scopes": [ 21133 // "https://www.googleapis.com/auth/admin.directory.user", 21134 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 21135 // ] 21136 // } 21137 21138} 21139 21140// method id "directory.users.insert": 21141 21142type UsersInsertCall struct { 21143 s *Service 21144 user *User 21145 urlParams_ gensupport.URLParams 21146 ctx_ context.Context 21147 header_ http.Header 21148} 21149 21150// Insert: Creates a user. 21151func (r *UsersService) Insert(user *User) *UsersInsertCall { 21152 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21153 c.user = user 21154 return c 21155} 21156 21157// Fields allows partial responses to be retrieved. See 21158// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21159// for more information. 21160func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 21161 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21162 return c 21163} 21164 21165// Context sets the context to be used in this call's Do method. Any 21166// pending HTTP request will be aborted if the provided context is 21167// canceled. 21168func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 21169 c.ctx_ = ctx 21170 return c 21171} 21172 21173// Header returns an http.Header that can be modified by the caller to 21174// add HTTP headers to the request. 21175func (c *UsersInsertCall) Header() http.Header { 21176 if c.header_ == nil { 21177 c.header_ = make(http.Header) 21178 } 21179 return c.header_ 21180} 21181 21182func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 21183 reqHeaders := make(http.Header) 21184 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21185 for k, v := range c.header_ { 21186 reqHeaders[k] = v 21187 } 21188 reqHeaders.Set("User-Agent", c.s.userAgent()) 21189 var body io.Reader = nil 21190 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 21191 if err != nil { 21192 return nil, err 21193 } 21194 reqHeaders.Set("Content-Type", "application/json") 21195 c.urlParams_.Set("alt", alt) 21196 c.urlParams_.Set("prettyPrint", "false") 21197 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users") 21198 urls += "?" + c.urlParams_.Encode() 21199 req, err := http.NewRequest("POST", urls, body) 21200 if err != nil { 21201 return nil, err 21202 } 21203 req.Header = reqHeaders 21204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21205} 21206 21207// Do executes the "directory.users.insert" call. 21208// Exactly one of *User or error will be non-nil. Any non-2xx status 21209// code is an error. Response headers are in either 21210// *User.ServerResponse.Header or (if a response was returned at all) in 21211// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 21212// whether the returned error was because http.StatusNotModified was 21213// returned. 21214func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) { 21215 gensupport.SetOptions(c.urlParams_, opts...) 21216 res, err := c.doRequest("json") 21217 if res != nil && res.StatusCode == http.StatusNotModified { 21218 if res.Body != nil { 21219 res.Body.Close() 21220 } 21221 return nil, &googleapi.Error{ 21222 Code: res.StatusCode, 21223 Header: res.Header, 21224 } 21225 } 21226 if err != nil { 21227 return nil, err 21228 } 21229 defer googleapi.CloseBody(res) 21230 if err := googleapi.CheckResponse(res); err != nil { 21231 return nil, err 21232 } 21233 ret := &User{ 21234 ServerResponse: googleapi.ServerResponse{ 21235 Header: res.Header, 21236 HTTPStatusCode: res.StatusCode, 21237 }, 21238 } 21239 target := &ret 21240 if err := gensupport.DecodeResponse(target, res); err != nil { 21241 return nil, err 21242 } 21243 return ret, nil 21244 // { 21245 // "description": "Creates a user.", 21246 // "flatPath": "admin/directory/v1/users", 21247 // "httpMethod": "POST", 21248 // "id": "directory.users.insert", 21249 // "parameterOrder": [], 21250 // "parameters": {}, 21251 // "path": "admin/directory/v1/users", 21252 // "request": { 21253 // "$ref": "User" 21254 // }, 21255 // "response": { 21256 // "$ref": "User" 21257 // }, 21258 // "scopes": [ 21259 // "https://www.googleapis.com/auth/admin.directory.user" 21260 // ] 21261 // } 21262 21263} 21264 21265// method id "directory.users.list": 21266 21267type UsersListCall struct { 21268 s *Service 21269 urlParams_ gensupport.URLParams 21270 ifNoneMatch_ string 21271 ctx_ context.Context 21272 header_ http.Header 21273} 21274 21275// List: Retrieves a paginated list of either deleted users or all users 21276// in a domain. 21277func (r *UsersService) List() *UsersListCall { 21278 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21279 return c 21280} 21281 21282// CustomFieldMask sets the optional parameter "customFieldMask": A 21283// comma-separated list of schema names. All fields from these schemas 21284// are fetched. This should only be set when `projection=custom`. 21285func (c *UsersListCall) CustomFieldMask(customFieldMask string) *UsersListCall { 21286 c.urlParams_.Set("customFieldMask", customFieldMask) 21287 return c 21288} 21289 21290// Customer sets the optional parameter "customer": The unique ID for 21291// the customer's Google Workspace account. In case of a multi-domain 21292// account, to fetch all groups for a customer, fill this field instead 21293// of domain. You can also use the `my_customer` alias to represent your 21294// account's `customerId`. The `customerId` is also returned as part of 21295// the Users resource (/admin-sdk/directory/v1/reference/users). Either 21296// the `customer` or the `domain` parameter must be provided. 21297func (c *UsersListCall) Customer(customer string) *UsersListCall { 21298 c.urlParams_.Set("customer", customer) 21299 return c 21300} 21301 21302// Domain sets the optional parameter "domain": The domain name. Use 21303// this field to get fields from only one domain. To return all domains 21304// for a customer account, use the `customer` query parameter instead. 21305// Either the `customer` or the `domain` parameter must be provided. 21306func (c *UsersListCall) Domain(domain string) *UsersListCall { 21307 c.urlParams_.Set("domain", domain) 21308 return c 21309} 21310 21311// Event sets the optional parameter "event": Event on which 21312// subscription is intended (if subscribing) 21313// 21314// Possible values: 21315// "add" - User Created Event 21316// "delete" - User Deleted Event 21317// "makeAdmin" - User Admin Status Change Event 21318// "undelete" - User Undeleted Event 21319// "update" - User Updated Event 21320func (c *UsersListCall) Event(event string) *UsersListCall { 21321 c.urlParams_.Set("event", event) 21322 return c 21323} 21324 21325// MaxResults sets the optional parameter "maxResults": Maximum number 21326// of results to return. 21327func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { 21328 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 21329 return c 21330} 21331 21332// OrderBy sets the optional parameter "orderBy": Property to use for 21333// sorting results. 21334// 21335// Possible values: 21336// "email" - Primary email of the user. 21337// "familyName" - User's family name. 21338// "givenName" - User's given name. 21339func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { 21340 c.urlParams_.Set("orderBy", orderBy) 21341 return c 21342} 21343 21344// PageToken sets the optional parameter "pageToken": Token to specify 21345// next page in the list 21346func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { 21347 c.urlParams_.Set("pageToken", pageToken) 21348 return c 21349} 21350 21351// Projection sets the optional parameter "projection": What subset of 21352// fields to fetch for this user. 21353// 21354// Possible values: 21355// "basic" (default) - Do not include any custom fields for the user. 21356// "custom" - Include custom fields from schemas requested in 21357// `customFieldMask`. 21358// "full" - Include all fields associated with this user. 21359func (c *UsersListCall) Projection(projection string) *UsersListCall { 21360 c.urlParams_.Set("projection", projection) 21361 return c 21362} 21363 21364// Query sets the optional parameter "query": Query string for searching 21365// user fields. For more information on constructing user queries, see 21366// Search for Users (/admin-sdk/directory/v1/guides/search-users). 21367func (c *UsersListCall) Query(query string) *UsersListCall { 21368 c.urlParams_.Set("query", query) 21369 return c 21370} 21371 21372// ShowDeleted sets the optional parameter "showDeleted": If set to 21373// `true`, retrieves the list of deleted users. (Default: `false`) 21374func (c *UsersListCall) ShowDeleted(showDeleted string) *UsersListCall { 21375 c.urlParams_.Set("showDeleted", showDeleted) 21376 return c 21377} 21378 21379// SortOrder sets the optional parameter "sortOrder": Whether to return 21380// results in ascending or descending order. 21381// 21382// Possible values: 21383// "ASCENDING" - Ascending order. 21384// "DESCENDING" - Descending order. 21385func (c *UsersListCall) SortOrder(sortOrder string) *UsersListCall { 21386 c.urlParams_.Set("sortOrder", sortOrder) 21387 return c 21388} 21389 21390// ViewType sets the optional parameter "viewType": Whether to fetch the 21391// administrator-only or domain-wide public view of the user. For more 21392// information, see Retrieve a user as a non-administrator 21393// (/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) 21394// . 21395// 21396// Possible values: 21397// "admin_view" (default) - Results include both administrator-only 21398// and domain-public fields for the user. 21399// "domain_public" - Results only include fields for the user that are 21400// publicly visible to other users in the domain. 21401func (c *UsersListCall) ViewType(viewType string) *UsersListCall { 21402 c.urlParams_.Set("viewType", viewType) 21403 return c 21404} 21405 21406// Fields allows partial responses to be retrieved. See 21407// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21408// for more information. 21409func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 21410 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21411 return c 21412} 21413 21414// IfNoneMatch sets the optional parameter which makes the operation 21415// fail if the object's ETag matches the given value. This is useful for 21416// getting updates only after the object has changed since the last 21417// request. Use googleapi.IsNotModified to check whether the response 21418// error from Do is the result of In-None-Match. 21419func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 21420 c.ifNoneMatch_ = entityTag 21421 return c 21422} 21423 21424// Context sets the context to be used in this call's Do method. Any 21425// pending HTTP request will be aborted if the provided context is 21426// canceled. 21427func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 21428 c.ctx_ = ctx 21429 return c 21430} 21431 21432// Header returns an http.Header that can be modified by the caller to 21433// add HTTP headers to the request. 21434func (c *UsersListCall) Header() http.Header { 21435 if c.header_ == nil { 21436 c.header_ = make(http.Header) 21437 } 21438 return c.header_ 21439} 21440 21441func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 21442 reqHeaders := make(http.Header) 21443 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21444 for k, v := range c.header_ { 21445 reqHeaders[k] = v 21446 } 21447 reqHeaders.Set("User-Agent", c.s.userAgent()) 21448 if c.ifNoneMatch_ != "" { 21449 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 21450 } 21451 var body io.Reader = nil 21452 c.urlParams_.Set("alt", alt) 21453 c.urlParams_.Set("prettyPrint", "false") 21454 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users") 21455 urls += "?" + c.urlParams_.Encode() 21456 req, err := http.NewRequest("GET", urls, body) 21457 if err != nil { 21458 return nil, err 21459 } 21460 req.Header = reqHeaders 21461 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21462} 21463 21464// Do executes the "directory.users.list" call. 21465// Exactly one of *Users or error will be non-nil. Any non-2xx status 21466// code is an error. Response headers are in either 21467// *Users.ServerResponse.Header or (if a response was returned at all) 21468// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 21469// check whether the returned error was because http.StatusNotModified 21470// was returned. 21471func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*Users, error) { 21472 gensupport.SetOptions(c.urlParams_, opts...) 21473 res, err := c.doRequest("json") 21474 if res != nil && res.StatusCode == http.StatusNotModified { 21475 if res.Body != nil { 21476 res.Body.Close() 21477 } 21478 return nil, &googleapi.Error{ 21479 Code: res.StatusCode, 21480 Header: res.Header, 21481 } 21482 } 21483 if err != nil { 21484 return nil, err 21485 } 21486 defer googleapi.CloseBody(res) 21487 if err := googleapi.CheckResponse(res); err != nil { 21488 return nil, err 21489 } 21490 ret := &Users{ 21491 ServerResponse: googleapi.ServerResponse{ 21492 Header: res.Header, 21493 HTTPStatusCode: res.StatusCode, 21494 }, 21495 } 21496 target := &ret 21497 if err := gensupport.DecodeResponse(target, res); err != nil { 21498 return nil, err 21499 } 21500 return ret, nil 21501 // { 21502 // "description": "Retrieves a paginated list of either deleted users or all users in a domain.", 21503 // "flatPath": "admin/directory/v1/users", 21504 // "httpMethod": "GET", 21505 // "id": "directory.users.list", 21506 // "parameterOrder": [], 21507 // "parameters": { 21508 // "customFieldMask": { 21509 // "description": "A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.", 21510 // "location": "query", 21511 // "type": "string" 21512 // }, 21513 // "customer": { 21514 // "description": "The unique ID for the customer's Google Workspace 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.", 21515 // "location": "query", 21516 // "type": "string" 21517 // }, 21518 // "domain": { 21519 // "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.", 21520 // "location": "query", 21521 // "type": "string" 21522 // }, 21523 // "event": { 21524 // "description": "Event on which subscription is intended (if subscribing)", 21525 // "enum": [ 21526 // "add", 21527 // "delete", 21528 // "makeAdmin", 21529 // "undelete", 21530 // "update" 21531 // ], 21532 // "enumDescriptions": [ 21533 // "User Created Event", 21534 // "User Deleted Event", 21535 // "User Admin Status Change Event", 21536 // "User Undeleted Event", 21537 // "User Updated Event" 21538 // ], 21539 // "location": "query", 21540 // "type": "string" 21541 // }, 21542 // "maxResults": { 21543 // "default": "100", 21544 // "description": "Maximum number of results to return.", 21545 // "format": "int32", 21546 // "location": "query", 21547 // "maximum": "500", 21548 // "minimum": "1", 21549 // "type": "integer" 21550 // }, 21551 // "orderBy": { 21552 // "description": "Property to use for sorting results.", 21553 // "enum": [ 21554 // "email", 21555 // "familyName", 21556 // "givenName" 21557 // ], 21558 // "enumDescriptions": [ 21559 // "Primary email of the user.", 21560 // "User's family name.", 21561 // "User's given name." 21562 // ], 21563 // "location": "query", 21564 // "type": "string" 21565 // }, 21566 // "pageToken": { 21567 // "description": "Token to specify next page in the list", 21568 // "location": "query", 21569 // "type": "string" 21570 // }, 21571 // "projection": { 21572 // "default": "basic", 21573 // "description": "What subset of fields to fetch for this user.", 21574 // "enum": [ 21575 // "basic", 21576 // "custom", 21577 // "full" 21578 // ], 21579 // "enumDescriptions": [ 21580 // "Do not include any custom fields for the user.", 21581 // "Include custom fields from schemas requested in `customFieldMask`.", 21582 // "Include all fields associated with this user." 21583 // ], 21584 // "location": "query", 21585 // "type": "string" 21586 // }, 21587 // "query": { 21588 // "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).", 21589 // "location": "query", 21590 // "type": "string" 21591 // }, 21592 // "showDeleted": { 21593 // "description": "If set to `true`, retrieves the list of deleted users. (Default: `false`)", 21594 // "location": "query", 21595 // "type": "string" 21596 // }, 21597 // "sortOrder": { 21598 // "description": "Whether to return results in ascending or descending order.", 21599 // "enum": [ 21600 // "ASCENDING", 21601 // "DESCENDING" 21602 // ], 21603 // "enumDescriptions": [ 21604 // "Ascending order.", 21605 // "Descending order." 21606 // ], 21607 // "location": "query", 21608 // "type": "string" 21609 // }, 21610 // "viewType": { 21611 // "default": "admin_view", 21612 // "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).", 21613 // "enum": [ 21614 // "admin_view", 21615 // "domain_public" 21616 // ], 21617 // "enumDescriptions": [ 21618 // "Results include both administrator-only and domain-public fields for the user.", 21619 // "Results only include fields for the user that are publicly visible to other users in the domain." 21620 // ], 21621 // "location": "query", 21622 // "type": "string" 21623 // } 21624 // }, 21625 // "path": "admin/directory/v1/users", 21626 // "response": { 21627 // "$ref": "Users" 21628 // }, 21629 // "scopes": [ 21630 // "https://www.googleapis.com/auth/admin.directory.user", 21631 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 21632 // "https://www.googleapis.com/auth/cloud-platform" 21633 // ] 21634 // } 21635 21636} 21637 21638// Pages invokes f for each page of results. 21639// A non-nil error returned from f will halt the iteration. 21640// The provided context supersedes any context provided to the Context method. 21641func (c *UsersListCall) Pages(ctx context.Context, f func(*Users) error) error { 21642 c.ctx_ = ctx 21643 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 21644 for { 21645 x, err := c.Do() 21646 if err != nil { 21647 return err 21648 } 21649 if err := f(x); err != nil { 21650 return err 21651 } 21652 if x.NextPageToken == "" { 21653 return nil 21654 } 21655 c.PageToken(x.NextPageToken) 21656 } 21657} 21658 21659// method id "directory.users.makeAdmin": 21660 21661type UsersMakeAdminCall struct { 21662 s *Service 21663 userKey string 21664 usermakeadmin *UserMakeAdmin 21665 urlParams_ gensupport.URLParams 21666 ctx_ context.Context 21667 header_ http.Header 21668} 21669 21670// MakeAdmin: Makes a user a super administrator. 21671// 21672// - userKey: Identifies the user in the API request. The value can be 21673// the user's primary email address, alias email address, or unique 21674// user ID. 21675func (r *UsersService) MakeAdmin(userKey string, usermakeadmin *UserMakeAdmin) *UsersMakeAdminCall { 21676 c := &UsersMakeAdminCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21677 c.userKey = userKey 21678 c.usermakeadmin = usermakeadmin 21679 return c 21680} 21681 21682// Fields allows partial responses to be retrieved. See 21683// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21684// for more information. 21685func (c *UsersMakeAdminCall) Fields(s ...googleapi.Field) *UsersMakeAdminCall { 21686 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21687 return c 21688} 21689 21690// Context sets the context to be used in this call's Do method. Any 21691// pending HTTP request will be aborted if the provided context is 21692// canceled. 21693func (c *UsersMakeAdminCall) Context(ctx context.Context) *UsersMakeAdminCall { 21694 c.ctx_ = ctx 21695 return c 21696} 21697 21698// Header returns an http.Header that can be modified by the caller to 21699// add HTTP headers to the request. 21700func (c *UsersMakeAdminCall) Header() http.Header { 21701 if c.header_ == nil { 21702 c.header_ = make(http.Header) 21703 } 21704 return c.header_ 21705} 21706 21707func (c *UsersMakeAdminCall) doRequest(alt string) (*http.Response, error) { 21708 reqHeaders := make(http.Header) 21709 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21710 for k, v := range c.header_ { 21711 reqHeaders[k] = v 21712 } 21713 reqHeaders.Set("User-Agent", c.s.userAgent()) 21714 var body io.Reader = nil 21715 body, err := googleapi.WithoutDataWrapper.JSONReader(c.usermakeadmin) 21716 if err != nil { 21717 return nil, err 21718 } 21719 reqHeaders.Set("Content-Type", "application/json") 21720 c.urlParams_.Set("alt", alt) 21721 c.urlParams_.Set("prettyPrint", "false") 21722 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/makeAdmin") 21723 urls += "?" + c.urlParams_.Encode() 21724 req, err := http.NewRequest("POST", urls, body) 21725 if err != nil { 21726 return nil, err 21727 } 21728 req.Header = reqHeaders 21729 googleapi.Expand(req.URL, map[string]string{ 21730 "userKey": c.userKey, 21731 }) 21732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21733} 21734 21735// Do executes the "directory.users.makeAdmin" call. 21736func (c *UsersMakeAdminCall) Do(opts ...googleapi.CallOption) error { 21737 gensupport.SetOptions(c.urlParams_, opts...) 21738 res, err := c.doRequest("json") 21739 if err != nil { 21740 return err 21741 } 21742 defer googleapi.CloseBody(res) 21743 if err := googleapi.CheckResponse(res); err != nil { 21744 return err 21745 } 21746 return nil 21747 // { 21748 // "description": "Makes a user a super administrator.", 21749 // "flatPath": "admin/directory/v1/users/{userKey}/makeAdmin", 21750 // "httpMethod": "POST", 21751 // "id": "directory.users.makeAdmin", 21752 // "parameterOrder": [ 21753 // "userKey" 21754 // ], 21755 // "parameters": { 21756 // "userKey": { 21757 // "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.", 21758 // "location": "path", 21759 // "required": true, 21760 // "type": "string" 21761 // } 21762 // }, 21763 // "path": "admin/directory/v1/users/{userKey}/makeAdmin", 21764 // "request": { 21765 // "$ref": "UserMakeAdmin" 21766 // }, 21767 // "scopes": [ 21768 // "https://www.googleapis.com/auth/admin.directory.user" 21769 // ] 21770 // } 21771 21772} 21773 21774// method id "directory.users.patch": 21775 21776type UsersPatchCall struct { 21777 s *Service 21778 userKey string 21779 user *User 21780 urlParams_ gensupport.URLParams 21781 ctx_ context.Context 21782 header_ http.Header 21783} 21784 21785// Patch: Updates a user using patch semantics. The update method should 21786// be used instead, since it also supports patch semantics and has 21787// better performance. This method is unable to clear fields that 21788// contain repeated objects (`addresses`, `phones`, etc). Use the update 21789// method instead. 21790// 21791// - userKey: Identifies the user in the API request. The value can be 21792// the user's primary email address, alias email address, or unique 21793// user ID. 21794func (r *UsersService) Patch(userKey string, user *User) *UsersPatchCall { 21795 c := &UsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21796 c.userKey = userKey 21797 c.user = user 21798 return c 21799} 21800 21801// Fields allows partial responses to be retrieved. See 21802// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21803// for more information. 21804func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall { 21805 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21806 return c 21807} 21808 21809// Context sets the context to be used in this call's Do method. Any 21810// pending HTTP request will be aborted if the provided context is 21811// canceled. 21812func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall { 21813 c.ctx_ = ctx 21814 return c 21815} 21816 21817// Header returns an http.Header that can be modified by the caller to 21818// add HTTP headers to the request. 21819func (c *UsersPatchCall) Header() http.Header { 21820 if c.header_ == nil { 21821 c.header_ = make(http.Header) 21822 } 21823 return c.header_ 21824} 21825 21826func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { 21827 reqHeaders := make(http.Header) 21828 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21829 for k, v := range c.header_ { 21830 reqHeaders[k] = v 21831 } 21832 reqHeaders.Set("User-Agent", c.s.userAgent()) 21833 var body io.Reader = nil 21834 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 21835 if err != nil { 21836 return nil, err 21837 } 21838 reqHeaders.Set("Content-Type", "application/json") 21839 c.urlParams_.Set("alt", alt) 21840 c.urlParams_.Set("prettyPrint", "false") 21841 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 21842 urls += "?" + c.urlParams_.Encode() 21843 req, err := http.NewRequest("PATCH", urls, body) 21844 if err != nil { 21845 return nil, err 21846 } 21847 req.Header = reqHeaders 21848 googleapi.Expand(req.URL, map[string]string{ 21849 "userKey": c.userKey, 21850 }) 21851 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21852} 21853 21854// Do executes the "directory.users.patch" call. 21855// Exactly one of *User or error will be non-nil. Any non-2xx status 21856// code is an error. Response headers are in either 21857// *User.ServerResponse.Header or (if a response was returned at all) in 21858// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 21859// whether the returned error was because http.StatusNotModified was 21860// returned. 21861func (c *UsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) { 21862 gensupport.SetOptions(c.urlParams_, opts...) 21863 res, err := c.doRequest("json") 21864 if res != nil && res.StatusCode == http.StatusNotModified { 21865 if res.Body != nil { 21866 res.Body.Close() 21867 } 21868 return nil, &googleapi.Error{ 21869 Code: res.StatusCode, 21870 Header: res.Header, 21871 } 21872 } 21873 if err != nil { 21874 return nil, err 21875 } 21876 defer googleapi.CloseBody(res) 21877 if err := googleapi.CheckResponse(res); err != nil { 21878 return nil, err 21879 } 21880 ret := &User{ 21881 ServerResponse: googleapi.ServerResponse{ 21882 Header: res.Header, 21883 HTTPStatusCode: res.StatusCode, 21884 }, 21885 } 21886 target := &ret 21887 if err := gensupport.DecodeResponse(target, res); err != nil { 21888 return nil, err 21889 } 21890 return ret, nil 21891 // { 21892 // "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.", 21893 // "flatPath": "admin/directory/v1/users/{userKey}", 21894 // "httpMethod": "PATCH", 21895 // "id": "directory.users.patch", 21896 // "parameterOrder": [ 21897 // "userKey" 21898 // ], 21899 // "parameters": { 21900 // "userKey": { 21901 // "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.", 21902 // "location": "path", 21903 // "required": true, 21904 // "type": "string" 21905 // } 21906 // }, 21907 // "path": "admin/directory/v1/users/{userKey}", 21908 // "request": { 21909 // "$ref": "User" 21910 // }, 21911 // "response": { 21912 // "$ref": "User" 21913 // }, 21914 // "scopes": [ 21915 // "https://www.googleapis.com/auth/admin.directory.user" 21916 // ] 21917 // } 21918 21919} 21920 21921// method id "directory.users.signOut": 21922 21923type UsersSignOutCall struct { 21924 s *Service 21925 userKey string 21926 urlParams_ gensupport.URLParams 21927 ctx_ context.Context 21928 header_ http.Header 21929} 21930 21931// SignOut: Signs a user out of all web and device sessions and reset 21932// their sign-in cookies. User will have to sign in by authenticating 21933// again. 21934// 21935// - userKey: Identifies the target user in the API request. The value 21936// can be the user's primary email address, alias email address, or 21937// unique user ID. 21938func (r *UsersService) SignOut(userKey string) *UsersSignOutCall { 21939 c := &UsersSignOutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 21940 c.userKey = userKey 21941 return c 21942} 21943 21944// Fields allows partial responses to be retrieved. See 21945// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 21946// for more information. 21947func (c *UsersSignOutCall) Fields(s ...googleapi.Field) *UsersSignOutCall { 21948 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 21949 return c 21950} 21951 21952// Context sets the context to be used in this call's Do method. Any 21953// pending HTTP request will be aborted if the provided context is 21954// canceled. 21955func (c *UsersSignOutCall) Context(ctx context.Context) *UsersSignOutCall { 21956 c.ctx_ = ctx 21957 return c 21958} 21959 21960// Header returns an http.Header that can be modified by the caller to 21961// add HTTP headers to the request. 21962func (c *UsersSignOutCall) Header() http.Header { 21963 if c.header_ == nil { 21964 c.header_ = make(http.Header) 21965 } 21966 return c.header_ 21967} 21968 21969func (c *UsersSignOutCall) doRequest(alt string) (*http.Response, error) { 21970 reqHeaders := make(http.Header) 21971 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 21972 for k, v := range c.header_ { 21973 reqHeaders[k] = v 21974 } 21975 reqHeaders.Set("User-Agent", c.s.userAgent()) 21976 var body io.Reader = nil 21977 c.urlParams_.Set("alt", alt) 21978 c.urlParams_.Set("prettyPrint", "false") 21979 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/signOut") 21980 urls += "?" + c.urlParams_.Encode() 21981 req, err := http.NewRequest("POST", urls, body) 21982 if err != nil { 21983 return nil, err 21984 } 21985 req.Header = reqHeaders 21986 googleapi.Expand(req.URL, map[string]string{ 21987 "userKey": c.userKey, 21988 }) 21989 return gensupport.SendRequest(c.ctx_, c.s.client, req) 21990} 21991 21992// Do executes the "directory.users.signOut" call. 21993func (c *UsersSignOutCall) Do(opts ...googleapi.CallOption) error { 21994 gensupport.SetOptions(c.urlParams_, opts...) 21995 res, err := c.doRequest("json") 21996 if err != nil { 21997 return err 21998 } 21999 defer googleapi.CloseBody(res) 22000 if err := googleapi.CheckResponse(res); err != nil { 22001 return err 22002 } 22003 return nil 22004 // { 22005 // "description": "Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.", 22006 // "flatPath": "admin/directory/v1/users/{userKey}/signOut", 22007 // "httpMethod": "POST", 22008 // "id": "directory.users.signOut", 22009 // "parameterOrder": [ 22010 // "userKey" 22011 // ], 22012 // "parameters": { 22013 // "userKey": { 22014 // "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.", 22015 // "location": "path", 22016 // "required": true, 22017 // "type": "string" 22018 // } 22019 // }, 22020 // "path": "admin/directory/v1/users/{userKey}/signOut", 22021 // "scopes": [ 22022 // "https://www.googleapis.com/auth/admin.directory.user.security" 22023 // ] 22024 // } 22025 22026} 22027 22028// method id "directory.users.undelete": 22029 22030type UsersUndeleteCall struct { 22031 s *Service 22032 userKey string 22033 userundelete *UserUndelete 22034 urlParams_ gensupport.URLParams 22035 ctx_ context.Context 22036 header_ http.Header 22037} 22038 22039// Undelete: Undeletes a deleted user. 22040// 22041// - userKey: The immutable id of the user. 22042func (r *UsersService) Undelete(userKey string, userundelete *UserUndelete) *UsersUndeleteCall { 22043 c := &UsersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22044 c.userKey = userKey 22045 c.userundelete = userundelete 22046 return c 22047} 22048 22049// Fields allows partial responses to be retrieved. See 22050// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22051// for more information. 22052func (c *UsersUndeleteCall) Fields(s ...googleapi.Field) *UsersUndeleteCall { 22053 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22054 return c 22055} 22056 22057// Context sets the context to be used in this call's Do method. Any 22058// pending HTTP request will be aborted if the provided context is 22059// canceled. 22060func (c *UsersUndeleteCall) Context(ctx context.Context) *UsersUndeleteCall { 22061 c.ctx_ = ctx 22062 return c 22063} 22064 22065// Header returns an http.Header that can be modified by the caller to 22066// add HTTP headers to the request. 22067func (c *UsersUndeleteCall) Header() http.Header { 22068 if c.header_ == nil { 22069 c.header_ = make(http.Header) 22070 } 22071 return c.header_ 22072} 22073 22074func (c *UsersUndeleteCall) doRequest(alt string) (*http.Response, error) { 22075 reqHeaders := make(http.Header) 22076 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22077 for k, v := range c.header_ { 22078 reqHeaders[k] = v 22079 } 22080 reqHeaders.Set("User-Agent", c.s.userAgent()) 22081 var body io.Reader = nil 22082 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userundelete) 22083 if err != nil { 22084 return nil, err 22085 } 22086 reqHeaders.Set("Content-Type", "application/json") 22087 c.urlParams_.Set("alt", alt) 22088 c.urlParams_.Set("prettyPrint", "false") 22089 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/undelete") 22090 urls += "?" + c.urlParams_.Encode() 22091 req, err := http.NewRequest("POST", urls, body) 22092 if err != nil { 22093 return nil, err 22094 } 22095 req.Header = reqHeaders 22096 googleapi.Expand(req.URL, map[string]string{ 22097 "userKey": c.userKey, 22098 }) 22099 return gensupport.SendRequest(c.ctx_, c.s.client, req) 22100} 22101 22102// Do executes the "directory.users.undelete" call. 22103func (c *UsersUndeleteCall) Do(opts ...googleapi.CallOption) error { 22104 gensupport.SetOptions(c.urlParams_, opts...) 22105 res, err := c.doRequest("json") 22106 if err != nil { 22107 return err 22108 } 22109 defer googleapi.CloseBody(res) 22110 if err := googleapi.CheckResponse(res); err != nil { 22111 return err 22112 } 22113 return nil 22114 // { 22115 // "description": "Undeletes a deleted user.", 22116 // "flatPath": "admin/directory/v1/users/{userKey}/undelete", 22117 // "httpMethod": "POST", 22118 // "id": "directory.users.undelete", 22119 // "parameterOrder": [ 22120 // "userKey" 22121 // ], 22122 // "parameters": { 22123 // "userKey": { 22124 // "description": "The immutable id of the user", 22125 // "location": "path", 22126 // "required": true, 22127 // "type": "string" 22128 // } 22129 // }, 22130 // "path": "admin/directory/v1/users/{userKey}/undelete", 22131 // "request": { 22132 // "$ref": "UserUndelete" 22133 // }, 22134 // "scopes": [ 22135 // "https://www.googleapis.com/auth/admin.directory.user" 22136 // ] 22137 // } 22138 22139} 22140 22141// method id "directory.users.update": 22142 22143type UsersUpdateCall struct { 22144 s *Service 22145 userKey string 22146 user *User 22147 urlParams_ gensupport.URLParams 22148 ctx_ context.Context 22149 header_ http.Header 22150} 22151 22152// Update: Updates a user. This method supports patch semantics, meaning 22153// you only need to include the fields you wish to update. Fields that 22154// are not present in the request will be preserved, and fields set to 22155// `null` will be cleared. 22156// 22157// - userKey: Identifies the user in the API request. The value can be 22158// the user's primary email address, alias email address, or unique 22159// user ID. 22160func (r *UsersService) Update(userKey string, user *User) *UsersUpdateCall { 22161 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22162 c.userKey = userKey 22163 c.user = user 22164 return c 22165} 22166 22167// Fields allows partial responses to be retrieved. See 22168// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22169// for more information. 22170func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 22171 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22172 return c 22173} 22174 22175// Context sets the context to be used in this call's Do method. Any 22176// pending HTTP request will be aborted if the provided context is 22177// canceled. 22178func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 22179 c.ctx_ = ctx 22180 return c 22181} 22182 22183// Header returns an http.Header that can be modified by the caller to 22184// add HTTP headers to the request. 22185func (c *UsersUpdateCall) Header() http.Header { 22186 if c.header_ == nil { 22187 c.header_ = make(http.Header) 22188 } 22189 return c.header_ 22190} 22191 22192func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 22193 reqHeaders := make(http.Header) 22194 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22195 for k, v := range c.header_ { 22196 reqHeaders[k] = v 22197 } 22198 reqHeaders.Set("User-Agent", c.s.userAgent()) 22199 var body io.Reader = nil 22200 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 22201 if err != nil { 22202 return nil, err 22203 } 22204 reqHeaders.Set("Content-Type", "application/json") 22205 c.urlParams_.Set("alt", alt) 22206 c.urlParams_.Set("prettyPrint", "false") 22207 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}") 22208 urls += "?" + c.urlParams_.Encode() 22209 req, err := http.NewRequest("PUT", urls, body) 22210 if err != nil { 22211 return nil, err 22212 } 22213 req.Header = reqHeaders 22214 googleapi.Expand(req.URL, map[string]string{ 22215 "userKey": c.userKey, 22216 }) 22217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 22218} 22219 22220// Do executes the "directory.users.update" call. 22221// Exactly one of *User or error will be non-nil. Any non-2xx status 22222// code is an error. Response headers are in either 22223// *User.ServerResponse.Header or (if a response was returned at all) in 22224// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 22225// whether the returned error was because http.StatusNotModified was 22226// returned. 22227func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) { 22228 gensupport.SetOptions(c.urlParams_, opts...) 22229 res, err := c.doRequest("json") 22230 if res != nil && res.StatusCode == http.StatusNotModified { 22231 if res.Body != nil { 22232 res.Body.Close() 22233 } 22234 return nil, &googleapi.Error{ 22235 Code: res.StatusCode, 22236 Header: res.Header, 22237 } 22238 } 22239 if err != nil { 22240 return nil, err 22241 } 22242 defer googleapi.CloseBody(res) 22243 if err := googleapi.CheckResponse(res); err != nil { 22244 return nil, err 22245 } 22246 ret := &User{ 22247 ServerResponse: googleapi.ServerResponse{ 22248 Header: res.Header, 22249 HTTPStatusCode: res.StatusCode, 22250 }, 22251 } 22252 target := &ret 22253 if err := gensupport.DecodeResponse(target, res); err != nil { 22254 return nil, err 22255 } 22256 return ret, nil 22257 // { 22258 // "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.", 22259 // "flatPath": "admin/directory/v1/users/{userKey}", 22260 // "httpMethod": "PUT", 22261 // "id": "directory.users.update", 22262 // "parameterOrder": [ 22263 // "userKey" 22264 // ], 22265 // "parameters": { 22266 // "userKey": { 22267 // "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.", 22268 // "location": "path", 22269 // "required": true, 22270 // "type": "string" 22271 // } 22272 // }, 22273 // "path": "admin/directory/v1/users/{userKey}", 22274 // "request": { 22275 // "$ref": "User" 22276 // }, 22277 // "response": { 22278 // "$ref": "User" 22279 // }, 22280 // "scopes": [ 22281 // "https://www.googleapis.com/auth/admin.directory.user" 22282 // ] 22283 // } 22284 22285} 22286 22287// method id "directory.users.watch": 22288 22289type UsersWatchCall struct { 22290 s *Service 22291 channel *Channel 22292 urlParams_ gensupport.URLParams 22293 ctx_ context.Context 22294 header_ http.Header 22295} 22296 22297// Watch: Watches for changes in users list. 22298func (r *UsersService) Watch(channel *Channel) *UsersWatchCall { 22299 c := &UsersWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22300 c.channel = channel 22301 return c 22302} 22303 22304// CustomFieldMask sets the optional parameter "customFieldMask": 22305// Comma-separated list of schema names. All fields from these schemas 22306// are fetched. This should only be set when projection=custom. 22307func (c *UsersWatchCall) CustomFieldMask(customFieldMask string) *UsersWatchCall { 22308 c.urlParams_.Set("customFieldMask", customFieldMask) 22309 return c 22310} 22311 22312// Customer sets the optional parameter "customer": Immutable ID of the 22313// Google Workspace account. In case of multi-domain, to fetch all users 22314// for a customer, fill this field instead of domain. 22315func (c *UsersWatchCall) Customer(customer string) *UsersWatchCall { 22316 c.urlParams_.Set("customer", customer) 22317 return c 22318} 22319 22320// Domain sets the optional parameter "domain": Name of the domain. Fill 22321// this field to get users from only this domain. To return all users in 22322// a multi-domain fill customer field instead." 22323func (c *UsersWatchCall) Domain(domain string) *UsersWatchCall { 22324 c.urlParams_.Set("domain", domain) 22325 return c 22326} 22327 22328// Event sets the optional parameter "event": Events to watch for. 22329// 22330// Possible values: 22331// "add" - User Created Event 22332// "delete" - User Deleted Event 22333// "makeAdmin" - User Admin Status Change Event 22334// "undelete" - User Undeleted Event 22335// "update" - User Updated Event 22336func (c *UsersWatchCall) Event(event string) *UsersWatchCall { 22337 c.urlParams_.Set("event", event) 22338 return c 22339} 22340 22341// MaxResults sets the optional parameter "maxResults": Maximum number 22342// of results to return. 22343func (c *UsersWatchCall) MaxResults(maxResults int64) *UsersWatchCall { 22344 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 22345 return c 22346} 22347 22348// OrderBy sets the optional parameter "orderBy": Column to use for 22349// sorting results 22350// 22351// Possible values: 22352// "email" - Primary email of the user. 22353// "familyName" - User's family name. 22354// "givenName" - User's given name. 22355func (c *UsersWatchCall) OrderBy(orderBy string) *UsersWatchCall { 22356 c.urlParams_.Set("orderBy", orderBy) 22357 return c 22358} 22359 22360// PageToken sets the optional parameter "pageToken": Token to specify 22361// next page in the list 22362func (c *UsersWatchCall) PageToken(pageToken string) *UsersWatchCall { 22363 c.urlParams_.Set("pageToken", pageToken) 22364 return c 22365} 22366 22367// Projection sets the optional parameter "projection": What subset of 22368// fields to fetch for this user. 22369// 22370// Possible values: 22371// "basic" (default) - Do not include any custom fields for the user. 22372// "custom" - Include custom fields from schemas mentioned in 22373// customFieldMask. 22374// "full" - Include all fields associated with this user. 22375func (c *UsersWatchCall) Projection(projection string) *UsersWatchCall { 22376 c.urlParams_.Set("projection", projection) 22377 return c 22378} 22379 22380// Query sets the optional parameter "query": Query string search. 22381// Should be of the form "". Complete documentation is at https: 22382// //developers.google.com/admin-sdk/directory/v1/guides/search-users 22383func (c *UsersWatchCall) Query(query string) *UsersWatchCall { 22384 c.urlParams_.Set("query", query) 22385 return c 22386} 22387 22388// ShowDeleted sets the optional parameter "showDeleted": If set to 22389// true, retrieves the list of deleted users. (Default: false) 22390func (c *UsersWatchCall) ShowDeleted(showDeleted string) *UsersWatchCall { 22391 c.urlParams_.Set("showDeleted", showDeleted) 22392 return c 22393} 22394 22395// SortOrder sets the optional parameter "sortOrder": Whether to return 22396// results in ascending or descending order. 22397// 22398// Possible values: 22399// "ASCENDING" - Ascending order. 22400// "DESCENDING" - Descending order. 22401func (c *UsersWatchCall) SortOrder(sortOrder string) *UsersWatchCall { 22402 c.urlParams_.Set("sortOrder", sortOrder) 22403 return c 22404} 22405 22406// ViewType sets the optional parameter "viewType": Whether to fetch the 22407// administrator-only or domain-wide public view of the user. For more 22408// information, see Retrieve a user as a non-administrator 22409// (/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) 22410// . 22411// 22412// Possible values: 22413// "admin_view" (default) - Results include both administrator-only 22414// and domain-public fields. 22415// "domain_public" - Results only include fields for the user that are 22416// publicly visible to other users in the domain. 22417func (c *UsersWatchCall) ViewType(viewType string) *UsersWatchCall { 22418 c.urlParams_.Set("viewType", viewType) 22419 return c 22420} 22421 22422// Fields allows partial responses to be retrieved. See 22423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22424// for more information. 22425func (c *UsersWatchCall) Fields(s ...googleapi.Field) *UsersWatchCall { 22426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22427 return c 22428} 22429 22430// Context sets the context to be used in this call's Do method. Any 22431// pending HTTP request will be aborted if the provided context is 22432// canceled. 22433func (c *UsersWatchCall) Context(ctx context.Context) *UsersWatchCall { 22434 c.ctx_ = ctx 22435 return c 22436} 22437 22438// Header returns an http.Header that can be modified by the caller to 22439// add HTTP headers to the request. 22440func (c *UsersWatchCall) Header() http.Header { 22441 if c.header_ == nil { 22442 c.header_ = make(http.Header) 22443 } 22444 return c.header_ 22445} 22446 22447func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) { 22448 reqHeaders := make(http.Header) 22449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22450 for k, v := range c.header_ { 22451 reqHeaders[k] = v 22452 } 22453 reqHeaders.Set("User-Agent", c.s.userAgent()) 22454 var body io.Reader = nil 22455 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 22456 if err != nil { 22457 return nil, err 22458 } 22459 reqHeaders.Set("Content-Type", "application/json") 22460 c.urlParams_.Set("alt", alt) 22461 c.urlParams_.Set("prettyPrint", "false") 22462 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/watch") 22463 urls += "?" + c.urlParams_.Encode() 22464 req, err := http.NewRequest("POST", urls, body) 22465 if err != nil { 22466 return nil, err 22467 } 22468 req.Header = reqHeaders 22469 return gensupport.SendRequest(c.ctx_, c.s.client, req) 22470} 22471 22472// Do executes the "directory.users.watch" call. 22473// Exactly one of *Channel or error will be non-nil. Any non-2xx status 22474// code is an error. Response headers are in either 22475// *Channel.ServerResponse.Header or (if a response was returned at all) 22476// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 22477// check whether the returned error was because http.StatusNotModified 22478// was returned. 22479func (c *UsersWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 22480 gensupport.SetOptions(c.urlParams_, opts...) 22481 res, err := c.doRequest("json") 22482 if res != nil && res.StatusCode == http.StatusNotModified { 22483 if res.Body != nil { 22484 res.Body.Close() 22485 } 22486 return nil, &googleapi.Error{ 22487 Code: res.StatusCode, 22488 Header: res.Header, 22489 } 22490 } 22491 if err != nil { 22492 return nil, err 22493 } 22494 defer googleapi.CloseBody(res) 22495 if err := googleapi.CheckResponse(res); err != nil { 22496 return nil, err 22497 } 22498 ret := &Channel{ 22499 ServerResponse: googleapi.ServerResponse{ 22500 Header: res.Header, 22501 HTTPStatusCode: res.StatusCode, 22502 }, 22503 } 22504 target := &ret 22505 if err := gensupport.DecodeResponse(target, res); err != nil { 22506 return nil, err 22507 } 22508 return ret, nil 22509 // { 22510 // "description": "Watches for changes in users list.", 22511 // "flatPath": "admin/directory/v1/users/watch", 22512 // "httpMethod": "POST", 22513 // "id": "directory.users.watch", 22514 // "parameterOrder": [], 22515 // "parameters": { 22516 // "customFieldMask": { 22517 // "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", 22518 // "location": "query", 22519 // "type": "string" 22520 // }, 22521 // "customer": { 22522 // "description": "Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.", 22523 // "location": "query", 22524 // "type": "string" 22525 // }, 22526 // "domain": { 22527 // "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.\"", 22528 // "location": "query", 22529 // "type": "string" 22530 // }, 22531 // "event": { 22532 // "description": "Events to watch for.", 22533 // "enum": [ 22534 // "add", 22535 // "delete", 22536 // "makeAdmin", 22537 // "undelete", 22538 // "update" 22539 // ], 22540 // "enumDescriptions": [ 22541 // "User Created Event", 22542 // "User Deleted Event", 22543 // "User Admin Status Change Event", 22544 // "User Undeleted Event", 22545 // "User Updated Event" 22546 // ], 22547 // "location": "query", 22548 // "type": "string" 22549 // }, 22550 // "maxResults": { 22551 // "default": "100", 22552 // "description": "Maximum number of results to return.", 22553 // "format": "int32", 22554 // "location": "query", 22555 // "maximum": "500", 22556 // "minimum": "1", 22557 // "type": "integer" 22558 // }, 22559 // "orderBy": { 22560 // "description": "Column to use for sorting results", 22561 // "enum": [ 22562 // "email", 22563 // "familyName", 22564 // "givenName" 22565 // ], 22566 // "enumDescriptions": [ 22567 // "Primary email of the user.", 22568 // "User's family name.", 22569 // "User's given name." 22570 // ], 22571 // "location": "query", 22572 // "type": "string" 22573 // }, 22574 // "pageToken": { 22575 // "description": "Token to specify next page in the list", 22576 // "location": "query", 22577 // "type": "string" 22578 // }, 22579 // "projection": { 22580 // "default": "basic", 22581 // "description": "What subset of fields to fetch for this user.", 22582 // "enum": [ 22583 // "basic", 22584 // "custom", 22585 // "full" 22586 // ], 22587 // "enumDescriptions": [ 22588 // "Do not include any custom fields for the user.", 22589 // "Include custom fields from schemas mentioned in customFieldMask.", 22590 // "Include all fields associated with this user." 22591 // ], 22592 // "location": "query", 22593 // "type": "string" 22594 // }, 22595 // "query": { 22596 // "description": "Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-users", 22597 // "location": "query", 22598 // "type": "string" 22599 // }, 22600 // "showDeleted": { 22601 // "description": "If set to true, retrieves the list of deleted users. (Default: false)", 22602 // "location": "query", 22603 // "type": "string" 22604 // }, 22605 // "sortOrder": { 22606 // "description": "Whether to return results in ascending or descending order.", 22607 // "enum": [ 22608 // "ASCENDING", 22609 // "DESCENDING" 22610 // ], 22611 // "enumDescriptions": [ 22612 // "Ascending order.", 22613 // "Descending order." 22614 // ], 22615 // "location": "query", 22616 // "type": "string" 22617 // }, 22618 // "viewType": { 22619 // "default": "admin_view", 22620 // "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).", 22621 // "enum": [ 22622 // "admin_view", 22623 // "domain_public" 22624 // ], 22625 // "enumDescriptions": [ 22626 // "Results include both administrator-only and domain-public fields.", 22627 // "Results only include fields for the user that are publicly visible to other users in the domain." 22628 // ], 22629 // "location": "query", 22630 // "type": "string" 22631 // } 22632 // }, 22633 // "path": "admin/directory/v1/users/watch", 22634 // "request": { 22635 // "$ref": "Channel" 22636 // }, 22637 // "response": { 22638 // "$ref": "Channel" 22639 // }, 22640 // "scopes": [ 22641 // "https://www.googleapis.com/auth/admin.directory.user", 22642 // "https://www.googleapis.com/auth/admin.directory.user.readonly", 22643 // "https://www.googleapis.com/auth/cloud-platform" 22644 // ] 22645 // } 22646 22647} 22648 22649// method id "directory.users.aliases.delete": 22650 22651type UsersAliasesDeleteCall struct { 22652 s *Service 22653 userKey string 22654 alias string 22655 urlParams_ gensupport.URLParams 22656 ctx_ context.Context 22657 header_ http.Header 22658} 22659 22660// Delete: Removes an alias. 22661// 22662// - alias: The alias to be removed. 22663// - userKey: Identifies the user in the API request. The value can be 22664// the user's primary email address, alias email address, or unique 22665// user ID. 22666func (r *UsersAliasesService) Delete(userKey string, alias string) *UsersAliasesDeleteCall { 22667 c := &UsersAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22668 c.userKey = userKey 22669 c.alias = alias 22670 return c 22671} 22672 22673// Fields allows partial responses to be retrieved. See 22674// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22675// for more information. 22676func (c *UsersAliasesDeleteCall) Fields(s ...googleapi.Field) *UsersAliasesDeleteCall { 22677 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22678 return c 22679} 22680 22681// Context sets the context to be used in this call's Do method. Any 22682// pending HTTP request will be aborted if the provided context is 22683// canceled. 22684func (c *UsersAliasesDeleteCall) Context(ctx context.Context) *UsersAliasesDeleteCall { 22685 c.ctx_ = ctx 22686 return c 22687} 22688 22689// Header returns an http.Header that can be modified by the caller to 22690// add HTTP headers to the request. 22691func (c *UsersAliasesDeleteCall) Header() http.Header { 22692 if c.header_ == nil { 22693 c.header_ = make(http.Header) 22694 } 22695 return c.header_ 22696} 22697 22698func (c *UsersAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { 22699 reqHeaders := make(http.Header) 22700 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22701 for k, v := range c.header_ { 22702 reqHeaders[k] = v 22703 } 22704 reqHeaders.Set("User-Agent", c.s.userAgent()) 22705 var body io.Reader = nil 22706 c.urlParams_.Set("alt", alt) 22707 c.urlParams_.Set("prettyPrint", "false") 22708 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases/{alias}") 22709 urls += "?" + c.urlParams_.Encode() 22710 req, err := http.NewRequest("DELETE", urls, body) 22711 if err != nil { 22712 return nil, err 22713 } 22714 req.Header = reqHeaders 22715 googleapi.Expand(req.URL, map[string]string{ 22716 "userKey": c.userKey, 22717 "alias": c.alias, 22718 }) 22719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 22720} 22721 22722// Do executes the "directory.users.aliases.delete" call. 22723func (c *UsersAliasesDeleteCall) Do(opts ...googleapi.CallOption) error { 22724 gensupport.SetOptions(c.urlParams_, opts...) 22725 res, err := c.doRequest("json") 22726 if err != nil { 22727 return err 22728 } 22729 defer googleapi.CloseBody(res) 22730 if err := googleapi.CheckResponse(res); err != nil { 22731 return err 22732 } 22733 return nil 22734 // { 22735 // "description": "Removes an alias.", 22736 // "flatPath": "admin/directory/v1/users/{userKey}/aliases/{alias}", 22737 // "httpMethod": "DELETE", 22738 // "id": "directory.users.aliases.delete", 22739 // "parameterOrder": [ 22740 // "userKey", 22741 // "alias" 22742 // ], 22743 // "parameters": { 22744 // "alias": { 22745 // "description": "The alias to be removed.", 22746 // "location": "path", 22747 // "required": true, 22748 // "type": "string" 22749 // }, 22750 // "userKey": { 22751 // "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.", 22752 // "location": "path", 22753 // "required": true, 22754 // "type": "string" 22755 // } 22756 // }, 22757 // "path": "admin/directory/v1/users/{userKey}/aliases/{alias}", 22758 // "scopes": [ 22759 // "https://www.googleapis.com/auth/admin.directory.user", 22760 // "https://www.googleapis.com/auth/admin.directory.user.alias" 22761 // ] 22762 // } 22763 22764} 22765 22766// method id "directory.users.aliases.insert": 22767 22768type UsersAliasesInsertCall struct { 22769 s *Service 22770 userKey string 22771 alias *Alias 22772 urlParams_ gensupport.URLParams 22773 ctx_ context.Context 22774 header_ http.Header 22775} 22776 22777// Insert: Adds an alias. 22778// 22779// - userKey: Identifies the user in the API request. The value can be 22780// the user's primary email address, alias email address, or unique 22781// user ID. 22782func (r *UsersAliasesService) Insert(userKey string, alias *Alias) *UsersAliasesInsertCall { 22783 c := &UsersAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22784 c.userKey = userKey 22785 c.alias = alias 22786 return c 22787} 22788 22789// Fields allows partial responses to be retrieved. See 22790// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22791// for more information. 22792func (c *UsersAliasesInsertCall) Fields(s ...googleapi.Field) *UsersAliasesInsertCall { 22793 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22794 return c 22795} 22796 22797// Context sets the context to be used in this call's Do method. Any 22798// pending HTTP request will be aborted if the provided context is 22799// canceled. 22800func (c *UsersAliasesInsertCall) Context(ctx context.Context) *UsersAliasesInsertCall { 22801 c.ctx_ = ctx 22802 return c 22803} 22804 22805// Header returns an http.Header that can be modified by the caller to 22806// add HTTP headers to the request. 22807func (c *UsersAliasesInsertCall) Header() http.Header { 22808 if c.header_ == nil { 22809 c.header_ = make(http.Header) 22810 } 22811 return c.header_ 22812} 22813 22814func (c *UsersAliasesInsertCall) doRequest(alt string) (*http.Response, error) { 22815 reqHeaders := make(http.Header) 22816 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22817 for k, v := range c.header_ { 22818 reqHeaders[k] = v 22819 } 22820 reqHeaders.Set("User-Agent", c.s.userAgent()) 22821 var body io.Reader = nil 22822 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alias) 22823 if err != nil { 22824 return nil, err 22825 } 22826 reqHeaders.Set("Content-Type", "application/json") 22827 c.urlParams_.Set("alt", alt) 22828 c.urlParams_.Set("prettyPrint", "false") 22829 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases") 22830 urls += "?" + c.urlParams_.Encode() 22831 req, err := http.NewRequest("POST", urls, body) 22832 if err != nil { 22833 return nil, err 22834 } 22835 req.Header = reqHeaders 22836 googleapi.Expand(req.URL, map[string]string{ 22837 "userKey": c.userKey, 22838 }) 22839 return gensupport.SendRequest(c.ctx_, c.s.client, req) 22840} 22841 22842// Do executes the "directory.users.aliases.insert" call. 22843// Exactly one of *Alias or error will be non-nil. Any non-2xx status 22844// code is an error. Response headers are in either 22845// *Alias.ServerResponse.Header or (if a response was returned at all) 22846// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 22847// check whether the returned error was because http.StatusNotModified 22848// was returned. 22849func (c *UsersAliasesInsertCall) Do(opts ...googleapi.CallOption) (*Alias, error) { 22850 gensupport.SetOptions(c.urlParams_, opts...) 22851 res, err := c.doRequest("json") 22852 if res != nil && res.StatusCode == http.StatusNotModified { 22853 if res.Body != nil { 22854 res.Body.Close() 22855 } 22856 return nil, &googleapi.Error{ 22857 Code: res.StatusCode, 22858 Header: res.Header, 22859 } 22860 } 22861 if err != nil { 22862 return nil, err 22863 } 22864 defer googleapi.CloseBody(res) 22865 if err := googleapi.CheckResponse(res); err != nil { 22866 return nil, err 22867 } 22868 ret := &Alias{ 22869 ServerResponse: googleapi.ServerResponse{ 22870 Header: res.Header, 22871 HTTPStatusCode: res.StatusCode, 22872 }, 22873 } 22874 target := &ret 22875 if err := gensupport.DecodeResponse(target, res); err != nil { 22876 return nil, err 22877 } 22878 return ret, nil 22879 // { 22880 // "description": "Adds an alias.", 22881 // "flatPath": "admin/directory/v1/users/{userKey}/aliases", 22882 // "httpMethod": "POST", 22883 // "id": "directory.users.aliases.insert", 22884 // "parameterOrder": [ 22885 // "userKey" 22886 // ], 22887 // "parameters": { 22888 // "userKey": { 22889 // "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.", 22890 // "location": "path", 22891 // "required": true, 22892 // "type": "string" 22893 // } 22894 // }, 22895 // "path": "admin/directory/v1/users/{userKey}/aliases", 22896 // "request": { 22897 // "$ref": "Alias" 22898 // }, 22899 // "response": { 22900 // "$ref": "Alias" 22901 // }, 22902 // "scopes": [ 22903 // "https://www.googleapis.com/auth/admin.directory.user", 22904 // "https://www.googleapis.com/auth/admin.directory.user.alias" 22905 // ] 22906 // } 22907 22908} 22909 22910// method id "directory.users.aliases.list": 22911 22912type UsersAliasesListCall struct { 22913 s *Service 22914 userKey string 22915 urlParams_ gensupport.URLParams 22916 ifNoneMatch_ string 22917 ctx_ context.Context 22918 header_ http.Header 22919} 22920 22921// List: Lists all aliases for a user. 22922// 22923// - userKey: Identifies the user in the API request. The value can be 22924// the user's primary email address, alias email address, or unique 22925// user ID. 22926func (r *UsersAliasesService) List(userKey string) *UsersAliasesListCall { 22927 c := &UsersAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 22928 c.userKey = userKey 22929 return c 22930} 22931 22932// Event sets the optional parameter "event": Events to watch for. 22933// 22934// Possible values: 22935// "add" - Alias Created Event 22936// "delete" - Alias Deleted Event 22937func (c *UsersAliasesListCall) Event(event string) *UsersAliasesListCall { 22938 c.urlParams_.Set("event", event) 22939 return c 22940} 22941 22942// Fields allows partial responses to be retrieved. See 22943// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 22944// for more information. 22945func (c *UsersAliasesListCall) Fields(s ...googleapi.Field) *UsersAliasesListCall { 22946 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 22947 return c 22948} 22949 22950// IfNoneMatch sets the optional parameter which makes the operation 22951// fail if the object's ETag matches the given value. This is useful for 22952// getting updates only after the object has changed since the last 22953// request. Use googleapi.IsNotModified to check whether the response 22954// error from Do is the result of In-None-Match. 22955func (c *UsersAliasesListCall) IfNoneMatch(entityTag string) *UsersAliasesListCall { 22956 c.ifNoneMatch_ = entityTag 22957 return c 22958} 22959 22960// Context sets the context to be used in this call's Do method. Any 22961// pending HTTP request will be aborted if the provided context is 22962// canceled. 22963func (c *UsersAliasesListCall) Context(ctx context.Context) *UsersAliasesListCall { 22964 c.ctx_ = ctx 22965 return c 22966} 22967 22968// Header returns an http.Header that can be modified by the caller to 22969// add HTTP headers to the request. 22970func (c *UsersAliasesListCall) Header() http.Header { 22971 if c.header_ == nil { 22972 c.header_ = make(http.Header) 22973 } 22974 return c.header_ 22975} 22976 22977func (c *UsersAliasesListCall) doRequest(alt string) (*http.Response, error) { 22978 reqHeaders := make(http.Header) 22979 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 22980 for k, v := range c.header_ { 22981 reqHeaders[k] = v 22982 } 22983 reqHeaders.Set("User-Agent", c.s.userAgent()) 22984 if c.ifNoneMatch_ != "" { 22985 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 22986 } 22987 var body io.Reader = nil 22988 c.urlParams_.Set("alt", alt) 22989 c.urlParams_.Set("prettyPrint", "false") 22990 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases") 22991 urls += "?" + c.urlParams_.Encode() 22992 req, err := http.NewRequest("GET", urls, body) 22993 if err != nil { 22994 return nil, err 22995 } 22996 req.Header = reqHeaders 22997 googleapi.Expand(req.URL, map[string]string{ 22998 "userKey": c.userKey, 22999 }) 23000 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23001} 23002 23003// Do executes the "directory.users.aliases.list" call. 23004// Exactly one of *Aliases or error will be non-nil. Any non-2xx status 23005// code is an error. Response headers are in either 23006// *Aliases.ServerResponse.Header or (if a response was returned at all) 23007// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 23008// check whether the returned error was because http.StatusNotModified 23009// was returned. 23010func (c *UsersAliasesListCall) Do(opts ...googleapi.CallOption) (*Aliases, error) { 23011 gensupport.SetOptions(c.urlParams_, opts...) 23012 res, err := c.doRequest("json") 23013 if res != nil && res.StatusCode == http.StatusNotModified { 23014 if res.Body != nil { 23015 res.Body.Close() 23016 } 23017 return nil, &googleapi.Error{ 23018 Code: res.StatusCode, 23019 Header: res.Header, 23020 } 23021 } 23022 if err != nil { 23023 return nil, err 23024 } 23025 defer googleapi.CloseBody(res) 23026 if err := googleapi.CheckResponse(res); err != nil { 23027 return nil, err 23028 } 23029 ret := &Aliases{ 23030 ServerResponse: googleapi.ServerResponse{ 23031 Header: res.Header, 23032 HTTPStatusCode: res.StatusCode, 23033 }, 23034 } 23035 target := &ret 23036 if err := gensupport.DecodeResponse(target, res); err != nil { 23037 return nil, err 23038 } 23039 return ret, nil 23040 // { 23041 // "description": "Lists all aliases for a user.", 23042 // "flatPath": "admin/directory/v1/users/{userKey}/aliases", 23043 // "httpMethod": "GET", 23044 // "id": "directory.users.aliases.list", 23045 // "parameterOrder": [ 23046 // "userKey" 23047 // ], 23048 // "parameters": { 23049 // "event": { 23050 // "description": "Events to watch for.", 23051 // "enum": [ 23052 // "add", 23053 // "delete" 23054 // ], 23055 // "enumDescriptions": [ 23056 // "Alias Created Event", 23057 // "Alias Deleted Event" 23058 // ], 23059 // "location": "query", 23060 // "type": "string" 23061 // }, 23062 // "userKey": { 23063 // "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.", 23064 // "location": "path", 23065 // "required": true, 23066 // "type": "string" 23067 // } 23068 // }, 23069 // "path": "admin/directory/v1/users/{userKey}/aliases", 23070 // "response": { 23071 // "$ref": "Aliases" 23072 // }, 23073 // "scopes": [ 23074 // "https://www.googleapis.com/auth/admin.directory.user", 23075 // "https://www.googleapis.com/auth/admin.directory.user.alias", 23076 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 23077 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 23078 // ] 23079 // } 23080 23081} 23082 23083// method id "directory.users.aliases.watch": 23084 23085type UsersAliasesWatchCall struct { 23086 s *Service 23087 userKey string 23088 channel *Channel 23089 urlParams_ gensupport.URLParams 23090 ctx_ context.Context 23091 header_ http.Header 23092} 23093 23094// Watch: Watches for changes in users list. 23095// 23096// - userKey: Email or immutable ID of the user. 23097func (r *UsersAliasesService) Watch(userKey string, channel *Channel) *UsersAliasesWatchCall { 23098 c := &UsersAliasesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23099 c.userKey = userKey 23100 c.channel = channel 23101 return c 23102} 23103 23104// Event sets the optional parameter "event": Events to watch for. 23105// 23106// Possible values: 23107// "add" - Alias Created Event 23108// "delete" - Alias Deleted Event 23109func (c *UsersAliasesWatchCall) Event(event string) *UsersAliasesWatchCall { 23110 c.urlParams_.Set("event", event) 23111 return c 23112} 23113 23114// Fields allows partial responses to be retrieved. See 23115// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23116// for more information. 23117func (c *UsersAliasesWatchCall) Fields(s ...googleapi.Field) *UsersAliasesWatchCall { 23118 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23119 return c 23120} 23121 23122// Context sets the context to be used in this call's Do method. Any 23123// pending HTTP request will be aborted if the provided context is 23124// canceled. 23125func (c *UsersAliasesWatchCall) Context(ctx context.Context) *UsersAliasesWatchCall { 23126 c.ctx_ = ctx 23127 return c 23128} 23129 23130// Header returns an http.Header that can be modified by the caller to 23131// add HTTP headers to the request. 23132func (c *UsersAliasesWatchCall) Header() http.Header { 23133 if c.header_ == nil { 23134 c.header_ = make(http.Header) 23135 } 23136 return c.header_ 23137} 23138 23139func (c *UsersAliasesWatchCall) doRequest(alt string) (*http.Response, error) { 23140 reqHeaders := make(http.Header) 23141 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23142 for k, v := range c.header_ { 23143 reqHeaders[k] = v 23144 } 23145 reqHeaders.Set("User-Agent", c.s.userAgent()) 23146 var body io.Reader = nil 23147 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 23148 if err != nil { 23149 return nil, err 23150 } 23151 reqHeaders.Set("Content-Type", "application/json") 23152 c.urlParams_.Set("alt", alt) 23153 c.urlParams_.Set("prettyPrint", "false") 23154 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/aliases/watch") 23155 urls += "?" + c.urlParams_.Encode() 23156 req, err := http.NewRequest("POST", urls, body) 23157 if err != nil { 23158 return nil, err 23159 } 23160 req.Header = reqHeaders 23161 googleapi.Expand(req.URL, map[string]string{ 23162 "userKey": c.userKey, 23163 }) 23164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23165} 23166 23167// Do executes the "directory.users.aliases.watch" call. 23168// Exactly one of *Channel or error will be non-nil. Any non-2xx status 23169// code is an error. Response headers are in either 23170// *Channel.ServerResponse.Header or (if a response was returned at all) 23171// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 23172// check whether the returned error was because http.StatusNotModified 23173// was returned. 23174func (c *UsersAliasesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 23175 gensupport.SetOptions(c.urlParams_, opts...) 23176 res, err := c.doRequest("json") 23177 if res != nil && res.StatusCode == http.StatusNotModified { 23178 if res.Body != nil { 23179 res.Body.Close() 23180 } 23181 return nil, &googleapi.Error{ 23182 Code: res.StatusCode, 23183 Header: res.Header, 23184 } 23185 } 23186 if err != nil { 23187 return nil, err 23188 } 23189 defer googleapi.CloseBody(res) 23190 if err := googleapi.CheckResponse(res); err != nil { 23191 return nil, err 23192 } 23193 ret := &Channel{ 23194 ServerResponse: googleapi.ServerResponse{ 23195 Header: res.Header, 23196 HTTPStatusCode: res.StatusCode, 23197 }, 23198 } 23199 target := &ret 23200 if err := gensupport.DecodeResponse(target, res); err != nil { 23201 return nil, err 23202 } 23203 return ret, nil 23204 // { 23205 // "description": "Watches for changes in users list.", 23206 // "flatPath": "admin/directory/v1/users/{userKey}/aliases/watch", 23207 // "httpMethod": "POST", 23208 // "id": "directory.users.aliases.watch", 23209 // "parameterOrder": [ 23210 // "userKey" 23211 // ], 23212 // "parameters": { 23213 // "event": { 23214 // "description": "Events to watch for.", 23215 // "enum": [ 23216 // "add", 23217 // "delete" 23218 // ], 23219 // "enumDescriptions": [ 23220 // "Alias Created Event", 23221 // "Alias Deleted Event" 23222 // ], 23223 // "location": "query", 23224 // "type": "string" 23225 // }, 23226 // "userKey": { 23227 // "description": "Email or immutable ID of the user", 23228 // "location": "path", 23229 // "required": true, 23230 // "type": "string" 23231 // } 23232 // }, 23233 // "path": "admin/directory/v1/users/{userKey}/aliases/watch", 23234 // "request": { 23235 // "$ref": "Channel" 23236 // }, 23237 // "response": { 23238 // "$ref": "Channel" 23239 // }, 23240 // "scopes": [ 23241 // "https://www.googleapis.com/auth/admin.directory.user", 23242 // "https://www.googleapis.com/auth/admin.directory.user.alias", 23243 // "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", 23244 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 23245 // ] 23246 // } 23247 23248} 23249 23250// method id "directory.users.photos.delete": 23251 23252type UsersPhotosDeleteCall struct { 23253 s *Service 23254 userKey string 23255 urlParams_ gensupport.URLParams 23256 ctx_ context.Context 23257 header_ http.Header 23258} 23259 23260// Delete: Removes the user's photo. 23261// 23262// - userKey: Identifies the user in the API request. The value can be 23263// the user's primary email address, alias email address, or unique 23264// user ID. 23265func (r *UsersPhotosService) Delete(userKey string) *UsersPhotosDeleteCall { 23266 c := &UsersPhotosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23267 c.userKey = userKey 23268 return c 23269} 23270 23271// Fields allows partial responses to be retrieved. See 23272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23273// for more information. 23274func (c *UsersPhotosDeleteCall) Fields(s ...googleapi.Field) *UsersPhotosDeleteCall { 23275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23276 return c 23277} 23278 23279// Context sets the context to be used in this call's Do method. Any 23280// pending HTTP request will be aborted if the provided context is 23281// canceled. 23282func (c *UsersPhotosDeleteCall) Context(ctx context.Context) *UsersPhotosDeleteCall { 23283 c.ctx_ = ctx 23284 return c 23285} 23286 23287// Header returns an http.Header that can be modified by the caller to 23288// add HTTP headers to the request. 23289func (c *UsersPhotosDeleteCall) Header() http.Header { 23290 if c.header_ == nil { 23291 c.header_ = make(http.Header) 23292 } 23293 return c.header_ 23294} 23295 23296func (c *UsersPhotosDeleteCall) doRequest(alt string) (*http.Response, error) { 23297 reqHeaders := make(http.Header) 23298 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23299 for k, v := range c.header_ { 23300 reqHeaders[k] = v 23301 } 23302 reqHeaders.Set("User-Agent", c.s.userAgent()) 23303 var body io.Reader = nil 23304 c.urlParams_.Set("alt", alt) 23305 c.urlParams_.Set("prettyPrint", "false") 23306 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 23307 urls += "?" + c.urlParams_.Encode() 23308 req, err := http.NewRequest("DELETE", urls, body) 23309 if err != nil { 23310 return nil, err 23311 } 23312 req.Header = reqHeaders 23313 googleapi.Expand(req.URL, map[string]string{ 23314 "userKey": c.userKey, 23315 }) 23316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23317} 23318 23319// Do executes the "directory.users.photos.delete" call. 23320func (c *UsersPhotosDeleteCall) Do(opts ...googleapi.CallOption) error { 23321 gensupport.SetOptions(c.urlParams_, opts...) 23322 res, err := c.doRequest("json") 23323 if err != nil { 23324 return err 23325 } 23326 defer googleapi.CloseBody(res) 23327 if err := googleapi.CheckResponse(res); err != nil { 23328 return err 23329 } 23330 return nil 23331 // { 23332 // "description": "Removes the user's photo.", 23333 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23334 // "httpMethod": "DELETE", 23335 // "id": "directory.users.photos.delete", 23336 // "parameterOrder": [ 23337 // "userKey" 23338 // ], 23339 // "parameters": { 23340 // "userKey": { 23341 // "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.", 23342 // "location": "path", 23343 // "required": true, 23344 // "type": "string" 23345 // } 23346 // }, 23347 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23348 // "scopes": [ 23349 // "https://www.googleapis.com/auth/admin.directory.user" 23350 // ] 23351 // } 23352 23353} 23354 23355// method id "directory.users.photos.get": 23356 23357type UsersPhotosGetCall struct { 23358 s *Service 23359 userKey string 23360 urlParams_ gensupport.URLParams 23361 ifNoneMatch_ string 23362 ctx_ context.Context 23363 header_ http.Header 23364} 23365 23366// Get: Retrieves the user's photo. 23367// 23368// - userKey: Identifies the user in the API request. The value can be 23369// the user's primary email address, alias email address, or unique 23370// user ID. 23371func (r *UsersPhotosService) Get(userKey string) *UsersPhotosGetCall { 23372 c := &UsersPhotosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23373 c.userKey = userKey 23374 return c 23375} 23376 23377// Fields allows partial responses to be retrieved. See 23378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23379// for more information. 23380func (c *UsersPhotosGetCall) Fields(s ...googleapi.Field) *UsersPhotosGetCall { 23381 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23382 return c 23383} 23384 23385// IfNoneMatch sets the optional parameter which makes the operation 23386// fail if the object's ETag matches the given value. This is useful for 23387// getting updates only after the object has changed since the last 23388// request. Use googleapi.IsNotModified to check whether the response 23389// error from Do is the result of In-None-Match. 23390func (c *UsersPhotosGetCall) IfNoneMatch(entityTag string) *UsersPhotosGetCall { 23391 c.ifNoneMatch_ = entityTag 23392 return c 23393} 23394 23395// Context sets the context to be used in this call's Do method. Any 23396// pending HTTP request will be aborted if the provided context is 23397// canceled. 23398func (c *UsersPhotosGetCall) Context(ctx context.Context) *UsersPhotosGetCall { 23399 c.ctx_ = ctx 23400 return c 23401} 23402 23403// Header returns an http.Header that can be modified by the caller to 23404// add HTTP headers to the request. 23405func (c *UsersPhotosGetCall) Header() http.Header { 23406 if c.header_ == nil { 23407 c.header_ = make(http.Header) 23408 } 23409 return c.header_ 23410} 23411 23412func (c *UsersPhotosGetCall) doRequest(alt string) (*http.Response, error) { 23413 reqHeaders := make(http.Header) 23414 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23415 for k, v := range c.header_ { 23416 reqHeaders[k] = v 23417 } 23418 reqHeaders.Set("User-Agent", c.s.userAgent()) 23419 if c.ifNoneMatch_ != "" { 23420 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 23421 } 23422 var body io.Reader = nil 23423 c.urlParams_.Set("alt", alt) 23424 c.urlParams_.Set("prettyPrint", "false") 23425 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 23426 urls += "?" + c.urlParams_.Encode() 23427 req, err := http.NewRequest("GET", urls, body) 23428 if err != nil { 23429 return nil, err 23430 } 23431 req.Header = reqHeaders 23432 googleapi.Expand(req.URL, map[string]string{ 23433 "userKey": c.userKey, 23434 }) 23435 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23436} 23437 23438// Do executes the "directory.users.photos.get" call. 23439// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 23440// status code is an error. Response headers are in either 23441// *UserPhoto.ServerResponse.Header or (if a response was returned at 23442// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 23443// to check whether the returned error was because 23444// http.StatusNotModified was returned. 23445func (c *UsersPhotosGetCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 23446 gensupport.SetOptions(c.urlParams_, opts...) 23447 res, err := c.doRequest("json") 23448 if res != nil && res.StatusCode == http.StatusNotModified { 23449 if res.Body != nil { 23450 res.Body.Close() 23451 } 23452 return nil, &googleapi.Error{ 23453 Code: res.StatusCode, 23454 Header: res.Header, 23455 } 23456 } 23457 if err != nil { 23458 return nil, err 23459 } 23460 defer googleapi.CloseBody(res) 23461 if err := googleapi.CheckResponse(res); err != nil { 23462 return nil, err 23463 } 23464 ret := &UserPhoto{ 23465 ServerResponse: googleapi.ServerResponse{ 23466 Header: res.Header, 23467 HTTPStatusCode: res.StatusCode, 23468 }, 23469 } 23470 target := &ret 23471 if err := gensupport.DecodeResponse(target, res); err != nil { 23472 return nil, err 23473 } 23474 return ret, nil 23475 // { 23476 // "description": "Retrieves the user's photo.", 23477 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23478 // "httpMethod": "GET", 23479 // "id": "directory.users.photos.get", 23480 // "parameterOrder": [ 23481 // "userKey" 23482 // ], 23483 // "parameters": { 23484 // "userKey": { 23485 // "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.", 23486 // "location": "path", 23487 // "required": true, 23488 // "type": "string" 23489 // } 23490 // }, 23491 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23492 // "response": { 23493 // "$ref": "UserPhoto" 23494 // }, 23495 // "scopes": [ 23496 // "https://www.googleapis.com/auth/admin.directory.user", 23497 // "https://www.googleapis.com/auth/admin.directory.user.readonly" 23498 // ] 23499 // } 23500 23501} 23502 23503// method id "directory.users.photos.patch": 23504 23505type UsersPhotosPatchCall struct { 23506 s *Service 23507 userKey string 23508 userphoto *UserPhoto 23509 urlParams_ gensupport.URLParams 23510 ctx_ context.Context 23511 header_ http.Header 23512} 23513 23514// Patch: Adds a photo for the user. This method supports patch 23515// semantics (/admin-sdk/directory/v1/guides/performance#patch). 23516// 23517// - userKey: Identifies the user in the API request. The value can be 23518// the user's primary email address, alias email address, or unique 23519// user ID. 23520func (r *UsersPhotosService) Patch(userKey string, userphoto *UserPhoto) *UsersPhotosPatchCall { 23521 c := &UsersPhotosPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23522 c.userKey = userKey 23523 c.userphoto = userphoto 23524 return c 23525} 23526 23527// Fields allows partial responses to be retrieved. See 23528// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23529// for more information. 23530func (c *UsersPhotosPatchCall) Fields(s ...googleapi.Field) *UsersPhotosPatchCall { 23531 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23532 return c 23533} 23534 23535// Context sets the context to be used in this call's Do method. Any 23536// pending HTTP request will be aborted if the provided context is 23537// canceled. 23538func (c *UsersPhotosPatchCall) Context(ctx context.Context) *UsersPhotosPatchCall { 23539 c.ctx_ = ctx 23540 return c 23541} 23542 23543// Header returns an http.Header that can be modified by the caller to 23544// add HTTP headers to the request. 23545func (c *UsersPhotosPatchCall) Header() http.Header { 23546 if c.header_ == nil { 23547 c.header_ = make(http.Header) 23548 } 23549 return c.header_ 23550} 23551 23552func (c *UsersPhotosPatchCall) doRequest(alt string) (*http.Response, error) { 23553 reqHeaders := make(http.Header) 23554 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23555 for k, v := range c.header_ { 23556 reqHeaders[k] = v 23557 } 23558 reqHeaders.Set("User-Agent", c.s.userAgent()) 23559 var body io.Reader = nil 23560 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) 23561 if err != nil { 23562 return nil, err 23563 } 23564 reqHeaders.Set("Content-Type", "application/json") 23565 c.urlParams_.Set("alt", alt) 23566 c.urlParams_.Set("prettyPrint", "false") 23567 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 23568 urls += "?" + c.urlParams_.Encode() 23569 req, err := http.NewRequest("PATCH", urls, body) 23570 if err != nil { 23571 return nil, err 23572 } 23573 req.Header = reqHeaders 23574 googleapi.Expand(req.URL, map[string]string{ 23575 "userKey": c.userKey, 23576 }) 23577 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23578} 23579 23580// Do executes the "directory.users.photos.patch" call. 23581// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 23582// status code is an error. Response headers are in either 23583// *UserPhoto.ServerResponse.Header or (if a response was returned at 23584// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 23585// to check whether the returned error was because 23586// http.StatusNotModified was returned. 23587func (c *UsersPhotosPatchCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 23588 gensupport.SetOptions(c.urlParams_, opts...) 23589 res, err := c.doRequest("json") 23590 if res != nil && res.StatusCode == http.StatusNotModified { 23591 if res.Body != nil { 23592 res.Body.Close() 23593 } 23594 return nil, &googleapi.Error{ 23595 Code: res.StatusCode, 23596 Header: res.Header, 23597 } 23598 } 23599 if err != nil { 23600 return nil, err 23601 } 23602 defer googleapi.CloseBody(res) 23603 if err := googleapi.CheckResponse(res); err != nil { 23604 return nil, err 23605 } 23606 ret := &UserPhoto{ 23607 ServerResponse: googleapi.ServerResponse{ 23608 Header: res.Header, 23609 HTTPStatusCode: res.StatusCode, 23610 }, 23611 } 23612 target := &ret 23613 if err := gensupport.DecodeResponse(target, res); err != nil { 23614 return nil, err 23615 } 23616 return ret, nil 23617 // { 23618 // "description": "Adds a photo for the user. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).", 23619 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23620 // "httpMethod": "PATCH", 23621 // "id": "directory.users.photos.patch", 23622 // "parameterOrder": [ 23623 // "userKey" 23624 // ], 23625 // "parameters": { 23626 // "userKey": { 23627 // "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.", 23628 // "location": "path", 23629 // "required": true, 23630 // "type": "string" 23631 // } 23632 // }, 23633 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23634 // "request": { 23635 // "$ref": "UserPhoto" 23636 // }, 23637 // "response": { 23638 // "$ref": "UserPhoto" 23639 // }, 23640 // "scopes": [ 23641 // "https://www.googleapis.com/auth/admin.directory.user" 23642 // ] 23643 // } 23644 23645} 23646 23647// method id "directory.users.photos.update": 23648 23649type UsersPhotosUpdateCall struct { 23650 s *Service 23651 userKey string 23652 userphoto *UserPhoto 23653 urlParams_ gensupport.URLParams 23654 ctx_ context.Context 23655 header_ http.Header 23656} 23657 23658// Update: Adds a photo for the user. 23659// 23660// - userKey: Identifies the user in the API request. The value can be 23661// the user's primary email address, alias email address, or unique 23662// user ID. 23663func (r *UsersPhotosService) Update(userKey string, userphoto *UserPhoto) *UsersPhotosUpdateCall { 23664 c := &UsersPhotosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23665 c.userKey = userKey 23666 c.userphoto = userphoto 23667 return c 23668} 23669 23670// Fields allows partial responses to be retrieved. See 23671// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23672// for more information. 23673func (c *UsersPhotosUpdateCall) Fields(s ...googleapi.Field) *UsersPhotosUpdateCall { 23674 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23675 return c 23676} 23677 23678// Context sets the context to be used in this call's Do method. Any 23679// pending HTTP request will be aborted if the provided context is 23680// canceled. 23681func (c *UsersPhotosUpdateCall) Context(ctx context.Context) *UsersPhotosUpdateCall { 23682 c.ctx_ = ctx 23683 return c 23684} 23685 23686// Header returns an http.Header that can be modified by the caller to 23687// add HTTP headers to the request. 23688func (c *UsersPhotosUpdateCall) Header() http.Header { 23689 if c.header_ == nil { 23690 c.header_ = make(http.Header) 23691 } 23692 return c.header_ 23693} 23694 23695func (c *UsersPhotosUpdateCall) doRequest(alt string) (*http.Response, error) { 23696 reqHeaders := make(http.Header) 23697 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23698 for k, v := range c.header_ { 23699 reqHeaders[k] = v 23700 } 23701 reqHeaders.Set("User-Agent", c.s.userAgent()) 23702 var body io.Reader = nil 23703 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userphoto) 23704 if err != nil { 23705 return nil, err 23706 } 23707 reqHeaders.Set("Content-Type", "application/json") 23708 c.urlParams_.Set("alt", alt) 23709 c.urlParams_.Set("prettyPrint", "false") 23710 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/photos/thumbnail") 23711 urls += "?" + c.urlParams_.Encode() 23712 req, err := http.NewRequest("PUT", urls, body) 23713 if err != nil { 23714 return nil, err 23715 } 23716 req.Header = reqHeaders 23717 googleapi.Expand(req.URL, map[string]string{ 23718 "userKey": c.userKey, 23719 }) 23720 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23721} 23722 23723// Do executes the "directory.users.photos.update" call. 23724// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx 23725// status code is an error. Response headers are in either 23726// *UserPhoto.ServerResponse.Header or (if a response was returned at 23727// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 23728// to check whether the returned error was because 23729// http.StatusNotModified was returned. 23730func (c *UsersPhotosUpdateCall) Do(opts ...googleapi.CallOption) (*UserPhoto, error) { 23731 gensupport.SetOptions(c.urlParams_, opts...) 23732 res, err := c.doRequest("json") 23733 if res != nil && res.StatusCode == http.StatusNotModified { 23734 if res.Body != nil { 23735 res.Body.Close() 23736 } 23737 return nil, &googleapi.Error{ 23738 Code: res.StatusCode, 23739 Header: res.Header, 23740 } 23741 } 23742 if err != nil { 23743 return nil, err 23744 } 23745 defer googleapi.CloseBody(res) 23746 if err := googleapi.CheckResponse(res); err != nil { 23747 return nil, err 23748 } 23749 ret := &UserPhoto{ 23750 ServerResponse: googleapi.ServerResponse{ 23751 Header: res.Header, 23752 HTTPStatusCode: res.StatusCode, 23753 }, 23754 } 23755 target := &ret 23756 if err := gensupport.DecodeResponse(target, res); err != nil { 23757 return nil, err 23758 } 23759 return ret, nil 23760 // { 23761 // "description": "Adds a photo for the user.", 23762 // "flatPath": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23763 // "httpMethod": "PUT", 23764 // "id": "directory.users.photos.update", 23765 // "parameterOrder": [ 23766 // "userKey" 23767 // ], 23768 // "parameters": { 23769 // "userKey": { 23770 // "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.", 23771 // "location": "path", 23772 // "required": true, 23773 // "type": "string" 23774 // } 23775 // }, 23776 // "path": "admin/directory/v1/users/{userKey}/photos/thumbnail", 23777 // "request": { 23778 // "$ref": "UserPhoto" 23779 // }, 23780 // "response": { 23781 // "$ref": "UserPhoto" 23782 // }, 23783 // "scopes": [ 23784 // "https://www.googleapis.com/auth/admin.directory.user" 23785 // ] 23786 // } 23787 23788} 23789 23790// method id "directory.verificationCodes.generate": 23791 23792type VerificationCodesGenerateCall struct { 23793 s *Service 23794 userKey string 23795 urlParams_ gensupport.URLParams 23796 ctx_ context.Context 23797 header_ http.Header 23798} 23799 23800// Generate: Generates new backup verification codes for the user. 23801// 23802// - userKey: Email or immutable ID of the user. 23803func (r *VerificationCodesService) Generate(userKey string) *VerificationCodesGenerateCall { 23804 c := &VerificationCodesGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23805 c.userKey = userKey 23806 return c 23807} 23808 23809// Fields allows partial responses to be retrieved. See 23810// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23811// for more information. 23812func (c *VerificationCodesGenerateCall) Fields(s ...googleapi.Field) *VerificationCodesGenerateCall { 23813 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23814 return c 23815} 23816 23817// Context sets the context to be used in this call's Do method. Any 23818// pending HTTP request will be aborted if the provided context is 23819// canceled. 23820func (c *VerificationCodesGenerateCall) Context(ctx context.Context) *VerificationCodesGenerateCall { 23821 c.ctx_ = ctx 23822 return c 23823} 23824 23825// Header returns an http.Header that can be modified by the caller to 23826// add HTTP headers to the request. 23827func (c *VerificationCodesGenerateCall) Header() http.Header { 23828 if c.header_ == nil { 23829 c.header_ = make(http.Header) 23830 } 23831 return c.header_ 23832} 23833 23834func (c *VerificationCodesGenerateCall) doRequest(alt string) (*http.Response, error) { 23835 reqHeaders := make(http.Header) 23836 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23837 for k, v := range c.header_ { 23838 reqHeaders[k] = v 23839 } 23840 reqHeaders.Set("User-Agent", c.s.userAgent()) 23841 var body io.Reader = nil 23842 c.urlParams_.Set("alt", alt) 23843 c.urlParams_.Set("prettyPrint", "false") 23844 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/generate") 23845 urls += "?" + c.urlParams_.Encode() 23846 req, err := http.NewRequest("POST", urls, body) 23847 if err != nil { 23848 return nil, err 23849 } 23850 req.Header = reqHeaders 23851 googleapi.Expand(req.URL, map[string]string{ 23852 "userKey": c.userKey, 23853 }) 23854 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23855} 23856 23857// Do executes the "directory.verificationCodes.generate" call. 23858func (c *VerificationCodesGenerateCall) Do(opts ...googleapi.CallOption) error { 23859 gensupport.SetOptions(c.urlParams_, opts...) 23860 res, err := c.doRequest("json") 23861 if err != nil { 23862 return err 23863 } 23864 defer googleapi.CloseBody(res) 23865 if err := googleapi.CheckResponse(res); err != nil { 23866 return err 23867 } 23868 return nil 23869 // { 23870 // "description": "Generates new backup verification codes for the user.", 23871 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes/generate", 23872 // "httpMethod": "POST", 23873 // "id": "directory.verificationCodes.generate", 23874 // "parameterOrder": [ 23875 // "userKey" 23876 // ], 23877 // "parameters": { 23878 // "userKey": { 23879 // "description": "Email or immutable ID of the user", 23880 // "location": "path", 23881 // "required": true, 23882 // "type": "string" 23883 // } 23884 // }, 23885 // "path": "admin/directory/v1/users/{userKey}/verificationCodes/generate", 23886 // "scopes": [ 23887 // "https://www.googleapis.com/auth/admin.directory.user.security" 23888 // ] 23889 // } 23890 23891} 23892 23893// method id "directory.verificationCodes.invalidate": 23894 23895type VerificationCodesInvalidateCall struct { 23896 s *Service 23897 userKey string 23898 urlParams_ gensupport.URLParams 23899 ctx_ context.Context 23900 header_ http.Header 23901} 23902 23903// Invalidate: Invalidates the current backup verification codes for the 23904// user. 23905// 23906// - userKey: Email or immutable ID of the user. 23907func (r *VerificationCodesService) Invalidate(userKey string) *VerificationCodesInvalidateCall { 23908 c := &VerificationCodesInvalidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 23909 c.userKey = userKey 23910 return c 23911} 23912 23913// Fields allows partial responses to be retrieved. See 23914// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 23915// for more information. 23916func (c *VerificationCodesInvalidateCall) Fields(s ...googleapi.Field) *VerificationCodesInvalidateCall { 23917 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 23918 return c 23919} 23920 23921// Context sets the context to be used in this call's Do method. Any 23922// pending HTTP request will be aborted if the provided context is 23923// canceled. 23924func (c *VerificationCodesInvalidateCall) Context(ctx context.Context) *VerificationCodesInvalidateCall { 23925 c.ctx_ = ctx 23926 return c 23927} 23928 23929// Header returns an http.Header that can be modified by the caller to 23930// add HTTP headers to the request. 23931func (c *VerificationCodesInvalidateCall) Header() http.Header { 23932 if c.header_ == nil { 23933 c.header_ = make(http.Header) 23934 } 23935 return c.header_ 23936} 23937 23938func (c *VerificationCodesInvalidateCall) doRequest(alt string) (*http.Response, error) { 23939 reqHeaders := make(http.Header) 23940 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 23941 for k, v := range c.header_ { 23942 reqHeaders[k] = v 23943 } 23944 reqHeaders.Set("User-Agent", c.s.userAgent()) 23945 var body io.Reader = nil 23946 c.urlParams_.Set("alt", alt) 23947 c.urlParams_.Set("prettyPrint", "false") 23948 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes/invalidate") 23949 urls += "?" + c.urlParams_.Encode() 23950 req, err := http.NewRequest("POST", urls, body) 23951 if err != nil { 23952 return nil, err 23953 } 23954 req.Header = reqHeaders 23955 googleapi.Expand(req.URL, map[string]string{ 23956 "userKey": c.userKey, 23957 }) 23958 return gensupport.SendRequest(c.ctx_, c.s.client, req) 23959} 23960 23961// Do executes the "directory.verificationCodes.invalidate" call. 23962func (c *VerificationCodesInvalidateCall) Do(opts ...googleapi.CallOption) error { 23963 gensupport.SetOptions(c.urlParams_, opts...) 23964 res, err := c.doRequest("json") 23965 if err != nil { 23966 return err 23967 } 23968 defer googleapi.CloseBody(res) 23969 if err := googleapi.CheckResponse(res); err != nil { 23970 return err 23971 } 23972 return nil 23973 // { 23974 // "description": "Invalidates the current backup verification codes for the user.", 23975 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes/invalidate", 23976 // "httpMethod": "POST", 23977 // "id": "directory.verificationCodes.invalidate", 23978 // "parameterOrder": [ 23979 // "userKey" 23980 // ], 23981 // "parameters": { 23982 // "userKey": { 23983 // "description": "Email or immutable ID of the user", 23984 // "location": "path", 23985 // "required": true, 23986 // "type": "string" 23987 // } 23988 // }, 23989 // "path": "admin/directory/v1/users/{userKey}/verificationCodes/invalidate", 23990 // "scopes": [ 23991 // "https://www.googleapis.com/auth/admin.directory.user.security" 23992 // ] 23993 // } 23994 23995} 23996 23997// method id "directory.verificationCodes.list": 23998 23999type VerificationCodesListCall struct { 24000 s *Service 24001 userKey string 24002 urlParams_ gensupport.URLParams 24003 ifNoneMatch_ string 24004 ctx_ context.Context 24005 header_ http.Header 24006} 24007 24008// List: Returns the current set of valid backup verification codes for 24009// the specified user. 24010// 24011// - userKey: Identifies the user in the API request. The value can be 24012// the user's primary email address, alias email address, or unique 24013// user ID. 24014func (r *VerificationCodesService) List(userKey string) *VerificationCodesListCall { 24015 c := &VerificationCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 24016 c.userKey = userKey 24017 return c 24018} 24019 24020// Fields allows partial responses to be retrieved. See 24021// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 24022// for more information. 24023func (c *VerificationCodesListCall) Fields(s ...googleapi.Field) *VerificationCodesListCall { 24024 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 24025 return c 24026} 24027 24028// IfNoneMatch sets the optional parameter which makes the operation 24029// fail if the object's ETag matches the given value. This is useful for 24030// getting updates only after the object has changed since the last 24031// request. Use googleapi.IsNotModified to check whether the response 24032// error from Do is the result of In-None-Match. 24033func (c *VerificationCodesListCall) IfNoneMatch(entityTag string) *VerificationCodesListCall { 24034 c.ifNoneMatch_ = entityTag 24035 return c 24036} 24037 24038// Context sets the context to be used in this call's Do method. Any 24039// pending HTTP request will be aborted if the provided context is 24040// canceled. 24041func (c *VerificationCodesListCall) Context(ctx context.Context) *VerificationCodesListCall { 24042 c.ctx_ = ctx 24043 return c 24044} 24045 24046// Header returns an http.Header that can be modified by the caller to 24047// add HTTP headers to the request. 24048func (c *VerificationCodesListCall) Header() http.Header { 24049 if c.header_ == nil { 24050 c.header_ = make(http.Header) 24051 } 24052 return c.header_ 24053} 24054 24055func (c *VerificationCodesListCall) doRequest(alt string) (*http.Response, error) { 24056 reqHeaders := make(http.Header) 24057 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 24058 for k, v := range c.header_ { 24059 reqHeaders[k] = v 24060 } 24061 reqHeaders.Set("User-Agent", c.s.userAgent()) 24062 if c.ifNoneMatch_ != "" { 24063 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 24064 } 24065 var body io.Reader = nil 24066 c.urlParams_.Set("alt", alt) 24067 c.urlParams_.Set("prettyPrint", "false") 24068 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/directory/v1/users/{userKey}/verificationCodes") 24069 urls += "?" + c.urlParams_.Encode() 24070 req, err := http.NewRequest("GET", urls, body) 24071 if err != nil { 24072 return nil, err 24073 } 24074 req.Header = reqHeaders 24075 googleapi.Expand(req.URL, map[string]string{ 24076 "userKey": c.userKey, 24077 }) 24078 return gensupport.SendRequest(c.ctx_, c.s.client, req) 24079} 24080 24081// Do executes the "directory.verificationCodes.list" call. 24082// Exactly one of *VerificationCodes or error will be non-nil. Any 24083// non-2xx status code is an error. Response headers are in either 24084// *VerificationCodes.ServerResponse.Header or (if a response was 24085// returned at all) in error.(*googleapi.Error).Header. Use 24086// googleapi.IsNotModified to check whether the returned error was 24087// because http.StatusNotModified was returned. 24088func (c *VerificationCodesListCall) Do(opts ...googleapi.CallOption) (*VerificationCodes, error) { 24089 gensupport.SetOptions(c.urlParams_, opts...) 24090 res, err := c.doRequest("json") 24091 if res != nil && res.StatusCode == http.StatusNotModified { 24092 if res.Body != nil { 24093 res.Body.Close() 24094 } 24095 return nil, &googleapi.Error{ 24096 Code: res.StatusCode, 24097 Header: res.Header, 24098 } 24099 } 24100 if err != nil { 24101 return nil, err 24102 } 24103 defer googleapi.CloseBody(res) 24104 if err := googleapi.CheckResponse(res); err != nil { 24105 return nil, err 24106 } 24107 ret := &VerificationCodes{ 24108 ServerResponse: googleapi.ServerResponse{ 24109 Header: res.Header, 24110 HTTPStatusCode: res.StatusCode, 24111 }, 24112 } 24113 target := &ret 24114 if err := gensupport.DecodeResponse(target, res); err != nil { 24115 return nil, err 24116 } 24117 return ret, nil 24118 // { 24119 // "description": "Returns the current set of valid backup verification codes for the specified user.", 24120 // "flatPath": "admin/directory/v1/users/{userKey}/verificationCodes", 24121 // "httpMethod": "GET", 24122 // "id": "directory.verificationCodes.list", 24123 // "parameterOrder": [ 24124 // "userKey" 24125 // ], 24126 // "parameters": { 24127 // "userKey": { 24128 // "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.", 24129 // "location": "path", 24130 // "required": true, 24131 // "type": "string" 24132 // } 24133 // }, 24134 // "path": "admin/directory/v1/users/{userKey}/verificationCodes", 24135 // "response": { 24136 // "$ref": "VerificationCodes" 24137 // }, 24138 // "scopes": [ 24139 // "https://www.googleapis.com/auth/admin.directory.user.security" 24140 // ] 24141 // } 24142 24143} 24144